app/soc/views/models/home_settings.py
changeset 502 e1e24c0a4e82
parent 499 d22e4fe8e64b
child 507 3603fdafabf7
equal deleted inserted replaced
501:be89bf307478 502:e1e24c0a4e82
    49   """
    49   """
    50 
    50 
    51     # TODO(tlarsen): partial_path will be a hard-coded read-only
    51     # TODO(tlarsen): partial_path will be a hard-coded read-only
    52     #   field for some (most?) User Roles
    52     #   field for some (most?) User Roles
    53   doc_partial_path = forms.CharField(required=False,
    53   doc_partial_path = forms.CharField(required=False,
    54       label=soc.models.work.Work.partial_path.verbose_name,
    54       label=ugettext_lazy('Document partial path'),
    55       help_text=soc.models.work.Work.partial_path.help_text)
    55       help_text=soc.models.work.Work.partial_path.help_text)
    56 
    56 
    57   # TODO(tlarsen): actually, using these two text fields to specify
    57   # TODO(tlarsen): actually, using these two text fields to specify
    58   #   the Document is pretty cheesy; this needs to be some much better
    58   #   the Document is pretty cheesy; this needs to be some much better
    59   #   Role-scoped Document selector that we don't have yet
    59   #   Role-scoped Document selector that we don't have yet
    60   doc_link_name = forms.CharField(required=False,
    60   doc_link_name = forms.CharField(required=False,
    61       label=soc.models.work.Work.link_name.verbose_name,
    61       label=ugettext_lazy('Document link name'),
    62       help_text=soc.models.work.Work.link_name.help_text)
    62       help_text=soc.models.work.Work.link_name.help_text)
    63 
    63 
    64   def clean_feed_url(self):
    64   def clean_feed_url(self):
    65     feed_url = self.cleaned_data.get('feed_url')
    65     feed_url = self.cleaned_data.get('feed_url')
    66 
    66 
   110 
   110 
   111     params = {}
   111     params = {}
   112     rights = {}
   112     rights = {}
   113 
   113 
   114     params['name'] = "Home Settings"
   114     params['name'] = "Home Settings"
   115     params['name_short'] = "home_settings"
   115     params['name_short'] = "Home Settings"
   116     params['name_plural'] = "Home Settings"
   116     params['name_plural'] = "Home Settings"
       
   117     params['url_name'] = "home/settings"
       
   118     params['module_name'] = "home_settings"
   117 
   119 
   118     params['edit_form'] = EditForm
   120     params['edit_form'] = EditForm
   119     params['create_form'] = CreateForm
   121     params['create_form'] = CreateForm
   120 
   122 
   121     # TODO(tlarsen) Add support for Django style template lookup
   123     # TODO(tlarsen) Add support for Django style template lookup
   128       'list_pagination': 'soc/list/list_pagination.html',
   130       'list_pagination': 'soc/list/list_pagination.html',
   129       'list_row': 'soc/home_settings/list/home_row.html',
   131       'list_row': 'soc/home_settings/list/home_row.html',
   130       'list_heading': 'soc/home_settings/list/home_heading.html',
   132       'list_heading': 'soc/home_settings/list/home_heading.html',
   131     }
   133     }
   132 
   134 
   133     params['delete_redirect'] = '/home/list'
   135     params['delete_redirect'] = '/' + params['url_name'] + '/list'
   134 
   136 
   135     params['save_message'] = [ugettext_lazy('Profile saved.')]
   137     params['save_message'] = [ugettext_lazy('Profile saved.')]
   136 
   138 
   137     params['edit_params'] = {
   139     params['edit_params'] = {
   138         self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED,
   140         self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED,