From 74712cc30bdf9304334fa65ced2092c9764a33fe Mon Sep 17 00:00:00 2001 From: e-lie Date: Sun, 26 Aug 2018 12:56:56 +0000 Subject: [PATCH] redesign incoming --- src/css/style.less | 57 ++++++++++++++++++++++++----- src/js/yunohost/controllers/apps.js | 20 ++++++++-- src/views/app/app_list_install.ms | 23 +++++------- 3 files changed, 74 insertions(+), 26 deletions(-) diff --git a/src/css/style.less b/src/css/style.less index eb710868..1bcfe573 100644 --- a/src/css/style.less +++ b/src/css/style.less @@ -558,22 +558,56 @@ input[type='radio'].nice-radio { } .app-card { - margin-bottom: 20px; - width: 30%; - float: left; - min-height: 1px; - margin-right: 10px; - margin-left: 10px; - border-radius: 4px; + // margin-bottom: 20px; + // width: 30%; + // float: left; + // min-height: 1px; + // margin-right: 10px; + // margin-left: 10px; + border-radius: .5rem; +} + +.grid { + display: grid; + grid-auto-rows: minmax(125px, auto); + grid-gap: .5rem; +} + +.app-card-desc { + height: 6rem; + overflow: hidden; +} + +.app-card-date-maintainer { + text-align: right; + max-height: 18px; + margin-bottom: 3px; + margin-right: 7px; + margin-top: -5px; } .btn-group { width: 100%; - margin-left: 0px; + .btn:first-child{ + border-bottom-left-radius: .5rem; + } + .btn:last-child{ + border-bottom-right-radius: .5rem; + margin-left: 0; + } } .panel-body { - padding: 15px; + padding: 1.5rem; + + h3 { + margin-top: 0; + margin-bottom: .5rem; + } + + .category { + margin-bottom: .5rem; + } } @@ -619,6 +653,11 @@ input[type='radio'].nice-radio { } } + .grid { + grid-template-columns: repeat(3, 1fr); + grid-gap: 10px; + } + #flashMessage { position: fixed; top: 0; diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index b1fe4cab..29104edd 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -17,6 +17,18 @@ }); }); + function levelToColor(level){ + if (level > 6){ + return 'success' + } + else if (level > 2){ + return 'warning' + } + else { + return 'danger' + } + } + // List available apps app.get('#/apps/install', function (c) { c.api('/apps', function(data) { // http://api.yunohost.org/#!/app/app_list_get_8 @@ -27,12 +39,12 @@ if ((!v['installed'] || dataraw[v['id']].manifest.multi_instance) && !v['id'].match(/__[0-9]{1,5}$/)) { // Check app source dataraw[v['id']]['official'] = (dataraw[v['id']]['repository'] == 'yunohost'); + dataraw[v['id']]['color'] = levelToColor(dataraw[v['id']]['level']) jQuery.extend(dataraw[v['id']], v); apps.push(dataraw[v['id']]); } }); - // Sort app list c.arraySortById(apps); c.view('app/app_list_install', {apps: apps}); @@ -681,7 +693,7 @@ c.view('app/app_changelabel', data); }); }); - + // Change app label app.post('#/apps/:app/changelabel', function (c) { params = {'new_label': c.params['label']}; @@ -718,7 +730,7 @@ }); }); }); - + // Change app URL app.post('#/apps/:app/changeurl', function (c) { c.confirm( @@ -736,5 +748,5 @@ c.redirect('#/apps/'+ c.params['app'] + '/changeurl'); } ); - }); + }); })(); diff --git a/src/views/app/app_list_install.ms b/src/views/app/app_list_install.ms index 5b1b8654..3db753e9 100644 --- a/src/views/app/app_list_install.ms +++ b/src/views/app/app_list_install.ms @@ -15,32 +15,29 @@
-
+
{{#apps}} -
+

{{name}}

-
{{level}} +
{{level}} validated AGPL-3.0
{{description}}
- 10 April 2018 - - aymhce + 10 April 2018 - + aymhce