[MKDoc-commit] Splite up document and events listings into seperate templates and

chris at mkdoc.demon.co.uk chris at mkdoc.demon.co.uk
Wed Mar 30 13:17:02 BST 2005


Log Message:
-----------
Splite up document and events listings into seperate templates and updated events formatting

Tags:
----
mkdoc-1-6

Modified Files:
--------------
    mkd/templates/component/headlines/user:
        en.html

Added Files:
-----------
    mkd/templates/component/headlines/user/documents:
        en.html
    mkd/templates/component/headlines/user/events:
        en.html

-------------- next part --------------
--- /dev/null
+++ templates/component/headlines/user/documents/en.html
@@ -0,0 +1,95 @@
+<!--?
+
+
+This template is used for rendering the headlines component in documents
+for logged in users who don't get personalized headlines either because 
+nothing matches their preferences or because they haven't set their 
+preferences. 
+
+?-->
+<div
+  class="headlines"
+  xmlns:petal="http://purl.org/petal/1.0/"
+  xmlns:metal="http://xml.zope.org/namespaces/metal"
+  petal:condition="true: self/is_user_logged_in; 
+                   false: self/personalized_headlines"
+>
+  <h2 
+    xml:lang="en"
+    lang="en"
+    dir="ltr"
+    petal:condition="true: self/title"
+    petal:attributes="xml:lang lang; lang lang; dir dir;"
+    petal:content="self/title"
+  >Headlines Title</h2>
+
+  <p 
+    petal:condition="true: self/audience_on"
+  >
+    Audience preferences have been set for this listing by the editor of this page.
+  </p>
+
+  <p
+    lang="en"
+    xml:lang="en"
+    dir="ltr"
+    petal:condition="false: self/audience_on"
+  >
+    This list of documents has not been personalized because you didn't set
+    <a 
+      petal:define="preferences_p plugin: flo::plugin::Account::Preferences"
+      petal:attributes="href preferences_p/uri"
+      href="./.account.preferences"
+    >your preferences</a>
+    or because none of the documents in the list matched them.
+  </p>
+
+  <dl>
+
+    <div 
+      petal:condition="true: self/mode_is_newest"
+      petal:repeat="headline self/default_headlines" 
+      petal:omit-tag=""
+    >
+      <dt
+        class="document"
+      >
+        <a
+            href="#"
+            hreflang="en"
+            lang="en"
+            xml:lang="en"
+            dir="ltr"
+            petal:attributes="href headline/uri; 
+                              hreflang headline/lang; 
+                              lang headline/lang; 
+                              xml:lang headline/lang; 
+                              dir headline/direction;"
+            petal:content="headline/title"
+          >Title of the document</a>
+      </dt>
+      <dd
+        class="document"
+      >
+        <span
+          lang="en"
+          xml:lang="en"
+          dir="ltr"
+          petal:attributes="lang headline/lang; 
+                            xml:lang headline/lang; 
+                            dir headline/direction;"
+          petal:content="headline/description"
+        >
+          A description of the document.
+        </span>
+        <br />
+        <small petal:content="headline/date_created"> 
+          01-03-2005
+        </small>
+      </dd>
+    </div>
+
+  </dl>
+
+</div>
+
Index: en.html
===================================================================
RCS file: /var/spool/cvs/mkd/templates/component/headlines/user/Attic/en.html,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -Ltemplates/component/headlines/user/en.html -Ltemplates/component/headlines/user/en.html -u -r1.1.2.2 -r1.1.2.3
--- templates/component/headlines/user/en.html
+++ templates/component/headlines/user/en.html
@@ -8,134 +8,27 @@
 
 ?-->
 <div
-  class="headlines"
   xmlns:petal="http://purl.org/petal/1.0/"
-  xmlns:metal="http://xml.zope.org/namespaces/metal"
+  petal:omit-tag=""
   petal:condition="true: self/is_user_logged_in; 
                    false: self/personalized_headlines"
 >
-  <h2 
-    xml:lang="en"
-    lang="en"
-    dir="ltr"
-    petal:condition="true: self/title"
-    petal:attributes="xml:lang lang; lang lang; dir dir;"
-    petal:content="self/title"
-  >Headlines Title</h2>
 
-  <p
-    lang="en"
-    xml:lang="en"
-    dir="ltr"
-    petal:condition="false: self/audience_on"
+  <!--? Upcoming events style headlines -->
+  <div 
+    petal:condition="true: self/mode_is_upcoming"
+    petal:omit-tag=""
   >
-    This list of documents has not been personalized because you didn't set
-    <a 
-      petal:define="preferences_p plugin: flo::plugin::Account::Preferences"
-      petal:attributes="href preferences_p/uri"
-      href="./.account.preferences"
-    >your preferences</a>
-    or because none of the documents in the list matched them.
-  </p>
+  <?include file="./events/"?>
+  </div>
 
