From 0816cf91422346313d44cba5f017125899afbf2d Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Mon, 30 Mar 2015 15:58:20 +0200 Subject: Add experimental applications switch Allows administrators to disable or enabled experimental applications as well as show the trust level. --- settings/js/apps.js | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'settings/js') diff --git a/settings/js/apps.js b/settings/js/apps.js index 3db84e8acd5..f54611369b3 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -9,6 +9,17 @@ Handlebars.registerHelper('score', function() { } return new Handlebars.SafeString(''); }); +Handlebars.registerHelper('level', function() { + if(typeof this.level !== 'undefined') { + if(this.level === 200) { + return new Handlebars.SafeString('Official'); + } else if(this.level === 100) { + return new Handlebars.SafeString('Approved'); + } else { + return new Handlebars.SafeString('Experimental'); + } + } +}); OC.Settings = OC.Settings || {}; OC.Settings.Apps = OC.Settings.Apps || { @@ -73,7 +84,6 @@ OC.Settings.Apps = OC.Settings.Apps || { this._loadCategoryCall = $.ajax(OC.generateUrl('settings/apps/list?category={categoryId}', { categoryId: categoryId }), { - data:{}, type:'GET', success: function (apps) { OC.Settings.Apps.State.apps = _.indexBy(apps.apps, 'id'); @@ -81,13 +91,27 @@ OC.Settings.Apps = OC.Settings.Apps || { var template = Handlebars.compile(source); if (apps.apps.length) { + apps.apps.sort(function(a,b) { + return b.level - a.level; + }); + + var firstExperimental = false; _.each(apps.apps, function(app) { - OC.Settings.Apps.renderApp(app, template, null); + if(app.level === 0 && firstExperimental === false) { + firstExperimental = true; + OC.Settings.Apps.renderApp(app, template, null, true); + } else { + OC.Settings.Apps.renderApp(app, template, null, false); + } }); } else { $('#apps-list').addClass('hidden'); $('#apps-list-empty').removeClass('hidden'); } + + $('.app-level .official').tipsy({fallback: t('core', 'Official apps are developed by and within the ownCloud community and its GitHub repository and offer functionality central to ownCloud. They are ready for serious use.')}); + $('.app-level .approved').tipsy({fallback: t('core', 'Approved apps are developed by trusted developers and have passed a cursory security check. They are actively maintained in an open code repository and their maintainers deem them to be stable for casual to normal use.')}); + $('.app-level .experimental').tipsy({fallback: t('core', 'This app is not checked for security issues and is new or known to be unstable. Install on your own risk.')}); }, complete: function() { $('#apps-list').removeClass('icon-loading'); @@ -95,7 +119,7 @@ OC.Settings.Apps = OC.Settings.Apps || { }); }, - renderApp: function(app, template, selector) { + renderApp: function(app, template, selector, firstExperimental) { if (!template) { var source = $("#app-template").html(); template = Handlebars.compile(source); @@ -103,6 +127,7 @@ OC.Settings.Apps = OC.Settings.Apps || { if (typeof app === 'string') { app = OC.Settings.Apps.State.apps[app]; } + app.firstExperimental = firstExperimental; var html = template(app); if (selector) { @@ -438,6 +463,16 @@ OC.Settings.Apps = OC.Settings.Apps || { $select.change(); }); + $(document).on('click', '#enable-experimental-apps', function () { + var state = $('#enable-experimental-apps').prop('checked'); + $.ajax(OC.generateUrl('settings/apps/experimental'), { + data: {state: state}, + type: 'POST', + success:function () { + location.reload(); + } + }); + }); } }; -- cgit v1.2.3 From 6250365bf4e72c72427cb45213c185f1bd724963 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Tue, 7 Apr 2015 11:55:10 +0200 Subject: app mgmt app level design enhancements --- core/css/styles.css | 2 +- settings/css/settings.css | 60 +++++++++++++++++++++++++-------------------- settings/js/apps.js | 2 +- settings/templates/apps.php | 11 +++------ 4 files changed, 39 insertions(+), 36 deletions(-) (limited to 'settings/js') diff --git a/core/css/styles.css b/core/css/styles.css index cbce78c525b..b1df8d1a8a2 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -670,7 +670,7 @@ label.infield { } .warning-input { - border-color: #cc3333 !important; + border-color: #ce3702 !important; } /* Fixes for log in page, TODO should be removed some time */ diff --git a/settings/css/settings.css b/settings/css/settings.css index eb6b0f54053..999a7f9ea4a 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -194,38 +194,42 @@ input.userFilter {width: 200px;} background: #fbb; } -.recommendedapp { - font-size: 11px; - background-position: left center; - padding-left: 18px; - vertical-align: top; +span.version { + margin-left: 1em; + margin-right: 1em; + color: #555; } -span.version { margin-left:1em; margin-right:1em; color:#555; } #app-navigation .app-external, -.app-version, -.recommendedapp { +.app-version { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; filter: alpha(opacity=50); opacity: .5; } .app-level { - color: white; + margin-top: 8px; } - -.app-level .official, .app-level .approved { - background-color: #E8C805; - border-radius: 2px; - margin-left: 5px; - padding: 3px; +.app-level span { + color: #555; + background-color: transparent; + border: 1px solid #555; + border-radius: 3px; + padding: 3px 6px; +} +.app-level .official { + border-color: #37ce02; + background-position: left center; + background-position: 5px center; + padding-left: 25px; +} +.app-level .approved { + border-color: #e8c805; } - .app-level .experimental { - background-color: #F02405; - border-radius: 2px; - margin-left: 5px; - padding: 3px; + background-color: #ce3702; + border-color: #ce3702; + color: #fff; } #apps-list { @@ -235,6 +239,9 @@ span.version { margin-left:1em; margin-right:1em; color:#555; } .section { position: relative; } +.section h2.app-name { + margin-bottom: 8px; +} .app-image { float: left; padding-right: 10px; @@ -254,8 +261,7 @@ span.version { margin-left:1em; margin-right:1em; color:#555; } .app-name, .app-version, .app-score, -.app-level, -.recommendedapp { +.app-level { display: inline-block; } @@ -286,7 +292,7 @@ span.version { margin-left:1em; margin-right:1em; color:#555; } .app-dependencies { margin-top: 10px; - color: #c33; + color: #ce3702; } .missing-dependencies { @@ -321,7 +327,7 @@ table.grid td.date{ #security-warning li { list-style: initial; margin: 10px 0; - color: #c33; + color: #ce3702; } #shareAPI p { padding-bottom: 0.8em; } #shareAPI input#shareapiExpireAfterNDays {width: 25px;} @@ -372,12 +378,12 @@ table.grid td.date{ } span.success { - background: #37ce02; - border-radius: 3px; + background: #37ce02; + border-radius: 3px; } span.error { - background: #ce3702; + background: #ce3702; } diff --git a/settings/js/apps.js b/settings/js/apps.js index f54611369b3..8afde558709 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -12,7 +12,7 @@ Handlebars.registerHelper('score', function() { Handlebars.registerHelper('level', function() { if(typeof this.level !== 'undefined') { if(this.level === 200) { - return new Handlebars.SafeString('Official'); + return new Handlebars.SafeString('Official'); } else if(this.level === 100) { return new Handlebars.SafeString('Approved'); } else { diff --git a/settings/templates/apps.php b/settings/templates/apps.php index b9459e0bd54..1629a46416d 100644 --- a/settings/templates/apps.php +++ b/settings/templates/apps.php @@ -59,9 +59,6 @@ script( {{/if}}

{{name}}

{{version}}
-
- {{{level}}} -
{{#if profilepage}}{{/if}}
t('by')); ?> {{author}} {{#if licence}} @@ -72,9 +69,9 @@ script( {{#if score}}
{{{score}}}
{{/if}} - {{#if internalclass}} -
{{internallabel}}
- {{/if}} +
+ {{{level}}} +
-
+
>

-- cgit v1.2.3 From 0cd29e00d1040a32be95314178c77ec50c1dded3 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 8 Apr 2015 21:24:03 +0200 Subject: Fix wording --- config/config.sample.php | 2 +- settings/js/apps.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'settings/js') diff --git a/config/config.sample.php b/config/config.sample.php index f17473b7d80..2032994cc27 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -577,7 +577,7 @@ $CONFIG = array( 'appstoreurl' => 'https://api.owncloud.com/v1', /** - * Whether to experimental apps in the appstore interface + * Whether to show experimental apps in the appstore interface * * Experimental apps are not checked for security issues and are new or known * to be unstable and under heavy development. Installing these can cause data diff --git a/settings/js/apps.js b/settings/js/apps.js index 8afde558709..cd69fe1c28f 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -109,7 +109,7 @@ OC.Settings.Apps = OC.Settings.Apps || { $('#apps-list-empty').removeClass('hidden'); } - $('.app-level .official').tipsy({fallback: t('core', 'Official apps are developed by and within the ownCloud community and its GitHub repository and offer functionality central to ownCloud. They are ready for serious use.')}); + $('.app-level .official').tipsy({fallback: t('core', 'Official apps are developed by and within the ownCloud community. They offer functionality central to ownCloud and are ready for production use.')}); $('.app-level .approved').tipsy({fallback: t('core', 'Approved apps are developed by trusted developers and have passed a cursory security check. They are actively maintained in an open code repository and their maintainers deem them to be stable for casual to normal use.')}); $('.app-level .experimental').tipsy({fallback: t('core', 'This app is not checked for security issues and is new or known to be unstable. Install on your own risk.')}); }, -- cgit v1.2.3 From eb1cf58d11a6514261eb11abde37ed924cfa8a51 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 8 Apr 2015 21:26:12 +0200 Subject: Reference `$(this)` instead --- settings/js/apps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'settings/js') diff --git a/settings/js/apps.js b/settings/js/apps.js index cd69fe1c28f..1bd7ffdf790 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -464,7 +464,7 @@ OC.Settings.Apps = OC.Settings.Apps || { }); $(document).on('click', '#enable-experimental-apps', function () { - var state = $('#enable-experimental-apps').prop('checked'); + var state = $(this).prop('checked') $.ajax(OC.generateUrl('settings/apps/experimental'), { data: {state: state}, type: 'POST', -- cgit v1.2.3