xforum 0.0.372 → 0.0.373

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d76a2c0955075babe121fdcbc5c4b10a0776a46
4
- data.tar.gz: 0ad69779618221c41f6253d82376dac01e1a1dd6
3
+ metadata.gz: d41a0792d86f523f5cd6e101d5a122968c528a1e
4
+ data.tar.gz: 0e7084ef6a0a2678fef31d1daee19251df18e069
5
5
  SHA512:
6
- metadata.gz: b330908427c98178c107d67e3909a4ae233c9f64e52fbe501bb8f90f237e78a2de35e35342626447fa40a170c32b41961ddc0ab0df203157e3f7afb09279b896
7
- data.tar.gz: 69ca03ac90092844a24151d8470e7f3ed8cc9f39c3b929740720464c81ba5644196e752dc375ddb71ad842e0e9177f9a1096ea005f53eb5dc790dc9b38849b0c
6
+ metadata.gz: 2303f14698428456128f29dd44f9b258df5aa249f37479db61a5957a78697e3647499b45031ca95dcec88622c281fc467ed7c5e831dcfece7fbeec8b98cc1570
7
+ data.tar.gz: e91455ca524b2af719a0ff75e2d82441b9ce734ef2cd5ad24e1c48aa76c595cb475054b9ea9d0f46a8a53c5c2e479db6af606810f1a3b7c5bf1c6d411da10f6c
@@ -22,6 +22,8 @@ jQuery ->
22
22
  event.stopPropagation()
23
23
  $('#forum-senate-admin-users').delegate '[id = forum-admin-list-option]','click', (evt) ->
24
24
  setSelections(event.target)
25
+ $('#forum-senate-admin-lists').delegate '[id = set-moderation]','click', (evt) ->
26
+ changeModeration(event.target)
25
27
  $('#forum-category-admin').change ->
26
28
  getAdminsTopic()
27
29
  $('#forum-actions').change ->
@@ -145,6 +147,7 @@ window.doAdminStuff = ->
145
147
 
146
148
 
147
149
  setAdminDisplay=->
150
+ hideModerating()
148
151
  hideMe({id: 'review-forum-span'})
149
152
  hideMe({id: 'forum-senate'})
150
153
  showMe({id: 'forum-senate-admin'})
@@ -361,7 +364,7 @@ addCancel=(params)->
361
364
  $("[id = forum-add-admin-user]").val('me')
362
365
 
363
366
  openEditObject = (which_one)->
364
- id=which_one.dataset.id
367
+ id=which_one.dataset.admin_list_id
365
368
  parent = which_one.parentNode
366
369
  line=parent.children[CHILD_EDIT_ENTRY].children[0]
367
370
  if which_one.dataset.state == 'edit'
@@ -371,6 +374,7 @@ openEditObject = (which_one)->
371
374
  line.value = parent.children[CHILD_EDIT_ITEM].innerHTML
372
375
  hideMe({obj:parent.children[CHILD_EDIT_ITEM]})
373
376
  line.focus()
377
+ addModerate(which_one)
374
378
  else if which_one.dataset.state == 'save'
375
379
  which_one.dataset.state = 'edit'
376
380
  newline = line.value
@@ -380,7 +384,42 @@ openEditObject = (which_one)->
380
384
  unless newline == ''
381
385
  translating=which_one.parentNode.parentElement.dataset.translating
382
386
  parent.children[CHILD_EDIT_ITEM].innerHTML = newline
