Content deleted Content added
Archived first roadmap and discussions |
remove page from Special:WantedTemplates |
||
(One intermediate revision by one other user not shown) | |||
Line 127:
:
:The nice thing about [[Module:Arguments]] is that it automatically fetches arguments from the both the frame and the parent frame. Writing <syntaxhighlight lang="wikitext" inline="1">{{#invoke:SeatsEUPPs|main}}</syntaxhighlight> in the template will hand the parent frame parameters (from the template call in article wikitext) to the module. You can see this working in {{tlx|SeatsEUPPs/sandbox}}:
::<syntaxhighlight lang="wikitext" inline="1">{{SeatsEUPPs/sandbox|EP|EPP}}</syntaxhighlight> → {{t|SeatsEUPPs/sandbox|EP|EPP}}
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 16:14, 25 March 2025 (UTC)
::Yeah, I have to admit that's neater this way. Thanks, it's all looking really clear. [[User:Julius Schwarz|Julius Schwarz]] ([[User talk:Julius Schwarz|talk]]) 21:35, 25 March 2025 (UTC)
Line 137:
And all of a sudden, it became a bit irresistible to make another module, based on [[Module:SeatsEUPPs]] that would spit out the composition bar :D Now, I got the gist of most of the process, but I could use a quick hand to write the part that actually writes the composition bar using our module. Would you mind having a look? It's at [[Module:Sandbox/Julius Schwarz/CompositionBarEUPPs]] [[User:Julius Schwarz|Julius Schwarz]] ([[User talk:Julius Schwarz|talk]]) 21:43, 25 March 2025 (UTC)
:Forking is a bad idea. Instead, add a new exported function to [[Module:SeatsEUPPs/sandbox]] that calls the necessary local functions to produce the output that you want. I've started a function <code>composition_bar()</code> at the bottom of ~/sandbox, added some comments and questions there. Improve on that.
::<syntaxhighlight lang="wikitext" inline="1">{{#invoke:SeatsEUPPs/sandbox|composition_bar|EC|EPP}}</syntaxhighlight> → <nowiki>{{#invoke:SeatsEUPPs/sandbox|composition_bar|EC|EPP}}</nowiki>
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 22:50, 25 March 2025 (UTC)
::Well noted. I started having a look at the comment you made. For line 346, indeed, share has no place here. That was in case "%" or "share" ended up as the party argument. Not happening here. And I will introduce data validation for width and percentage. However, I hit the same issue three times: 1) width should be a percentage and not a number should we can input it as a number but we have attach a "%" sign; 2) I have to attach a "#" sign to the hex code; and 3) I might attach a "%" for seats_share. In all three cases, I am not sure how to concatenate text. [[User:Julius Schwarz|Julius Schwarz]] ([[User talk:Julius Schwarz|talk]]) 23:57, 25 March 2025 (UTC)
Line 162:
::::::::
::::::::Rewrote <code>get_colour()</code>. The hash prefix is added there because it should be possible to use named colors in {{para|bar-color}} (which overrides the wikidata color). Other color parameters also appear to be working:
:::::::::<syntaxhighlight lang="wikitext" inline="1">{{EUPP composition bar/sandbox|EC|EPP|bar-color=blue|border=red|background-color=#3a3}}</syntaxhighlight> → {{t|EUPP composition bar/sandbox|EC|EPP|bar-color=blue|border=red|background-color=#3a3}}
::::::::{{para|percent}} and {{para|ref}} are now case-insensitive. Positional parameters <code>{{{3}}}</code>, <code>{{{4}}}</code>, and <code>{{{5}}}</code> are now ignored.
::::::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 00:31, 28 March 2025 (UTC)
|