[Mpuls-commits] r1956 - in wasko/branches/2.0: jmdweb/templates/casemanagement mpulsweb/templates/casemanagement
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Mar 16 10:02:05 CET 2010
Author: torsten
Date: 2010-03-16 10:02:04 +0100 (Tue, 16 Mar 2010)
New Revision: 1956
Added:
wasko/branches/2.0/mpulsweb/templates/casemanagement/caselist.mako
wasko/branches/2.0/mpulsweb/templates/casemanagement/overview.mako
Removed:
wasko/branches/2.0/jmdweb/templates/casemanagement/caselist.mako
wasko/branches/2.0/jmdweb/templates/casemanagement/overview.mako
Log:
Moved templates for caseoverview into base.
Deleted: wasko/branches/2.0/jmdweb/templates/casemanagement/caselist.mako
===================================================================
--- wasko/branches/2.0/jmdweb/templates/casemanagement/caselist.mako 2010-03-16 08:55:36 UTC (rev 1955)
+++ wasko/branches/2.0/jmdweb/templates/casemanagement/caselist.mako 2010-03-16 09:02:04 UTC (rev 1956)
@@ -1,173 +0,0 @@
-## -*- coding: utf-8 -*-
-<%!
-from pylons.i18n import _
-
-import mpulsweb.lib.helper.filters as F
-import mpulsweb.lib.helpers as h
-
-def hide_if_anonymized(case, value):
- """
- If the case is marked for anonymisation return empty string, value otherwise
- """
- if case.getState().getState() == 4 and h.hasRole(['cm_ka']):
- return ""
- return value
-
-all_roles = ['admin', 'cm']
-
-## Fields to show in the case list. Each entry is a tuple of the form
-## (TITLE, FIELDNAME, STYLE, ROLES, FORMATTER)
-## Here, TITLE is the title of the field, FIELDNAME is the field name
-## used in the search URL that's built for each column, STYLE is a CSS
-## class name to use in the style attribute of the HTML TH-element,
-## ROLES is a list with the names of the roles for which the field
-## should be shown. Finally, FORMATTER is a python callable that is
-## called with the case object as argument and which should return the
-## formatted value for the column.
-
-fields = [
- (_('cm_overview_tbl_header_id'), "kundennummer", "table_id", all_roles,
- lambda case: h.shorten(hide_if_anonymized(case, case.knr), 15)),
-
- (_('cm_overview_tbl_header_lastname'), "name_1", "table_name", all_roles,
- lambda case: h.shorten(hide_if_anonymized(case, case.last_name), 15)),
-
- (_('cm_overview_tbl_header_firstname'), "vorname_1", "table_name",
- all_roles,
- lambda case: h.shorten(hide_if_anonymized(case, case.first_name),15)),
-
- (_('cm_overview_tbl_header_editor'), "bearbeiter_id", "table_name",
- ["admin"],
- lambda case: "%s, %s" % (F.NA(case.getEditor().last_name),
- F.NA(case.getEditor().first_name[:1]))),
-
- (_('cm_overview_tbl_header_accesstime'), "zugriff", "table_name", ["cm"],
- lambda case: h.format_date(case.state.getAccessTime())),
- ]
-%>
-
-<%def name="build_list_headers()">
- % if g.mpuls_config.is_enabled('case-module', 'casebundle'):
- <th class="table_header_h table_checkbox"> </th>
- % endif
- % for title, urlpart, style, roles, get_value in fields:
- % if h.hasRole(roles):
- <th class="${style} table_header_h">${title}
- <a href="/case_overview/overview?sort_field=${urlpart}&sort_order=asc">
- <img class="sorticon" src="/images/icons/sort_asc.png"></a>
- <a href="/case_overview/overview?sort_field=${urlpart}&sort_order=desc">
- <img class="sorticon" src="/images/icons/sort_desc.png"></a>
- </th>
- % endif
- % endfor
- <th class="table_status table_header_h">
- ${_('cm_overview_tbl_header_status')}
- </th>
- <th class="table_action table_header_h">
- ${_('cm_overview_tbl_header_actions')}
- </th>
-</%def>
-
-<%def name="build_list_row(case)">
- % if g.mpuls_config.is_enabled('case-module', 'casebundle'):
- <td><input type="checkbox" name="case_id" value="${case.id}"></td>
- % endif
- % for title, urlpart, style, roles, get_value in fields:
- % if h.hasRole(roles):
- <td>${get_value(case) | F.NA, h}</td>
- % endif
- % endfor
- <td>
- ${get_state_icon(case)}
- </td>
- <td>
- ${get_actions(case)}
- </td>
-</%def>
-
-<%def name="get_state_icon(case)">
- % if h.hasRole(['cm_ka']):
- % if str(case.getEditor().id) == str(session.get('USER_AUTHORIZED').id):
- <img src="/images/icons/editor_grey.gif" border="0"
- alt="${_('cm_overview_img_editor')}"
- title="${_('cm_overview_img_editor')}">
- % else:
- <img src="/images/icons/stand-in_grey.gif" border="0"
- alt="${_('cm_overview_img_standin')}"
- title="${_('cm_overview_img_standin')}">
- % endif
- % endif
- % if case.getState().getState() in (1,2):
- <img src="/images/icons/work_in_progress_grey.gif" border="0"
- alt="${_('case_state_label_open')}"
- title="${_('case_state_label_open')}">
- % elif case.getState().getState() == 3:
- <img src="/images/icons/delete_grey.gif" border="0"
- alt="${_('case_state_label_delete')}"
- title="${_('case_state_label_delete')}">
- % elif case.getState().getState() == 4:
- <img src="/images/icons/anonym.gif" border="0"
- alt="${_('case_state_label_markanonym')}"
- title="${_('case_state_label_markanonym')}">
- % elif case.getState().getState() == 5:
- <img src="/images/icons/anonym.gif" border="0"
- alt="${_('case_state_label_anonym')}"
- title="${_('case_state_label_anonym')}">
- % endif
-</%def>
-
-<%def name="get_actions(case)">
- % if case.getState().getState() != 5:
- <a href="/case/select/${case.id}/0/">
- <img src="/images/icons/view_red.gif" border="0"
- alt="${_('cm_overview_a_show')}"
- title="${_('cm_overview_a_show')}"></a>
- % endif
- % if h.hasRole(['admin_ka']):
- % if case.getState().getState() in (3, 5):
- <a href="/case/delete/${case.id}/0/">
- <img src="/images/icons/delete_red.gif" border="0"
- alt="${_('cm_overview_a_delete')}"
- title="${_('cm_overview_a_delete')}"></a>
- % endif
- % if case.getState().getState() == 4:
- <a href="/case/anonymize/${case.id}/0/">
- <img src="/images/icons/anonym_red.gif" border="0"
- alt="${_('cm_overview_a_anonymize')}"
- title="${_('cm_overview_a_anonymize')}"></a>
- % endif
- % if case.getState().getState() in (3, 4):
- <a href="/case/restore/${case.id}/0/">
- <img src="/images/icons/recover_red.gif" border="0"
- alt="${_('cm_overview_a_restore')}"
- title="${_('cm_overview_a_restore')}"></a>
- % endif
- % elif h.hasRole(['cm_ka']) and case.getState().getState() in (1, 2):
- <a href="/case/markForAnonymizeFromOverview/${case.id}/0/">
- <img src="/images/icons/anonym_red.gif" border="0"
- alt="${_('cm_overview_a_anonymize')}"
- title="${_('cm_overview_a_anonymize')}"></a>
- <a href="/case/markForDelete/${case.id}/0/">
- <img src="/images/icons/delete_red.gif" border="0"
- alt="${_('cm_overview_a_delete')}"
- title="${_('cm_overview_a_delete')}"></a>
- % endif
-</%def>
-
-<table>
- <tr>
- ${build_list_headers()}
- </tr>
- % for num, case in enumerate(c.cases.getDatasets()):
- <tr class="${num % 2 and 'table_row_h' or ''}">
- ${build_list_row(case)}
- </tr>
- % endfor
- % if len(c.cases.getDatasets()) <= 0:
- <tr>
- <td colspan="6">
- ${_('cm_overview_tbl_no_data_found')}
- </td>
- </tr>
- % endif
-</table>
Deleted: wasko/branches/2.0/jmdweb/templates/casemanagement/overview.mako
===================================================================
--- wasko/branches/2.0/jmdweb/templates/casemanagement/overview.mako 2010-03-16 08:55:36 UTC (rev 1955)
+++ wasko/branches/2.0/jmdweb/templates/casemanagement/overview.mako 2010-03-16 09:02:04 UTC (rev 1956)
@@ -1,53 +0,0 @@
-## -*- coding: utf-8 -*-
-<%inherit file="../main.mako" />
-<%! import mpulsweb.lib.helper.filters as F %>
-<%def name="buildNavipath()">
- ${parent.buildNavipath()}
- <li><a href="/case">${_('cm_np_root')}</a></li>
- <li><a href="/case_overview">${_('cm_np_overview')}</a></li>
-</%def>
-<h1>${_('cm_header_overview')}</h1>
-% if h.hasRole(['admin_ka']):
- <!-- <p>${_('cm_overview_con_list_dossiers_admin')}</p>-->
-% endif
-
-% if h.hasRole(['cm_ka']):
- <!-- <p>${_('cm_overview_con_list_dossiers_cm')}</p>-->
-%endif
-<%include file="/casemanagement/search.mako" />
-Es wurden ${c.count_all} Fallakten gefunden
-<div class="waska_form">
- <form action="/case_overview/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">Alle angezeigten Fallakten (${c.count_all}) auswählen</label>
- </div>
- <div class="waska_form_element w30">
- <select name="action">
- <option value="no_action">Keine Aktion</option>
- % if h.hasRole(['admin_ka']):
- <option value="delete">Löschen</option>
- <option value="anonymize">Anonymisieren</option>
- <option value="restore">Wiederherstellen</option>
- <option value="transfer">Bearbeitung übertragen</option>
- % endif
- % if h.hasRole(['cm_ka']):
- <option value="markdelete">Löschen</option>
- <option value="markanonymize">Anonymisieren</option>
- % endif
- % if h.hasRole(['admin_ka', 'cm_ka']):
- <option value="stand-in">Vertretung zuweisen</option>
- <option value="exportXLS">Als Excel-Tabellen exportieren</option>
- <option value="exportXML">Als XML-Datei exportieren</option>
- <option value="exportCSV">Als CSV-Datei exportieren</option>
- % endif
- </select>
- </div>
- <div class="waska_form_element w50">
- <input type="submit" value="Aktion für Auswahl ausführen">
- </div>
- % endif
- </form>
- <br class="newline">
-</div>
Copied: wasko/branches/2.0/mpulsweb/templates/casemanagement/caselist.mako (from rev 1954, wasko/branches/2.0/jmdweb/templates/casemanagement/caselist.mako)
Property changes on: wasko/branches/2.0/mpulsweb/templates/casemanagement/caselist.mako
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: wasko/branches/2.0/mpulsweb/templates/casemanagement/overview.mako (from rev 1953, wasko/branches/2.0/jmdweb/templates/casemanagement/overview.mako)
Property changes on: wasko/branches/2.0/mpulsweb/templates/casemanagement/overview.mako
___________________________________________________________________
Name: svn:mergeinfo
+
More information about the Mpuls-commits
mailing list