383
- $.post('xforum/forum_ajax',{function:'edit forum object',id:id,newline:newline,which_list:which_one.parentNode.parentElement.id, translating:translating})
387
+ request={function:'edit forum object',id:id,newline:newline,which_list:which_one.parentNode.parentElement.id, translating:translating}
388
+ request.moderate_me= which_one.dataset.moderated
389
+ hideModerating()
390
+ $.post('xforum/forum_ajax',request)
391
+
392
+ changeModeration=(target)->
393
+ id=target.dataset.target
394
+ b_target= $('[data-admin_list_id='+id+']')
395
+ for i in [0...b_target.length]
396
+ if b_target[i].id='edit-forum-object'
397
+ b_target[i].dataset.moderated=b_target[i].dataset.moderated=='false'
398
+
399
+
400
+ hideModerating=->
401
+ hideMe({name:'moderate-category'})
402
+ hideMe({name:'moderate-topic'})
403
+ hideMe({name:'un-moderate-category'})
404
+ hideMe({name:'un-moderate-topic'})
405
+
406
+
407
+ addModerate=(which_one)->
408
+ if which_one.dataset.moderated=='true'
409
+ if which_one.dataset.parent=='category-list'
410
+ showMe({name:'un-moderate-category'})
411
+ $('[name=un-moderate-category]')[0].dataset.target=which_one.dataset.admin_list_id
412
+ else
413
+ showMe({name:'un-moderate-topic'})
414
+ $('[name=un-moderate-topic]')[0].dataset.target=which_one.dataset.admin_list_id
415
+ else
416
+ if which_one.dataset.parent=='category-list'
417
+ showMe({name:'moderate-category'})
418
+ $('[name=moderate-category]')[0].dataset.target=which_one.dataset.admin_list_id
419
+ else
420
+ showMe({name:'moderate-topic'})
421
+ $('[name=moderate-topic]')[0].dataset.target=which_one.dataset.admin_list_id
422
+
384
423
 
385
424
  getAdminCategories = ->
386
425
  $.post('xforum/forum_ajax',{function:'get categories',category:select,language:getLanguage(),list,'category',hold_test:false,restriced:false},loadAdminsList)
@@ -425,16 +464,17 @@ addListEntry = (which,vars)->
425
464
  i = document.getElementById(which).children.length
426
465
  ref = document.getElementById(which).children[i-1]
427
466
  tag = which.split('-')[1]
428
- entry.children[CHILD_DEL].dataset.id = vars.id
467
+ entry.children[CHILD_DEL].dataset.admin_list_id = vars.id
429
468
  entry.children[CHILD_DEL].dataset.target = 'list-item-'+tag+'-'+i
430
469
  if vars.inert
431
470
  $(entry.children[CHILD_DEL]).val('----')
432
471
  else
433
472
  entry.children[CHILD_DEL].id = 'delete-forum-object'
434
473
  entry.children[CHILD_DEL].value= entry.children[CHILD_DEL].dataset.del
435
- entry.children[CHILD_EDIT].dataset.id = vars.id
474
+ entry.children[CHILD_EDIT].dataset.admin_list_id = vars.id
436
475
  entry.children[CHILD_EDIT].dataset.target = 'list-item-'+tag+'-'+i
437
476
  entry.children[CHILD_EDIT].dataset.state = 'edit'
477
+ entry.children[CHILD_EDIT].dataset.moderated = vars.is_moderated
438
478
  entry.children[CHILD_EDIT_ITEM].innerHTML = vars.item
439
479
  entry.children[CHILD_EDIT_ITEM].id = 'list-item-'+tag+'-'+i
440
480
  entry.children[CHILD_EDIT_ENTRY].children[0].id="edit-entry-#{vars.id}"
@@ -43,7 +43,7 @@ module Xforum
43
43
  end
44
44
 
45
45
  def self.edit_category(params,user)
46
- Category.where(id: params[:id]).update_all(name:params[:newline]) if user.forum_admin?
46
+ Category.where(id: params[:id]).update_all(name: params[:newline], is_moderated: params[:moderate_me]=='true') if user.forum_admin?
47
47
  end
48
48
  def self.suggestion(params,user) #add new category or topic
49
49
  Category.create(suggestion:true,name:params[:suggestion],user_id:user.id)
@@ -63,8 +63,8 @@ module Xforum
63
63
  end
64
64
 
65
65
  params[:hold_test]=='true' ?
66
- category_list= Category.grab({closed:false,suggestion:false},[:id,:name,:closed,:restricted],{}) :
67
- category_list= Category.grab('all',[:id,:name,:closed,:restricted],{})
66
+ category_list= Category.grab({closed:false,suggestion:false},[:id,:name,:closed,:restricted,:is_moderated],{}) :
67
+ category_list= Category.grab('all',[:id,:name,:closed,:restricted,:is_moderated],{})
68
68
  category_list=ForumAssist.make_last(category_list.clone, {key: :id,ref:Category.where(name:'request new category').pluck(:id)[0]})
