From c4e40a3a5c1507ee453997138ea2355feee6fa85 Mon Sep 17 00:00:00 2001 From: jensp Date: Thu, 6 Nov 2014 16:16:01 +0000 Subject: [PATCH] Foundry support for ObjectLists. Paginator and filters are not yet supported, will be added in the next commit. git-svn-id: https://svn.libreccm.org/ccm/trunk@2954 8810af33-2d31-482b-a856-94f89814c4df --- .../web/themes/foundry/conf/templates.xml | 3 + .../foundry/foundry/lib/template-tags.xsl | 1 + .../lib/template-tags/content-items.xsl | 180 +++++++++++++++++- .../template-tags/content-items/article.xsl | 9 +- .../assets/image-attachments.xsl | 4 +- .../foundry/lib/template-tags/object-list.xsl | 96 ++++++++++ .../templates/contentitem-default-list.xml | 6 + .../templates/contentitem-detail-default.xml | 6 + .../templates/contentitem-link-default.xml | 6 + .../templates/content-items/article-list.xml | 9 + .../content-items/detail-default.xml | 1 - .../templates/content-items/list-default.xml | 6 + .../foundry/templates/default-layout.xml | 22 +++ 13 files changed, 341 insertions(+), 8 deletions(-) create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/object-list.xsl create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/templates/contentitem-default-list.xml create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/templates/contentitem-detail-default.xml create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/templates/contentitem-link-default.xml create mode 100644 ccm-sci-bundle/web/themes/foundry/templates/content-items/article-list.xml create mode 100644 ccm-sci-bundle/web/themes/foundry/templates/content-items/list-default.xml diff --git a/ccm-sci-bundle/web/themes/foundry/conf/templates.xml b/ccm-sci-bundle/web/themes/foundry/conf/templates.xml index b77f8d791..db3b53472 100644 --- a/ccm-sci-bundle/web/themes/foundry/conf/templates.xml +++ b/ccm-sci-bundle/web/themes/foundry/conf/templates.xml @@ -23,6 +23,9 @@ content-items/link-default.xml + + content-items/article-list.xml + content-items/list-default.xml diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags.xsl index 2e0063a88..b11f1a741 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags.xsl @@ -30,6 +30,7 @@ + diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items.xsl index 8de0058ef..4254aad5e 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items.xsl @@ -47,7 +47,7 @@

- The content-item tag with the attribute mode set the + The content-item element with the attribute mode set to detail or without the attribute inserts the HTML representation of the detail view of the current content item. The content item can either be the greeting item or normal item. @@ -57,7 +57,7 @@ with the contentitem-layout element as root. Usually these templates are located in the templates/content-items folder. Which template is used for a particular content item is defined by the conf/templates.xml - file. In this file there is a content-items below the + file. In this file there is a content-items element below the templates element. The association between templates and content items is described by the content-item elements in the content-items element. The content-item has four @@ -263,7 +263,8 @@ select="'contentitem-default-detail.xml'"/> - + @@ -325,8 +326,172 @@ + + +

+ The content-item element with the mode attribute set to + list inserts the HTML representation of the the list view of a content + item. The list view is primarily used in object lists. +

+

+ As for the detail view, the HTML representation of the list view of a conten item is + defined using special templates with the contentitem-layout element as + root. Usually these templates are located in the + templates/content-items folder. Which is used for a particular content + item is defined in the conf/templates.xml file. In this file there is + a content-items element below the templates element. +

+

+ There three attributes which can be used to define in which cases a specific + template is used: +

+
+
style
+
+ Used to select a specific style for the list view of the item. To select a style + add a style attribute to the content-item attribute + in the application layout file. +
+
content-type
+
The content-type of the item.
+
+ category +
+
+ The template is only used for the content item if the item is viewed as item of + the category. The category is set as a path contains the names the categories. +
+
+
+ + The template system + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -363,7 +528,14 @@ - + + + + + + + + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items/article.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items/article.xsl index b9e06fa86..57fefe43d 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items/article.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items/article.xsl @@ -31,7 +31,14 @@ - + + + + + + + + diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items/assets/image-attachments.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items/assets/image-attachments.xsl index f40a07e37..b0565ed27 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items/assets/image-attachments.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items/assets/image-attachments.xsl @@ -81,10 +81,10 @@ -
+        
         
         
         
diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/object-list.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/object-list.xsl
new file mode 100644
index 000000000..a1ba4c034
--- /dev/null
+++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/object-list.xsl
@@ -0,0 +1,96 @@
+
+
+                      ]>
+
+
+
+    
+        
+        
+        
+        
+            
+            
+                
+                    
+                        
+                    
+                    
+                        
+                    
+                    
+                        
+                    
+                    
+                        
+                    
+                    
+                        
+                    
+                
+            
+            
+            
+                
+            
+        
+    
+
+    
+        
+        
+        
+    
+        
+    
+        
+            
+                
+            
+        
+        
+    
+
+
\ No newline at end of file
diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/templates/contentitem-default-list.xml b/ccm-sci-bundle/web/themes/foundry/foundry/templates/contentitem-default-list.xml
new file mode 100644
index 000000000..d619470a7
--- /dev/null
+++ b/ccm-sci-bundle/web/themes/foundry/foundry/templates/contentitem-default-list.xml
@@ -0,0 +1,6 @@
+
+
+    

+ +

+
\ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/templates/contentitem-detail-default.xml b/ccm-sci-bundle/web/themes/foundry/foundry/templates/contentitem-detail-default.xml new file mode 100644 index 000000000..a3e1a5e4c --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/foundry/templates/contentitem-detail-default.xml @@ -0,0 +1,6 @@ + + +
+ +
+
\ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/templates/contentitem-link-default.xml b/ccm-sci-bundle/web/themes/foundry/foundry/templates/contentitem-link-default.xml new file mode 100644 index 000000000..85758cdf1 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/foundry/templates/contentitem-link-default.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/templates/content-items/article-list.xml b/ccm-sci-bundle/web/themes/foundry/templates/content-items/article-list.xml new file mode 100644 index 000000000..3d82092e3 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/templates/content-items/article-list.xml @@ -0,0 +1,9 @@ + + +

+ +

+
+ +
+
\ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/templates/content-items/detail-default.xml b/ccm-sci-bundle/web/themes/foundry/templates/content-items/detail-default.xml index 47da2b36c..a3e1a5e4c 100644 --- a/ccm-sci-bundle/web/themes/foundry/templates/content-items/detail-default.xml +++ b/ccm-sci-bundle/web/themes/foundry/templates/content-items/detail-default.xml @@ -2,6 +2,5 @@
-
\ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/templates/content-items/list-default.xml b/ccm-sci-bundle/web/themes/foundry/templates/content-items/list-default.xml new file mode 100644 index 000000000..d619470a7 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/templates/content-items/list-default.xml @@ -0,0 +1,6 @@ + + +

+ +

+
\ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/templates/default-layout.xml b/ccm-sci-bundle/web/themes/foundry/templates/default-layout.xml index e2fd04d40..21cced908 100644 --- a/ccm-sci-bundle/web/themes/foundry/templates/default-layout.xml +++ b/ccm-sci-bundle/web/themes/foundry/templates/default-layout.xml @@ -58,6 +58,28 @@ +
+ +
    + +
  • + +
  • +
    +
+
+
+
+ +
    + +
  • +
    news-item
    +
  • +
    +
+
+