source: main/waeup.kofa/trunk/layout/rules.xml @ 17956

Last change on this file since 17956 was 17172, checked in by Henrik Bettermann, 2 years ago

Add Javascript which automatically submits a form on select change (not used in base but in lpng custom package).

File size: 5.8 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<rules
3    xmlns="http://namespaces.plone.org/diazo"
4    xmlns:css="http://namespaces.plone.org/diazo/css"
5    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6    xmlns:xi="http://www.w3.org/2001/XInclude">
7
8  <!-- Cases where we do not want themes... -->
9  <notheme if-path="/++grokui++" />  <!-- do not theme GrokUI -->
10  <notheme if-path="/_debug" /><!-- output by debugger -->
11  <notheme css:if-content="div#error-area" />
12
13  <!-- use error page if there is a <table class="layout">
14       tag in content. This tag is rendered in Zope 3 errors. -->
15  <rules css:if-content="table#layout">
16    <theme href="error-zope.html" />
17    <replace css:theme-children="#kofa-error-message"
18             css:content-children="h3" />
19  </rules>
20  <!-- use error page if there is no <div> tag in content.
21       This happens if something in the application went wrong. -->
22  <rules css:if-not-content="div">
23    <theme href="error-zope.html" />
24    <replace css:theme-children="#kofa-error-message"
25             css:content-children="body" />
26  </rules>
27
28  <!-- regular rules -->
29  <rules css:if-content="body.kofa-body">
30
31    <theme href="theme.html" />
32
33    <!-- head elements -->
34    <replace css:theme="html head title"
35             css:content="html head title" />
36
37    <!-- brand (upper left) -->
38    <copy attributes="href" css:theme="a.kofa-brand-link"
39          css:content="a.kofa-brand-link" />
40    <replace css:theme-children="a.kofa-brand-link"
41             css:content-children="a.kofa-brand-link" />
42
43    <!-- left top navigation -->
44    <replace css:theme-children="ul.kofa-navbar-left"
45             css:content-children="ul.kofa-navbar-left" />
46
47    <!-- right side top navigation -->
48    <replace css:theme-children="ul.kofa-navbar-right"
49             css:content-children="ul.kofa-navbar-right" />
50
51    <!-- maintenance mode warning -->
52    <drop css:theme="div.kofa-maintenance"
53          css:if-not-content="div.maintenance-warning" />
54    <replace css:theme-children="div.maintenance-warning"
55             css:content-children="div.maintenance-warning" />
56
57    <!-- breadcrumbs -->
58    <drop css:theme="div.kofa-breadcrumbs-box-long"
59          css:if-not-content="ul.breadcrumb" />
60    <drop css:theme="div.kofa-breadcrumbs-box-long"
61          css:if-content="div.wfstatus" />
62    <drop css:theme="div.kofa-breadcrumbs-box-short"
63          css:if-not-content="ul.breadcrumb" />
64    <drop css:theme="div.kofa-breadcrumbs-box-short"
65          css:if-not-content="div.wfstatus" />
66    <replace css:theme-children="ol.kofa-breadcrumbs"
67             css:content-children="ul.breadcrumb" />
68
69    <!-- student status -->
70    <drop css:theme="div.kofa-student-status-box"
71          css:if-not-content="div.wfstatus" />
72    <replace css:theme-children="div.wfstatus"
73             css:content-children="div.wfstatus" />
74
75    <!-- sidebar -->
76
77    <drop css:theme="div.kofa-sidebar"
78          css:if-not-content="div.sidebar" />
79    <replace css:theme-children="div.sidebar-nav"
80             css:content-children="div.sidebar" />
81
82    <!-- content -->
83
84    <!-- drop one of the both content areas, depending on sidebar -->
85
86    <drop css:theme="div.kofa-content-narrow"
87          css:if-not-content="div.sidebar" />
88    <drop css:theme="div.kofa-content-wide"
89          css:if-content="div.sidebar" />
90    <replace css:theme-children="div.kofa-content"
91             css:content-children="div.kofa-content" />
92
93
94    <!-- scripts -->
95    <drop css:theme="script.kofa-script-tooltip"
96          css:if-not-content="[data-toggle='tooltip']" />
97
98    <drop css:theme="script.kofa-script-datepicker"
99          css:if-not-content="input.datepicker-le-year" />
100
101    <drop css:theme="script.kofa-script-datatable"
102          css:if-not-content="table.kofa-data-table" />
103
104    <drop css:theme="script.kofa-filterByText"
105          css:if-not-content="input.kofa-filterbox" />
106
107    <drop css:theme="script.kofa-autoSubmit"
108          css:if-not-content="form.autosubmit" />
109
110<!--
111
112    <rules css:if-not-content="input.datepicker-le-year">
113        <drop css:theme="script.jquery-ui"
114              css:if-not-content="[data-toggle='tooltip']" />
115    </rules>
116
117-->
118<!--
119    <after css:theme-children="html head"
120           css:content="html head meta" />
121-->
122<!--
123    <after css:theme-children="html head"
124           css:content="html head base" />
125-->
126
127    <!-- top navigation -->
128    <!-- left top navigation -->
129<!--
130    <replace css:theme-children="ul.kofa-navbar-left"
131             css:content-children="ul.kofa-navbar-left" />
132-->
133
134    <!-- the language selector
135
136      quite tricky. We insert a <li> element at beginning of
137      ul.kofa-navbar-right. This <li> has a header element
138      (the 'Language' button) and the a number of <li> elements
139      representing the supported languages.
140      We change the input content of format
141
142         <a href="foo" title="Lang">Abbrev</a>
143
144      to
145
146         <a href="foo">Lang</a>
147
148      creating new nodes (<xsl:element>) with attributes copied over.
149    -->
150    <before css:theme-children="ul.kofa-navbar-right">
151      <li class="dropdown kofa-langselect">
152        <a href="#" class="dropdown-toggle"
153           data-toggle="dropdown">
154           <img src="/static/img/earth.png" />
155        </a>
156        <ul class="dropdown-menu">
157          <xsl:for-each css:select=" .language a">
158            <li class="kofa-language">
159              <xsl:element name="a">
160                <xsl:attribute name="href">
161                  <xsl:value-of select="@href" />
162                </xsl:attribute>
163                <xsl:value-of select="@title" />
164              </xsl:element>
165            </li>
166          </xsl:for-each>
167        </ul>
168      </li>
169    </before>
170
171    <!-- Make all data tables responsive -->
172
173    <replace css:content="table.kofa-data-table">
174      <div class="table-responsive">
175        <xsl:apply-templates css:select="table.kofa-data-table" mode="raw"/>
176      </div>
177    </replace>
178
179   </rules>
180
181</rules>
Note: See TracBrowser for help on using the repository browser.