-  <dl>
-
-    <!--? Generate upcoming events style headlines -->
-    <div 
-      petal:condition="true: self/mode_is_upcoming"
-      petal:repeat="row self/default_headlines" 
-      petal:omit-tag=""
-    >
-      <dt
-        class="event" 
-        petal:define="headline row/document; timerange row/timerange;"
-      >
-        <a
-            href="#"
-            hreflang="en"
-            lang="en"
-            xml:lang="en"
-            dir="ltr"
-            petal:attributes="href headline/uri; 
-                              hreflang headline/lang; 
-                              lang headline/lang; 
-                              xml:lang headline/lang; 
-                              dir headline/direction;"
-            petal:content="headline/title"
-          >Title of the document</a>
-      </dt>
-      <dd
-        class="event" 
-      > 
-        <span
-          lang="en"
-          xml:lang="en"
-          dir="ltr"
-          petal:attributes="lang headline/lang; 
-                            xml:lang headline/lang; 
-                            dir headline/direction;"
-          petal:content="timerange/title"
-        >
-          A description of the event.
-        </span>
-      </dd>
-      <dd
-        class="event" 
-      >
-        <span
-          metal:use-macro="/macros/timerange/#simple"
-          class="mkdoc-date"
-        >
-          10:11am to 5:10pm Monday December 18 2005
-        </span>
-      </dd>
-    </div>
-
-    <!--? Generate newest documents style headlines -->
-    <div 
-      petal:condition="true: self/mode_is_newest"
-      petal:repeat="headline self/default_headlines" 
-      petal:omit-tag=""
-    >
-      <dt
-        class="document"
-      >
-        <a
-            href="#"
-            hreflang="en"
-            lang="en"
-            xml:lang="en"
-            dir="ltr"
-            petal:attributes="href headline/uri; 
-                              hreflang headline/lang; 
-                              lang headline/lang; 
-                              xml:lang headline/lang; 
-                              dir headline/direction;"
-            petal:content="headline/title"
-          >Title of the document</a>
-      </dt>
-      <dd
-        class="document"
-      >
-        <span
-          lang="en"
-          xml:lang="en"
-          dir="ltr"
-          petal:attributes="lang headline/lang; 
-                            xml:lang headline/lang; 
-                            dir headline/direction;"
-          petal:content="headline/description"
-        >
-          A description of the document.
-        </span>
-        <br />
-        <small petal:content="headline/date_created"> 
-          01-03-2005
-        </small>
-      </dd>
-    </div>
-
-  </dl>
+  <!--? Newest documents style headlines -->
+  <div 
+    petal:condition="true: self/mode_is_newest"
+    petal:omit-tag=""
+  >
+  <?include file="./documents/"?>
+  </div>
 
 </div>
 
--- /dev/null
+++ templates/component/headlines/user/events/en.html
@@ -0,0 +1,118 @@
+<!--?
+
+
+This template is used for rendering the headlines component in documents
+for logged in users who don't get personalized headlines either because 
+nothing matches their preferences or because they haven't set their 
+preferences. 
+
+?-->
+<div
+  class="headlines"
+  xmlns:petal="http://purl.org/petal/1.0/"
+  xmlns:metal="http://xml.zope.org/namespaces/metal"
+  petal:condition="true: self/is_user_logged_in; 
+                   false: self/personalized_headlines"
+>
+  <h2 
+    xml:lang="en"
+    lang="en"
+    dir="ltr"
+    petal:condition="true: self/title"
+    petal:attributes="xml:lang lang; lang lang; dir dir;"
+    petal:content="self/title"
+  >Headlines Title</h2>
+
+  <p 
+    petal:condition="true: self/audience_on"
+  >
+    Audience preferences have been set for this listing by the editor of this page.
+  </p>
+
+  <p
+    lang="en"
+    xml:lang="en"
+    dir="ltr"
+    petal:condition="false: self/audience_on"
+  >
+    This list of documents has not been personalized because you didn't set
+    <a 
+      petal:define="preferences_p plugin: flo::plugin::Account::Preferences"
+      petal:attributes="href preferences_p/uri"
+      href="./.account.preferences"
+    >your preferences</a>
+    or because none of the documents in the list matched them.
+  </p>
+
+  <dl>
+
+    <div 
+      petal:condition="true: self/mode_is_upcoming"
+      petal:repeat="row self/default_headlines" 
+      petal:omit-tag=""
+    >
+      <dt
+        class="event" 
+        petal:define="headline row/document; 
+                      timerange row/timerange;"
+      >
+        <a
+            href="#"
+            hreflang="en"
+            lang="en"
+            xml:lang="en"
+            petal:attributes="href headline/uri; 
+                              hreflang headline/lang; 
+                              lang headline/lang; 
+                              xml:lang headline/lang; 
+                              dir headline/direction;
+                              title headline/description"
+            petal:content="headline/title"
+          >Title of the document</a>
+         <bdo
+           dir="ltr"
+           petal:attributes="self/direction"
+         >:</bdo>
+         <span
+            lang="en"
+            xml:lang="en"
+            dir="ltr"
+            petal:attributes="href headline/uri; 
+                              lang headline/lang; 
+                              xml:lang headline/lang" 
+            petal:content="timerange/title"
+          >Title of the event</span>
+      </dt>
+<!--? Document description
+      <dd
+        class="event" 
+      > 
+        <span
+          lang="en"
+          xml:lang="en"
+          dir="ltr"
+          petal:attributes="lang headline/lang; 
+                            xml:lang headline/lang; 
+                            dir headline/direction;"
+          petal:content="timerange/title"
+        >
+          A description of the event.
+        </span>
+      </dd>
+?-->
+      <dd
+        class="event" 
+      >
+        <span
+          metal:use-macro="/macros/timerange/#simple"
+          class="mkdoc-date"
+        >
+          10:11am to 5:10pm Monday December 18 2005
+        </span>
+      </dd>
+    </div>
+
+  </dl>
+
+</div>
+


More information about the MKDoc-commit mailing list