Module:SOM.Page.Opinion Collection

From SunshinePPS Wiki

Documentation for this module may be created at Module:SOM.Page.Opinion Collection/doc

require("Module:No globals")

local RA = require("Module:SOM.meta.ReferencingAttribute")
local Page = require("Module:SOM.meta.Page")
local StringBuffer = require("Module:SOM.util.StringBuffer")
local References = require("Module:SOM.util.References")
local util = require("Module:SOM.util")

local InformedOpinion = require("Module:SOM.Composite.InformedOpinion")
local FreeWikitext = require("Module:SOM.Simple.FreeWikitext")

local ENTITY_ROOT_CATEGORY = require("Module:SOM.const.ENTITY_ROOT_CATEGORY")

return Page.generate_page{
	class_name = "Opinion Collection",
	parent_categories = { ENTITY_ROOT_CATEGORY },
	category_description = [==[
An ''Opinion Collection'' is a XXXXXXXYYYY.
]==],
	naming_advice = [[
New pages should be named using a functional/descriptive name of the property (e.g., "Clara Sweet School Building").]],
	attributes = {
--		positive = {
--			arg = "positive",
--			class = InformedOpinion,
--			label = "Positive Opinion"
--		},
		opinions = {
			arg = "opinions",
			class = InformedOpinion,
			label = "Positive Opinion"
		},
--		negative = {
--			arg = "negative",
--			class = InformedOpinion,
--			label = "Negative Opinion"
--		},
		text = {
			arg = "text",
			class = FreeWikitext,
			label = "Article Text"
		},
	},
	form_layout = {
		{ section4 = "Opinions" },
		{ attribute = "opinions" },
--		{ section4 = "Positive Opinions" },
--		{ attribute = "positive" },
--		{ section4 = "Negative Opinions" },
--		{ attribute = "negative" },
		{ section2 = "Article Text" },
		{ attribute = "text" },
	},
	page_layout = {
		{ attribute = "text" },
		{ references = {} },
		--{ section2 = "Fact History" },
		{ attribute = "opinions", render = "render_table_and_references",
			render_args = {
				columns = {
					{ label = "Opinions", key = "opinion", },
					RA.COLUMN_REFERENCES,
				}
			}
		},
--		{ attribute = "positive", render = "render_table_and_references",
--			render_args = {
--				columns = {
--					{ label = "Positive Opinion", key = "opinion", },
--					RA.COLUMN_REFERENCES,
--				}
--			}
--		},
--		{ attribute = "negative", render = "render_table_and_references",
--			render_args = {
--				columns = {
--					{ label = "Negative Opinion", key = "opinion", },
--					RA.COLUMN_REFERENCES,
--				}
--			}
--		},
		--	render_args = HasName.basic_current_first_table_args(),
		--	render_args = {
		--		sort = DBA.sort_current_first,
		--		columns = {
		--			{ label = "Owner", key = "owner" },
--		--			{ label = "Role", key = "role" },
--		--			{ label = "Attributes", -- key = "role_attributes",
--		--				render = function (instance)
--		--					return table.concat(
--		--						instance.role_attributes, ", ")
--		--				end,
--		--			 },
					-- { label = "Property", key = "thing" },
		--			DBA.COLUMN_FROM,
		--			DBA.COLUMN_UNTIL,
		--		}
		--	}
		{ section2 = "Yet More Things" },
		{ wikitext = "''More important information goes here.''" },
	}
}