[Mpuls-commits] r3032 - in jmd/trunk: . jmdstrukturweb/templates jmdweb/templates

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jun 18 13:07:15 CEST 2010


Author: bh
Date: 2010-06-18 13:07:14 +0200 (Fri, 18 Jun 2010)
New Revision: 3032

Added:
   jmd/trunk/jmdstrukturweb/templates/main.mako
Modified:
   jmd/trunk/ChangeLog
   jmd/trunk/development-combined.ini
   jmd/trunk/jmdweb/templates/main.mako
Log:
* development-combined.ini (jmd.otherapp.url): New setting for
both app:struktur and app:jmd to set the URL that points to the
other application.

* jmdstrukturweb/templates/main.mako: New. Version of main.mako
adapted for the structure part which needs a link back to the case
management part.  Whether this link is actually generated and
where it points to is configurable in the ini file.

* jmdweb/templates/main.mako: Take the URL for the link to the
structure part from the configuration


Modified: jmd/trunk/ChangeLog
===================================================================
--- jmd/trunk/ChangeLog	2010-06-18 10:43:06 UTC (rev 3031)
+++ jmd/trunk/ChangeLog	2010-06-18 11:07:14 UTC (rev 3032)
@@ -1,3 +1,17 @@
+2010-06-18  Bernhard Herzog  <bh at intevation.de>
+
+	* development-combined.ini (jmd.otherapp.url): New setting for
+	both app:struktur and app:jmd to set the URL that points to the
+	other application.
+
+	* jmdweb/templates/main.mako: Take the URL for the link to the
+	structure part from the configuration
+
+	* jmdstrukturweb/templates/main.mako: New. Version of main.mako
+	adapted for the structure part which needs a link back to the case
+	management part.  Whether this link is actually generated and
+	where it points to is configurable in the ini file.
+
 2010-06-18  Torsten Irländer <torsten.irlaender at intevation.de>
 
 	* Changes: Änderungen der Version 1.0pre3 dokumentiert.

Modified: jmd/trunk/development-combined.ini
===================================================================
--- jmd/trunk/development-combined.ini	2010-06-18 10:43:06 UTC (rev 3031)
+++ jmd/trunk/development-combined.ini	2010-06-18 11:07:14 UTC (rev 3032)
@@ -126,7 +126,12 @@
 mpuls.db.user = %(jmd.casedb.user)s
 mpuls.db.name = %(jmd.casedb.name)s
 
+# URL to put into the Web-interface to let the user switch to the other
+# part of the JMD application.  This URL must include the prefix of the
+# other app used in the [composite:main] section
+jmd.otherapp.url = /struktur/
 
+
 # Structure Part
 [app:struktur]
 use = egg:mpulsweb
@@ -169,6 +174,11 @@
 mpuls.db.user = %(jmd.structuredb.user)s
 mpuls.db.name = %(jmd.structuredb.name)s
 
+# URL to put into the Web-interface to let the user switch to the other
+# part of the JMD application.  This URL must include the prefix of the
+# other app used in the [composite:main] section
+jmd.otherapp.url = /jmd/
+
 # force login to be done with the jmd application.  
 #
 # The prefix used here must match the one used in the [composite:main]

Added: jmd/trunk/jmdstrukturweb/templates/main.mako
===================================================================
--- jmd/trunk/jmdstrukturweb/templates/main.mako	2010-06-18 10:43:06 UTC (rev 3031)
+++ jmd/trunk/jmdstrukturweb/templates/main.mako	2010-06-18 11:07:14 UTC (rev 3032)
@@ -0,0 +1,288 @@
+## -*- coding: utf-8 -*-
+<%inherit file="base.mako" />
+<%def name="buildStatusBar()">
+  <div id="statusbar">
+    ${_('statusbar_logininfo')}:
+        <a href="${h.url_for(controller='/usersettings', action='showSettings',
+                             id=h.getUserId())}"
+           title="${_('sm_menu_link_settings')}"
+           onclick="return checkModification();">
+    % if h.getLogin() != 'adm':
+        <strong>${h.getUserFullname()}</strong></a> (${h.getRole()})
+    % else:
+        <strong>${h.getUserLastname()}</strong></a>
+    % endif
+  </div>
+</%def>
+
+<%def name="buildStartMenu()">
+  <div id="startmenu">
+    <ul>
+      <li>
+        <a href="${h.url_for(controller='/')}"
+           onclick="return checkModification();">
+          ${_('sm_menu_link_home')}
+        </a>
+      </li>
+      <li>
+        <a href="${h.url_for(controller='/usersettings', action='showSettings',
+                             id=h.getUserId())}"
+           onclick="return checkModification();">
+          ${_('sm_menu_link_settings')}
+        </a>
+      </li>
+      <li>
+          <a href="${h.url_for(controller='/help')}"
+           onclick="return checkModification();">
+           ${_('sm_menu_link_help')}</a>
+      </li>
+      <li>
+        <a href="${h.url_for(controller='/auth', action='logout')}"
+           onclick="return checkModification();">
+          ${_('sm_menu_link_logout')}</a>
+      </li>
+    </ul>
+  </div>
+</%def>
+
+<%def name="buildNavipath()">
+  <li><a href="${h.url_for(controller='/')}"
+         onclick="return checkModification();">${_('%s Start') % h.get_app_title()}</a></li>
+</%def>
+
+<%def name="buildInfofield()">
+</%def>
+
+<%def name="buildPrivacyfield()">
+</%def>
+
+<%def name="buildIco()">
+  <span class="menuico"> &gt;&gt;</span>
+</%def>
+
+<%def name="buildNavigation()">
+  % if (h.getLogin() != 'adm'):
+    % if h.hasRole(['cm_ka', 'admin_ka']):
+      <div class="menu">
+        <div class="actions">
+          <h1>${_('%s Start') % h.get_app_title()}</h1>
+          <ul>
+            <li>
+              <a href="${h.url_for(controller='/')}">
+                ${_('sm_menu_link_home')}
+              </a>
+            </li>
+            ## APPOINTMENTS 
+            % if g.mpuls_config.is_enabled('module', 'appointments'):
+              <li>
+                <a href="${h.url_for(controller='/appointment',
+                                     action='overview')}">
+                  ${_('menu_app_link_overview')}
+                </a>
+              </li>
+            % endif
+            ## DOCUMENTS
+            % if g.mpuls_config.is_enabled('module', 'documents'):
+              <li>
+                <a href="${h.url_for(controller='/document', 
+                                     action='globalOverview')}">
+                  ${_('menu_doc_link_overview')}
+                </a>
+              </li>
+            % endif
+          </ul>
+        </div>
+      </div>
+    % endif
+    <div class="menu">
+      <div class="actions">
+        % if g.mpuls_config.is_enabled('module', 'casemanagement'):
+          <h1>${_('menu_header_cm')}</h1>
+          <ul>
+            <li>
+              <a href="${h.url_for(controller='/case_overview',
+                                   action='overview')}">
+                ${_('menu_cm_link_overview')}
+              </a>
+            </li>
+            % if h.hasRole(['cm_ka']):
+              <li>
+                <a href="${h.url_for(controller='/case', action='new')}">
+                  ${_('menu_cm_link_new')}
+                </a> 
+              </li>
+              % if g.mpuls_config.is_enabled('case-module', 'import'):
+                <li>
+                  <a href="${h.url_for(controller='/case', action='importCase')}">
+                    ${_('menu_cm_link_import')}
+                  </a>
+                </li>
+              % endif
+            % endif
+          </ul>
+        % endif
+      </div>
+    </div>
+    % if config.get('jmd.otherapp.url'):
+      <div class="menu">
+        <div class="actions">
+          <h1>Fallakten</h1>
+          <ul>
+            <li>
+              ## hier kein url_for, da diese URL auf eine andere WSGI
+              ## Applikation verweist
+              <a href="${config['jmd.otherapp.url']}">Zum Fallaktenteil wechseln</a>
+            </li>
+          </ul>
+        </div>
+      </div>
+    %endif
+    % if g.mpuls_config.is_enabled('module', 'evaluation'):
+      <div class="menu">
+        <div class="actions">
+          <h1>${_('Evaluations')}</h1>
+          ${self.buildEvaluations()}
+        </div>
+      </div>
+    % endif
+    <div class="menu_spacer">
+      <div class="actions">
+      </div>
+    </div>
+  % endif
+  % if h.hasRole(['admin_ka']):
+    <div class="menu">
+      <div class="actions">
+        <h1>${_('menu_header_adm')}</h1>
+        <ul>
+          <li>
+            <a href="${h.url_for(controller='/administration',
+                                 action='overviewUser')}"> 
+              ${_('menu_adm_link_useroverview')}
+            </a>
+          </li>
+          <li>
+            <a href="${h.url_for(controller='/administration',
+                                 action='overviewUserGroups')}">
+              ${_('menu_adm_link_usergroupoverview')}
+            </a>
+          </li>
+          <li>
+            <a href="${h.url_for(controller='/settings')}">
+              ${_('menu_adm_link_showsettings')}
+            </a>
+          </li>
+        </ul>
+      </div>
+    </div>
+  % endif
+</%def>
+
+<%def name="buildEvaluations()">
+  <ul>
+    % for eval in g.mpuls_config.get('evaluations', 'enabled'): 
+      <li>
+        <a href="${h.url_for(controller='/evaluate', action='evaluate',
+                             id=eval.get('id'))}">${eval.get('name')}</a>
+      </li>
+    % endfor
+  </ul>
+</%def>
+
+<%def name="buildFormErrors(labels=None)">
+  <% formular_labels = labels or {} %>
+  % if len(c.form_errors) > 0:
+    <div class="form_errors">
+      <h1><a name="error_list">${_('main_formular_input_error')}</a></h1>
+      <ul>
+        % for key, value in c.form_errors.iteritems():
+          <li>${_(formular_labels.get(key, '%s' % key))}: ${value}</li>
+        % endfor
+      </ul>
+    </div>
+  % endif
+</%def>
+
+<%def name="buildFooter()">
+  <div id="footer">
+    <div id="version_str">
+    <a href="${h.url_for(controller='/info')}"
+           onclick="return checkModification();">
+          ${_('sm_menu_link_responsible')}</a>
+      | ${g.mpuls_config.get_app_name()}
+      | ${g.mpuls_config.get_releasedate()}
+      | ${g.mpuls_config.get_app_version()}
+    </div>
+  </div>
+</%def>
+
+<%def name="buildContentHeader()">
+  ${self.buildUeberschrift()}
+  ${self.buildModusfield()}
+</%def>
+
+<%def name="buildUeberschrift()">
+</%def>
+
+<%def name="buildModusfield()">
+</%def>
+
+<span class="skiplink">
+  <a href="#startmenu" title="Direkt zum Hauptmen&#252; springen" 
+     tabindex="1">
+    Zum Hauptmen&#252; springen
+  </a>
+</span>
+<span class="skiplink">
+  <a href="#navigation" title="Direkt zum Bereichsmen&#252; springen" 
+     tabindex="1">
+    Zum Bereichsmen&#252; springen
+  </a>
+</span>
+<span class="skiplink">
+  <a href="#content" title="Direkt zum Inhalt springen" tabindex="2">
+    Zum Inhalt springen
+  </a>
+</span>
+<div id="header">
+  <div class="left" id="logo">
+    <a href="${h.url_for(controller='/')}"
+       onclick="return checkModification();">
+      <img src="${h.url_for('/images/logos/logo_ka_75.png')}" 
+           alt="Logo Einrichtung" border="0">
+    </a>
+  </div>
+  <div id="rightheader">
+    ${self.buildStartMenu()}
+    ${self.buildStatusBar()}
+    <div id="navipath">
+      <ul>
+        ${self.buildNavipath()}
+      </ul>
+    </div>
+  </div>
+</div>
+<div id="main">
+  <div class="left">
+    <div>
+      % if h.hasRole(['cm_ka']):
+        ${self.buildPrivacyfield()}
+      % endif
+      ${next.buildNavigation()}
+    </div>
+  </div>
+  <div id="content" class="right">
+    <div id="status_str_nofloat">
+      % if c.status_msg:
+        <span class="redcolor">${c.status_msg}</span>
+      % else:
+        <strong>Hinweis:</strong> 
+        Gegen ${h.get_logouttime()} Uhr wird diese Sitzung automatisch 
+        beendet. Speichern sie bitte vorher Ihre Eingaben!
+      % endif
+    </div>
+    ${self.buildContentHeader()}
+    ${self.body()}
+  </div>
+</div>
+${self.buildFooter()}

Modified: jmd/trunk/jmdweb/templates/main.mako
===================================================================
--- jmd/trunk/jmdweb/templates/main.mako	2010-06-18 10:43:06 UTC (rev 3031)
+++ jmd/trunk/jmdweb/templates/main.mako	2010-06-18 11:07:14 UTC (rev 3032)
@@ -143,7 +143,7 @@
             <li>
               ## hier kein url_for, da diese URL auf eine andere WSGI
               ## Applikation verweist
-              <a href="/struktur">Zum Strukturteil wechseln</a>
+              <a href="${config['jmd.otherapp.url']}">Zum Strukturteil wechseln</a>
             </li>
             %if h.hasRole(['admin']):
             <li>



More information about the Mpuls-commits mailing list