mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
Organization settings: "Default streams" tab view-only support.
This changes the layout of "organization settings" for
non-administrators such that they can view "Default streams" ("Actions"
and the form to add new default stream is not visible).
This commit is contained in:
committed by
Tim Abbott
parent
f1e966bfaa
commit
dc801eb5ed
@@ -122,13 +122,29 @@ function render(template_name, args) {
|
||||
(function admin_default_streams_list() {
|
||||
var html = '<table>';
|
||||
var streams = ['devel', 'trac', 'zulip'];
|
||||
|
||||
// When the logged in user is admin
|
||||
_.each(streams, function (stream) {
|
||||
var args = {stream: {name: stream, invite_only: false}};
|
||||
var args = {stream: {name: stream, invite_only: false},
|
||||
can_modify: true,
|
||||
};
|
||||
html += render('admin_default_streams_list', args);
|
||||
});
|
||||
html += "</table>";
|
||||
var span = $(html).find(".default_stream_name:first");
|
||||
assert.equal(span.text(), "devel");
|
||||
|
||||
// When the logged in user is not admin
|
||||
html = '<table>';
|
||||
_.each(streams, function (stream) {
|
||||
var args = {stream: {name: stream, invite_only: false},
|
||||
can_modify: false,
|
||||
};
|
||||
html += render('admin_default_streams_list', args);
|
||||
});
|
||||
html += "</table>";
|
||||
span = $(html).find(".default_stream_name:first");
|
||||
assert.equal(span.text(), "devel");
|
||||
global.write_handlebars_output("admin_default_streams_list", html);
|
||||
}());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user