[Mpuls-commits] r5955 - base/trunk/mpulsweb/templates/casemanagement

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Mon May 7 16:12:02 CEST 2012


Author: bricks
Date: 2012-05-07 16:12:01 +0200 (Mon, 07 May 2012)
New Revision: 5955

Added:
   base/trunk/mpulsweb/templates/casemanagement/overview_base.mako
Modified:
   base/trunk/mpulsweb/templates/casemanagement/overview.mako
Log:
Refactor templates/casemanagement/overview.mako to be able to overwrite the export options

For mpuls_S we need another special export. This export must be added as an option to the
action select box. With this change an application like mpuls_S may override the overview.mako
and derive from the new overview_base.mako to achieve this.


Modified: base/trunk/mpulsweb/templates/casemanagement/overview.mako
===================================================================
--- base/trunk/mpulsweb/templates/casemanagement/overview.mako	2012-04-30 13:01:26 UTC (rev 5954)
+++ base/trunk/mpulsweb/templates/casemanagement/overview.mako	2012-05-07 14:12:01 UTC (rev 5955)
@@ -1,82 +1,13 @@
 ## -*- coding: utf-8 -*-
-<%inherit file="../main.mako" />
-<%!  import mpulsweb.lib.helper.filters as F %>
+<%inherit file="overview_base.mako" />
+
 <%def name="buildNavipath()">
   ${parent.buildNavipath()}
   <li><a href="${h.url(controller='case', action='index')}">${_('Case Management')}</a></li>
   <li><a href="${h.url(controller='case_overview', action='index')}">${_('Case document overview')}</a></li>
 </%def>
-<h1>${_('Case documents overview')}</h1>
-% if h.hasRole(['admin']):
- <!-- <p>${_('List all case documents of the organisation or the user')}</p>-->
-% endif
 
-% if h.hasRole(['cm']):
- <!-- <p>${_('List all cases of this user')}</p>-->
-%endif
-<%include file="/casemanagement/search.mako" />
-${ungettext('%s case was found.', '%s cases where found.', c.count_all) % c.count_all}
-<div class="waska_form">
-  <form action="${h.url(controller='case_bundle', action='bundleAction')}"
-        method="POST">
-  <%include file="./caselist.mako" />
-  % if g.mpuls_config.is_enabled('case-module', 'casebundle'):
-  <div class="waska_form_element">
-    <input type="checkbox" name="all_cases" id="all_cases" value="1"><label for="all_cases">
-    ${ungettext('Select the %s found case.', 'Select all %s found cases', c.count_all) % c.count_all}</label>
-    <input type="hidden" name="id_field" value="">
-    <input type="hidden" name="all_ids" value="">
-  </div>
-  <div class="waska_form_element w30">
-    <select name="action">
-      <option value="no_action">${_('No action')}</option>
-      % if h.hasRole(['admin']):
-        <option value="delete">${_('Delete')}</option>
-        % if g.mpuls_config.is_enabled('case-module', 'anonymize'):
-          <option value="anonymize">${_('Anonymize')}</option>
-        % endif
-        <option value="restore">${_('Restore')}</option>
-        % if g.mpuls_config.is_enabled('case-module', 'organisation'):
-          <option value="transfer">${_('Transfer editing')}</option>
-        % endif
-      % endif
-      % if h.hasRole(['cm']):
-        <option value="markdelete">${_('Delete')}</option>
-        % if g.mpuls_config.is_enabled('case-module', 'anonymize'):
-          <option value="markanonymize">${_('Mark anonymize')}</option>
-        % endif
-      % endif
-      % if h.hasRole(['admin', 'cm']):
-        % if g.mpuls_config.is_enabled('case-module', 'organisation'):
-          <option value="standin">${_('Set standin')}</option>
-        % endif
-      % endif
-      % if g.mpuls_config.is_enabled('case-module', 'exportXLS'):
-        <option value="exportXLS">${_('Export as XLS')}</option>
-      % endif
-      % if g.mpuls_config.is_enabled('case-module', 'exportXML'):
-        <option value="exportXML">${_('Export as XML')}</option>
-      % endif
-      % if g.mpuls_config.is_enabled('case-module', 'exportCSV'):
-        <option value="exportCSV">${_('Export as CSV')}</option>
-      % endif
-      % if g.mpuls_config.is_enabled('case-module', 'formletter'):
-        % for l in g.mpuls_config.get('case', 'formletter'):
-          <option value="formletter:${l.get('id')}">${l.get('name')}</option>
-        % endfor
-      % endif
-      % if g.mpuls_config.is_enabled('module', 'evaluation') \
-        and len(g.mpuls_config.get('evaluations', 'enabled')) > 0 \
-        and not c.hide_evaluation:
-        <option value="evaluate">${_('Evaluate')}</option>
-      % endif
-    </select>
-  </div>
-  <div class="waska_form_element w50">
-    <input type="submit" value="${_('submit action')}">
-  </div>
-  % endif
-  </form>
-  <br class="newline">
-</div>
+<%def name="render_additional_exports()">
+</%def>
 
