Changes

Jump to navigation Jump to search
Created page with "<noinclude> This template is called from within other ''category'' templates (e.g. Author, Topic, Theory) to store the completion rate of a given ''date'' property. The templa..."
<noinclude>
This template is called from within other ''category'' templates (e.g. Author, Topic, Theory) to store the completion rate of a given ''date'' property. The template checks whether the Year, Month, and Day components of the date are present. Depending on the value of <code><nowiki>|requireddateprecision=</nowiki></code>, the template calculates the completion rate and stores the value in a property titled <code><nowiki>CR_{{{propertyname}}}</nowiki></code>.

'''NOTE:''' As any "set" template, it doesn't print anything on the page, but merely sets the appropriate values.

'''Parameters:'''
* <code><nowiki>|propertyname=</nowiki></code> - the name of the property for which a completion rate is to be calculated.
* <code><nowiki>|propertyvalueyear=</nowiki></code> - the year value.
* <code><nowiki>|propertyvaluemonth=</nowiki></code> - the month value.
* <code><nowiki>|propertyvalueday=</nowiki></code> - the day value.
* <code><nowiki>|requireddateprecision=</nowiki></code> - the required date precision; allowed values are <code><nowiki>Year</nowiki></code>, <code><nowiki>Month</nowiki></code>, and <code><nowiki>Day</nowiki></code>; the default is <code><nowiki>Day</nowiki></code>.

</noinclude><includeonly><!--
-->{{#vardefine: varCR|0}}<!-- start from 0 as the completion rate
-->{{#switch: {{{requireddateprecision|Day}}}<!--
-->|Day=<!--
-->{{#if: {{{propertyvalueyear|}}}<!--
-->|<!-- if the year is given
-->{{#if: {{{propertyvaluemonth|}}}<!--
-->|<!-- if: the month is also given
-->{{#if: {{{propertyvalueday|}}}<!--
-->|<!-- if: the day is also given
-->{{#vardefine: varCR|100}}<!--
--><!--
-->|<!-- else: only the year and month are given
-->{{#vardefine: varCR|50}}<!--
--><!--
-->}}<!-- if day
--><!--
-->|<!-- else: only the year is given
-->{{#vardefine: varCR|25}}<!--
--><!--
-->}}<!-- if month
--><!--
-->}}<!-- if year
--><!--
-->|Month=<!--
-->{{#if: {{{propertyvalueyear|}}}<!--
-->|<!-- if the year is given
-->{{#if: {{{propertyvaluemonth|}}}<!--
-->|<!-- if: the month is also given
-->{{#vardefine: varCR|100}}<!--
--><!--
-->|<!-- else: only the year is given
-->{{#vardefine: varCR|50}}<!--
--><!--
-->}}<!-- if month
--><!--
-->}}<!-- if year
--><!--
-->|Year=<!--
-->{{#if: {{{propertyvalueyear|}}}<!--
-->|<!-- if the year is given
-->{{#vardefine: varCR|100}}<!--
--><!--
-->}}<!-- if year
--><!--
-->}}<!-- switch
--><!-- store the value
-->{{#set: CR_{{{propertyname}}}={{#var: varCR}} }}<!--
--></includeonly>

Navigation menu