-
Notifications
You must be signed in to change notification settings - Fork 0
/
assignmentTable.cfm
executable file
·142 lines (132 loc) · 6.32 KB
/
assignmentTable.cfm
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!---
Copyright 2011 Blue River Interactive
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---><cfsilent>
<cfset secure=false>
<cfinclude template="plugin/config.cfm">
<cfset rsLocales=translationManager.getAssignedSites(url.siteID)>
<cfset pSession=pluginConfig.getSession()>
<cfif not url.doMap>
<cfset pSession.init()>
</cfif>
</cfsilent>
<cfoutput>
<div class="mura-control-group">
<label><!--- Empty on purpose---></label>
<div class="mura-control justify">
<div class="bigui biguiMasaTranslations" id="bigui__masatranslations" data-label="Manage Masa Translations">
<div class="bigui__title">Manage Masa Translations</div>
<div class="bigui__controls">
<div class="mura-control-group" id="masatranslations-selector">
<label><!---placeholder do not delete ---></label>
<div class="mura-control justify" id="expires-notify">
<dl class="oneColumn">
<dt class="first">
<div class="control-group">
<label>
Associated Locales<cfif translationManager.hasTranslation(url.contentID,url.siteID)>: <a href="##" onclick="removeTranslationAssignments();return false;">[Remove Translation Assignment(s)]</a></cfif>
</label>
</div>
</dt>
<table class="table table-striped table-condensed table-bordered mura-table-grid" id="locales">
<thead>
<tr>
<th class="actions"></th>
<th>Locale</th>
<th>Site</th>
<th class="var-width">Node</th>
</tr>
</thead>
<cfif rsLocales.recordcount>
<tbody id="Locales">
<cfloop query="rsLocales">
<cfset translation=translationManager.getTranslation()>
<cfset translation.setLocalSiteID(url.siteid)>
<cfset translation.setLocalID(url.contentID)>
<cfset translation.setRemoteSiteID(rsLocales.siteid)>
<!---<hr>#translation.getLocal().getRemoteID()#::#translation.getLocal().getRemoteSiteID()#<hr>--->
<cfset mapping=translation.getLocal()>
<cfset mapCrumb=application.contentGateway.getCrumblist(mapping.getRemoteID(),mapping.getRemoteSiteID())>
<tr>
<td class="actions" id="stm_admin#rsLocales.siteid#">
<a class="show-actions" href="javascript:;" ontouch="this.onclick();" onclick="showTableControls(this);"><i class="mi-ellipsis-v"></i></a>
<div class="actions-menu hide">
<ul class="actions-list">
<cfif len(mapping.getRemoteID())>
<cfif application.permUtility.getModulePerm('00000000000000000000000000000000000',mapCrumb[1].siteID)
and listFindNoCase("Editor,Author",application.permUtility.getnodePerm(mapCrumb))>
<li class="edit"><a target="_top" href="#application.configBean.getContext()#/admin/index.cfm?muraaction=cArch.edit&contenthistid=#mapCrumb[1].contentHistID#&contentid=#mapCrumb[1].contentID#&type=#mapCrumb[1].type#&parentid=#mapCrumb[1].parentID#&topid=#mapCrumb[1].contentID#&siteid=#mapCrumb[1].siteID#&moduleid=00000000000000000000000000000000000&startrow=1" onclick=";"><i class="mi-pencil"></i>Edit</a></li>
<cfelse>
<li class="edit editOff"><a>Edit</a></li>
</cfif>
<cfelse>
<cfif application.permUtility.getModulePerm('00000000000000000000000000000000000',rsLocales.siteid)>
<li class="select"><a target="_top" href="#application.configBean.getContext()#/plugins/#pluginConfig.getDirectory()#/search.cfm?localSiteID=#translation.getLocalSiteID()#&localID=#translation.getLocalID()#&remoteSiteID=#translation.getRemoteSiteID()#&parentID=#url.parentID#&type=#url.type#&contentHistID=#url.contentHistID#" onclick="return saveBeforeTranslation(this.href);"><i class="mi-plus-circle"></i>Select</a></li>
<cfelse>
<li class="select selectOff"><a>Select</a></li>
</cfif>
</cfif>
</ul>
</div>
</td>
<td>#HTMLEditFormat(rsLocales.alias)#</td>
<td>#HTMLEditFormat(rsLocales.site)#</td>
<td class="var-width" id="stm_crumb#rsLocales.siteid#">
<cfif len(mapping.getRemoteID())>
#application.contentRenderer.dspZoom(mapCrumb)#
<cfelse>
<em>(No Assigned Translation)</em>
</cfif>
</td>
</tr>
</cfloop>
</tbody>
<cfelse>
<tr>
<td id="noFilters" colspan="4" class="noResults">This site currently has no translation peers.</td>
</tr>
</cfif>
</table>
</dl>
</div>
</div>
</div>
</div> <!--- /.bigui --->
</div>
</div>
</cfoutput>
<script type="text/javascript">
$(document).ready(function(){
// create hidden BigUI with button, close link
var renderBigUIMasaTranslations = function(el){
var idstr = $(el).attr('id');
var labelstr = $(el).attr('data-label');
$(el).before('<a class="bigui__launch" data-rel="' + idstr + '" href="#">' + labelstr + '</a>');
<!--- todo: resource bundle key for 'done' --->
$(el).prepend('<a class="bigui__close">Done <i class="mi-angle-right"></i></a>')
$(el).wrapInner('<div class="bigui__wrapper"></div>');
$(el).detach().appendTo('#mura-content-body-block .tab-content');
}
// set up all BigUI elements
$('.biguiMasaTranslations').each(function(){
renderBigUIMasaTranslations($(this));
})
$('.bigui__launch').on('click',function(){
var rel = $(this).attr('data-rel');
$('.biguiMasaTranslations').hide();
$('#' + rel).show();
return false;
});
$('.bigui__close').on('click',function(){
$(this).parents('.biguiMasaTranslations').hide();
})
});
</script>