# HG changeset patch # User Todd Larsen # Date 1227251275 0 # Node ID 7c5ec72cdcf14c1493d7efd986a211de51aab7f8 # Parent 5e6ae12cc4958e6bdb7dec81c41cb7625c18a699 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 diff -r 5e6ae12cc495 -r 7c5ec72cdcf1 app/soc/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. diff -r 5e6ae12cc495 -r 7c5ec72cdcf1 app/soc/templates/README.templates --- 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/ sub-directories. For example, the template used by the Profile -view for the Person Model belongs in soc/person/profile.html. +soc// sub-directories. diff -r 5e6ae12cc495 -r 7c5ec72cdcf1 app/soc/templates/soc/document/public.html --- 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 %} -
Created on {{ entity.created }} by {{ entity.author.nick_name }}
+
Created on {{ entity.created }} by {{ entity.author.public_name }}
{{ entity.content|safe }}
{% endblock %} diff -r 5e6ae12cc495 -r 7c5ec72cdcf1 app/soc/templates/soc/host/public.html --- 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 %} diff -r 5e6ae12cc495 -r 7c5ec72cdcf1 app/soc/templates/soc/person/edit.html --- 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 %} - - - - Profile - {% block 'stylesheet' %}{% endblock %} - - -

- {% block 'logo' %} - Melange - {% endblock %} -

- {% block 'greeting' %} - Welcome, {{user.nickname}}. - {% endblock %} -

-

- {% block 'instructions' %} - Please update your profile: - {% endblock %} -

-
- - - - - {% field_as_table_row form.given_name %} - {% field_as_table_row form.surname %} - {% field_as_table_row form.display_name %} - - - - - - {% 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 %} - - - - - - {% field_as_table_row form.latitude %} - {% field_as_table_row form.longitude %} - - - - - - {% 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 %} - - - - - - {% 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 %} - - - - - - - {% 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 %} -
- Name (publicly displayed) -
 
- Online Profile (publicly displayed) -
 
- Location (publicly displayed, these will be replaced with a - Google Maps control) -
 
- Residence Address (kept private) -
 
- Shipping Address (kept private; optional, if omitted, Residence - Address will be used) -
 
- Personal Information (kept private) -
- -
-

- - - diff -r 5e6ae12cc495 -r 7c5ec72cdcf1 app/soc/templates/soc/user/edit.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 }} <{{ existing_user.account.email }}> {% endif %} {% endblock %} @@ -43,7 +43,7 @@ {% 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 %} diff -r 5e6ae12cc495 -r 7c5ec72cdcf1 app/soc/templates/soc/user/edit_self.html --- 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 }} <{{ account.email }}> +Modify Existing User Profile for {{ user.public_name }} <{{ account.email }}> {% else %} Create a New User Profile for <{{ account.email }}> {% endif %} @@ -30,7 +30,7 @@

- {% field_as_table_row form.nick_name %} + {% field_as_table_row form.public_name %} {% field_as_table_row form.link_id %} diff -r 5e6ae12cc495 -r 7c5ec72cdcf1 app/soc/templates/soc/user/list/user_heading.html --- 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 @@ - + diff -r 5e6ae12cc495 -r 7c5ec72cdcf1 app/soc/templates/soc/user/list/user_row.html --- 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 @@ - + diff -r 5e6ae12cc495 -r 7c5ec72cdcf1 app/soc/templates/soc/user/lookup.html --- 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 %} - - + + @@ -88,7 +88,7 @@ {% endif %} diff -r 5e6ae12cc495 -r 7c5ec72cdcf1 app/soc/templates/soc/user/public.html --- 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 %}

 
Account EmailNicknamePublic name Link ID
{{ data_element.nick_name }}
{{ data_element.public_name }}
Nick name{{ found_user.nick_name }}Public name{{ found_user.public_name }}    
- Edit the User profile of {{ found_user.nick_name }}. + Edit the User profile of {{ found_user.public_name }}.
{% 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 %}

diff -r 5e6ae12cc495 -r 7c5ec72cdcf1 app/soc/views/models/user.py --- 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, }