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

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

Add to code to allow the OAI editor to be used with the new openid
based security system. Add the policy file and secured ini file +
adjust handling of users - enforcing page access via URL content

  • basically either by provider ID or via 'admin=1' parameter for

admin users. For the latter, provider security_redirector module to
allow admin users to use same point of entry as normal users.

Line 
1<!--! Template methods to support Provider Info 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                from oai_info_editor.controllers.master import ADMIN_PARAMETER
13        ?>
14       <script py:if="c.user.isAdmin" type="text/javascript">
15function confirmProviderInfoDelete() 
16{
17        var r=confirm('Do you really want to delete this provider info data?');
18        if (r==true)
19        {
20                Div_show("loading");
21                return true; 
22        }
23        return false;
24}
25        </script>
26
27        <div class="providerInfoTable" py:def="ProviderInfoTable(records, isEditable, editLink, harvestLink)">
28        <table width="100%">
29                <tr class="headerRow">
30                                <th width="3%" />
31                                <th width="3%" />
32                        <th align="left" width="60%">Provider Name</th>
33                        <th align="left">Provider Email</th>
34                </tr>
35                <div py:replace="ProviderInfoRecord(records, isEditable, editLink, harvestLink)" />
36        </table>
37    </div>
38
39        <div py:def="ProviderInfoRecord(record, isEditable, editLink, harvestLink)">
40        <tr>
41                <span py:if="editLink"> 
42                <?python
43                        editLink = '%s%s' %(editLink, urllib.quote(record.name))
44                        if c.user.isAdmin:
45                                editLink += ADMIN_PARAMETER
46                        ?>
47                        <td>
48                        <a href="$editLink" onclick="Div_show('loading');">Edit</a>
49                        </td>
50                        <td py:if="c.user.isAdmin">
51                        <a href="${'%s%s%s' %(c.deleteLink, urllib.quote(record.name), ADMIN_PARAMETER)}" onclick="return confirmProviderInfoDelete();">Delete</a>
52                        </td>
53                        <td py:if="not c.user.isAdmin" />
54                </span>
55                <span py:if="not editLink"><td /><td /></span>
56                <?python
57adminEdit = False
58if c.user.isAdmin and isEditable:
59        adminEdit = True
60                ?>
61                <div py:replace="EditTextField(PI.NAME_ATT_NAME, record.name, adminEdit, constants.TEXT_FIELD, width='60%')"/>
62                <div py:replace="EditTextField(PI.EMAIL_ADDRESS_NAME, record.email, isEditable, constants.TEXT_FIELD)"/>
63                <input py:if="not adminEdit" type="hidden" name="${PI.NAME_ATT_NAME}" value="${record.name}"/>
64        </tr>
65        <tr py:if="record.repositoryInfos or isEditable">
66                <td />
67                <th>Repository Info</th>
68                <td colspan="2">
69                <div py:replace="RepositoryInfoTable(record.repositoryInfos, isEditable, editLink, harvestLink.replace(constants.PROVIDER_REPLACEMENT, urllib.quote(record.name)))" />
70                </td>
71        </tr>
72        </div>
73</html>
Note: See TracBrowser for help on using the repository browser.