69
69
  category_list=ForumAssist.make_first(category_list.clone,{key: :id,ref:Category.where(name:'select category').pluck(:id)[0]})
70
70
  category_list=PeopleList.check_restrictions(category_list.clone,user,'categories') unless user.forum_admin?
@@ -75,15 +75,16 @@ module Xforum
75
75
  parent=set_new_senate_entry(senate_list,new_list,parent,user.id, {moderator:moderator,vote:voting[:vote],votes:votes,subscribed:subscribed,admin:user.forum_admin?}) unless parent.nil?
76
76
  Forum.is_child_there?(senate_list,new_list,0,parent,user.id) #push first child
77
77
  new_list.delete_if {|record|
78
- test=PeopleList.check_people_list({topic:record[:id], user_id:user.id,list:'invitation'}) if (record[:restricted] && !record[:owner])
78
+ test=!PeopleList.check_people_list({topic:record[:id], user_id:user.id,list:'invitation'}) if (record[:restricted] && !record[:owner])
79
79
  if test.nil?
80
80
  case record[:state]
81
- when 'reject' then test= false
82
- when 'new' then test= !(ENV['XFORUM_NEW_RULE']=='no')
83
- else test=true
81
+ when 'reject' then test= true
82
+ when 'new'
83
+ ENV['XFORUM_NEW_RULE']=='no' || Topic.where(id:topic_id).is_moderated
84
+ else test=false
84
85
  end
85
86
  end
86
- !test
87
+ test
87
88
  }
88
89
  the_list=new_list
89
90
  end
@@ -23,8 +23,8 @@ module Xforum
23
23
  unless params[:category] == 'select category'
24
24
  category_id=Category.where(name:params[:category]).pluck(:id)[0]
25
25
  params[:hold_test]=='true' ?
26
- topics=Topic.grab({category_id:category_id,closed:false,suggestion:false}, [:id,:name,:state,:restricted,:closed],{swap:{name: :item}}) :
27
- topics=Topic.grab({category_id:category_id}, [:id,:name,:state,:restricted,:closed],{swap:{name: :item}})
26
+ topics=Topic.grab({category_id:category_id,closed:false,suggestion:false}, [:id,:name,:state,:restricted,:closed,:is_moderated],{swap:{name: :item}}) :
27
+ topics=Topic.grab({category_id:category_id}, [:id,:name,:state,:restricted,:closed,:is_moderated],{swap:{name: :item}})
28
28
  topics=[] if topics[0][:id].nil?
29
29
  topics=PeopleList.check_restrictions(topics,user,'topic') unless user.forum_admin?
30
30
  a=Topic.grab({name:'select topic'},[:id,:name,:state,:restricted,:closed],{swap:{name: :item}})[0]
@@ -139,7 +139,7 @@ module Xforum
139
139
  end
140
140
 
141
141
  def self.edit_topic(params,user)
142
- Topic.where(id: params[:id]).update_all(name:params[:newline]) if user.forum_admin?
142
+ Topic.where(id: params[:id]).update_all(name: params[:newline], is_moderated: params[:moderate_me]=='true') if user.forum_admin?
143
143
  end
144
144
 
145
145
  def self.remove_object(params,user)
@@ -44,6 +44,9 @@
44
44
  data-state='add' data-add= "<%= t('xForum.Add_Category')%>" data-save= "<%= t('xForum.save')%>" value= "<%= t('xForum.Add_Category')%>" >
45
45
  <input class='blue-ellipse comment-btn' type='button' id=forum-admin-button name= 'forum-translate-category'
46
46
  data-state='translate' data-translate= "<%= t('xForum.Translate')%>" data-done= "<%= t('xForum.Done')%>" value= "<%= t('xForum.Translate')%>" >
