Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added folder listing overrides for events

  • Loading branch information...
commit e7abe194d8eed0f44570b13a05e96ad4444d6acf 1 parent 72416de
Luca Fabbri authored
19 collective/microdata/event/browser/configure.zcml
@@ -11,7 +11,7 @@
11 11 name="event_view"
12 12 layer="..interfaces.IMicrodataEventLayer"
13 13 class=".view.EventView"
14   - template="event_view.pt"
  14 + template="templates/event_view.pt"
15 15 permission="zope2.View"
16 16 />
17 17 <browser:menuItem
@@ -22,4 +22,21 @@
22 22 description=""
23 23 />
24 24
  25 + <browser:page
  26 + for="*"
  27 + name="http://schema.org/Event folder_listing_item"
  28 + layer="..interfaces.IMicrodataEventLayer"
  29 + class="collective.microdata.core.browser.view.BaseItemListingView"
  30 + template="templates/folder_listing_item.pt"
  31 + permission="zope2.View"
  32 + />
  33 + <browser:page
  34 + for="*"
  35 + name="http://schema.org/Event folder_summary_view_item"
  36 + layer="..interfaces.IMicrodataEventLayer"
  37 + class="collective.microdata.core.browser.view.BaseItemListingView"
  38 + template="templates/folder_summary_view_item.pt"
  39 + permission="zope2.View"
  40 + />
  41 +
