Handle 'unmaintained' state on app page (#732)

This commit is contained in:
Alexandre Aubin 2018-06-04 16:05:41 +02:00 committed by GitHub
parent a9d0cde6dd
commit 33738195d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

26
apps.md
View file

@ -83,6 +83,10 @@
margin-top: -5px; margin-top: -5px;
} }
.app-card .unmaintained {
color: #e0aa33;
}
.app-card-desc { .app-card-desc {
height:100px; height:100px;
overflow: hidden; overflow: hidden;
@ -123,7 +127,7 @@
</div> </div>
<div class="app-card-date-maintainer"> <div class="app-card-date-maintainer">
<span class="glyphicon glyphicon-refresh"></span> {app_update} - <span class="glyphicon glyphicon-refresh"></span> {app_update} -
<span class="glyphicon glyphicon-user"></span> {app_maintainer} <span title="{maintained_help}" class="{maintained_state}"><span class="glyphicon glyphicon-{maintained_icon}"></span> {app_maintainer}</span>
</div> </div>
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<a href="{app_git}" target="_BLANK" type="button" class="btn btn-default col-sm-4"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Code</a> <a href="{app_git}" target="_BLANK" type="button" class="btn btn-default col-sm-4"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Code</a>
@ -258,17 +262,30 @@ $(document).ready(function () {
.replace('{app_state_bootstrap}', app_state_bootstrap) .replace('{app_state_bootstrap}', app_state_bootstrap)
.replace('{app_install_bootstrap}', app_install_bootstrap); .replace('{app_install_bootstrap}', app_install_bootstrap);
if (infos.maintained == false)
{
html = html
.replace('{maintained_state}', 'unmaintained')
.replace('{maintained_icon}', 'warning-sign')
.replace('{app_maintainer}', "Unmaintained")
.replace('{maintained_help}', "This package is currently unmaintained. Feel free to propose yourself as the new maintainer !");
} else {
if (infos.manifest.developer) { if (infos.manifest.developer) {
html = html html = html
.replace('{maintained_state}', 'maintained')
.replace('{maintained_icon}', 'user')
.replace('{app_maintainer}', infos.manifest.developer.name) .replace('{app_maintainer}', infos.manifest.developer.name)
.replace('{app_mail}', infos.manifest.developer.email); .replace('{maintained_help}', "Current maintainer of this package");
} }
if (infos.manifest.maintainer) { if (infos.manifest.maintainer) {
html = html html = html
.replace('{maintained_state}', 'maintained')
.replace('{maintained_icon}', 'user')
.replace('{app_maintainer}', infos.manifest.maintainer.name) .replace('{app_maintainer}', infos.manifest.maintainer.name)
.replace('{app_mail}', infos.manifest.maintainer.email); .replace('{maintained_help}', "Current maintainer of this package");;
} }
}
// Fill the template // Fill the template
$('#app-cards-list').append(html); $('#app-cards-list').append(html);
@ -285,4 +302,3 @@ $(document).ready(function () {
//================================================= //=================================================
}); });
</script> </script>