Replace nick_name and its variants with public_name. Remove the
authorTodd Larsen <tlarsen@google.com>
Fri, 21 Nov 2008 07:07:55 +0000
changeset 529 7c5ec72cdcf1
parent 528 5e6ae12cc495
child 530 8d5adb2b8d48
Replace nick_name and its variants with public_name. Remove the soc/templates/soc/person/edit.html template, since it does not appear to be referenced anywhere (and contained a nick_name reference that would otherwise need to be remedied). Patch by: Todd Larsen
app/soc/models/user.py
app/soc/templates/README.templates
app/soc/templates/soc/document/public.html
app/soc/templates/soc/host/public.html
app/soc/templates/soc/person/edit.html
app/soc/templates/soc/user/edit.html
app/soc/templates/soc/user/edit_self.html
app/soc/templates/soc/user/list/user_heading.html
app/soc/templates/soc/user/list/user_row.html
app/soc/templates/soc/user/lookup.html
app/soc/templates/soc/user/public.html
app/soc/views/models/user.py
--- a/app/soc/models/user.py	Thu Nov 20 23:51:45 2008 +0000
+++ b/app/soc/models/user.py	Fri Nov 21 07:07:55 2008 +0000
@@ -74,10 +74,11 @@
   #: this User.
   former_accounts = db.ListProperty(users.User)
 
-  #: Required field storing a nickname; displayed publicly.
-  #: Nicknames can be any valid UTF-8 text.
-  nick_name = db.StringProperty(required=True,
-      verbose_name=ugettext_lazy('Nick name'))
+  #: Required field storing publicly-displayed name.  Can be a real name
+  #: (though this is not recommended), or a nick name or some other public
+  #: alias.  Public names can be any valid UTF-8 text.
+  public_name = db.StringProperty(required=True,
+      verbose_name=ugettext_lazy('Public name'))
       
   #: Required field storing link_id used in URLs to identify user.
   #: Lower ASCII characters only.
--- a/app/soc/templates/README.templates	Thu Nov 20 23:51:45 2008 +0000
+++ b/app/soc/templates/README.templates	Fri Nov 21 07:07:55 2008 +0000
@@ -23,6 +23,5 @@
 View templates are usually named some_view.html for a corresponding someView()
 function and SomeViewForm form class.  Since SomeView is likely to be a common
 View name for multiple Models, Model-specific templates should be placed in
-soc/<model> sub-directories.  For example, the template used by the Profile
-view for the Person Model belongs in soc/person/profile.html.
+soc/<model>/<view> sub-directories.
 
--- a/app/soc/templates/soc/document/public.html	Thu Nov 20 23:51:45 2008 +0000
+++ b/app/soc/templates/soc/document/public.html	Fri Nov 21 07:07:55 2008 +0000
@@ -22,6 +22,6 @@
 {% endblock %}
 
 {% block body %}
-<div id="created">Created on {{ entity.created }} by {{ entity.author.nick_name }}</div>
+<div id="created">Created on {{ entity.created }} by {{ entity.author.public_name }}</div>
 <div id="content">{{ entity.content|safe }}</div>
 {% endblock %}
--- a/app/soc/templates/soc/host/public.html	Thu Nov 20 23:51:45 2008 +0000
+++ b/app/soc/templates/soc/host/public.html	Fri Nov 21 07:07:55 2008 +0000
@@ -15,7 +15,7 @@
 {% load forms_helpers %}
 
 {% block header_title %}
-{{ page_name }} for {{ entity.user.nick_name }} ({{ entity.given_name }} {{ entity.surname }})
+{{ page_name }} for {{ entity.user.public_name }} ({{ entity.given_name }} {{ entity.surname }})
 {% endblock %}
 
 {% block body %}
