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 +4 -4
- data/app/assets/javascripts/xforum/forum_admin.js.coffee +44 -4
- data/app/models/xforum/category.rb +3 -3
- data/app/models/xforum/forum.rb +6 -5
- data/app/models/xforum/topic.rb +3 -3
- data/app/views/xforum/admin_lists/_admins_edit_lists.html.erb +5 -0
- data/config/locales/forum.de.yml +3 -1
- data/config/locales/forum.en.yml +3 -1
- data/config/locales/forum.es.yml +3 -1
- data/config/locales/forum.fr.yml +3 -1
- data/db/migrate/20140813300_add_is_moderated_to_category_topics.rb +6 -0
- data/lib/xforum/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d41a0792d86f523f5cd6e101d5a122968c528a1e
|
4
|
+
data.tar.gz: 0e7084ef6a0a2678fef31d1daee19251df18e069
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
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.
|
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.
|
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
|
-
|
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?
|
data/app/models/xforum/forum.rb
CHANGED
@@ -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
|
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=
|
82
|
-
when 'new'
|
83
|
-
|
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
|
-
|
87
|
+
test
|
87
88
|
}
|
88
89
|
the_list=new_list
|
89
90
|
end
|
data/app/models/xforum/topic.rb
CHANGED
@@ -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>
|
data/config/locales/forum.de.yml
CHANGED
data/config/locales/forum.en.yml
CHANGED
data/config/locales/forum.es.yml
CHANGED
data/config/locales/forum.fr.yml
CHANGED
data/lib/xforum/version.rb
CHANGED
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.
|
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-
|
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
|