source: TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/templates/provider_info.html @ 5237

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/templates/provider_info.html@5237
Revision 5237, 1.8 KB checked in by cbyrom, 11 years ago (diff)

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

Line 
1<!--! Template methods to support Change Request data -->
2<html xmlns="http://www.w3.org/1999/xhtml" 
3        xmlns:py="http://genshi.edgewall.org/"
4        xmlns:xi="http://www.w3.org/2001/XInclude"
5        py:strip="">
6        <xi:include href="utils.html" />
7        <xi:include href="repository_info.html" />
8    <?python
9                import oai_info_editor.lib.constants as constants
10                import oai_info_editor.model.providerinfo as PI
11                import urllib
12        ?>
13
14        <div class="providerInfoTable" py:def="ProviderInfoTable(records, isEditable, editLink)">
15        <table width="100%">
16                <tr class="headerRow">
17                                <th width="3%" />
18                                <th width="3%" />
19                        <th align="left">Provider Name</th>
20                </tr>
21                <div py:replace="ProviderInfoRecord(records, isEditable, editLink)" />
22               
23        </table>
24    </div>
25
26        <div py:def="ProviderInfoRecord(record, isEditable, editLink)">
27        <tr>
28                <span py:if="editLink"> 
29                        <td>
30                        <a href="${'%s%s' %(c.editLink, urllib.quote(record.name))}" onclick="Div_show('loading');">Edit</a>
31                        </td>
32                        <td py:if="c.user.isAdmin">
33                        <a href="${'%s%s' %(c.deleteLink, urllib.quote(record.name))}" onclick="Div_show('loading');">Delete</a>
34                        </td>
35                        <td py:if="not c.user.isAdmin" />
36                </span>
37                <span py:if="not editLink"><td /><td /></span>
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}"/>
45        </tr>
46        <tr py:if="record.repositoryInfos or isEditable">
47                <td />
48                <th>Repository Info</th>
49                <td colspan="$colSpan">
50                <div py:replace="RepositoryInfoTable(record.repositoryInfos, isEditable, editLink, None)" />
51                </td>
52        </tr>
53       
54        </div>
55</html>
Note: See TracBrowser for help on using the repository browser.