aboutsummaryrefslogtreecommitdiffstats
path: root/settings/templates/apps.php
blob: d7b232b915e1996a3b2cad0e2f6f66ac718c365d (plain)
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
style('settings', 'settings');
vendor_script(
	'core',
	[
		'marked/marked.min',
	]
);
script(
	'settings',
	[
		'settings',
		'apps',
	]
);
/** @var array $_ */
?>
<script id="categories-template" type="text/x-handlebars-template">
{{#each this}}
	<li id="app-category-{{ident}}" data-category-id="{{ident}}" tabindex="0">
		<a href="#" class="icon-category-{{ident}}">{{displayName}}</a>
		<div class="app-navigation-entry-utils">
			<ul>
				<li class="app-navigation-entry-utils-counter">{{ counter }}</li>
			</ul>
		</div>
	</li>
{{/each}}

<?php if($_['appstoreEnabled']): ?>
	<li>
		<a class="app-external icon-info" target="_blank" rel="noreferrer noopener" href="https://docs.nextcloud.org/server/12/developer_manual/"><?php p($l->t('Developer documentation'));?> </a>
	</li>
<?php endif; ?>
</script>

<script id="app-template-installed" type="text/x-handlebars">
{{#if newCategory}}
<div class="apps-header">
	<div class="app-image"></div>
	<h2>{{categoryName}} <input class="enable" type="submit" data-bundleid="{{bundleId}}" data-active="true" value="<?php p($l->t('Enable all'));?>"/></h2>
	<div class="app-version"></div>
	<div class="app-level"></div>
	<div class="app-groups"></div>
	<div class="actions">&nbsp;</div>
</div>
{{/if}}
<div class="section" id="app-{{id}}">
	<div class="app-image app-image-icon"></div>
	<div class="app-name">
		{{#if detailpage}}
			<a href="{{detailpage}}" target="_blank" rel="noreferrer noopener">{{name}}</a>
		{{else}}
			{{name}}
		{{/if}}
	</div>
	<div class="app-version">{{version}}</div>
	<div class="app-level">
		{{{level}}}{{#unless internal}}<a href="https://apps.nextcloud.com/apps/{{id}}"><?php p($l->t('View in store'));?> </a>{{/unless}}
	</div>

	<div class="app-groups">
		{{#if active}}
		<div class="groups-enable">
			<input type="checkbox" class="groups-enable__checkbox checkbox" id="groups_enable-{{id}}"/>
			<label for="groups_enable-{{id}}"><?php p($l->t('Limit to groups')); ?></label>
			<input type="hidden" class="group_select" title="<?php p($l->t('All')); ?>">
		</div>
		{{/if}}
	</div>

	<div class="actions">
		<div class="warning hidden"></div>
		<input class="update hidden" type="submit" value="<?php p($l->t('Update to %s', array('{{update}}'))); ?>" data-appid="{{id}}" />
		{{#if canUnInstall}}
		<input class="uninstall" type="submit" value="<?php p($l->t('Remove')); ?>" data-appid="{{id}}" />
		{{/if}}
		{{#if active}}
		<input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable"));?>"/>
		{{else}}
		<input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable"));?>"/>
		{{/if}}
	</div>
</div>
</script>

<script id="app-template" type="text/x-handlebars">
	<div class="section" id="app-{{id}}">
	{{#if preview}}
	<div class="app-image{{#if previewAsIcon}} app-image-icon{{/if}} icon-loading">
	</div>
	{{/if}}
	<h2 class="app-name">
		{{#if detailpage}}
			<a href="{{detailpage}}" target="_blank" rel="noreferrer noopener">{{name}}</a>
		{{else}}
			{{name}}
		{{/if}}
	</h2>
	<div class="app-level">
		{{{level}}}
	</div>
	{{#if ratingNumThresholdReached }}
	<div class="app-score">{{{score}}}</div>
	{{/if}}
	<div class="app-detailpage"></div>

	<div class="app-description-container hidden">
		<div class="app-version">{{version}}</div>
		{{#if profilepage}}<a href="{{profilepage}}" target="_blank" rel="noreferrer noopener">{{/if}}
		<div class="app-author"><?php p($l->t('by %s', ['{{author}}']));?>
			{{#if licence}}
			(<?php p($l->t('%s-licensed', ['{{licence}}'])); ?>)
			{{/if}}
		</div>
		{{#if profilepage}}</a>{{/if}}
		<div class="app-description">{{{description}}}</div>
		<!--<div class="app-changed">{{changed}}</div>-->
		{{#if documentation}}
		<p class="documentation">
			<?php p($l->t("Documentation:"));?>
			{{#if documentation.user}}
			<span class="userDocumentation">
			<a id="userDocumentation" class="appslink" href="{{documentation.user}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('User documentation'));?> </a>
			</span>
			{{/if}}

			{{#if documentation.admin}}
			<span class="adminDocumentation">
			<a id="adminDocumentation" class="appslink" href="{{documentation.admin}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Admin documentation'));?> </a>
			</span>
			{{/if}}

			{{#if documentation.developer}}
			<span class="developerDocumentation">
			<a id="developerDocumentation" class="appslink" href="{{documentation.developer}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Developer documentation'));?> </a>
			</span>
			{{/if}}
		</p>
		{{/if}}

		{{#if website}}
		<a id="userDocumentation" class="appslink" href="{{website}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Visit website'));?> </a>
		{{/if}}

		{{#if bugs}}
		<a id="adminDocumentation" class="appslink" href="{{bugs}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Report a bug'));?> </a>
		{{/if}}
	</div><!-- end app-description-container -->
	<div class="app-description-toggle-show" role="link"><?php p($l->t("Show description …"));?></div>
	<div class="app-description-toggle-hide hidden" role="link"><?php p($l->t("Hide description …"));?></div>

	<div class="app-dependencies update hidden">
		<p><?php p($l->t('This app has an update available.')); ?></p>
	</div>

	{{#if missingMinOwnCloudVersion}}
		<div class="app-dependencies">
			<p><?php p($l->t('This app has no minimum Nextcloud version assigned. This will be an error in the future.')); ?></p>
		</div>
	{{else}}
		{{#if missingMaxOwnCloudVersion}}
			<div class="app-dependencies">
				<p><?php p($l->t('This app has no maximum Nextcloud version assigned. This will be an error in the future.')); ?></p>
			</div>
		{{/if}}
	{{/if}}

	{{#unless canInstall}}
	<div class="app-dependencies">
	<p><?php p($l->t('This app cannot be installed because the following dependencies are not fulfilled:')); ?></p>
	<ul class="missing-dependencies">
	{{#each missingDependencies}}
	<li>{{this}}</li>
	{{/each}}
	</ul>
	</div>
	{{/unless}}

	<input class="update hidden" type="submit" value="<?php p($l->t('Update to %s', array('{{update}}'))); ?>" data-appid="{{id}}" />
	{{#if active}}
	<input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable"));?>"/>
	<div class="groups-enable">
		<input type="checkbox" class="groups-enable__checkbox checkbox" id="groups_enable-{{id}}"/>
		<label for="groups_enable-{{id}}"><?php p($l->t('Enable only for specific groups')); ?></label>
	</div>
	<input type="hidden" class="group_select" title="<?php p($l->t('All')); ?>" style="width: 200px">
	{{else}}
	<input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable"));?>"/>
	{{/if}}
	{{#if canUnInstall}}
	<input class="uninstall" type="submit" value="<?php p($l->t('Remove')); ?>" data-appid="{{id}}" />
	{{/if}}

	<div class="warning hidden"></div>

	</div>
</script>

<div id="app-navigation" class="icon-loading" data-category="<?php p($_['category']);?>">
	<ul id="apps-categories">

	</ul>
</div>
<div id="app-content" class="icon-loading">
	<div id="apps-list"></div>
	<div id="apps-list-empty" class="hidden emptycontent emptycontent-search">
		<div id="app-list-empty-icon" class="icon-search"></div>
		<h2><?php p($l->t('No apps found for your version')) ?></h2>
	</div>
</div>