Permalink
Browse files

create_topic_channel: use default_affiliation instead of publish_model

  • Loading branch information...
1 parent 9a15b5a commit a53f6d4018fdaae406e69b1c4930d6dbfa1e3438 @astro astro committed Feb 28, 2012
@@ -232,10 +232,10 @@ <h2 class="title">Create Channel</h2>
<label for="channel_default_role">Default Role</label>
<div>
<select id="channel_default_role">
- <option value="follower">follower</option>
- <option value="followerPlus">follower+</option>
+ <option value="member">follower</option>
+ <option value="publisher" selected>follower+post</option>
</select>
- <span class="hint followerSelected">
+ <span class="hint followerPlusSelected">
<span class="follower">
can only read your channel
</span>
@@ -2,7 +2,7 @@ unless process.title is 'browser'
return module.exports =
src: "create_topic_channel.html"
select: () ->
- @select "div.channelView", ".location.dual, .role"
+ @select "div.channelView", ".location.dual, .publish"
{ Template } = require 'dynamictemplate'
@@ -13,6 +13,19 @@ module.exports = design (view) ->
return jqueryify new Template schema:5, ->
@$div class:'channelView', ->
@$form class: "stream clearfix", ->
+ @$div class: 'role', ->
+ @$div ->
+ role = null
+ role = @$select id: 'channel_default_role'
+ @$span class: 'hint followerPlusSelected', ->
+ view.bind 'change:role', =>
+ if role.attr('value') is 'publisher'
+ newClass = 'followerPlusSelected'
+ else
+ newClass = 'followerSelected'
+ @attr 'class', @attr('class').
+ replace(/followerSelected|followerPlusSelected/, "") +
+ " #{newClass}"
@$nav class: "bottom clearfix", ->
@$div class: "button callToAction", ->
@@ -336,8 +336,13 @@ Strophe.addConnectionPlugin('buddycloud', {
case 'description':
case 'access_model':
case 'publish_model':
+ case 'creation_date':
config["pubsub#" + key] = value;
break;
+ case 'default_affiliation':
+ case 'channel_type':
+ config["buddycloud#" + key] = value;
+ break;
}
}
return config;
@@ -7,6 +7,7 @@ class exports.CreateTopicChannelView extends BaseView
events:
'click #create_button': 'on_click_create'
+ 'change #channel_default_role': 'on_change_role'
on_click_create: EventHandler ->
if @$('#channel_public_access').prop('checked')
@@ -17,7 +18,8 @@ class exports.CreateTopicChannelView extends BaseView
title: @$('#channel_name').val()
description: @$('#channel_description').val()
access_model: access_model
- publish_model: @$('#channel_publish').val()
+ publish_model: 'publishers'
+ default_affiliation: @$('#channel_default_role').val()
@trigger 'loading:start'
app.handler.data.create_topic_channel metadata, (err, userid) =>
@@ -26,3 +28,6 @@ class exports.CreateTopicChannelView extends BaseView
return
app.router.navigate "#{userid}", true
+
+ on_change_role: =>
+ @trigger 'change:role'

0 comments on commit a53f6d4

Please sign in to comment.