invite: Draw lock by invite-only streams (and don't select by default).

(imported from commit 1ad8a033801f70d3c6491691eebef79bbce82b77)
This commit is contained in:
Waseem Daher 2013-02-06 20:15:12 -05:00
parent a44aa44e6c
commit e98b4b9f1e
2 changed files with 9 additions and 4 deletions

View File

@ -2,9 +2,11 @@
<a href="#" onclick="invite.set_all_streams(event, true);">Check all</a> |
<a href="#" onclick="invite.set_all_streams(event, false);">Uncheck all</a>
<div id="stream-checkboxes">
{{#each subscriptions}}
{{#each streams}}
<label class="checkbox">
<input type="checkbox" name="stream" value="{{this}}" checked="true"> {{this}}
<input type="checkbox" name="stream" value="{{name}}"
{{#unless invite_only}}checked="true"{{/unless}}> {{name}}
{{#if invite_only}}<i class="icon-lock"></i>{{/if}}
</label>
{{/each}}
</div>

View File

@ -7,8 +7,11 @@ function update_subscription_checkboxes() {
// stream list has actually changed; that way, the settings of the
// checkboxes are saved from invocation to invocation (which is
// nice if I want to invite a bunch of people at once)
$('#streams_to_add').html(templates.invite_subscription({subscriptions:
subs.subscribed_streams()}));
var streams = [];
$.each(subs.subscribed_streams(), function (index, value) {
streams.push({name: value, invite_only: subs.get_invite_only(value)});
});
$('#streams_to_add').html(templates.invite_subscription({streams: streams}));
}
function reset_error_messages() {