css button space fix + remove 0 level apps from only working view

This commit is contained in:
e-lie 2018-09-02 13:02:45 +00:00 committed by elie
parent 440f18dea3
commit 806c44a012
3 changed files with 11 additions and 13 deletions

View file

@ -561,6 +561,12 @@ input[type='radio'].nice-radio {
.app-card { .app-card {
margin: 2%; margin: 2%;
width: 96%; width: 96%;
.btn-group {
width: 100%;
.btn{
margin-left: 0;
}
}
} }
#app-filter-input{ #app-filter-input{
@ -599,14 +605,6 @@ input[type='radio'].nice-radio {
margin-top: -5px; margin-top: -5px;
} }
.btn-group {
width: 100%;
.btn:first-child{
}
.btn:last-child{
margin-left: 0;
}
}
.panel-body { .panel-body {
padding: 1.5rem; padding: 1.5rem;

View file

@ -78,13 +78,13 @@
var apps = [] var apps = []
$.each(data['apps'], function(k, v) { $.each(data['apps'], function(k, v) {
var state = dataraw[v['id']]['state']; var state = dataraw[v['id']]['state'];
var isWorking = (state === 'working' || state === 'validated'); var levelFormatted = parseInt(dataraw[v['id']]['level']);
var isWorking = (state === 'working' || state === 'validated') && levelFormatted > 0;
// Keep only the first instance of each app and remove community not working apps // Keep only the first instance of each app and remove community not working apps
if (!v['id'].match(/__[0-9]{1,5}$/) && (dataraw[v['id']]['repository'] === 'yunohost' || state !== 'notworking')) { if (!v['id'].match(/__[0-9]{1,5}$/) && (dataraw[v['id']]['repository'] === 'yunohost' || state !== 'notworking')) {
dataraw[v['id']]['installable'] = (!v['installed'] || dataraw[v['id']].manifest.multi_instance) dataraw[v['id']]['installable'] = (!v['installed'] || dataraw[v['id']].manifest.multi_instance)
dataraw[v['id']]['status'] = (dataraw[v['id']]['repository'] === 'yunohost') ? 'official' : 'community'; dataraw[v['id']]['status'] = (dataraw[v['id']]['repository'] === 'yunohost') ? 'official' : 'community';
levelFormatted = parseInt(dataraw[v['id']]['level']);
dataraw[v['id']]['levelFormatted'] = isNaN(levelFormatted) ? '?' : levelFormatted; dataraw[v['id']]['levelFormatted'] = isNaN(levelFormatted) ? '?' : levelFormatted;
dataraw[v['id']]['levelColor'] = levelToColor(levelFormatted); dataraw[v['id']]['levelColor'] = levelToColor(levelFormatted);
dataraw[v['id']]['stateColor'] = stateToColor(state); dataraw[v['id']]['stateColor'] = stateToColor(state);

View file

@ -51,14 +51,14 @@
{{^maintained}}<i class="fas fa-warning"></i> {{t 'unmaintained'}}{{/maintained}} {{^maintained}}<i class="fas fa-warning"></i> {{t 'unmaintained'}}{{/maintained}}
</div> </div>
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<a href="{{git.url}}" target="_BLANK" type="button" role="button" class="btn btn-default col-sm-4"> <a href="{{git.url}}" target="_BLANK" type="button" role="button" class="btn btn-default col-xs-4">
<i class="fa-globe"></i> Code <i class="fa-globe"></i> Code
</a> </a>
<a href="{{git.url}}/blob/master/README.md" target="_BLANK" type="button" role="button" class="btn btn-default col-sm-4"> <a href="{{git.url}}/blob/master/README.md" target="_BLANK" type="button" role="button" class="btn btn-default col-xs-4">
<i class="fa-book"></i> Readme <i class="fa-book"></i> Readme
</a> </a>
{{#installable}} {{#installable}}
<a href="#/apps/install/{{id}}" type="button" role="button" class="btn btn-{{installColor}} col-sm-4 active"> <a href="#/apps/install/{{id}}" type="button" role="button" class="btn btn-{{installColor}} col-xs-4 active">
<i class="fa-plus"></i> {{t 'install'}}{{^isSafe}} <i class="fa-warning"></i>{{/isSafe}} <i class="fa-plus"></i> {{t 'install'}}{{^isSafe}} <i class="fa-warning"></i>{{/isSafe}}
</a> </a>
{{/installable}} {{/installable}}