25 42 </configure>
0  collective/microdata/event/browser/event_view.pt → ...e/microdata/event/browser/templates/event_view.pt
File renamed without changes
152 collective/microdata/event/browser/templates/folder_listing_item.pt
... ... @@ -0,0 +1,152 @@
  1 + <tal:block tal:define="item view/item;
  2 + microdata view/microdata;
  3 + plone_view nocall:context/@@plone;
  4 + normalizeString nocall: context/plone_utils/normalizeString;
  5 + use_view_action site_properties/typesUseViewActionInListings|python:();
  6 + isAnon context/@@plone_portal_state/anonymous;
  7 + show_about python:not isAnon or site_properties.allowAnonymousViewAbout;
  8 + pas_member context/@@pas_member;
  9 + navigation_root_url context/@@plone_portal_state/navigation_root_url;
  10 + toLocalizedTime nocall: context/@@plone/toLocalizedTime;
  11 + item_url item/getURL|item/absolute_url;
  12 + item_id item/getId|item/id;
  13 + item_title_or_id item/pretty_title_or_id;
  14 + item_description item/Description;
  15 + item_type item/portal_type;
  16 + item_type_title item/Type;
  17 + item_modified item/ModificationDate;
  18 + item_created item/CreationDate;
  19 + item_icon python:plone_view.getIcon(item);
  20 + item_type_class python:'contenttype-' + normalizeString(item_type);
  21 + item_wf_state item/review_state|python: context.portal_workflow.getInfoFor(item, 'review_state', '');
  22 + item_wf_state_class python:'state-' + normalizeString(item_wf_state);
  23 + item_creator item/Creator;
  24 + item_start item/start|item/StartDate|nothing;
  25 + item_end item/end|item/EndDate|nothing;
  26 + item_sametime python: item_start == item_end;
  27 + item_samedate python: (item_end - item_start &lt; 1) if item_type == 'Event' else False;"
  28 + i18n:domain="plone">
  29 + <metal:block>
  30 +
  31 + <dt metal:define-macro="listitem"
  32 + itemscope="itemscope"
  33 + class="vevent"
  34 + tal:attributes="itemtype microdata/microdata_vocabulary;">
  35 +
  36 + <span class="summary">
  37 + <img tal:replace="structure item_icon/html_tag" />
  38 + <a href="#"
  39 + itemprop="url"
  40 + tal:attributes="href python:item_type in use_view_action and item_url+'/view' or item_url;
  41 + class string:$item_type_class $item_wf_state_class url">
  42 + <span itemprop="name"
  43 + tal:content="item_title_or_id">Item Title</span>
  44 + </a>
  45 + </span>
  46 +
  47 + <span class="documentByLine">
  48 + <span tal:condition="item_sametime"
  49 + i18n:translate="label_event_byline_onlyfrom">
  50 + <meta i18n:name="microdata_start" itemprop="startDate" tal:attributes="content microdata/startDate" />
  51 + <abbr class="dtstart"
  52 + tal:attributes="title python:item_start"
  53 + tal:content="python:toLocalizedTime(item_start,long_format=1)"
  54 + i18n:name="start">from date</abbr>
  55 + </span>
  56 + <span tal:condition="python:item_samedate and not item_sametime"
  57 + i18n:translate="label_event_byline_samedate"
  58 + i18n:domain="collective.microdata.event">
  59 + <abbr class="dtstart"
  60 + tal:attributes="title python:item_start"
  61 + tal:content="python:toLocalizedTime(item_start)"
  62 + i18n:name="start">from date</abbr> from
  63 + <meta i18n:name="microdata_start" itemprop="startDate" tal:attributes="content microdata/startDate" />
  64 + <abbr class="dtstart"
  65 + tal:attributes="title python:item_start"
  66 + tal:content="python:toLocalizedTime(item_start,time_only=1)"
  67 + i18n:name="starttime">from time</abbr> to
  68 + <meta i18n:name="microdata_end" itemprop="endDate" tal:attributes="content microdata/endDate" />
  69 + <abbr class="dtend"
  70 + tal:attributes="title python:item_end"
  71 + tal:content="python:toLocalizedTime(item_end,time_only=1)"
  72 + i18n:name="end">to time</abbr>
  73 + </span>
  74 + <span tal:condition="python:not item_samedate and not item_sametime"
  75 + i18n:translate="label_event_byline"
  76 + i18n:domain="collective.microdata.event">
  77 + from
  78 + <meta i18n:name="microdata_start" itemprop="startDate" tal:attributes="content microdata/startDate" />
  79 + <abbr class="dtstart"
  80 + tal:attributes="title python:item_start"
  81 + tal:content="python:toLocalizedTime(item_start,long_format=1)"
  82 + i18n:name="start">from date</abbr> to
  83 + <meta i18n:name="microdata_end" itemprop="endDate" tal:attributes="content microdata/endDate" />
  84 + <abbr class="dtend"
  85 + tal:attributes="title python:item_end"
  86 + tal:content="python:toLocalizedTime(item_end,long_format=1)"
  87 + i18n:name="end">to date</abbr>
  88 + </span>
  89 + <span tal:condition="item/location"
  90 + i18n:translate="label_event_byline_location">&mdash;
  91 + <span tal:content="string:${item/location}"
  92 + class="location"
  93 + itemprop="location"
  94 + i18n:name="location">Oslo</span>,
  95 + </span>
  96 + <meta itemprop="duration" tal:attributes="content microdata/duration" />
  97 +
  98 + <tal:byline condition="show_about">
  99 + &mdash;
  100 +
  101 + <tal:name tal:condition="item_creator"
  102 + tal:define="author python:pas_member.info(item_creator);
  103 + creator_short_form author/username;
  104 + creator_long_form string:?author=${author/username};
  105 + creator_is_openid python:'/' in creator_short_form;
  106 + creator_id python:(creator_short_form, creator_long_form)[creator_is_openid];">
  107 + <span i18n:translate="label_by_author">
  108 + by
  109 + <a href="#"
  110 + tal:attributes="href string:${navigation_root_url}/author/${item_creator}"
  111 + tal:content="author/name_or_id"
  112 + tal:omit-tag="not:author"
  113 + i18n:name="author">
  114 + Bob Dobalina
  115 + </a>
  116 + </span>
  117 +
  118 + </tal:name>
  119 +
  120 + <tal:modified condition="python: item_type != 'Event'">
  121 + &mdash;
  122 + <tal:mod i18n:translate="box_last_modified">
  123 + last modified
  124 + </tal:mod>
  125 + <span tal:replace="python:toLocalizedTime(item_modified,long_format=1)">
  126 + August 16, 2001 at 23:35:59
  127 + </span>
  128 + </tal:modified>
  129 +
  130 + <metal:description define-slot="description_slot">
  131 + <tal:comment replace="nothing">
  132 + Place custom listing info for custom types here
  133 + </tal:comment>
  134 + </metal:description>
  135 + </tal:byline>
  136 + </span>
  137 +
  138 + <meta itemprop="description"
  139 + tal:attributes="content item_description" />
  140 +
  141 + </dt>
  142 +
  143 + <dd tal:condition="item_description">
  144 + <!-- itemprop there is futile, as we are outside the itemscope -->
  145 + <span class="description"
  146 + tal:content="item_description">
  147 + description
  148 + </span>
  149 + </dd>
  150 +
  151 + </metal:block>
  152 + </tal:block>