--- a/app/soc/templates/soc/person/edit.html	Thu Nov 20 23:51:45 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-{% 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 %}
-{% load forms_helpers %}
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html lang="en">
- <head>
-  <title>Profile</title>
-  {% block 'stylesheet' %}{% endblock %}
- </head>
- <body>
-  <p>
-   {% block 'logo' %}
-   <img src="/soc/content/images/dune.jpg" alt="Melange" />
-   {% endblock %}
-   <p>
-   {% block 'greeting' %}
-   Welcome, {{user.nickname}}.
-   {% endblock %}
-   </p>
-   <p>
-   {% block 'instructions' %}
-   Please update your profile:
-   {% endblock %}
-   </p>
-   <form method="POST">
-    <table>
-     <tr>
-      <td class="formfieldheading" colspan="4">
-       Name <i>(publicly displayed)</i>
-      </td>
-     </tr>
-     {% field_as_table_row form.given_name %}
-     {% field_as_table_row form.surname %}
-     {% field_as_table_row form.display_name %}
-     <tr><td colspan="4">&nbsp;</td></tr>
-
-     <tr>
-      <td class="formfieldheading" colspan="4">
-       Online Profile <i>(publicly displayed)</i>
-      </td>
-     </tr>
-     {% field_as_table_row form.email %}
-     {% field_as_table_row form.im_network %}
-     {% field_as_table_row form.im_handle %}
-     {% field_as_table_row form.home_page %}
-     {% field_as_table_row form.blog %}
-     {% field_as_table_row form.photo_url %}
-     <tr><td colspan="4">&nbsp;</td></tr>
-
-     <tr>
-      <td class="formfieldheading" colspan="4">
-       Location <i>(publicly displayed, these will be replaced with a
-                    Google Maps control)</i>
-      </td>
-     </tr>
-     {% field_as_table_row form.latitude %}
-     {% field_as_table_row form.longitude %}
-     <tr><td colspan="4">&nbsp;</td></tr>
-
-     <tr>
-      <td class="formfieldheading" colspan="4">
-       Residence Address <i>(kept private)</i>
-      </td>
-     </tr>
-     {% field_as_table_row form.res_street %}
-     {% field_as_table_row form.res_city %}
-     {% field_as_table_row form.res_state %}
-     {% field_as_table_row form.res_postalcode %}
-     {% field_as_table_row form.res_country %}
-     <tr><td colspan="4">&nbsp;</td></tr>
-
-     <tr>
-      <td class="formfieldheading" colspan="4">
-       Shipping Address <i>(kept private; optional, if omitted, Residence
-                            Address will be used)</i>
-      </td>
-     </tr>
-     {% field_as_table_row form.ship_street %}
-     {% field_as_table_row form.ship_city %}
-     {% field_as_table_row form.ship_state %}
-     {% field_as_table_row form.ship_postalcode %}
-     {% field_as_table_row form.ship_country %}
-
-     <tr><td colspan="4">&nbsp;</td></tr>
-
-     <tr>
-      <td class="formfieldheading" colspan="4">
-       Personal Information <i>(kept private)</i>
-      </td>
-     </tr>
-     {% field_as_table_row form.phone %}
-     {% field_as_table_row form.birth_date %}
-     {% field_as_table_row form.tshirt_size %}
-     {% field_as_table_row form.tshirt_style %}
-    </table>
-    <input type="submit" />
-   </form>
-  </p>
- </body>
-</html>
-
--- a/app/soc/templates/soc/user/edit.html	Thu Nov 20 23:51:45 2008 +0000
+++ b/app/soc/templates/soc/user/edit.html	Fri Nov 21 07:07:55 2008 +0000
@@ -16,7 +16,7 @@
 {% block header_title %}
  {{ page_name }}
  {% if existing_user %}
-for {{ existing_user.nick_name }}
+for {{ existing_user.public_name }}
 <a href="mailto:{{ existing_user.account.email }} ">&lt;{{ existing_user.account.email }}&gt;</a>
  {% endif %}
 {% endblock %}
@@ -43,7 +43,7 @@
 </tr>
 {% endif %}
   {% field_as_table_row form.link_id %}
-  {% field_as_table_row form.nick_name %}
+  {% field_as_table_row form.public_name %}
   {% field_as_table_row form.is_developer %}
   {% if existing_user.former_accounts %}
   <tr>
--- a/app/soc/templates/soc/user/edit_self.html	Thu Nov 20 23:51:45 2008 +0000
+++ b/app/soc/templates/soc/user/edit_self.html	Fri Nov 21 07:07:55 2008 +0000
@@ -16,7 +16,7 @@
 {% block page_title %}User Profile{% endblock %}
 {% block header_title %}
 {% if user %}
-Modify Existing User Profile for {{ user.nick_name }} <a href="mailto:{{ account.email }} ">&lt;{{ account.email }}&gt;</a>
+Modify Existing User Profile for {{ user.public_name }} <a href="mailto:{{ account.email }} ">&lt;{{ account.email }}&gt;</a>
 {% else %}
 Create a New User Profile for <a href="mailto:{{ account.email }} ">&lt;{{ account.email }}&gt;</a>
 {% endif %}
@@ -30,7 +30,7 @@
 </p>
 <form method="POST">
  <table>
-  {% field_as_table_row form.nick_name %}
+  {% field_as_table_row form.public_name %}
   {% field_as_table_row form.link_id %}
   <tr>
    <td colspan="4">&nbsp;</td>
--- a/app/soc/templates/soc/user/list/user_heading.html	Thu Nov 20 23:51:45 2008 +0000
+++ b/app/soc/templates/soc/user/list/user_heading.html	Fri Nov 21 07:07:55 2008 +0000
@@ -1,6 +1,6 @@
 <tr align="left">
   <th class="first" align="right">Account</th>
   <th>Email</th>
-  <th>Nickname</th>
+  <th>Public name</th>
   <th>Link ID</th>
 </tr>
--- a/app/soc/templates/soc/user/list/user_row.html	Thu Nov 20 23:51:45 2008 +0000
+++ b/app/soc/templates/soc/user/list/user_row.html	Fri Nov 21 07:07:55 2008 +0000
@@ -5,6 +5,6 @@
      </div>
   </td>
   <td><div class="email">{{ data_element.account.email }}</a></div></td>
-  <td><div class="nick_name">{{ data_element.nick_name }}</div></td>
+  <td><div class="public_name">{{ data_element.public_name }}</div></td>
   <td><div class="link_id">{{ data_element.link_id }}</div></td>
 </tr>
--- a/app/soc/templates/soc/user/lookup.html	Thu Nov 20 23:51:45 2008 +0000
+++ b/app/soc/templates/soc/user/lookup.html	Fri Nov 21 07:07:55 2008 +0000
@@ -45,8 +45,8 @@
   {% field_as_table_row form.link_id %}
 {% if found_user %}
  <tr>
-  <td class="formfieldlabel">Nick name</td>
-  <td>{{ found_user.nick_name }}</td>
+  <td class="formfieldlabel">Public name</td>
+  <td>{{ found_user.public_name }}</td>
   <td class="formfieldrequired">&nbsp;</td>
   <td class="formfieldhelptext">&nbsp;</td>
  </tr>
@@ -88,7 +88,7 @@
   </tr>
   <tr>
    <td colspan="4">
-    <a href="{{ edit_link }}">Edit the User profile of {{ found_user.nick_name }}.</a>
+    <a href="{{ edit_link }}">Edit the User profile of {{ found_user.public_name }}.</a>
    </td>
   </tr>
 {% endif %}
--- a/app/soc/templates/soc/user/public.html	Thu Nov 20 23:51:45 2008 +0000
+++ b/app/soc/templates/soc/user/public.html	Fri Nov 21 07:07:55 2008 +0000
@@ -15,14 +15,14 @@
 {% load forms_helpers %}
 
 {% block header_title %}
-{{ page_name }} for {{ entity.nick_name }}
+{{ page_name }} for {{ entity.public_name }}
 {% endblock %}
 
 {% block body %}
 <p>
  <table>
   {% readonly_field_as_table_row entity.fields.link_id.label entity.link_id %}
-  {% readonly_field_as_table_row entity.fields.nick_name.label entity.nick_name %}
+  {% readonly_field_as_table_row entity.fields.public_name.label entity.public_name %}
   <!-- TODO(pawel.solyga) make this generic -->
  </table>
 </p>
--- a/app/soc/views/models/user.py	Thu Nov 20 23:51:45 2008 +0000
+++ b/app/soc/views/models/user.py	Fri Nov 21 07:07:55 2008 +0000
@@ -52,8 +52,8 @@
       label=soc.models.user.User.link_id.verbose_name,
       help_text=soc.models.user.User.link_id.help_text)
 
-  nick_name = forms.CharField(
-      label=soc.models.user.User.nick_name.verbose_name)
+  public_name = forms.CharField(
+      label=soc.models.user.User.public_name.verbose_name)
 
   is_developer = forms.BooleanField(required=False,
       label=soc.models.user.User.is_developer.verbose_name,
@@ -222,7 +222,7 @@
         new_link_id = form.cleaned_data.get('link_id')
         properties = {
           'link_id': new_link_id,
-          'nick_name': form.cleaned_data.get("nick_name"),
+          'public_name': form.cleaned_data.get("public_name"),
           'account': account,
         }