Introduce the sso marker for postInstallMessage

The marker is "=== sso ==="
The part before the marker is shown if sso i disabled,
the remaining part is shown when sso is enabled.

If no marker is found, the whole text is shown
This commit is contained in:
Johannes
2016-11-24 15:33:45 +01:00
parent 14ef7688b8
commit 2ca12db362
3 changed files with 17 additions and 2 deletions

View File

@@ -235,6 +235,21 @@ app.filter('markdown2html', function () {
};
});
app.filter('postInstallMessage', function () {
var SSO_MARKER = '=== sso ===';
return function (text, app) {
if (!app) return text;
var parts = text.split(SSO_MARKER);
if (parts.length === 1) return text;
if (app.sso) return parts[1];
else return parts[0];
};
});
// keep this in sync with eventlog.js
var ACTION_ACTIVATE = 'cloudron.activate';
var ACTION_APP_CONFIGURE = 'app.configure';

View File

@@ -220,7 +220,7 @@
</div>
<div class="modal-body">
<div class="app-postinstall-message">
<div ng-bind-html="appPostInstall.message | markdown2html"></div>
<div ng-bind-html="appPostInstall.message | postInstallMessage:appPostInstall.app | markdown2html"></div>
</div>
</div>
<div class="modal-footer">

View File

@@ -124,7 +124,7 @@
</div>
<div class="collapse" id="postInstallMessage" data-toggle="false">
<div class="appstore-install-description">
<div ng-bind-html="appInstall.app.manifest.postInstallMessage | markdown2html"></div>
<div ng-bind-html="appInstall.app.manifest.postInstallMessage | postInstallMessage:appInstall.app | markdown2html"></div>
</div>
</div>
</div>