summaryrefslogtreecommitdiffstats
path: root/modules-available/news/templates/page-news.html
blob: 1c944cb8af2b95efa80662668a7fc9959dc6f611 (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
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
<h1>{{lang_mainHeading}}</h1>

<p>{{lang_introText}}</p>

<h2>{{newsTypeName}}</h2>

<form action="?do=news" method="post">
	<input type="hidden" name="token" value="{{token}}">
	<input type="hidden" name="type" value="{{type}}">
	<input type="hidden" name="action" value="save">
	{{#withTitle}}
	<div class="form-group">
		<label for="news-title-id">{{lang_title}}</label>
		<input type="text" name="news-title" id ="news-title-id" class="form-control" placeholder="{{lang_titlePh}}" value="{{currentTitle}}" {{save.readonly}}>
	</div>
	{{/withTitle}}
	<div class="form-group row">
		<div class="col-md-12">
			<label for="enddate">{{lang_expiryDate}}</label>
			<div class="checkbox">
				<input id="infinite-checkbox" type="checkbox" name="infinite" {{infinite_checked}}>
				<label for="infinite-checkbox">{{lang_infiniteDuration}}</label>
			</div>
		</div>
		<div class="col-md-3 col-sm-6">
			<div class="input-group">
				<span class="input-group-addon">
					<span class="glyphicon glyphicon-calendar"></span>
				</span>
				<input id="enddate" type="text" name="enddate" value="{{enddate}}" class="form-control datepicker" {{save.readonly}}>
			</div>
		</div>
		<div class="col-md-3 col-sm-6">
			<div class="input-group bootstrap-timepicker timepicker">
				<span class="input-group-addon">
					<span class="glyphicon glyphicon-time"></span>
				</span>
				<input id="endtime" type="time" name="endtime" value="{{endtime}}" class="form-control timepicker2" {{save.readonly}} pattern="[0-9]{1,2}:[0-9]{2}">
			</div>
		</div>
	</div>
	<div class="form-group">
		<label for="news-content-id">{{lang_content}}</label>
		<textarea required name="news-content" id ="news-content-id" class="form-control summernote" rows="5" cols="30" {{save.readonly}}>{{currentContent}}</textarea>
	</div>
	<div>
		{{lang_lastUpdate}}: {{dateline_s}}
		<br>
		{{lang_expires}}: {{expires_s}}
	</div>
	<div class="text-right">
		<button {{save.disabled}} class="btn btn-primary sn-btn" type="submit">
			<span class="glyphicon glyphicon-floppy-disk"></span>
			{{lang_save}}
		</button>
	</div>

</form>
<br><br>
<div class="panel panel-default">
	<div class="panel-heading">
		{{lang_previousEntries}}
	</div>
	<div class="panel-body">
		<div class="table-responsive">
			<form method="post" action="?do=news">
				<input type="hidden" name="token" value="{{token}}">
				<input type="hidden" name="type" value="{{type}}">
				<input type="hidden" name="action" value="delete">
				<table class="table table-condensed stupidtable">
					<thead>
						<tr>
							<th></th>
							<th class="text-nowrap slx-smallcol" data-sort="int">{{lang_created}}</th>
							<th class="text-nowrap slx-smallcol" data-sort="int">{{lang_expires}}</th>
							<th class="text-nowrap" data-sort="string">{{lang_title}}</th>
							<th class="text-nowrap" data-sort="string" width="30%">{{lang_content}}</th>
							<th class="text-nowrap slx-smallcol">{{lang_show}}</th>
							<th class="text-nowrap slx-smallcol">{{lang_delete}}</th>
						</tr>
					</thead>
					<tbody>
						{{#list}}
						<tr class="{{live}} {{muted}}">
							<td>{{#active}}<span class="glyphicon glyphicon-eye-open"></span>{{/active}}</td>
							<td class="text-left text-nowrap" data-sort-value={{dateline}}>{{dateline_s}}</td>
							<td class="text-left text-nowrap" data-sort-value={{expires}}>{{expires_s}}</td>
							<td><table class="slx-ellipsis"><tr><td>{{title}}</td></tr></table></td>
							<td><table class="slx-ellipsis"><tr><td class="small">{{content}}</td></tr></table></td>
							<td class="text-center">
								<a class="btn btn-primary btn-xs" href="?do=news&amp;newsid={{newsid}}&amp;action=show">
									<span class="glyphicon glyphicon-share-alt"></span>
								</a>
							</td>
							<td class="text-center">
								<button {{delete.disabled}} class="btn btn-danger btn-xs btn-delete" type="submit"
										name="newsid" value="{{newsid}}" data-confirm="#confirm-delete" data-title="{{title}}">
									<span class="glyphicon glyphicon-trash"></span>
								</button>
							</td>
						</tr>
						{{/list}}
					</tbody>
				</table>
			</form>
		</div>
	</div>
</div>

<div class="hidden" id="confirm-delete">{{lang_confirmDelete}}</div>
<script type="application/javascript"><!--
document.addEventListener("DOMContentLoaded", function () {
	$('.sn-btn').click(function (event) {
		var $button = $('.note-btn.btn-codeview');
		if ($button.hasClass('active')) {
			$button.click();
		}
	});
	{{#hasSummernote}}
	$('.summernote[readonly]').each(function() { $(this).summernote('disable'); });
	{{/hasSummernote}}
	var dateSettings = {
		format: 'yyyy-mm-dd',
		todayHighlight: true,
	};
	$('.datepicker').datepicker(dateSettings);
	var chf = function() {
		$('#enddate, #endtime').prop('disabled', $('#infinite-checkbox').is(':checked'));
	};
	$('#infinite-checkbox').change(chf);
	chf();
}, false);
// --></script>