summaryrefslogtreecommitdiffstats
path: root/modules-available/translation/templates/edit.html
blob: 082e2cb513bcc6bf158f968ef22039bab22c51db (plain) (blame)
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
<div class="panel panel-default">
	<div class="panel-heading">
		{{module}} / {{section}}
	</div>
	<div class="panel-body">
		<p>{{lang_templateAdminHelp}}</p>
		<div class="alert alert-info">
			{{lang_templateHint}}
		</div>
		<form action="?do=Translation" method="post" class="slx-visible-rows">
			<input type="hidden" name="module" value="{{module}}">
			<input type="hidden" name="destlang" value="{{destlang}}">
			<input type="hidden" name="section" value="{{section}}">
			<input type="hidden" name="subsection" value="{{subsection}}">
			<input type="hidden" name="token" value="{{token}}">
			<a class="btn btn-primary" href='?do=Translation' >{{lang_back}}</a>
			<button class="btn btn-primary" type="button" onclick="slxAddTag()" >{{lang_createTag}}</button>
			<button type="submit" class="btn btn-primary" name="update" value="true">{{lang_save}}</button>
			<div class="row">
				<div class="col-xs-4 col-sm-3">{{lang_tag}}</div>
				<div class="col-xs-6 col-sm-4">{{lang_translation}} (<b>{{language}}</b>)</div>
				<div class="hidden-xs col-sm-3 col-lg-4">{{lang_sample}}</div>
				<div class="col-xs-2 col-sm-2 col-lg-1">!</div>
			</div>
			{{#tags}}
			<div class="row">
				<div class="col-xs-4 col-sm-3">
					{{#unused}}
					<span class="label label-info">{{lang_unused}}</span>
					{{/unused}}
					{{#missing}}
					<span class="label label-warning">{{lang_missing}}</span>
					{{/missing}}
					{{#isglobal}}
					<span class="label label-success" title="{{lang_globalTooltip}}">{{lang_global}}</span>
					{{/isglobal}}
					{{tag}}
					<div class="slx-notebox">{{{notes}}}</div>
				</div>
				<div class="col-xs-6 col-sm-4" id="tagid-{{tagid}}">
					{{^big}}
					<input type="text" class="form-control switchable" value="{{translation}}" ondblclick="slxMb(this)" name="lang#!#{{tag}}" placeholder="{{placeholder}}">
					{{/big}}
					{{#big}}
					<textarea rows="3" class="form-control" name="lang#!#{{tag}}" placeholder="{{placeholder}}">{{translation}}</textarea>
					{{/big}}
				</div>
				<div class="hidden-xs col-sm-3 col-lg-4">
					<div class="slx-textpreview"><div>
						<div class="badge">{{samplelang}}</div>
						{{sampletext}}
						</div></div>
				</div>
				<div class="col-xs-2 col-sm-2 col-lg-1">
					<button type="button" class="btn btn-danger btn-xs" onclick="slxDelTag({{tagid}})" tabindex="-1">
						<span class="glyphicon glyphicon-remove"></span>
						<span class="hidden-xs">{{lang_delete}}</span>
					</button>
				</div>
			</div>
			{{/tags}}
			<div id="newTag"></div>
			<a class="btn btn-primary" href='?do=Translation' >{{lang_back}}</a>
			<button class="btn btn-primary" type="button" onclick="slxAddTag()" >{{lang_createTag}}</button>
			<button type="submit" class="btn btn-primary" name="update" value="true">{{lang_save}}</button>
		</form>
	</div>
</div>
<script type="text/javascript">
	var slxNewTagCounter = 0;
	function slxAddTag()
	{
		$('#newTag').before(
			'<div class="row" id="new-delete-' + slxNewTagCounter + '">' +
			'	<div class="col-xs-4 col-sm-3">' +
			'		<input type="text" name="new-id[' + slxNewTagCounter + ']" class="form-control">' +
			'	</div>' +
			'	<div class="col-xs-6 col-sm-4">' +
			'		<input type="text" class="form-control" name="new-text[' + slxNewTagCounter + ']">' +
			'	</div>' +
			'	<div class="hidden-xs col-sm-4">' +
			'	</div>' + 
			'	<div class="col-xs-2 col-sm-1">' +
			'		<button type="button" class="btn btn-danger btn-xs" onclick="slxDelNew(' + slxNewTagCounter + ')" tabindex="-1"><span class="glyphicon glyphicon-remove"></span> {{lang_delete}}</button>' +
			'	</div>' +
			'</div>'
		);
		slxNewTagCounter++;
	}
	
	function slxDelNew(id)
	{
		$('#new-delete-' + id).remove();
	}
	
	function slxDelTag(id)
	{
		$('#tagid-' + id).text('-');
	}
	
	function slxMb(el)
	{
		var old = $(el);
		var ta = $('<textarea name="' + el.name + '" class="form-control" rows="3"></textarea>');
		ta.val(old.val());
		old.replaceWith(ta);
	}
</script>