94 collective/microdata/event/browser/templates/folder_summary_view_item.pt
... ... @@ -0,0 +1,94 @@
  1 + <div class="tileItem visualIEFloatFix"
  2 + itemscope="itemscope"
  3 + tal:define="item view/item;
  4 + microdata view/microdata;
  5 + item_object item/getObject;
  6 + site_properties context/portal_properties/site_properties;
  7 + item_type item/portal_type;
  8 + use_view_action site_properties/typesUseViewActionInListings|python:();
  9 + item_url item/getURL|item/absolute_url;
  10 + item_title_or_id item/pretty_title_or_id;
  11 + item_description item/Description;
  12 + item_start item/start|item/StartDate|nothing;
  13 + item_end item/end|item/EndDate|nothing;
  14 + toLocalizedTime nocall: context/@@plone/toLocalizedTime;
  15 + pas_member context/@@pas_member;
  16 + item_creator item/Creator;
  17 + item_modified item/ModificationDate;"
  18 + tal:attributes="itemtype microdata/microdata_vocabulary"
  19 + i18n:domain="plone">
  20 +
  21 + <a href="#"
  22 + tal:condition="exists:item_object/image_thumb"
  23 + tal:attributes="href python: item_type in use_view_action and item_url+'/view' or item_url">
  24 + <img src="" alt=""
  25 + tal:replace="structure python: path('nocall:item_object/tag')(scale='thumb', css_class='tileImage', itemprop='image')" />
  26 + </a>
  27 +
  28 + <h2 class="tileHeadline"
  29 + metal:define-macro="listitem">
  30 +
  31 + <a href="#"
  32 + class="summary url"
  33 + itemprop="url"
  34 + tal:attributes="href python: item_type in use_view_action and item_url+'/view' or item_url;">
  35 + <span itemprop="name"
  36 + tal:content="item_title_or_id">Item Title</span>
  37 + </a>
  38 +
  39 + </h2>
  40 +
  41 + <div class="documentByLine" tal:condition="python: site_properties.allowAnonymousViewAbout or not isAnon">
  42 + <span tal:condition="item/location"
  43 + i18n:translate="label_event_byline_with_location"
  44 + i18n:domain="collective.microdata.event">
  45 + (<span tal:content="string:${item/location}"
  46 + class="location"
  47 + itemprop="location"
  48 + i18n:name="location">Oslo</span>, from
  49 + <meta i18n:name="microdata_start" itemprop="startDate" tal:attributes="content microdata/startDate" />
  50 + <abbr class="dtstart"
  51 + tal:attributes="title python:item_start"
  52 + tal:content="python:toLocalizedTime(item_start,long_format=1)"
  53 + i18n:name="start">from date</abbr> to
  54 + <meta i18n:name="microdata_end" itemprop="endDate" tal:attributes="content microdata/endDate" />
  55 + <abbr class="dtend"
  56 + tal:attributes="title python:item_end"
  57 + tal:content="python:toLocalizedTime(item_end,long_format=1)"
  58 + i18n:name="end">to date</abbr>)
  59 + </span>
  60 + <span tal:condition="not:item/location"
  61 + i18n:translate="label_event_byline_without_location"
  62 + i18n:domain="collective.microdata.event">
  63 + (from
  64 + <meta i18n:name="microdata_start" itemprop="startDate" tal:attributes="content microdata/startDate" />
  65 + <abbr class="dtstart"
  66 + tal:attributes="title python:item_start"
  67 + tal:content="python:toLocalizedTime(item_start,long_format=1)"
  68 + i18n:name="start">from date</abbr> to
  69 + <meta i18n:name="microdata_end" itemprop="endDate" tal:attributes="content microdata/endDate" />
  70 + <abbr class="dtend"
  71 + tal:attributes="title python:item_end"
  72 + tal:content="python:toLocalizedTime(item_end,long_format=1)"
  73 + i18n:name="end">to date</abbr>)
  74 + </span>
  75 + <meta itemprop="duration" tal:attributes="content microdata/duration" />
  76 + </div>
  77 +
  78 + <p class="tileBody" tal:condition="item_description">
  79 + <span class="description" tal:content="item_description" itemprop="description">
  80 + description
  81 + </span>
  82 + </p>
  83 +
  84 + <p class="tileFooter">
  85 + <a href=""
  86 + tal:attributes="href python: item_type in use_view_action and item_url+'/view' or item_url;">
  87 + <span class="hiddenStructure"><span tal:replace="item_title_or_id" /> - </span>
  88 + <span i18n:translate="read_more">Read More&hellip;</span>
  89 + </a>
  90 + </p>
  91 +
  92 + <div class="visualClear"><!-- --></div>
  93 +
  94 + </div>
26 collective/microdata/event/locales/collective.microdata.event.pot
@@ -4,7 +4,7 @@
4 4 msgid ""
5 5 msgstr ""
6 6 "Project-Id-Version: PACKAGE VERSION\n"
7   -"POT-Creation-Date: 2012-07-15 18:14+0000\n"
  7 +"POT-Creation-Date: 2012-08-19 14:39+0000\n"
