Fixed proper display version of updatable plugins when in details page

This commit is contained in:
Djamil Legato
2016-04-29 11:02:01 -07:00
parent 3fb572d4ea
commit 6e68fd9e02
2 changed files with 12 additions and 9 deletions

View File

@@ -107,7 +107,8 @@ export default class Updates {
Object.keys(resources).forEach(function(item) { Object.keys(resources).forEach(function(item) {
// listing page // listing page
let element = $(`[data-gpm-${singles[index]}="${item}"] .gpm-name`); let container = $(`[data-gpm-${singles[index]}="${item}"]`);
let element = container.find('.gpm-name');
let url = element.find('a'); let url = element.find('a');
if (type === 'plugins' && !element.find('.badge.update').length) { if (type === 'plugins' && !element.find('.badge.update').length) {
@@ -117,10 +118,11 @@ export default class Updates {
} }
// details page // details page
let details = $(`.grav-update.${singles[index]}`); if (container.length) {
if (details.length) { let details = $(`.grav-update.${singles[index]}`);
let releaseType = resources[item].type === 'testing' ? '<span class="gpm-testing">test release</span>' : ''; if (details.length) {
details.html(` let releaseType = resources[item].type === 'testing' ? '<span class="gpm-testing">test release</span>' : '';
details.html(`
<p> <p>
<i class="fa fa-bullhorn"></i> <i class="fa fa-bullhorn"></i>
<strong>v${resources[item].available}</strong> ${releaseType} ${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}!
@@ -128,8 +130,9 @@ export default class Updates {
</p> </p>
`); `);
// display update bar for themes/plugins details // display update bar for themes/plugins details
$(`[data-gpm-${singles[index]}="${item}"]`).css('display', 'block'); $(`[data-gpm-${singles[index]}="${item}"]`).css('display', 'block');
}
} }
}); });
}); });

File diff suppressed because one or more lines are too long