Rename 'group' to 'entity' in the Django templates
authorSverre Rabbelier <srabbelier@gmail.com>
Thu, 16 Oct 2008 17:30:58 +0000
changeset 360 5ad9cabb5892
parent 359 4308324241bc
child 361 465e4df617de
Rename 'group' to 'entity' in the Django templates This allows for generic use of these templates. Patch by: Sverre Rabbelier Reviewed by: to-be-reviewed
app/soc/templates/soc/group/list/all.html
app/soc/templates/soc/group/list/group_row.html
app/soc/templates/soc/group/profile/edit.html
app/soc/templates/soc/group/profile/public.html
app/soc/templates/soc/site/sponsor/profile/edit.html
app/soc/views/site/sponsor/list.py
app/soc/views/site/sponsor/profile.py
app/soc/views/sponsor/profile.py
--- a/app/soc/templates/soc/group/list/all.html	Thu Oct 16 16:05:08 2008 +0000
+++ b/app/soc/templates/soc/group/list/all.html	Thu Oct 16 17:30:58 2008 +0000
@@ -14,18 +14,18 @@
 {% endcomment %}
 {% load forms_helpers %}
 {% block page_title %}
-Site: {{ group_type_plural }} List
+Site: {{ entity_type_plural }} List
 {% endblock %}
 {% block header_title %}
-{{ group_type_plural }} List
+{{ entity_type_plural }} List
 {% endblock %}
 {% block body %}
 <p>
 <p>
 {% block instructions %}
-List of {{ group_type_plural }} in Google Open Source Programs.
+List of {{ entity_type_plural }} in Google Open Source Programs.
 {% endblock %}
 </p>
 {% include list_main %}
 </p>
-{% endblock %}
\ No newline at end of file
+{% endblock %}
--- a/app/soc/templates/soc/group/list/group_row.html	Thu Oct 16 16:05:08 2008 +0000
+++ b/app/soc/templates/soc/group/list/group_row.html	Thu Oct 16 17:30:58 2008 +0000
@@ -1,7 +1,7 @@
 <tr class="off" onmouseover="this.className='on'" onmouseout="this.className='off'" 
-onclick="document.location.href='/site/{{ group_type_short|lower }}/profile/{{ data_element.link_name }}'" name="name">
+onclick="document.location.href='/site/{{ entity_type|lower }}/profile/{{ data_element.link_name }}'" name="name">
   <td align="right"><div class="name"><a class="noul"
-         href="/site/{{ group_type_short|lower }}/profile/{{ data_element.link_name }}">{{ data_element.name }}</a>
+         href="/site/{{ entity_type|lower }}/profile/{{ data_element.link_name }}">{{ data_element.name }}</a>
      </div>
   </td>
   <td><div class="link_name">{{ data_element.link_name }}</a></div></td>
--- a/app/soc/templates/soc/group/profile/edit.html	Thu Oct 16 16:05:08 2008 +0000
+++ b/app/soc/templates/soc/group/profile/edit.html	Thu Oct 16 17:30:58 2008 +0000
@@ -18,17 +18,17 @@
 {% endblock %}
 
 {% block page_title %}
-{% if existing_group %}
-Site: Modify Existing {{ group_type }}
+{% if existing_entity %}
+Site: Modify Existing {{ entity_type }}
 {% else %}
-Site: Create New {{ group_type }}
+Site: Create New {{ entity_type }}
 {% endif %}
 {% endblock %}
 {% block header_title %}
-{% if existing_group %}
-Modify Existing {{ group_type }}
+{% if entity %}
+Modify Existing {{ entity_type }}
 {% else %}
-Create a New {{ group_type }}
+Create a New {{ entity_type }}
 {% endif %}
 {% endblock %}
 
@@ -36,7 +36,7 @@
 <p>
 <p>
 {% block instructions %}
-Please use this form to alter {{ group_type }} details.
+Please use this form to alter {{ entity_type }} details.
 {% endblock %}
 </p>
 <form method="POST">
--- a/app/soc/templates/soc/group/profile/public.html	Thu Oct 16 16:05:08 2008 +0000
+++ b/app/soc/templates/soc/group/profile/public.html	Thu Oct 16 17:30:58 2008 +0000
@@ -13,22 +13,22 @@
 limitations under the License.
 {% endcomment %}
 {% load forms_helpers %}
-{% block page_title %}{{ group_type }} Public Profile{% endblock %}
+{% block page_title %}{{ entity_type }} Public Profile{% endblock %}
 {% block header_title %}
-{{ group_type }} Public Profile for {{ link_name_group.name }}
+{{ entity_type }} Public Profile for {{ entity.name }}
 {% endblock %}
 {% block body %}
 <p>
  <table>
