Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

channel edit: replace publish_model by default_affiliation input

  • Loading branch information...
commit d1197a414691221f632f55a0144ad625a35e6f1f 1 parent e101d76
@astro astro authored
View
6 assets/streams.html
@@ -20,13 +20,17 @@
-->
<div class="edits">
<div class="contenteditable">
+ <input id="allowPost" type="checkbox">
+ <label for="allowPost">New followers can post</label>
+ </div>
+ <!--div class="contenteditable">
<select id="channel_publish">
<option value="open">Anyone</option>
<option value="subscribers">Followers</option>
<option value="moderators">Moderators</option>
</select>
<label for="channel_publish">can post</label>
- </div>
+ </div-->
<!--div class="contenteditable">
<label for="userEmail">Email</label>
<input id="userEmail" type="email" value="vera@buddycloud.com" placeholder="Email Adress">
View
12 src/templates/channel/edit.coffee
@@ -14,6 +14,18 @@ module.exports = design (view) ->
return jqueryify new Template schema:5, ->
@$div id: 'editbar', ->
@$div class: 'edits', ->
+ @$div class: 'contenteditable', ->
+ @$input id: 'allowPost', ->
+ metadata = view.model.
+ nodes.get_or_create(id: 'posts').metadata
+ set_value = =>
+ default_affiliation = metadata.get('default_affiliation')?.value
+ if default_affiliation is 'publisher'
+ @attr 'checked', 'checked'
+ else
+ @removeAttr 'checked'
+ metadata.bind 'change', set_value
+ set_value()
@$nav class: 'clearfix', ->
@$span class: 'spinner', ->
view.bind('loading:stop', @hide)
View
11 src/views/channel/edit.coffee
@@ -35,9 +35,6 @@ class exports.ChannelEditView extends BaseView
@el.show()
callback?.call(this)
- publish_model = @model.nodes.get('posts').metadata.get('publish_model')?.value
- @$('#channel_publish').val(publish_model)
-
hide: =>
return if @active
@trigger 'update:el', $('<div id="editbar">')
@@ -91,20 +88,22 @@ class exports.ChannelEditView extends BaseView
# whenever multiple ChannelViews are rendered yet hidden.
open = @parent.$('#accessModel').prop 'checked'
access_model = if open then 'open' else 'authorize'
- publish_model = @$('#channel_publish').val()
+ publish_model = 'publishers'
+ default_affiliation = if @$('#allowPost').prop('checked') then 'publisher' else 'member'
+ console.warn "default_affiliation", default_affiliation
# Send to server
async.parallel [ (cb) =>
# Full metadata for posts node
postsnode = @model.nodes.get_or_create id: 'posts'
app.handler.data.set_node_metadata postsnode
- , { title, description, access_model, publish_model }
+ , { title, description, access_model, publish_model, default_affiliation }
, cb
, (cb) =>
# Access model metadata for status node
statusnode = @model.nodes.get_or_create id: 'status'
app.handler.data.set_node_metadata statusnode
- , { access_model }
+ , { access_model, publish_model: 'publishers', default_affiliation: 'member' }
, cb
, (cb) =>
# Update status
Please sign in to comment.
Something went wrong with that request. Please try again.