Changeset 5237


Ignore:
Timestamp:
28/04/09 15:03:55 (10 years ago)
Author:
cbyrom
Message:

Various tidy ups of editor code - including restricting editing rights
to non-admin users of editor.

Location:
TI01-discovery/trunk/OAIInfoEditor
Files:
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/trunk/OAIInfoEditor/editor.config

    r5226 r5237  
    2020backupFileDir: oaiInfoEditorDataBackups 
    2121 
     22[USER_LIST] 
     23# include a list of users (user IDs) who can use the editor 
     24# NB, these should then each have their own sections - which specify values 
     25# for 'pw' (the user password) and 'providerNames' (the provider info editable by the user) 
     26# if the providerNames list includes 'admin' the user is given admin rights and can update and 
     27# add any new provider info.  NB, the providerName list should use ';' as the delimiter - e.g. 
     28# providerNames:blah blow;quack;provider 32;provider fred 
     29userIDs: calum bob fred 
     30 
     31[calum] 
     32pw: gloopy 
     33providerNames: admin 
     34 
     35[bob] 
     36pw: bob 
     37providerNames: provider1 
     38 
     39[fred] 
     40pw: fred 
     41providerNames: provider2 provider3 
     42 
     43 
    2244 
    2345[layout] 
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/controllers/edit.py

    r5236 r5237  
    4949        self.repositoryInfos = [] 
    5050        while self.inputs.has_key(str(i) + RI_DELIMITER + NAME_ELEMENT_NAME): 
    51             self.repositoryInfos.append(self.__getInputResositoryInfo(str(i) + RI_DELIMITER)) 
     51            ri = self.__getInputResositoryInfo(str(i) + RI_DELIMITER) 
     52            if not ri.isEmpty(): 
     53                self.repositoryInfos.append(ri) 
    5254            i += 1 
    5355             
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/controllers/master.py

    r5235 r5237  
    6767            # needed 
    6868            if inputs or c.errors: 
    69                 import pdb 
    70                 pdb.set_trace() 
    7169                for key, val in inputs.items(): 
    7270                    inputs[key] = str(val) 
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/controllers/view.py

    r5236 r5237  
    2828            c.title = const.VIEW_ALL_DATA_TITLE 
    2929                     
     30        c.editLink = h.url_for('editProviderInfo', providerName = '') 
    3031        if c.user.isAdmin: 
    3132            c.createLink = h.url_for('createProviderInfo') 
     
    3334            # provider's data in a page - so finish constructing the links in the 
    3435            # templates 
    35             c.editLink = h.url_for('editProviderInfo', providerName = '') 
    3636            c.deleteLink = h.url_for('deleteProviderInfo', providerName = '') 
    3737         
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/editor.config

    r5226 r5237  
    3939[fred] 
    4040pw: fred 
    41 providerNames: provider2 provider3 
     41providerNames: provider2;provider3 
    4242 
    4343 
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/model/repositoryinfo.py

    r5229 r5237  
    7272         
    7373        # don't include mod date when doing an object compare 
    74         self.ATTS_TO_SKIP.extend(MODIFICATION_DATE_ELEMENT_NAME) 
     74        self.ATTS_TO_SKIP.extend([MODIFICATION_DATE_ELEMENT_NAME,  
     75                                 DATA_FORMAT_ELEMENT_NAME,  
     76                                 SPLIT_BY_SET_NAME,  
     77                                 VERSION_ELEMENT_NAME]) 
    7578        if not self.version: 
    7679            self.version = '1' 
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/templates/layout.html

    r5226 r5237  
    33        xmlns:xi="http://www.w3.org/2001/XInclude" py:strip=""> 
    44<xi:include href="ndgPage.html" /> 
    5 <?python from vocabtermeditor.lib.constants import *?> 
     5<?python from oai_info_editor.lib.constants import *?> 
    66 
    77  <py:match path="head" once="true"> 
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/templates/provider_info.html

    r5236 r5237  
    3636                </span> 
    3737                <span py:if="not editLink"><td /><td /></span> 
    38                 <div py:replace="EditTextField(PI.NAME_ATT_NAME, record.name, isEditable, constants.TEXT_FIELD, width='20%')"/> 
     38                <?python 
     39adminEdit = False 
     40if c.user.isAdmin and isEditable: 
     41        adminEdit = True 
     42                ?> 
     43                <div py:replace="EditTextField(PI.NAME_ATT_NAME, record.name, adminEdit, constants.TEXT_FIELD, width='20%')"/> 
     44                <input py:if="not adminEdit" type="hidden" name="${PI.NAME_ATT_NAME}" value="${record.name}"/> 
    3945        </tr> 
    4046        <tr py:if="record.repositoryInfos or isEditable"> 
Note: See TracChangeset for help on using the changeset viewer.