-  {% readonly_field_as_table_row link_name_group.fields.name.label link_name_group.name %}
-  {% readonly_field_as_table_row link_name_group.fields.home_page.label link_name_group.home_page %}
-  {% readonly_field_as_table_row link_name_group.fields.description.label link_name_group.description %}
-  {% readonly_field_as_table_row link_name_group.fields.street.label link_name_group.street %}
-  {% readonly_field_as_table_row link_name_group.fields.city.label link_name_group.city %}
-  {% readonly_field_as_table_row link_name_group.fields.state.label link_name_group.state %}
-  {% readonly_field_as_table_row link_name_group.fields.country.label link_name_group.country %}
-  {% readonly_field_as_table_row link_name_group.fields.postalcode.label link_name_group.postalcode %}
-  {% readonly_field_as_table_row link_name_group.fields.phone.label link_name_group.phone %}
+  {% readonly_field_as_table_row entity.fields.name.label entity.name %}
+  {% readonly_field_as_table_row entity.fields.home_page.label entity.home_page %}
+  {% readonly_field_as_table_row entity.fields.description.label entity.description %}
+  {% readonly_field_as_table_row entity.fields.street.label entity.street %}
+  {% readonly_field_as_table_row entity.fields.city.label entity.city %}
+  {% readonly_field_as_table_row entity.fields.state.label entity.state %}
+  {% readonly_field_as_table_row entity.fields.country.label entity.country %}
+  {% readonly_field_as_table_row entity.fields.postalcode.label entity.postalcode %}
+  {% readonly_field_as_table_row entity.fields.phone.label entity.phone %}
  </table>
 </p>
-{% endblock %}
\ No newline at end of file
+{% endblock %}
--- a/app/soc/templates/soc/site/sponsor/profile/edit.html	Thu Oct 16 16:05:08 2008 +0000
+++ b/app/soc/templates/soc/site/sponsor/profile/edit.html	Thu Oct 16 17:30:58 2008 +0000
@@ -15,6 +15,6 @@
  {% block submit_buttons %}
  {{ block.super }}
 <td>
- <input type="button" onclick="location.href='/site/{{ group_type_short|lower }}/profile/{{ existing_group.link_name }}/delete'" value="Delete"/>
+ <input type="button" onclick="location.href='/site/{{ entity_type|lower }}/profile/{{ entity.link_name }}/delete'" value="Delete"/>
 </td>
- {% endblock %}
\ No newline at end of file
+ {% endblock %}
--- a/app/soc/views/site/sponsor/list.py	Thu Oct 16 16:05:08 2008 +0000
+++ b/app/soc/views/site/sponsor/list.py	Thu Oct 16 17:30:58 2008 +0000
@@ -78,8 +78,8 @@
                                  offset=offset, limit=limit, 
                                  list_templates=list_templates)
                                  
-  context.update({'group_type': 'Sponsor',
-                  'group_type_plural': sponsor_model.Sponsor.GROUP_TYPE_PLURAL,
-                  'group_type_short': sponsor_model.Sponsor.GROUP_TYPE_SHORT})
+  context.update({'entity_type': 'Sponsor',
+                  'entity_type_plural': sponsor_model.Sponsor.GROUP_TYPE_PLURAL,
+                  'entity_type_short': sponsor_model.Sponsor.GROUP_TYPE_SHORT})
 
   return helper.responses.respond(request, template, context)
--- a/app/soc/views/site/sponsor/profile.py	Thu Oct 16 16:05:08 2008 +0000
+++ b/app/soc/views/site/sponsor/profile.py	Thu Oct 16 17:30:58 2008 +0000
@@ -192,9 +192,9 @@
       sponsor_form = CreateForm()
     
   context.update({'form': sponsor_form,
-                  'existing_group':  existing_sponsor,
-                  'group_type': 'Sponsor',
-                  'group_type_short': sponsor_model.Sponsor.GROUP_TYPE_SHORT})
+                  'entity':  existing_sponsor,
+                  'entity_type': 'Sponsor',
+                  'entity_type_short': sponsor_model.Sponsor.GROUP_TYPE_SHORT})
 
   return helper.responses.respond(request, template, context)
 
--- a/app/soc/views/sponsor/profile.py	Thu Oct 16 16:05:08 2008 +0000
+++ b/app/soc/views/sponsor/profile.py	Thu Oct 16 17:30:58 2008 +0000
@@ -59,7 +59,7 @@
   link_name_sponsor.description = \
       helper.templates.unescape(link_name_sponsor.description)
   
-  context.update({'link_name_group': link_name_sponsor,
-                  'group_type': 'Sponsor'})
+  context.update({'entity': link_name_sponsor,
+                  'entity_type': 'Sponsor'})
 
   return helper.responses.respond(request, template, context)
\ No newline at end of file