Skip to content
Browse files

added folder listing overrides for events

  • Loading branch information...
1 parent 72416de commit e7abe194d8eed0f44570b13a05e96ad4444d6acf @keul committed Aug 19, 2012
View
19 collective/microdata/event/browser/configure.zcml
@@ -11,7 +11,7 @@
name="event_view"
layer="..interfaces.IMicrodataEventLayer"
class=".view.EventView"
- template="event_view.pt"
+ template="templates/event_view.pt"
permission="zope2.View"
/>
<browser:menuItem
@@ -22,4 +22,21 @@
description=""
/>
+ <browser:page
+ for="*"
+ name="http://schema.org/Event folder_listing_item"
+ layer="..interfaces.IMicrodataEventLayer"
+ class="collective.microdata.core.browser.view.BaseItemListingView"
+ template="templates/folder_listing_item.pt"
+ permission="zope2.View"
+ />
+ <browser:page
+ for="*"
+ name="http://schema.org/Event folder_summary_view_item"
+ layer="..interfaces.IMicrodataEventLayer"
+ class="collective.microdata.core.browser.view.BaseItemListingView"
+ template="templates/folder_summary_view_item.pt"
+ permission="zope2.View"
+ />
+
</configure>
View
0 ...ive/microdata/event/browser/event_view.pt → ...ata/event/browser/templates/event_view.pt
File renamed without changes.
View
152 collective/microdata/event/browser/templates/folder_listing_item.pt
@@ -0,0 +1,152 @@
+ <tal:block tal:define="item view/item;
+ microdata view/microdata;
+ plone_view nocall:context/@@plone;
+ normalizeString nocall: context/plone_utils/normalizeString;
+ use_view_action site_properties/typesUseViewActionInListings|python:();
+ isAnon context/@@plone_portal_state/anonymous;
+ show_about python:not isAnon or site_properties.allowAnonymousViewAbout;
+ pas_member context/@@pas_member;
+ navigation_root_url context/@@plone_portal_state/navigation_root_url;
+ toLocalizedTime nocall: context/@@plone/toLocalizedTime;
+ item_url item/getURL|item/absolute_url;
+ item_id item/getId|item/id;
+ item_title_or_id item/pretty_title_or_id;
+ item_description item/Description;
+ item_type item/portal_type;
+ item_type_title item/Type;
+ item_modified item/ModificationDate;
+ item_created item/CreationDate;
+ item_icon python:plone_view.getIcon(item);
+ item_type_class python:'contenttype-' + normalizeString(item_type);
+ item_wf_state item/review_state|python: context.portal_workflow.getInfoFor(item, 'review_state', '');
+ item_wf_state_class python:'state-' + normalizeString(item_wf_state);
+ item_creator item/Creator;
+ item_start item/start|item/StartDate|nothing;
+ item_end item/end|item/EndDate|nothing;
+ item_sametime python: item_start == item_end;
+ item_samedate python: (item_end - item_start &lt; 1) if item_type == 'Event' else False;"
+ i18n:domain="plone">
+ <metal:block>
+
+ <dt metal:define-macro="listitem"
+ itemscope="itemscope"
+ class="vevent"
+ tal:attributes="itemtype microdata/microdata_vocabulary;">
+
+ <span class="summary">
+ <img tal:replace="structure item_icon/html_tag" />
+ <a href="#"
+ itemprop="url"
+ tal:attributes="href python:item_type in use_view_action and item_url+'/view' or item_url;
+ class string:$item_type_class $item_wf_state_class url">
+ <span itemprop="name"
+ tal:content="item_title_or_id">Item Title</span>
+ </a>
+ </span>
+
+ <span class="documentByLine">
+ <span tal:condition="item_sametime"
+ i18n:translate="label_event_byline_onlyfrom">
+ <meta i18n:name="microdata_start" itemprop="startDate" tal:attributes="content microdata/startDate" />
+ <abbr class="dtstart"
+ tal:attributes="title python:item_start"
+ tal:content="python:toLocalizedTime(item_start,long_format=1)"
+ i18n:name="start">from date</abbr>
+ </span>
+ <span tal:condition="python:item_samedate and not item_sametime"
+ i18n:translate="label_event_byline_samedate"
+ i18n:domain="collective.microdata.event">
+ <abbr class="dtstart"
+ tal:attributes="title python:item_start"
+ tal:content="python:toLocalizedTime(item_start)"
+ i18n:name="start">from date</abbr> from
+ <meta i18n:name="microdata_start" itemprop="startDate" tal:attributes="content microdata/startDate" />
+ <abbr class="dtstart"
+ tal:attributes="title python:item_start"
+ tal:content="python:toLocalizedTime(item_start,time_only=1)"
+ i18n:name="starttime">from time</abbr> to
+ <meta i18n:name="microdata_end" itemprop="endDate" tal:attributes="content microdata/endDate" />
+ <abbr class="dtend"
+ tal:attributes="title python:item_end"
+ tal:content="python:toLocalizedTime(item_end,time_only=1)"
+ i18n:name="end">to time</abbr>
+ </span>
+ <span tal:condition="python:not item_samedate and not item_sametime"
+ i18n:translate="label_event_byline"
+ i18n:domain="collective.microdata.event">
+ from
+ <meta i18n:name="microdata_start" itemprop="startDate" tal:attributes="content microdata/startDate" />
+ <abbr class="dtstart"
+ tal:attributes="title python:item_start"
+ tal:content="python:toLocalizedTime(item_start,long_format=1)"
+ i18n:name="start">from date</abbr> to
+ <meta i18n:name="microdata_end" itemprop="endDate" tal:attributes="content microdata/endDate" />
+ <abbr class="dtend"
+ tal:attributes="title python:item_end"
+ tal:content="python:toLocalizedTime(item_end,long_format=1)"
+ i18n:name="end">to date</abbr>
+ </span>
+ <span tal:condition="item/location"
+ i18n:translate="label_event_byline_location">&mdash;
+ <span tal:content="string:${item/location}"
+ class="location"
+ itemprop="location"
+ i18n:name="location">Oslo</span>,
+ </span>
+ <meta itemprop="duration" tal:attributes="content microdata/duration" />
+
+ <tal:byline condition="show_about">
+ &mdash;
+
+ <tal:name tal:condition="item_creator"
+ tal:define="author python:pas_member.info(item_creator);
+ creator_short_form author/username;
+ creator_long_form string:?author=${author/username};
+ creator_is_openid python:'/' in creator_short_form;
+ creator_id python:(creator_short_form, creator_long_form)[creator_is_openid];">
+ <span i18n:translate="label_by_author">
+ by
+ <a href="#"
+ tal:attributes="href string:${navigation_root_url}/author/${item_creator}"
+ tal:content="author/name_or_id"
+ tal:omit-tag="not:author"
+ i18n:name="author">
+ Bob Dobalina
+ </a>
+ </span>
+
+ </tal:name>
+
+ <tal:modified condition="python: item_type != 'Event'">
+ &mdash;
+ <tal:mod i18n:translate="box_last_modified">
+ last modified
+ </tal:mod>
+ <span tal:replace="python:toLocalizedTime(item_modified,long_format=1)">
+ August 16, 2001 at 23:35:59
+ </span>
+ </tal:modified>
+
+ <metal:description define-slot="description_slot">
+ <tal:comment replace="nothing">
+ Place custom listing info for custom types here
+ </tal:comment>
+ </metal:description>
+ </tal:byline>
+ </span>
+
+ <meta itemprop="description"
+ tal:attributes="content item_description" />
+
+ </dt>
+
+ <dd tal:condition="item_description">
+ <!-- itemprop there is futile, as we are outside the itemscope -->
+ <span class="description"
+ tal:content="item_description">
+ description
+ </span>
+ </dd>
+
+ </metal:block>
+ </tal:block>
View
94 collective/microdata/event/browser/templates/folder_summary_view_item.pt
@@ -0,0 +1,94 @@
+ <div class="tileItem visualIEFloatFix"
+ itemscope="itemscope"
+ tal:define="item view/item;
+ microdata view/microdata;
+ item_object item/getObject;
+ site_properties context/portal_properties/site_properties;
+ item_type item/portal_type;
+ use_view_action site_properties/typesUseViewActionInListings|python:();
+ item_url item/getURL|item/absolute_url;
+ item_title_or_id item/pretty_title_or_id;
+ item_description item/Description;
+ item_start item/start|item/StartDate|nothing;
+ item_end item/end|item/EndDate|nothing;
+ toLocalizedTime nocall: context/@@plone/toLocalizedTime;
+ pas_member context/@@pas_member;
+ item_creator item/Creator;
+ item_modified item/ModificationDate;"
+ tal:attributes="itemtype microdata/microdata_vocabulary"
+ i18n:domain="plone">
+
+ <a href="#"
+ tal:condition="exists:item_object/image_thumb"
+ tal:attributes="href python: item_type in use_view_action and item_url+'/view' or item_url">
+ <img src="" alt=""
+ tal:replace="structure python: path('nocall:item_object/tag')(scale='thumb', css_class='tileImage', itemprop='image')" />
+ </a>
+
+ <h2 class="tileHeadline"
+ metal:define-macro="listitem">
+
+ <a href="#"
+ class="summary url"
+ itemprop="url"
+ tal:attributes="href python: item_type in use_view_action and item_url+'/view' or item_url;">
+ <span itemprop="name"
+ tal:content="item_title_or_id">Item Title</span>
+ </a>
+
+ </h2>
+
+ <div class="documentByLine" tal:condition="python: site_properties.allowAnonymousViewAbout or not isAnon">
+ <span tal:condition="item/location"
+ i18n:translate="label_event_byline_with_location"
+ i18n:domain="collective.microdata.event">
+ (<span tal:content="string:${item/location}"
+ class="location"
+ itemprop="location"
+ i18n:name="location">Oslo</span>, from
+ <meta i18n:name="microdata_start" itemprop="startDate" tal:attributes="content microdata/startDate" />
+ <abbr class="dtstart"
+ tal:attributes="title python:item_start"
+ tal:content="python:toLocalizedTime(item_start,long_format=1)"
+ i18n:name="start">from date</abbr> to
+ <meta i18n:name="microdata_end" itemprop="endDate" tal:attributes="content microdata/endDate" />
+ <abbr class="dtend"
+ tal:attributes="title python:item_end"
+ tal:content="python:toLocalizedTime(item_end,long_format=1)"
+ i18n:name="end">to date</abbr>)
+ </span>
+ <span tal:condition="not:item/location"
+ i18n:translate="label_event_byline_without_location"
+ i18n:domain="collective.microdata.event">
+ (from
+ <meta i18n:name="microdata_start" itemprop="startDate" tal:attributes="content microdata/startDate" />
+ <abbr class="dtstart"
+ tal:attributes="title python:item_start"
+ tal:content="python:toLocalizedTime(item_start,long_format=1)"
+ i18n:name="start">from date</abbr> to
+ <meta i18n:name="microdata_end" itemprop="endDate" tal:attributes="content microdata/endDate" />
+ <abbr class="dtend"
+ tal:attributes="title python:item_end"
+ tal:content="python:toLocalizedTime(item_end,long_format=1)"
+ i18n:name="end">to date</abbr>)
+ </span>
+ <meta itemprop="duration" tal:attributes="content microdata/duration" />
+ </div>
+
+ <p class="tileBody" tal:condition="item_description">
+ <span class="description" tal:content="item_description" itemprop="description">
+ description
+ </span>
+ </p>
+
+ <p class="tileFooter">
+ <a href=""
+ tal:attributes="href python: item_type in use_view_action and item_url+'/view' or item_url;">
+ <span class="hiddenStructure"><span tal:replace="item_title_or_id" /> - </span>
+ <span i18n:translate="read_more">Read More&hellip;</span>
+ </a>
+ </p>
+
+ <div class="visualClear"><!-- --></div>
+
+ </div>
View
26 collective/microdata/event/locales/collective.microdata.event.pot
@@ -4,7 +4,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2012-07-15 18:14+0000\n"
+"POT-Creation-Date: 2012-08-19 14:39+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,12 +18,32 @@ msgstr ""
"Domain: collective.microdata.event\n"
#. Default: "${microdata_start} ${startdate} to ${linebreak} ${microdata_end} ${enddate}"
-#: ../browser/event_view.pt:60
+#: ../browser/templates/event_view.pt:63
msgid "event_when_differentday"
msgstr ""
#. Default: "${date} ${linebreak} from ${microdata_start} ${starttime} to ${microdata_end} ${endtime}"
-#: ../browser/event_view.pt:98
+#: ../browser/templates/event_view.pt:101
msgid "event_when_sameday"
msgstr ""
+#. Default: "from ${microdata_start} ${start} to ${microdata_end} ${end}"
+#: ../browser/templates/folder_listing_item.pt:84
+msgid "label_event_byline"
+msgstr ""
+
+#. Default: "${start} from ${microdata_start} ${starttime} to ${microdata_end} ${end}"
+#: ../browser/templates/folder_listing_item.pt:69
+msgid "label_event_byline_samedate"
+msgstr ""
+
+#. Default: "(${location}, from ${microdata_start} ${start} to ${microdata_end} ${end})"
+#: ../browser/templates/folder_summary_view_item.pt:55
+msgid "label_event_byline_with_location"
+msgstr ""
+
+#. Default: "(from ${microdata_start} ${start} to ${microdata_end} ${end})"
+#: ../browser/templates/folder_summary_view_item.pt:70
+msgid "label_event_byline_without_location"
+msgstr ""
+
View
26 collective/microdata/event/locales/it/LC_MESSAGES/collective.microdata.event.po
@@ -3,7 +3,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2012-07-15 18:14+0000\n"
+"POT-Creation-Date: 2012-08-19 14:39+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: keul <luca@keul.it>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,12 +17,32 @@ msgstr ""
"Domain: collective.microdata.event\n"
#. Default: "${microdata_start} ${startdate} to ${linebreak} ${microdata_end} ${enddate}"
-#: ../browser/event_view.pt:60
+#: ../browser/templates/event_view.pt:63
msgid "event_when_differentday"
msgstr "dal ${microdata_start} ${startdate} ${linebreak} al ${microdata_end} ${enddate}"
#. Default: "${date} ${linebreak} from ${microdata_start} ${starttime} to ${microdata_end} ${endtime}"
-#: ../browser/event_view.pt:98
+#: ../browser/templates/event_view.pt:101
msgid "event_when_sameday"
msgstr "${date} ${linebreak} ${microdata_start} dalle ${starttime} alle ${microdata_end} ${endtime}"
+#. Default: "from ${microdata_start} ${start} to ${microdata_end} ${end}"
+#: ../browser/templates/folder_listing_item.pt:84
+msgid "label_event_byline"
+msgstr "dal ${microdata_start} ${start} al ${microdata_end} ${end}"
+
+#. Default: "${start} from ${microdata_start} ${starttime} to ${microdata_end} ${end}"
+#: ../browser/templates/folder_listing_item.pt:69
+msgid "label_event_byline_samedate"
+msgstr "${start} dalle ${microdata_start} ${starttime} alle ${microdata_end} ${end}"
+
+#. Default: "(${location}, from ${microdata_start} ${start} to ${microdata_end} ${end})"
+#: ../browser/templates/folder_summary_view_item.pt:55
+msgid "label_event_byline_with_location"
+msgstr "(${location}, da ${microdata_start} ${start} a ${microdata_end} ${end})"
+
+#. Default: "(from ${microdata_start} ${start} to ${microdata_end} ${end})"
+#: ../browser/templates/folder_summary_view_item.pt:70
+msgid "label_event_byline_without_location"
+msgstr "(da ${microdata_start} ${start} a ${microdata_end} ${end})"
+

0 comments on commit e7abe19

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