Added logic to handle Testing / Stable channels

This commit is contained in:
Djamil Legato
2016-04-18 14:46:41 -07:00
parent 16d2f0a752
commit a2a5e6397c
12 changed files with 65 additions and 157 deletions

View File

@@ -118,13 +118,14 @@ export default class Updates {
// details page
let details = $(`.grav-update.${singles[index]}`);
if (details.length) {
let releaseType = resources[item].type === 'testing' ? '<span class="gpm-testing">test release</span>' : '';
details.html(`
<p>
<i class="fa fa-bullhorn"></i>
<strong>v${resources[item].available}</strong> ${translations.PLUGIN_ADMIN.OF_THIS} ${singles[index]} ${translations.PLUGIN_ADMIN.IS_NOW_AVAILABLE}!
<strong>v${resources[item].available}</strong> ${releaseType} ${translations.PLUGIN_ADMIN.OF_THIS} ${singles[index]} ${translations.PLUGIN_ADMIN.IS_NOW_AVAILABLE}!
<a href="#" class="button button-small secondary" data-remodal-target="update-packages" data-packages-slugs="${item}" data-${singles[index]}-action="start-package-installation">${translations.PLUGIN_ADMIN.UPDATE} ${singles[index].charAt(0).toUpperCase() + singles[index].substr(1).toLowerCase()}</a>
</p>
`);
`).css('display', 'block');
}
});
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1078,6 +1078,15 @@ form {
color: lighten($content-text, 10%);
}
}
.gpm-testing {
@extend .badge;
background-color: $critical-bg;
color: $critical-text;
border-radius: 3px;
padding: 0 4px;
font-size: 0.8rem;
}
}
.pages-list {

View File

@@ -1,5 +1,6 @@
{% set gpm = admin.gpm() %}
{% set installed = gpm.isPluginInstalled(admin.route) %}
{% set isTestingRelease = gpm.isTestingRelease(plugin.slug) %}
<div class="grav-update plugin" data-gpm-plugin="{{ admin.route }}">
</div>
@@ -15,6 +16,7 @@
</small>
{% endif %}
<small>{{ plugin.version ? 'v' ~ plugin.version|e }}</small>
{% if isTestingRelease %}<span class="gpm-testing">test release</span>{% endif %}
</h1>
<div class="gpm-item-info">
<i class="gpm-item-icon fa fa-fw fa-{{ plugin.icon }}"></i>

View File

@@ -9,6 +9,7 @@
<table>
{% for slug, plugin in admin.plugins(not installing).toArray|ksort %}
{% set data = admin.data('plugins/' ~ slug) %}
{% set isTestingRelease = admin.gpm.isTestingRelease(slug) %}
<tr data-gpm-plugin="{{ slug|url_encode }}">
<td class="gpm-name quadruple">
@@ -23,6 +24,7 @@
</span>
{% endif %}
<span class="gpm-version">v{{ plugin.version }}</span>
{% if isTestingRelease %}<span class="gpm-testing">test release</span>{% endif %}
</td>
<td class="gpm-actions">
{% if (not installing and (plugin.form.fields.enabled.type != 'hidden')) %}

View File

@@ -1,5 +1,6 @@
{% set gpm = admin.gpm() %}
{% set installed = gpm.isThemeInstalled(admin.route) %}
{% set isTestingRelease = gpm.isTestingRelease(plugin.slug) %}
<div class="grav-update theme" data-gpm-theme="{{ admin.route }}">
</div>
@@ -15,6 +16,7 @@
</small>
{% endif %}
<small>{{ theme.version ? 'v' ~ theme.version|e }}</small>
{% if isTestingRelease %}<span class="gpm-testing">test release</span>{% endif %}
</h1>
<div class="gpm-item-info">
<i class="gpm-item-icon fa fa-fw fa-{{ theme.icon }}"></i>

View File

@@ -11,6 +11,7 @@
{% set state = 'inactive' %}
{% if (installing) %}{% set state = 'installing' %}{% endif %}
{% if (config.get('system.pages.theme') == slug) %}{% set state = 'active' %}{% endif %}
{% set isTestingRelease = admin.gpm.isTestingRelease(slug) %}
<div class="theme card-item pure-u-1-3 {{ state }}-theme" data-gpm-theme="{{ slug|url_encode }}">
<div class="gpm-name">
@@ -25,6 +26,7 @@
</span>
{% endif %}
<span class="gpm-version">v{{ theme.version }}</span>
{% if isTestingRelease %}<span class="gpm-testing">test release</span>{% endif %}
</div>
<div class="gpm-screenshot">
{% set thumb = installing ? '//getgrav.org/images/' ~ theme.screenshot : theme.thumbnail %}