Helma Logo
main list history

Version 6 by michi on 08. December 2005, 18:43

3  # Global/filters.js
4  function i18n_filter(input) {
5    if (getText(input)) {
6      return this.renderSkin(createSkin(getText(input)));
7    } else {
8      return input;
9    }
10  }
11  function modulo_filter(input, skinParam) {
12    return
13  }
14
15  # HopObject/macros.js
16  function count_macro() {
17    return this.count();
18  }
19
30
31  # Global/filters.js
32  function i18n_filter(input) {
33    if (getText(input)) {
34      return this.renderSkin(createSkin(getText(input)));
35    } else {
36      return input;
37    }
38  }
39  function modulo_filter(input, skinParam) {
40    return
41  }
42
43  # HopObject/macros.js
44  function count_macro() {
45    return this.count();
46  }

Version 5 by michi on 08. December 2005, 18:43

3   # Global/filters.js
4   function i18n_filter(input)
9   
10   function modulo_filter(input, skinParam)
11     return
12   
11   # HopObject/macros.js
12   function count_macro()
13     return this.count();
14   
15
16   # Site/topiclist.skin
17   <h1>{{ "site.topics.header" | i18n }}</h1>
37   # Site/actions.js
38   function topiclist_action()
39     this.renderSkin("topiclist", {topiclist: site.list()})
40   
39   # locale/en.properties

Version 4 by michi on 08. December 2005, 18:43

3  function i18n(input, key) # Global/filters.js
4    if (getText(key)) function i18n_filter(input)
5      return this.renderSkin(createSkin(getText(key)));if (getText(input))
6      return this.renderSkin(createSkin(getText(input)));
7  
8   function modulo(inputmodulo_filter(input, mod) skinParam)
9     return input % mod;
10  
9  <h1>{{ "site # HopObject/macros.topics.header" | i18n }}</h1>js
10 function count_macro() {
11   return this.count();
12 }
13
14 # Site/topiclist.skin
15 <h1>{{ "site.topics.header" | i18n }}</h1>
11  {% if this.count() topics.count == 0 %}
12    {{ "No topics to display." | i18n("site.topics.noTopics") | i18n }}
13  {% else if this.count() topics.count == 1 %}
14    {{ "This site has just one topic." | i18n("site.topics.oneTopic") | i18n }}
13    {{ "This site has {{ this.count }} topics." | i18n("site.topics.moreTopics") }}  # FIXME ??| i18n }}
15  {% for item in site.list() topiclist %}
19          <th>{{ "Topic" | i18n("site.topics.tableHead.topic") | i18n }}</th>
20          <th>{{ "Number of Stories" | i18n("site.topics.tableHead.numberOfStories") | i18n) }}</th>
22        <tr class="row{{ forloop.index | modulo(2) modulo 2 }}"
30
31 # Site/actions.js
32 function topiclist_action() {
33 this.renderSkin("topiclist", {topiclist: site.list()})
34 }
35
36 # locale/en.properties
37  site.topics.header = All topics
38  site.topics.noTopics = No topics to display.
39  site.topics.oneTopic = This site has just one topic.
40  site.topics.moreTopics = This site has {{ this.count }} topics.
41  site.topics.tableHead.topic = Topic
42  site.topics.tableHead.numberOfStories = Number of Stories

Version 3 by michi on 08. December 2005, 17:15

5      return this.renderSkin(createSkin());renderSkin(createSkin(getText(key)));

Version 2 by michi on 08. December 2005, 17:14

3  function i18n(input) i18n(input, key)
4    return this.renderSkin(createSkin(getText(input)));if (getText(key))
5      return this.renderSkin(createSkin());
6    } else {
7      return input;
8    }
22          <th><hc:this.msg id=<th>{{ "Topic" | i18n("site.topics.tableHead.topic">Topic</hc:this.msg></th>) }}</th>
23          <th><hc:this.msg id=<th>{{ "Number of Stories" | i18n("site.topics.tableHead.numberOfStories">Number of Stories</hc:this.msg></th>) }}</th>

Version 1 by michi on 08. December 2005, 17:12

1see http://home.leetsoft.com/liquid
2
3  function i18n(input) {
4    return this.renderSkin(createSkin(getText(input)));
5  }
6  function modulo(input, mod) {
7    return input % mod;
8  }
9
10  <h1>{{ "site.topics.header" | i18n }}</h1>
11  <p>
12  {% if this.count() == 0 %}
13    {{ "No topics to display." | i18n("site.topics.noTopics") }}
14  {% else if this.count() == 1 %}
15    {{ "This site has just one topic." | i18n("site.topics.oneTopic") }}
16  {% else %}
17    {{ "This site has {{ this.count }} topics." | i18n("site.topics.moreTopics") }}  # FIXME ??
18  {% endif %}
19  {% for item in site.list() %}
20    {% if forloop.first %}
21      <table>
22        <tr>
23          <th><hc:this.msg id="site.topics.tableHead.topic">Topic</hc:this.msg></th>
24          <th><hc:this.msg id="site.topics.tableHead.numberOfStories">Number of Stories</hc:this.msg></th>
25        </tr>
26    {% endif %}
27        <tr class="row{{ forloop.index | modulo(2) }}">
28          <td>{{ item.name }}</td>
29          <td>{{ item.count }}</td>
30        </tr>
31    {% if forloop.last %}
32      </table>
33    {% endif %}
34  {% endfor %}