+${parent.body()}

Added: base/trunk/mpulsweb/templates/casemanagement/overview_base.mako
===================================================================
--- base/trunk/mpulsweb/templates/casemanagement/overview_base.mako	                        (rev 0)
+++ base/trunk/mpulsweb/templates/casemanagement/overview_base.mako	2012-05-07 14:12:01 UTC (rev 5955)
@@ -0,0 +1,82 @@
+## -*- coding: utf-8 -*-
+<%inherit file="../main.mako" />
+<%!  import mpulsweb.lib.helper.filters as F %>
+
+<h1>${_('Case documents overview')}</h1>
+% if h.hasRole(['admin']):
+ <!-- <p>${_('List all case documents of the organisation or the user')}</p>-->
+% endif
+
+% if h.hasRole(['cm']):
+ <!-- <p>${_('List all cases of this user')}</p>-->
+%endif
+
+<%include file="/casemanagement/search.mako" />
+
+${ungettext('%s case was found.', '%s cases where found.', c.count_all) % c.count_all}
+
+<div class="waska_form">
+  <form action="${h.url(controller='case_bundle', action='bundleAction')}"
+        method="POST">
+  <%include file="./caselist.mako" />
+  % if g.mpuls_config.is_enabled('case-module', 'casebundle'):
+  <div class="waska_form_element">
+    <input type="checkbox" name="all_cases" id="all_cases" value="1"><label for="all_cases">
+    ${ungettext('Select the %s found case.', 'Select all %s found cases', c.count_all) % c.count_all}</label>
+    <input type="hidden" name="id_field" value="">
+    <input type="hidden" name="all_ids" value="">
+  </div>
+  <div class="waska_form_element w30">
+    <select name="action">
+      <option value="no_action">${_('No action')}</option>
+      % if h.hasRole(['admin']):
+        <option value="delete">${_('Delete')}</option>
+        % if g.mpuls_config.is_enabled('case-module', 'anonymize'):
+          <option value="anonymize">${_('Anonymize')}</option>
+        % endif
+        <option value="restore">${_('Restore')}</option>
+        % if g.mpuls_config.is_enabled('case-module', 'organisation'):
+          <option value="transfer">${_('Transfer editing')}</option>
+        % endif
+      % endif
+      % if h.hasRole(['cm']):
+        <option value="markdelete">${_('Delete')}</option>
+        % if g.mpuls_config.is_enabled('case-module', 'anonymize'):
+          <option value="markanonymize">${_('Mark anonymize')}</option>
+        % endif
+      % endif
+      % if h.hasRole(['admin', 'cm']):
+        % if g.mpuls_config.is_enabled('case-module', 'organisation'):
+          <option value="standin">${_('Set standin')}</option>
+        % endif
+      % endif
+      % if g.mpuls_config.is_enabled('case-module', 'exportXLS'):
+        <option value="exportXLS">${_('Export as XLS')}</option>
+      % endif
+      % if g.mpuls_config.is_enabled('case-module', 'exportXML'):
+        <option value="exportXML">${_('Export as XML')}</option>
+      % endif
+      % if g.mpuls_config.is_enabled('case-module', 'exportCSV'):
+        <option value="exportCSV">${_('Export as CSV')}</option>
+      % endif
+      % if g.mpuls_config.is_enabled('case-module', 'formletter'):
+        % for l in g.mpuls_config.get('case', 'formletter'):
+          <option value="formletter:${l.get('id')}">${l.get('name')}</option>
+        % endfor
+      % endif
+      % if g.mpuls_config.is_enabled('module', 'evaluation') \
+        and len(g.mpuls_config.get('evaluations', 'enabled')) > 0 \
+        and not c.hide_evaluation:
+        <option value="evaluate">${_('Evaluate')}</option>
+      % endif
+      ${self.render_additional_exports()}
+    </select>
+  </div>
+  <div class="waska_form_element w50">
+    <input type="submit" value="${_('submit action')}">
+  </div>
+  % endif
+  </form>
+  <br class="newline">
+</div>
+



More information about the Mpuls-commits mailing list