47
+ <input class='red-ellipse comment-btn' name='moderate-category' type="button" id="set-moderation" value="<%=t('xForum.moderate')%>">
48
+ <input class='red-ellipse comment-btn' name='un-moderate-category' type="button" id="set-moderation" value="<%=t('xForum.stop_moderating')%>">
49
+
47
50
  <input class='red-ellipse comment-btn' type="button" id="restrict-category" data-submit= "<%=t('xForum.Submit')%>" data-restrict="<%=t('xForum.Restrict')%>" value="<%=t('xForum.Restrict')%>">
48
51
  <input class='red-ellipse comment-btn' type='button' id=forum-admin-button name= 'forum-add-cancel'
49
52
  data-who='category' value= "<%= t('xForum.Cancel')%>" >
@@ -55,6 +58,8 @@
55
58
  <input class='blue-ellipse comment-btn' type='button' id=forum-admin-button name= 'forum-translate-topic'
56
59
  data-state='translate' data-translate= "<%= t('xForum.Translate')%>" data-done= "<%= t('xForum.Done')%>" value= "<%= t('xForum.Translate')%>" >
57
60
  <input class='red-ellipse comment-btn' type="button" id="restrict-topic" data-submit= "<%=t('xForum.Submit')%>" data-restrict="<%=t('xForum.Restrict')%>" value="<%=t('xForum.Restrict')%>">
61
+ <input class='red-ellipse comment-btn' name='moderate-topic' type="button" id="set-moderation" value="<%=t('xForum.moderate')%>">
62
+ <input class='red-ellipse comment-btn' name='un-moderate-topic' type="button" id="set-moderation" value="<%=t('xForum.stop_moderating')%>">
58
63
  <input class='red-ellipse comment-btn' type='button' id= 'forum-admin-button' name='forum-add-cancel'
59
64
  data-who='topic' value= "<%= t('xForum.Cancel')%>" >
60
65
  </span>
@@ -91,4 +91,6 @@ de:
91
91
  select_category: Kategorie auswählen
92
92
  Replay: Wiederholung
93
93
  Back: Zurück
94
- Action: "Forum Action"
94
+ Action: Forum Action
95
+ stop_moderating: mäßig
96
+ moderate: stoppen mäßig
@@ -93,4 +93,6 @@ en:
93
93
  Replay: Replay
94
94
  Back: Back
95
95
  Action: Action
96
- New: New
96
+ New: New
97
+ stop_moderating: stop moderating
98
+ moderate: moderate
@@ -91,4 +91,6 @@ es:
91
91
  select_topic: seleccione tema
92
92
  select_category: Elije categoría
93
93
  Replay: Repetición
94
- Back: Atrás
94
+ Back: Atrás
95
+ stop_moderating: moderada
96
+ moderate: dejar de moderar
@@ -91,4 +91,6 @@ fr:
91
91
  select_topic: sélectionnez le sujet
92
92
  select_category: de choisir une catégorie
93
93
  Replay: Rejouer
94
- Back: Arrière
94
+ Back: Arrière
95
+ stop_moderating: modéré
96
+ moderate: arrêter modérateur
@@ -0,0 +1,6 @@
1
+ class AddHasVideoToPhoto < ActiveRecord::Migration
2
+ def change
3
+ add_column :xforum_topics, :is_moderated, :boolean, default:false
4
+ add_column :xforum_categories, :is_moderated, :boolean, default:false
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module Xforum
2
- VERSION = '0.0.372'
2
+ VERSION = '0.0.373'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xforum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.372
4
+ version: 0.0.373
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert D Blanton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-28 00:00:00.000000000 Z
11
+ date: 2014-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3
@@ -251,6 +251,7 @@ files:
251
251
  - db/migrate/20140602_add_restricted_to_category.rb
252
252
  - db/migrate/20140603_change_suggestion_default.rb
253
253
  - db/migrate/20140604_add_has_video_to_photo.rb
254
+ - db/migrate/20140813300_add_is_moderated_to_category_topics.rb
254
255
  - lib/active_record_extension.rb
255
256
  - lib/tasks/xforum_tasks.rake
256
257
  - lib/xforum.rb