Welcome to mirror list, hosted at ThFree Co, Russian Federation.

plugin-details.twig « templates « Marketplace « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9e44e487ead7d9180025fd0ad7c411a84e606653 (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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
{% import '@Marketplace/macros.twig' as marketplaceMacro %}

{% block content %}

    <div class="pluginDetails">
        {% if errorMessage %}
            {{ errorMessage }}
        {% elseif plugin %}

            {% if plugin.versions is not empty and plugin.versions[plugin.versions|length - 1] %}
                {% set latestVersion = plugin.versions[plugin.versions|length - 1] %}
            {% else %}
                {% set latestVersion = '' %}
            {% endif %}

            <div class="row">
                <div class="col s12 m9">
                    <h2>{{ plugin.displayName }}</h2>
                    <p class="description">
                        {% if plugin.featured %}
                            {{ marketplaceMacro.featuredIcon('left') }}
                        {% endif %}
                        {{ plugin.description }}
                    </p>
                    <div class="contentDetails">
                        <div id="pluginDetailsTabs" class="row">
                            <div class="col s12">
                                <ul class="tabs">
                                    <li class="tab col s3"><a href="#tabs-description">{{ 'General_Description'|translate }}</a></li>

                                    {% if latestVersion.readmeHtml.faq %}
                                        <li class="tab col s3"><a href="#tabs-faq">{{ 'General_Faq'|translate }}</a></li>
                                    {% endif %}

                                    {% if latestVersion.readmeHtml.documentation %}
                                        <li class="tab col s3"><a href="#tabs-documentation">{{ 'General_Documentation'|translate }}</a></li>
                                    {% endif %}

                                    {% if plugin.screenshots|length %}
                                        <li class="tab col s3"><a href="#tabs-screenshots">{{ 'Marketplace_Screenshots'|translate }}</a></li>
                                    {% endif %}

                                    {% if plugin.shop is defined and plugin.shop and plugin.shop.reviews and plugin.shop.reviews.embedUrl is defined and plugin.shop.reviews.embedUrl %}
                                        <li class="tab col s3"><a href="#tabs-reviews">{{ 'Marketplace_Reviews'|translate }}</a></li>
                                    {% endif %}
                                </ul>
                            </div>

                            <div id="tabs-description" class="tab-content col s12">
                                {% if isSuperUser and (plugin.isDownloadable or plugin.isInstalled) %}
                                    {{ marketplaceMacro.missingRequirementsPleaseUpdateNotice(plugin) }}

                                    {% if isMultiServerEnvironment %}
                                        <div class="alert alert-warning">{{ 'Marketplace_MultiServerEnvironmentWarning'|translate }}</div>
                                    {% elseif not isAutoUpdateEnabled %}
                                        <div class="alert alert-warning">{{ 'Marketplace_AutoUpdateDisabledWarning'|translate("'[General]enable_auto_update=1'", "'config/config.ini.php'") }}</div>
                                    {% endif %}
                                {% endif %}

                                {% if hasSomeAdminAccess and plugin.isMissingLicense is defined and plugin.isMissingLicense %}
                                    <div class="alert alert-danger">{{ 'Marketplace_PluginLicenseMissingDescription'|translate }}</div>
                                {% elseif hasSomeAdminAccess and plugin.hasExceededLicense is defined and plugin.hasExceededLicense %}
                                    <div class="alert alert-warning">{{ 'Marketplace_PluginLicenseExceededDescription'|translate }}</div>
                                {% endif %}

                                {{ latestVersion.readmeHtml.description|raw }}
                            </div>

                            {% if latestVersion.readmeHtml.faq %}
                                <div id="tabs-faq" class="tab-content col s12">
                                    {{ latestVersion.readmeHtml.faq|raw }}
                                </div>
                            {% endif %}

                            {% if latestVersion.readmeHtml.documentation %}
                                <div id="tabs-documentation" class="tab-content col s12">
                                    {{ latestVersion.readmeHtml.documentation|raw }}
                                </div>
                            {% endif %}

                            {% if plugin.screenshots|length %}
                                <div id="tabs-screenshots" class="tab-content col s12">
                                    <div class="thumbnails">
                                        {% for screenshot in plugin.screenshots %}
                                            <div class="thumbnail">
                                                <a href="{{ screenshot }}" target="_blank"><img src="{{ screenshot }}?w=400" width="400" alt=""></a>
                                                <p>
                                                    {{ screenshot|split('/')|last|replace({'_': ' ', '.png': '', '.jpg': '', '.jpeg': ''}) }}
                                                </p>
                                            </div>
                                        {% endfor %}
                                    </div>
                                </div>
                            {% endif %}

                            {% if plugin.shop is defined and plugin.shop and plugin.shop.reviews and plugin.shop.reviews.embedUrl is defined and plugin.shop.reviews.embedUrl %}
                                <div id="tabs-reviews" class="tab-content col s12">
                                    <iframe class="reviewIframe"
                                            style="{% if plugin.shop.reviews.height %}height:{{ plugin.shop.reviews.height }}px;{% endif %}"
                                            id="{{ plugin.shop.reviews.embedUrl|md5 }}"
                                            src="{{ plugin.shop.reviews.embedUrl|raw }}"></iframe>
                                </div>
                            {% endif %}
                        </div>
                    </div>
                </div>
                <div class="col s12 m3">
                    <div class="metadata">
                        <div class="actionButton">
                            {% if not plugin.isDownloadable or not isSuperUser %}
                                {% if hasSomeAdminAccess and plugin.hasExceededLicense is defined and plugin.hasExceededLicense and plugin.consumer %}
                                    {% if plugin.consumer.loginUrl is defined and plugin.consumer.loginUrl %}
                                        <a class="install update"
                                           target="_blank"
                                           rel="noreferrer"
                                           href="{{ plugin.consumer.loginUrl|default('')|e('html_attr') }}"
                                        >{{ 'Marketplace_UpgradeSubscription'|translate }}</a>
                                    {% endif %}

                                {% elseif not plugin.isDownloadable and plugin.isPaid and plugin.shop is defined and plugin.shop %}

                                    {% if plugin.shop.variations|length %}

                                        <div class="input-field variationPicker">
                                            <select title="{{ 'Marketplace_ShownPriceIsExclTax'|translate|e('html_attr') }} {{ 'Marketplace_CurrentNumPiwikUsers'|translate(numUsers)|e('html_attr') }}">
                                                {% for variation in plugin.shop.variations %}
                                                    <option value="{{ variation.addToCartUrl }}"
                                                            title="{{ 'Marketplace_PriceExclTax'|translate(variation.price, variation.currency)|e('html_attr') }} {{ 'Marketplace_CurrentNumPiwikUsers'|translate(numUsers)|e('html_attr') }}"
                                                            {% if variation.recommended is defined and variation.recommended %}selected{% endif %}
                                                    >{{ variation.name }} - {{ variation.prettyPrice }} / {{ variation.period }}</option>
                                                {% endfor %}
                                            </select>
                                        </div>

                                        <a class="install update addToCartLink" target="_blank"
                                           title="{{ 'Marketplace_ClickToCompletePurchase'|translate|e('html_attr') }}"
                                           rel="noreferrer"
                                           href="{{ plugin.shop.url|default('')|e('html_attr') }}"
                                        >{{ 'Marketplace_AddToCart'|translate }}</a>
                                    {% else %}
                                        <a class="install update" target="_blank"
                                           rel="noreferrer"
                                           href="{% if plugin.shop is defined and plugin.shop and plugin.shop.url %}{{ plugin.shop.url|e('html_attr') }}{% else %}{{ plugin.homepage|e('html_attr') }}{% endif %}"
                                        >{{ 'General_MoreDetails'|translate }}</a>
                                    {% endif %}
                                {% endif %}
                            {% elseif isSuperUser %}
                                {% if not isAutoUpdatePossible %}
                                    <a onclick="$(this).css('display', 'none')" href="{{ linkTo({'action': 'download', 'pluginName': plugin.name, 'nonce': (plugin.name|nonce)}) }}"
                                       class="download">{{ 'General_Download'|translate }}</a>
                                {% elseif plugin.canBeUpdated and 0 == plugin.missingRequirements|length %}
                                    <a class="install update"
                                       href="{{ linkTo({'module': 'Marketplace', 'action':'updatePlugin', 'pluginName': plugin.name, 'nonce': updateNonce}) }}"
                                    >{{ 'CoreUpdater_UpdateTitle'|translate }}</a>
                                {% elseif plugin.isInstalled %}
                                    <br />
                                    <br />
                                    <br />
                                    <br />
                                {% elseif 0 < plugin.missingRequirements|length %}
                                    <br />
                                    <br />
                                    <br />
                                    <br />
                                {% else %}
                                    <a href="{{ linkTo({'module': 'Marketplace', 'action': 'installPlugin', 'pluginName': plugin.name, 'nonce': installNonce}) }}"
                                       class="install">{{ 'Marketplace_ActionInstall'|translate }}</a>
                                {% endif %}
                            {% else %}
                                <br />
                                <br />
                                <br />
                                <br />
                            {% endif %}
                        </div>

                        <p><br /></p>
                        <dl>
                            <dt>{{ 'CorePluginsAdmin_Version'|translate }}</dt>
                            <dd>{{ plugin.latestVersion }}</dd>
                            <dt>{{ 'Marketplace_PluginKeywords'|translate }}</dt>
                            <dd>{{ plugin.keywords|join(', ') }}</dd>
                            {% if plugin.lastUpdated %}
                                <dt>{{ 'Marketplace_LastUpdated'|translate }}</dt>
                                <dd>{{ plugin.lastUpdated }}</dd>
                            {% endif %}
                            {% if plugin.numDownloads %}
                                <dt>{{ 'General_Downloads'|translate }}</dt>
                                <dd title="{{ 'Marketplace_NumDownloadsLatestVersion'|translate(latestVersion.numDownloads|number_format) }}">{{ plugin.numDownloads }}</dd>
                            {% endif %}
                            <dt>{{ 'Marketplace_Developer'|translate }}</dt>
                            <dd>{{ marketplaceMacro.pluginDeveloper(plugin.owner) }}</dd>
                            {% if latestVersion and latestVersion.license is defined and latestVersion.license and latestVersion.license.name is defined and latestVersion.license.name %}
                                <dt>{{ 'Marketplace_License'|translate }}</dt>
                                <dd>
                                    {% if latestVersion.license.url is defined and latestVersion.license.url %}
                                        <a rel="noreferrer"
                                           href="{{ latestVersion.license.url }}"
                                           target="_blank">{{ latestVersion.license.name }}</a>
                                    {% else %}
                                        {{ latestVersion.license.name }}
                                    {% endif %}
                                </dd>
                            {% endif %}
                            <dt>{{ 'Marketplace_Authors'|translate }}</dt>
                            <dd>{% for author in plugin.authors if author.name %}

                                    {% spaceless %}
                                        {% if author.homepage %}
                                            <a target="_blank" rel="noreferrer" href="{{ author.homepage }}">{{ author.name }}</a>
                                        {% elseif author.email %}
                                            <a href="mailto:{{ author.email|escape('url') }}">{{ author.name }}</a>
                                        {% else %}
                                            {{ author.name }}
                                        {% endif %}

                                        {% if loop.index < plugin.authors|length %}
                                            ,
                                        {% endif %}
                                    {% endspaceless %}

                                {% endfor %}
                            </dd>
                            <dt>{{ 'CorePluginsAdmin_Websites'|translate }}</dt>
                            <dd>
                                {% if plugin.homepage %}
                                    <a target="_blank" rel="noreferrer" href="{{ plugin.homepage }}">{{ 'Marketplace_PluginWebsite'|translate }}</a>,
                                {% endif %}

                                {% if plugin.changelog is defined and plugin.changelog and plugin.changelog.url is defined and plugin.changelog.url %}
                                    <a target="_blank" rel="noreferrer" href="{{ plugin.changelog.url }}">{{ 'CorePluginsAdmin_Changelog'|translate }}</a>,
                                {% endif %}

                                <a target="_blank" href="{{ plugin.repositoryUrl }}">GitHub</a>
                            </dd>

                            {% if plugin.activity and plugin.activity.numCommits %}
                                <dt>{{ 'CorePluginsAdmin_Activity'|translate }}</dt>
                                <dd>
                                    {{ plugin.activity.numCommits }} commits

                                    {% if plugin.activity.numContributors > 1 %}
                                        {{ 'Marketplace_ByXDevelopers'|translate(plugin.activity.numContributors) }}
                                    {% endif %}
                                    {% if plugin.activity.lastCommitDate %}
                                        {{ 'Marketplace_LastCommitTime'|translate(plugin.activity.lastCommitDate) }}
                                    {% endif %}</dd>
                            {% endif %}
                        </dl>

                        {% if plugin.support is not empty %}
                            {% for entry in plugin.support %}
                                {% if entry.name and entry.value %}
                                    <dt>{{ entry.name }}</dt>
                                    <dd>{{ entry.value }}</dd>
                                {% endif %}
                            {% endfor %}
                        {% endif %}

                        <br />
                    </div>
                </div>
            </div>

            <script type="text/javascript">
                $(function() {

                    var active = 0;
                    {% if activeTab %}
                    var $activeTab = $('#tabs-{{ activeTab|e('js') }}');
                    if ($activeTab) {
                        active = $activeTab.index() - 1;
                    }
                    {% endif %}

                    $('#pluginDetailsTabs .tabs').tabs();
                    $('#pluginDetailsTabs .tabs').tabs('select_tab', active >= 0 ? active : 0);

                    $('.pluginDetails a').each(function (index, a) {
                        var link = $(a).attr('href');

                        if (link && 0 === link.indexOf('http')) {
                            $(a).attr('target', '_blank');
                        }
                    });
                });
            </script>

            {% if plugin.shop is defined and plugin.shop and plugin.shop.reviews and plugin.shop.reviews.embedUrl is defined and plugin.shop.reviews.embedUrl %}
                <script type="text/javascript">
                    $(function() {
                        var $iFrames = $('.pluginDetails iframe.reviewIframe');
                        for (var i = 0; i < $iFrames.length; i++) {
                            iFrameResize({checkOrigin: ['{{ plugin.shop.reviews.embedUrl|domainOnly }}']}, $iFrames[i]);
                        }
                    });
                </script>
            {% endif %}

            <script type="text/javascript">
                $(function() {
                    var $variationPicker = $('.pluginDetails .variationPicker select');
                    if ($variationPicker.val()) {
                        $('.addToCartLink').attr('href', $variationPicker.val());
                    }
                    $variationPicker.on('change', function () {
                        $('.addToCartLink').attr('href', $variationPicker.val())
                    });

                    if ($variationPicker.length) {
                        $variationPicker.material_select();
                    }
                });
            </script>
        {% endif %}
    </div>


{% endblock %}