8 8 "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
9 9 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
10 10 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,12 +18,32 @@ msgstr ""
18 18 "Domain: collective.microdata.event\n"
19 19
20 20 #. Default: "${microdata_start} ${startdate} to ${linebreak} ${microdata_end} ${enddate}"
21   -#: ../browser/event_view.pt:60
  21 +#: ../browser/templates/event_view.pt:63
22 22 msgid "event_when_differentday"
23 23 msgstr ""
24 24
25 25 #. Default: "${date} ${linebreak} from ${microdata_start} ${starttime} to ${microdata_end} ${endtime}"
26   -#: ../browser/event_view.pt:98
  26 +#: ../browser/templates/event_view.pt:101
27 27 msgid "event_when_sameday"
28 28 msgstr ""
29 29
  30 +#. Default: "from ${microdata_start} ${start} to ${microdata_end} ${end}"
  31 +#: ../browser/templates/folder_listing_item.pt:84
  32 +msgid "label_event_byline"
  33 +msgstr ""
  34 +
  35 +#. Default: "${start} from ${microdata_start} ${starttime} to ${microdata_end} ${end}"
  36 +#: ../browser/templates/folder_listing_item.pt:69
  37 +msgid "label_event_byline_samedate"
  38 +msgstr ""
  39 +
  40 +#. Default: "(${location}, from ${microdata_start} ${start} to ${microdata_end} ${end})"
  41 +#: ../browser/templates/folder_summary_view_item.pt:55
  42 +msgid "label_event_byline_with_location"
  43 +msgstr ""
  44 +
  45 +#. Default: "(from ${microdata_start} ${start} to ${microdata_end} ${end})"
  46 +#: ../browser/templates/folder_summary_view_item.pt:70
  47 +msgid "label_event_byline_without_location"
  48 +msgstr ""
  49 +
26 collective/microdata/event/locales/it/LC_MESSAGES/collective.microdata.event.po
@@ -3,7 +3,7 @@
3 3 msgid ""
4 4 msgstr ""
5 5 "Project-Id-Version: PACKAGE VERSION\n"
6   -"POT-Creation-Date: 2012-07-15 18:14+0000\n"
  6 +"POT-Creation-Date: 2012-08-19 14:39+0000\n"
7 7 "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
8 8 "Last-Translator: keul <luca@keul.it>\n"
9 9 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,12 +17,32 @@ msgstr ""
17 17 "Domain: collective.microdata.event\n"
18 18
19 19 #. Default: "${microdata_start} ${startdate} to ${linebreak} ${microdata_end} ${enddate}"
20   -#: ../browser/event_view.pt:60
  20 +#: ../browser/templates/event_view.pt:63
21 21 msgid "event_when_differentday"
22 22 msgstr "dal ${microdata_start} ${startdate} ${linebreak} al ${microdata_end} ${enddate}"
23 23
24 24 #. Default: "${date} ${linebreak} from ${microdata_start} ${starttime} to ${microdata_end} ${endtime}"
25   -#: ../browser/event_view.pt:98
  25 +#: ../browser/templates/event_view.pt:101
26 26 msgid "event_when_sameday"
27 27 msgstr "${date} ${linebreak} ${microdata_start} dalle ${starttime} alle ${microdata_end} ${endtime}"
28 28
  29 +#. Default: "from ${microdata_start} ${start} to ${microdata_end} ${end}"
  30 +#: ../browser/templates/folder_listing_item.pt:84
  31 +msgid "label_event_byline"
  32 +msgstr "dal ${microdata_start} ${start} al ${microdata_end} ${end}"
  33 +
  34 +#. Default: "${start} from ${microdata_start} ${starttime} to ${microdata_end} ${end}"
  35 +#: ../browser/templates/folder_listing_item.pt:69
  36 +msgid "label_event_byline_samedate"
  37 +msgstr "${start} dalle ${microdata_start} ${starttime} alle ${microdata_end} ${end}"
  38 +
  39 +#. Default: "(${location}, from ${microdata_start} ${start} to ${microdata_end} ${end})"
  40 +#: ../browser/templates/folder_summary_view_item.pt:55
  41 +msgid "label_event_byline_with_location"
  42 +msgstr "(${location}, da ${microdata_start} ${start} a ${microdata_end} ${end})"
  43 +
  44 +#. Default: "(from ${microdata_start} ${start} to ${microdata_end} ${end})"
  45 +#: ../browser/templates/folder_summary_view_item.pt:70
  46 +msgid "label_event_byline_without_location"
  47 +msgstr "(da ${microdata_start} ${start} a ${microdata_end} ${end})"
  48 +

0 comments on commit e7abe19

Please sign in to comment.
Something went wrong with that request. Please try again.