Fixed the edit site view having a delete button
authorSverre Rabbelier <srabbelier@gmail.com>
Wed, 28 Jan 2009 18:23:45 +0000
changeset 1049 cc6aedbde28d
parent 1048 0fe0cb8f7253
child 1050 77aab03aa693
Fixed the edit site view having a delete button Also a minor cleanup in group.py. Patch by: Sverre Rabbelier
app/soc/templates/soc/models/edit.html
app/soc/templates/soc/site/edit.html
app/soc/views/models/group.py
app/soc/views/models/site.py
--- a/app/soc/templates/soc/models/edit.html	Wed Jan 28 17:33:05 2009 +0000
+++ b/app/soc/templates/soc/models/edit.html	Wed Jan 28 18:23:45 2009 +0000
@@ -56,9 +56,11 @@
    {% endif %}
    </td>
    {% if entity %}
+   {% block delete_button %}
    <td>
     <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/delete/{{ entity_suffix }}'" value="Delete"/>
    </td>
+   {% endblock %}
 {% if export_link %}
    <td>
     <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/export/{{ entity_suffix }}'" value="Export"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/soc/templates/soc/site/edit.html	Wed Jan 28 18:23:45 2009 +0000
@@ -0,0 +1,16 @@
+{% extends "soc/models/edit.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 delete_button %}{% endblock %}
--- a/app/soc/views/models/group.py	Wed Jan 28 17:33:05 2009 +0000
+++ b/app/soc/views/models/group.py	Wed Jan 28 18:23:45 2009 +0000
@@ -56,21 +56,15 @@
 
     new_params = {}
 
-    new_params['extra_dynaexclude'] = ['founder',
-      # TODO(tlarsen): these need to be enabled once a button to a list
-      #   selection "interstitial" page is implemented, see:
-      #     http://code.google.com/p/soc/issues/detail?id=151
-      'home', 'tos', 'member_template']
+    new_params['extra_dynaexclude'] = ['founder','home', 'tos',
+                                       'member_template']
     new_params['edit_extra_dynafields'] = {
         'founded_by': forms.CharField(widget=widgets.ReadOnlyInput(),
                                    required=False),
         }
 
     #set the extra_django_patterns and include the one from params
-    patterns = params.get('extra_django_patterns')
-
-    if not patterns:
-      patterns = []
+    patterns = params.get('extra_django_patterns', [])
 
     patterns += [
         (r'^%(url_name)s/(?P<access_type>list_requests)/%(key_fields)s$',
--- a/app/soc/views/models/site.py	Wed Jan 28 17:33:05 2009 +0000
+++ b/app/soc/views/models/site.py	Wed Jan 28 18:23:45 2009 +0000
@@ -63,8 +63,10 @@
     new_params['sidebar_heading'] = new_params['name_short']
 
     new_params['public_template'] = 'soc/presence/public.html'
+    new_params['edit_template'] = 'soc/site/edit.html'
     new_params['home_template'] = 'soc/site/home.html'
 
+    new_params['extra_dynaexclude'] = ['is_enabled']
     new_params['create_extra_dynafields'] = {
         'link_id': forms.CharField(widget=forms.HiddenInput, required=True),
         }