Moved the custom error.html page for Site to it's proper place
authorSverre Rabbelier <srabbelier@gmail.com>
Sat, 22 Nov 2008 23:23:37 +0000
changeset 573 1b37588c4922
parent 572 1b3e7280743a
child 574 b7b77b4c9612
Moved the custom error.html page for Site to it's proper place Also made the error template a proper parameter instead of re-using the edit/public template.
app/soc/templates/soc/presence/error.html
app/soc/templates/soc/site/error.html
app/soc/views/models/base.py
--- a/app/soc/templates/soc/presence/error.html	Sat Nov 22 23:08:26 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-{% extends "soc/base.html" %}
-{% comment %}
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-{% endcomment %}
-
-{% block page_title %}
-Default Home page
-{% endblock %}
-
-{% block header_title %}
-Default Home page
-{% endblock %}
-
-{% block body %}
-This is the default home page, which can be edited via the <a href="/home/settings/create">Home Settings</a>.<br />
-{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/soc/templates/soc/site/error.html	Sat Nov 22 23:23:37 2008 +0000
@@ -0,0 +1,26 @@
+{% extends "soc/base.html" %}
+{% comment %}
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+
+{% block page_title %}
+Default Home page
+{% endblock %}
+
+{% block header_title %}
+Default Home page
+{% endblock %}
+
+{% block body %}
+This is the default home page, which can be edited via the <a href="/home/settings/create">Home Settings</a>.<br />
+{% endblock %}
--- a/app/soc/views/models/base.py	Sat Nov 22 23:08:26 2008 +0000
+++ b/app/soc/views/models/base.py	Sat Nov 22 23:23:37 2008 +0000
@@ -136,6 +136,9 @@
     new_params['list_template'] = 'soc/models/list.html'
     new_params['invite_template'] = 'soc/models/invite.html'
 
+    new_params['error_public'] = 'soc/%(module_name)s/error.html' % params
+    new_params['error_edit'] = 'soc/%(module_name)s/error.html'  % params
+
     new_params['list_main'] = 'soc/list/main.html'
     new_params['list_pagination'] = 'soc/list/pagination.html'
     new_params['list_row'] = 'soc/%(module_name)s/list/row.html' % params
@@ -190,7 +193,7 @@
       key_fields = self._logic.getKeyFieldsFromDict(kwargs)
       entity = self._logic.getIfFields(key_fields)
     except out_of_band.Error, error:
-      return error.response(request, template=params['public_template'],
+      return error.response(request, template=params['error_public'],
                             context=context)
 
     self._public(request, entity, context)
@@ -259,7 +262,7 @@
             'entity_type_lower' : params['name'].lower(),
             'entity_type' : params['name'],
             'create' : params['missing_redirect']})
-        return error.response(request, template=params['public_template'],
+        return error.response(request, template=params['error_public'],
                               context=context)
 
     if request.method == 'POST':
@@ -412,7 +415,7 @@
           'entity_type_lower' : params['name'].lower(),
           'entity_type' : params['name'],
           'create' : params['missing_redirect']})
-      return error.response(request, template=params['edit_template'],
+      return error.response(request, template=params['error_edit'],
                             context=context)
 
     if not entity: