source: trunk/skins/lemill/manage_translations.pt @ 1930

Revision 1930, 4.7 KB checked in by jukka, 12 years ago (diff)

Fixed tests and other stuff, fixed #1376, closed #1420.

Line 
1<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
2      lang="en"
3      metal:use-macro="here/main_template/macros/master"
4      >
5     
6     
7<metal:block fill-slot="top_slot"
8             tal:define="dummy python:request.set('disable_border',1)" />
9
10<body>
11
12<div metal:fill-slot="main"
13     tal:define="translations python:here.getTranslationsOfOriginal(include_self=False);
14                 mother here/getOriginal;
15                 obj_translations here/getTranslations;">
16
17      <div id="content" class="documentEditable">
18
19    <div id="region-content">
20      <a name="documentContent"></a>
21
22      <div metal:use-macro="here/global_statusmessage/macros/portal_message">
23        Portal status message
24      </div>
25
26    <h1>LeMill managers: Manage translations</h1>
27
28     <form name="change_mother"
29           method="post"
30           class="enableUnloadProtection"
31           tal:attributes="action string:${here/absolute_url}/manage_form_setTranslationOf"
32           action="manage_form_setTranslationOf">
33
34        <h2>
35            This '<span tal:replace="here/Title" />' (<span tal:replace="here/id" />) <br/>is a translation of...
36        </h2>
37        <p><input type="text" tal:attributes="value mother/id | string:" name="mother_field" /> <a href="" tal:condition="mother" tal:attributes="href string:${mother/absolute_url}/manage_translations" >link</a></p>
38
39      <div class="formControls">
40           
41           <input class="context"
42                  type="submit"
43                  name="form.button.set_mother"
44                  value="Change source of translation"
45                  tal:attributes="tabindex tabindex/next"
46                  />
47       </div>
48
49
50     </form>
51
52        <br/>
53
54        <h2>The following are translations of this resource:</h2>
55
56        <tal:cond condition="obj_translations">
57     <form name="assign_translations"
58           method="post"
59           class="enableUnloadProtection"
60           tal:attributes="action string:${here/absolute_url}/manage_form_setTranslations"
61           action="manage_form_setTranslations">
62
63
64        <ul tal:repeat="trans obj_translations">
65        <li  tal:define="index repeat/trans/index" >
66        <input type="text" tal:attributes="value trans/id; name python:'obj_translation%s' % index" />
67        <a href="" tal:content="trans/title" tal:attributes="href string:${trans/absolute_url}/manage_translations" />       
68        <input type="hidden" tal:attributes="value trans/id; name python:'obj_translation_old%s' % index" />
69        (<span tal:replace="python:here.script_getPrettyLanguage(trans.Language())" />)
70        </li>
71        </ul>
72
73
74
75      <div class="formControls">
76           <input class="context"
77                  type="submit"
78                  name="form.button.assign_translations"
79                  value="Change translations"
80                  tal:attributes="tabindex tabindex/next"
81                  />
82      </div>
83
84        <p>You can remove translations by setting the field blank or change translation by writing other objects id in place.</p>
85        <p tal:condition="mother"><b>This is a translation of resource <span tal:replace="mother/id" />, but seems to have translations of its own. These translations should also point to <span tal:replace="mother/id" />.</b></p>
86
87
88        </form>
89        </tal:cond>
90   <tal:cond condition="not:obj_translations">
91    <ul><li>No translations based on this resource</li></ul>
92   </tal:cond>
93
94    <br/><br/>
95
96     <form name="add_translations"
97           method="post"
98           class="enableUnloadProtection"
99           tal:attributes="action string:${here/absolute_url}/manage_form_addTranslation"
100           action="manage_form_addTranslation">
101
102        <p><input type="text" value="" name="new_translation" />
103        <input class="context"
104                  type="submit"
105                  name="form.button.add_translation"
106                  value="Add this as translation"
107                  tal:attributes="tabindex tabindex/next"
108                  />
109        </p>
110
111        <tal:cond condition="python:translations and mother">
112        <h>This resource belongs to a group of translations:</h2>
113
114        <legend>Source resource '<a href="" tal:content="mother/id" tal:attributes="href string:${mother/absolute_url}/manage_translations" />' (<span  tal:content="python:here.script_getPrettyLanguage(mother.Language())" />) has following translations:</legend>
115
116        <ul tal:repeat="trans translations">
117        <li><span tal:replace="trans/id" /> <a href="" tal:content="trans/title" tal:attributes="href string:${trans/absolute_url}/manage_translations" /> (<span tal:replace="python:here.script_getPrettyLanguage(trans.Language())" />)</li>
118        </ul>
119
120        </tal:cond>
121
122     </form>
123
124
125    </div>
126  </div>
127</div>
128
129</body>
130</html>
131
132
Note: See TracBrowser for help on using the repository browser.