-
Notifications
You must be signed in to change notification settings - Fork 243
/
versions.tpl
124 lines (113 loc) · 4.56 KB
/
versions.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{let page_limit=30
list_count=fetch('content','version_count', hash(contentobject, $object))}
<form action={concat("/content/versions/",$object.id,"/")|ezurl} method="post">
<div class="maincontentheader">
<h1>{"Versions for: %1"|i18n("design/standard/content/version",,array($object.name|wash))}</h1>
</div>
{switch match=$edit_warning}
{case match=1}
<div class="warning">
<h2>{"Version not a draft"|i18n("design/standard/content/version")}</h2>
<ul>
<li>{"Version %1 is not available for editing any more, only drafts can be edited."|i18n("design/standard/content/version",,array($edit_version))}</li>
<li>{"To edit this version create a copy of it."|i18n("design/standard/content/version")}</li>
</ul>
</div>
{/case}
{case match=2}
<div class="warning">
<h2>{"Version not yours"|i18n("design/standard/content/version")}</h2>
<ul>
<li>{"Version %1 was not created by you, only your own drafts can be edited."|i18n("design/standard/content/version",,array($edit_version))}</li>
<li>{"To edit this version create a copy of it."|i18n("design/standard/content/version")}</li>
</ul>
</div>
{/case}
{case match=3}
<div class="warning">
<h2>{"Unable to create new version"|i18n("design/standard/content/version")}</h2>
<ul>
<li>{"Version history limit has been exceeded and no archived version can be removed by the system."|i18n("design/standard/content/version")}</li>
<li>{"You can change your version history settings in content.ini, remove draft versions or edit existing drafts."|i18n("design/standard/content/version")}</li>
</ul>
</div>
{/case}
{case}
{/case}
{/switch}
{let version_list=fetch('content','version_list',hash(contentobject, $object,limit,$page_limit,offset,$view_parameters.offset))}
<table class="list" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<th colspan="2">
{"Version"|i18n("design/standard/content/version")}:
</th>
<th>
{"Status"|i18n("design/standard/content/version")}:
</th>
<th>
{"Translations"|i18n("design/standard/content/version")}:
</th>
<th>
{"Creator"|i18n("design/standard/content/version")}:
</th>
{section show=$can_edit}
<th colspan="2">
{"Modified"|i18n("design/standard/content/version")}:
</th>
{/section}
</tr>
{section name=Version loop=$version_list sequence=array(bglight,bgdark)}
<tr>
<td class="{$Version:sequence}">
{section show=or(eq($Version:item.status,0),eq($Version:item.status,3),eq($Version:item.status,4))}
<input type="checkbox" name="DeleteIDArray[]" value="{$Version:item.id}" />
{/section}
</td>
<td class="{$Version:sequence}">
<a href={concat("/content/versionview/",$object.id,"/",$Version:item.version,"/",$edit_language|not|choose(array($edit_language,"/"),""))|ezurl}>{$Version:item.version}</a>
{section show=eq($Version:item.version,$object.current_version)}*{/section}
</td>
<td class="{$Version:sequence}">
{$Version:item.status|choose("Draft","Published","Pending","Archived","Rejected")}
</td>
<td class="{$Version:sequence}">
{section name=Language loop=$Version:item.language_list}
{delimiter},{/delimiter}
<a href={concat("/content/versionview/",$object.id,"/",$Version:item.version,"/",$Version:Language:item.language_code,"/")|ezurl}>{$Version:Language:item.locale.intl_language_name}</a>{/section}
</td>
<td class="{$Version:sequence}">
<a href={concat("/content/view/full/",$Version:item.creator.main_node_id,"/")|ezurl}>{$Version:item.creator.name|wash}</a>
</td>
<td class="{$Version:sequence}">
<span class="small">{$Version:item.modified|l10n(shortdatetime)}</span>
</td>
{section show=$can_edit}
<td class="{$Version:sequence}">
<input type="radio" name="RevertToVersionID" value="{$Version:item.version}" {section show=eq($Version:item.version,$edit_version)}checked="checked"{/section} />
</td>
{/section}
</tr>
{/section}
<tr>
<td colspan="8">
{include uri="design:gui/trash.tpl"}
</td>
</tr>
</table>
{include name=navigator
uri='design:navigator/google.tpl'
page_uri=concat('/content/versions/', $object.id, '///' )
item_count=$list_count
view_parameters=$view_parameters
item_limit=$page_limit}
{section show=$can_edit}
<div class="buttonblock" align="right">
<input class="button" type="submit" name="EditButton" value="{'Edit'|i18n('design/standard/content/version')}" />
<input class="button" type="submit" name="CopyVersionButton" value="{'Copy and edit'|i18n('design/standard/content/version')}" />
</div>
{/section}
<input type="hidden" name="EditLanguage" value="{$edit_language}" />
</form>
{/let}
{/let}