skinny_forum 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +92 -0
- data/MIT-LICENSE +20 -0
- data/README.md +29 -0
- data/README.rdoc +3 -0
- data/Rakefile +34 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/images/skinny_forum/.keep +0 -0
- data/app/assets/images/skinny_forum/internet.png +0 -0
- data/app/assets/images/skinny_forum/myphoto.jpg +0 -0
- data/app/assets/images/skinny_forum/silver_selector.png +0 -0
- data/app/assets/javascripts/skinnyforum/application.js +22 -0
- data/app/assets/javascripts/skinnyforum/forum_admin.js.coffee +433 -0
- data/app/assets/javascripts/skinnyforum/forum_basic.js.coffee +269 -0
- data/app/assets/javascripts/skinnyforum/forum_translator.js.coffee +113 -0
- data/app/assets/javascripts/skinnyforum/forum_user.js.coffee +394 -0
- data/app/assets/javascripts/skinnyforum/global_java.js +141 -0
- data/app/assets/stylesheets/skinnyforum/application.css.scss +25 -0
- data/app/assets/stylesheets/skinnyforum/custom.css.scss +289 -0
- data/app/controllers/skinnyforum/application_controller.rb +24 -0
- data/app/controllers/skinnyforum/forums_controller.rb +130 -0
- data/app/helpers/skinnyforum/application_helper.rb +4 -0
- data/app/mailers/.keep +0 -0
- data/app/mailers/skinnyforum/user_mailer.rb +13 -0
- data/app/models/.keep +0 -0
- data/app/models/skinnyforum/forum.rb +251 -0
- data/app/models/skinnyforum/forum_category.rb +70 -0
- data/app/models/skinnyforum/forum_hyperlink.rb +50 -0
- data/app/models/skinnyforum/forum_language.rb +86 -0
- data/app/models/skinnyforum/forum_people_list.rb +183 -0
- data/app/models/skinnyforum/forum_photo.rb +62 -0
- data/app/models/skinnyforum/forum_topic.rb +137 -0
- data/app/models/skinnyforum/forum_translation.rb +109 -0
- data/app/views/layouts/skinnyforum/application.html.erb +14 -0
- data/app/views/skinnyforum/forums/_dummy.html.erb +0 -0
- data/app/views/skinnyforum/forums/_forum.html.erb +107 -0
- data/app/views/skinnyforum/forums/_forum_admin.html.erb +133 -0
- data/app/views/skinnyforum/forums/newforum_photo.js.erb +1 -0
- data/app/views/skinnyforum/user_mailer/note_to_forum_users.html.erb +32 -0
- data/app_data/forum_base.csv +8 -0
- data/app_data/forum_help.csv +24 -0
- data/app_data/reset cmds +13 -0
- data/config/locales/skinnyforum/forum_de.yml +88 -0
- data/config/locales/skinnyforum/forum_en.yml +88 -0
- data/config/locales/skinnyforum/forum_es.yml +88 -0
- data/config/locales/skinnyforum/forum_fr.yml +88 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20130100_add_users.rb +11 -0
- data/db/migrate/20140601_add_forums.rb +164 -0
- data/lib/skinny_forum.rb +4 -0
- data/lib/skinny_forum/engine.rb +5 -0
- data/lib/skinny_forum/forum_shared_code.rb +94 -0
- data/lib/skinny_forum/version.rb +3 -0
- data/lib/tasks/forum_tasks.rake +52 -0
- data/lib/tasks/skinny_forum_tasks.rake +4 -0
- data/skinny_forum.gemspec +28 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/mailers/.keep +0 -0
- data/test/dummy/app/models/.keep +0 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +23 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +83 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/skinny_forum_test.rb +7 -0
- data/test/test_helper.rb +15 -0
- metadata +234 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 2fbd828fec9a268a15c583a4b8efd898f9faaa65
|
|
4
|
+
data.tar.gz: b59505d064a1edbfac49011bdb039ec4929ecfd2
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 8ce89a3a717822bf77392544901100566dc692bd12acbf4e47be0f311067525e6d72787e3d00506a6ec7ee35ca66769a807cb7922ae111eee338577b17112705
|
|
7
|
+
data.tar.gz: a1e2b9889f777c23a17b852df035171590baf05387102dd17945a6b0504f6453c8682666be1f19bc9388f8f6dd698c4cefb552ac92291ffbc30565663c40c573
|
data/.gitignore
ADDED
data/Gemfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
source "https://rubygems.org"
|
|
2
|
+
|
|
3
|
+
# Declare your gem's dependencies in skinny_forum.gemspec.
|
|
4
|
+
# Bundler will treat runtime dependencies like base dependencies, and
|
|
5
|
+
# development dependencies will be added by default to the :development group.
|
|
6
|
+
gemspec
|
|
7
|
+
|
|
8
|
+
# Declare any dependencies that are still in development here instead of in
|
|
9
|
+
# your gemspec. These might include edge Rails or gems from your path or
|
|
10
|
+
# Git. Remember to move these dependencies to your gemspec before releasing
|
|
11
|
+
# your gem to rubygems.org.
|
|
12
|
+
|
|
13
|
+
# To use debugger
|
|
14
|
+
# gem 'debugger'
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
skinny_forum (0.0.1)
|
|
5
|
+
rails (~> 4.1.1)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
actionmailer (4.1.1)
|
|
11
|
+
actionpack (= 4.1.1)
|
|
12
|
+
actionview (= 4.1.1)
|
|
13
|
+
mail (~> 2.5.4)
|
|
14
|
+
actionpack (4.1.1)
|
|
15
|
+
actionview (= 4.1.1)
|
|
16
|
+
activesupport (= 4.1.1)
|
|
17
|
+
rack (~> 1.5.2)
|
|
18
|
+
rack-test (~> 0.6.2)
|
|
19
|
+
actionview (4.1.1)
|
|
20
|
+
activesupport (= 4.1.1)
|
|
21
|
+
builder (~> 3.1)
|
|
22
|
+
erubis (~> 2.7.0)
|
|
23
|
+
activemodel (4.1.1)
|
|
24
|
+
activesupport (= 4.1.1)
|
|
25
|
+
builder (~> 3.1)
|
|
26
|
+
activerecord (4.1.1)
|
|
27
|
+
activemodel (= 4.1.1)
|
|
28
|
+
activesupport (= 4.1.1)
|
|
29
|
+
arel (~> 5.0.0)
|
|
30
|
+
activesupport (4.1.1)
|
|
31
|
+
i18n (~> 0.6, >= 0.6.9)
|
|
32
|
+
json (~> 1.7, >= 1.7.7)
|
|
33
|
+
minitest (~> 5.1)
|
|
34
|
+
thread_safe (~> 0.1)
|
|
35
|
+
tzinfo (~> 1.1)
|
|
36
|
+
arel (5.0.1.20140414130214)
|
|
37
|
+
builder (3.2.2)
|
|
38
|
+
erubis (2.7.0)
|
|
39
|
+
hike (1.2.3)
|
|
40
|
+
i18n (0.6.9)
|
|
41
|
+
json (1.8.1)
|
|
42
|
+
mail (2.5.4)
|
|
43
|
+
mime-types (~> 1.16)
|
|
44
|
+
treetop (~> 1.4.8)
|
|
45
|
+
mime-types (1.25.1)
|
|
46
|
+
minitest (5.3.4)
|
|
47
|
+
multi_json (1.10.1)
|
|
48
|
+
polyglot (0.3.4)
|
|
49
|
+
rack (1.5.2)
|
|
50
|
+
rack-test (0.6.2)
|
|
51
|
+
rack (>= 1.0)
|
|
52
|
+
rails (4.1.1)
|
|
53
|
+
actionmailer (= 4.1.1)
|
|
54
|
+
actionpack (= 4.1.1)
|
|
55
|
+
actionview (= 4.1.1)
|
|
56
|
+
activemodel (= 4.1.1)
|
|
57
|
+
activerecord (= 4.1.1)
|
|
58
|
+
activesupport (= 4.1.1)
|
|
59
|
+
bundler (>= 1.3.0, < 2.0)
|
|
60
|
+
railties (= 4.1.1)
|
|
61
|
+
sprockets-rails (~> 2.0)
|
|
62
|
+
railties (4.1.1)
|
|
63
|
+
actionpack (= 4.1.1)
|
|
64
|
+
activesupport (= 4.1.1)
|
|
65
|
+
rake (>= 0.8.7)
|
|
66
|
+
thor (>= 0.18.1, < 2.0)
|
|
67
|
+
rake (10.3.2)
|
|
68
|
+
sprockets (2.12.1)
|
|
69
|
+
hike (~> 1.2)
|
|
70
|
+
multi_json (~> 1.0)
|
|
71
|
+
rack (~> 1.0)
|
|
72
|
+
tilt (~> 1.1, != 1.3.0)
|
|
73
|
+
sprockets-rails (2.1.3)
|
|
74
|
+
actionpack (>= 3.0)
|
|
75
|
+
activesupport (>= 3.0)
|
|
76
|
+
sprockets (~> 2.8)
|
|
77
|
+
sqlite3 (1.3.9)
|
|
78
|
+
thor (0.19.1)
|
|
79
|
+
thread_safe (0.3.4)
|
|
80
|
+
tilt (1.4.1)
|
|
81
|
+
treetop (1.4.15)
|
|
82
|
+
polyglot
|
|
83
|
+
polyglot (>= 0.3.1)
|
|
84
|
+
tzinfo (1.2.0)
|
|
85
|
+
thread_safe (~> 0.1)
|
|
86
|
+
|
|
87
|
+
PLATFORMS
|
|
88
|
+
ruby
|
|
89
|
+
|
|
90
|
+
DEPENDENCIES
|
|
91
|
+
skinny_forum!
|
|
92
|
+
sqlite3
|
data/MIT-LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright 2014 YOURNAME
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Skinnyforum
|
|
2
|
+
|
|
3
|
+
TODO: Write a gem description
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
gem 'skinnyforum'
|
|
10
|
+
|
|
11
|
+
And then execute:
|
|
12
|
+
|
|
13
|
+
$ bundle
|
|
14
|
+
|
|
15
|
+
Or install it yourself as:
|
|
16
|
+
|
|
17
|
+
$ gem install skinnyforum
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
TODO: Write usage instructions here
|
|
22
|
+
|
|
23
|
+
## Contributing
|
|
24
|
+
|
|
25
|
+
1. Fork it
|
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
29
|
+
5. Create new Pull Request
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
begin
|
|
2
|
+
require 'bundler/setup'
|
|
3
|
+
rescue LoadError
|
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
require 'rdoc/task'
|
|
8
|
+
|
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
11
|
+
rdoc.title = 'SkinnyForum'
|
|
12
|
+
rdoc.options << '--line-numbers'
|
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
|
18
|
+
load 'rails/tasks/engine.rake'
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
Bundler::GemHelper.install_tasks
|
|
23
|
+
|
|
24
|
+
require 'rake/testtask'
|
|
25
|
+
|
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
|
27
|
+
t.libs << 'lib'
|
|
28
|
+
t.libs << 'test'
|
|
29
|
+
t.pattern = 'test/**/*_test.rb'
|
|
30
|
+
t.verbose = false
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
task default: :test
|
|
File without changes
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
|
2
|
+
// listed below.
|
|
3
|
+
//
|
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
|
6
|
+
//
|
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
8
|
+
// compiled file.rectives.
|
|
9
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
|
10
|
+
// GO AFTER THE REQUIRES BELOW.
|
|
11
|
+
//
|
|
12
|
+
//= require jquery
|
|
13
|
+
//= require jquery.turbolinks
|
|
14
|
+
//= require jquery_ujs
|
|
15
|
+
//= require jquery.form
|
|
16
|
+
//= require bootstrap
|
|
17
|
+
//= require turbolinks
|
|
18
|
+
// = require_tree .
|
|
19
|
+
|
|
20
|
+
//
|
|
21
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
|
22
|
+
// about supported di
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
CHILD_DEL = 0
|
|
2
|
+
CHILD_ITEM = CHILD_DEL+1
|
|
3
|
+
|
|
4
|
+
CHILD_EDIT = CHILD_DEL+1
|
|
5
|
+
CHILD_EDIT_ITEM=CHILD_ITEM+1
|
|
6
|
+
CHILD_EDIT_ENTRY=CHILD_EDIT_ITEM+1
|
|
7
|
+
|
|
8
|
+
SUGGESTION_ACCEPT=0
|
|
9
|
+
SUGGESTION_REJECT=SUGGESTION_ACCEPT+1
|
|
10
|
+
SUGGESTION= SUGGESTION_REJECT+1
|
|
11
|
+
SUGGESTION_OWNER=SUGGESTION+1
|
|
12
|
+
SUGGESTION_CATEGORY=SUGGESTION_OWNER+1
|
|
13
|
+
|
|
14
|
+
jQuery ->
|
|
15
|
+
unless checkPage(getHomeName()) then return
|
|
16
|
+
|
|
17
|
+
$('#forum-senate-admin-lists').delegate 'input[id = delete-forum-object]','click', (evt) ->
|
|
18
|
+
deleteForumObject(event.target)
|
|
19
|
+
$('#forum-senate-admin-lists').delegate 'input[id = edit-forum-object]','click', (evt) ->
|
|
20
|
+
openEditTopic(event.target)
|
|
21
|
+
$('[id = forum-admin-button]').click ->
|
|
22
|
+
doButtonAction(event.target)
|
|
23
|
+
event.stopPropagation()
|
|
24
|
+
$('#forum-senate-admin-users').delegate 'option[id = forum-admin-option]','click', (evt) ->
|
|
25
|
+
checkForNone(event.target)
|
|
26
|
+
$('#forum-category-admin').change ->
|
|
27
|
+
getAdminsTopic()
|
|
28
|
+
$('#forum-actions').change ->
|
|
29
|
+
checkActionSetup(event.target)
|
|
30
|
+
$('#forum-admin-language-select').change ->
|
|
31
|
+
flipLanguage(event.target)
|
|
32
|
+
$('#forum-actions').change ->
|
|
33
|
+
handleActionChange(event.target)
|
|
34
|
+
$('#forum-category-monitor').change ->
|
|
35
|
+
monitorNewTopic()
|
|
36
|
+
#todo add reason selection for rejecion (forum and user privilages)
|
|
37
|
+
|
|
38
|
+
monitorNewTopic=->
|
|
39
|
+
select = document.getElementById('forum-category-monitor').value
|
|
40
|
+
$.post('forum_ajax', {function: 'get topics',list:'forum-topic-monitor', category: select, hold_test: false, restricted: false}, loadList)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
getAdminCategory=->
|
|
44
|
+
document.getElementById('forum-category-admin').value
|
|
45
|
+
|
|
46
|
+
handleActionChange=(which)->
|
|
47
|
+
switch which.value
|
|
48
|
+
when 'send email to'
|
|
49
|
+
showMe({id:"forum-email-email"})
|
|
50
|
+
else
|
|
51
|
+
hideMe({id:"forum-email-email"})
|
|
52
|
+
doButtonAction = (which)->
|
|
53
|
+
switch(which.name)
|
|
54
|
+
when 'forum-add-topic'
|
|
55
|
+
addTopic(which,getAdminCategory(),'me')
|
|
56
|
+
when 'review-forum'
|
|
57
|
+
setUpReview(which)
|
|
58
|
+
when 'forum-activate-language'
|
|
59
|
+
turnLanguage('on')
|
|
60
|
+
when 'forum-deactivate-language'
|
|
61
|
+
turnLanguage('off')
|
|
62
|
+
when 'forum-add-category'
|
|
63
|
+
addCategory(which,'me')
|
|
64
|
+
when 'forum-add-language'
|
|
65
|
+
addLanguage(which,'me')
|
|
66
|
+
when 'forum-translate-topic'
|
|
67
|
+
translateList(which)
|
|
68
|
+
when 'forum-translate-category'
|
|
69
|
+
translateList(which)
|
|
70
|
+
when 'forum-user-tag-choose'
|
|
71
|
+
setTagView()
|
|
72
|
+
when 'forum-user-email-choose'
|
|
73
|
+
setEmailView()
|
|
74
|
+
when 'forum-act-on-admin-selector'
|
|
75
|
+
doAction()
|
|
76
|
+
when 'forum-add-cancel'
|
|
77
|
+
addCancel({obj:which})
|
|
78
|
+
when 'forum-admin-views'
|
|
79
|
+
setAdminView(which)
|
|
80
|
+
else
|
|
81
|
+
|
|
82
|
+
window.doAdminStuff = ->
|
|
83
|
+
document.getElementById('forum-senate').dataset.admining = 'true'
|
|
84
|
+
setAdminDisplay()
|
|
85
|
+
$.post('forum_ajax',{function:'get list',by_name:false, list:'admin actions'},loadList)
|
|
86
|
+
$.post('forum_ajax',{function:'get list',by_name:false, list:'admin distributions'},loadList)
|
|
87
|
+
$.post('forum_ajax',{function:'get list',by_name:true, list:'admin emails'},loadList)
|
|
88
|
+
$.post('forum_ajax',{function:'get list',by_name:true, list:'admin users'},loadList)
|
|
89
|
+
|
|
90
|
+
setAdminDisplay=->
|
|
91
|
+
hideMe({id: 'review-forum-span'})
|
|
92
|
+
hideMe({id: 'forum-senate'})
|
|
93
|
+
showMe({id: 'forum-senate-admin'})
|
|
94
|
+
hideMe({id: 'forum-user-tag-span'})
|
|
95
|
+
hideMe({id: 'forum-user-email-span'})
|
|
96
|
+
hideMe({id: 'forum-email-email'})
|
|
97
|
+
showMe({name: 'forum-user-email-show'})
|
|
98
|
+
showMe({name: 'forum-user-tag-show'})
|
|
99
|
+
showMe({id:'forum-distribution-span'})
|
|
100
|
+
hideMe({id:'forum-moderator-add-span'})
|
|
101
|
+
|
|
102
|
+
turnLanguage=(toggle)->
|
|
103
|
+
showMe({id:'language-selector-span'})
|
|
104
|
+
$.post('forum_ajax',{function:'get language set',list:'forum-admin-language-select',active:toggle =='off'},loadList)
|
|
105
|
+
|
|
106
|
+
checkForNone = (which)->
|
|
107
|
+
if which.value == 'select none'
|
|
108
|
+
hideMe({obj:which.parentNode.parentNode})
|
|
109
|
+
name=which.parentNode.name + '-show'
|
|
110
|
+
showMe({name:name})
|
|
111
|
+
|
|
112
|
+
setEmailView = ->
|
|
113
|
+
blockMe({id:'forum-user-email-span'})
|
|
114
|
+
hideMe({name:'forum-user-email-show'})
|
|
115
|
+
$('#forum-user-email').focus()
|
|
116
|
+
|
|
117
|
+
setMonitorView=->
|
|
118
|
+
hideMe({id:'forum-distribution-span'})
|
|
119
|
+
showMe({id:'forum-moderator-add-span'})
|
|
120
|
+
|
|
121
|
+
setDistributionListView=->
|
|
122
|
+
showMe({id:'forum-distribution-span'})
|
|
123
|
+
hideMe({id:'forum-moderator-add-span'})
|
|
124
|
+
|
|
125
|
+
setTagView = ->
|
|
126
|
+
blockMe({id:'forum-user-tag-span'})
|
|
127
|
+
hideMe({name:'forum-user-tag-show'})
|
|
128
|
+
$('#user-tag').focus()
|
|
129
|
+
|
|
130
|
+
checkActionSetup = (which)->
|
|
131
|
+
switch which.value
|
|
132
|
+
when 'create distribution'
|
|
133
|
+
setDistributionListView()
|
|
134
|
+
when 'add topic monitor'
|
|
135
|
+
setMonitorView()
|
|
136
|
+
else
|
|
137
|
+
|
|
138
|
+
flipLanguage=(selector)->
|
|
139
|
+
select = getSelectValues({obj:selector,ref:false})
|
|
140
|
+
$.post('forum_ajax',{function:'toggle language',language:select})
|
|
141
|
+
selector.selectedIndex=0
|
|
142
|
+
hideMe({id:'language-selector-span'})
|
|
143
|
+
|
|
144
|
+
doAction = ->
|
|
145
|
+
request={}
|
|
146
|
+
request.function = 'forum admin action'
|
|
147
|
+
request.users1 = getSelectValues({name:'forum-user-tag',ref:false})
|
|
148
|
+
request.users2 = getSelectValues({name:'forum-user-email',ref:false})
|
|
149
|
+
request.subject = $('#forum-email-subject').val()
|
|
150
|
+
request.body= $('#forum-email-body').val()
|
|
151
|
+
request.topic=$('#forum-topic-monitor').val()
|
|
152
|
+
$('#forum-email-body').val('')
|
|
153
|
+
$('#forum-email-subject').val('')
|
|
154
|
+
request.new_list_name = $('#forum-new-distribution-list').val()
|
|
155
|
+
request.distribution_list = $('#forum-distribution-lists').val()
|
|
156
|
+
request.forum_action = $('#forum-actions').val()
|
|
157
|
+
document.getElementById('forum-actions').selectedIndex=0
|
|
158
|
+
setAdminDisplay()
|
|
159
|
+
$("forum-email-body").val('')
|
|
160
|
+
$.post('forum_ajax',request)
|
|
161
|
+
|
|
162
|
+
setAdminView = (which_one)->
|
|
163
|
+
switch(which_one.dataset.view)
|
|
164
|
+
when 'lists'
|
|
165
|
+
blockMe({id:'forum-senate-admin-lists'})
|
|
166
|
+
hideMe({id:'forum-senate-admin-users'})
|
|
167
|
+
addCancel({name:'category'})
|
|
168
|
+
addCancel({name:'topic'})
|
|
169
|
+
addCancel({name:'language'})
|
|
170
|
+
$.post('forum_ajax',{function:'categories',list:'category', language:getLanguage(),hold_test:false,restricted:false},loadAdminsList)
|
|
171
|
+
$.post('forum_ajax',{function:'get suggestions',list:'category'},loadCategorySuggestions)
|
|
172
|
+
$.post('forum_ajax',{function:'get suggestions',list:'topic'},loadCategorySuggestions)
|
|
173
|
+
$.post('forum_ajax',{function:'get suggestions',list:'language'},loadCategorySuggestions)
|
|
174
|
+
when 'users'
|
|
175
|
+
hideMe({id:'forum-senate-admin-lists'})
|
|
176
|
+
blockMe({id:'forum-senate-admin-users'})
|
|
177
|
+
else
|
|
178
|
+
|
|
179
|
+
setUpReview=(button)->
|
|
180
|
+
if button.dataset.state == 'done'
|
|
181
|
+
showMe(id:'forum-review-buttons')
|
|
182
|
+
button.dataset.state = 'review'
|
|
183
|
+
clearSenate()
|
|
184
|
+
$.post('forum_ajax', {function: 'get senate', topic: getTopic(), review: true}, setSenate)
|
|
185
|
+
button.value = button.dataset.done
|
|
186
|
+
else
|
|
187
|
+
button.dataset.state = 'done'
|
|
188
|
+
hideMe(id:'forum-review-buttons')
|
|
189
|
+
button.value= button.dataset.review
|
|
190
|
+
clearSenate
|
|
191
|
+
|
|
192
|
+
deleteForumObject = (which_one)->
|
|
193
|
+
id = which_one.dataset.target
|
|
194
|
+
$.post('forum_ajax',{function:'remove forum object',id:which_one.dataset.id,state_action:which_one.value})
|
|
195
|
+
if which_one.dataset.state == 'open'
|
|
196
|
+
which_one.value = which_one.dataset.del
|
|
197
|
+
document.getElementById(id).className = ''
|
|
198
|
+
which_one.dataset.state = 'closed'
|
|
199
|
+
else
|
|
200
|
+
which_one.value = which_one.dataset.open
|
|
201
|
+
document.getElementById(id).className = ''
|
|
202
|
+
which_one.dataset.state= 'open'
|
|
203
|
+
$.post('forum_ajax',{function:'categories',language:getLanguage(),hold_test:true,restricted:true},loadCategories)
|
|
204
|
+
|
|
205
|
+
addOptionTo = (which_one,item)->
|
|
206
|
+
by_name=false
|
|
207
|
+
switch which_one
|
|
208
|
+
when 'category'
|
|
209
|
+
pushOption($('[name=category_admin]'),{item:item,value:item},0)
|
|
210
|
+
pushOption($('[name=category]'),{item:item,value:item},2)
|
|
211
|
+
when 'language'
|
|
212
|
+
pushOption($('[name=language]'),{item:item,value:item},1)
|
|
213
|
+
else
|
|
214
|
+
|
|
215
|
+
translateList=(which)->
|
|
216
|
+
if which.dataset.state == 'done'
|
|
217
|
+
translateSetup({obj:which})
|
|
218
|
+
else
|
|
219
|
+
addCancel({obj:which})
|
|
220
|
+
|
|
221
|
+
addCategory = (which,user)->
|
|
222
|
+
if which.dataset.state == 'saved'
|
|
223
|
+
addSetup({obj:which})
|
|
224
|
+
else
|
|
225
|
+
new_category = $('#forum-add-admin-category').val()
|
|
226
|
+
unless new_category == ''
|
|
227
|
+
addListEntry('forum-admins-category-list',{item:new_category})
|
|
228
|
+
$.post('forum_ajax',{function:'add to list',list:'categories',new_item:new_category,user:$('#forum-add-admin-user').val()})
|
|
229
|
+
addOptionTo('category',new_category)
|
|
230
|
+
addCancel({obj:which})
|
|
231
|
+
|
|
232
|
+
addLanguage = (which,user)->
|
|
233
|
+
if which.dataset.state == 'saved'
|
|
234
|
+
addSetup({obj:which})
|
|
235
|
+
else
|
|
236
|
+
new_language = $('#forum-add-admin-language').val()
|
|
237
|
+
new_local = $('#forum-add-admin-language-localized').val()
|
|
238
|
+
new_code = $('#forum-add-admin-language-code')
|
|
239
|
+
unless new_language == ''
|
|
240
|
+
addListEntry('forum-admins-language-list',{item:new_language})
|
|
241
|
+
$.post('forum_ajax',{function:'add to list',list:'language',language:new_language,local:new_local,code:new_code, user:$('#forum-add-admin-user').val()})
|
|
242
|
+
addCancel({obj:which})
|
|
243
|
+
|
|
244
|
+
addTopic=(which,category,user)->
|
|
245
|
+
if which.dataset.state == 'saved'
|
|
246
|
+
addSetup({obj:which})
|
|
247
|
+
else
|
|
248
|
+
new_topic = $('#forum-add-admin-topic').val()
|
|
249
|
+
unless new_topic == ''
|
|
250
|
+
addListEntry('forum-admins-topic-list',{item:new_topic,shift:true})
|
|
251
|
+
$.post('forum_ajax',{function:'add to list',list:'topic', topic:new_topic,category:category,user:$('#forum-add-admin-user').val()})
|
|
252
|
+
addCancel({obj:which})
|
|
253
|
+
|
|
254
|
+
addSetup=(params)->
|
|
255
|
+
if params.name == undefined
|
|
256
|
+
params.name = params.obj.name.split('-')[2]
|
|
257
|
+
params.obj.value = params.obj.dataset.save
|
|
258
|
+
params.obj.dataset.state='adding'
|
|
259
|
+
hideMe({name:"forum-translate-#{params.name}"})
|
|
260
|
+
$("input[data-who=#{params.name}]").show() #show cancel button
|
|
261
|
+
showMe({id:"forum-add-#{params.name}-input-span"})
|
|
262
|
+
document.getElementById("forum-add-admin-#{params.name}").focus()
|
|
263
|
+
|
|
264
|
+
translateSetup=(params)->
|
|
265
|
+
if params.name == undefined
|
|
266
|
+
params.name = params.obj.name.split('-')[2]
|
|
267
|
+
params.obj.value = params.obj.dataset.done
|
|
268
|
+
params.obj.dataset.state='translating'
|
|
269
|
+
document.getElementById('forum-admins-'+params.name+'-list').dataset.translating=true
|
|
270
|
+
hideMe({name:"forum-add-#{params.name}"})
|
|
271
|
+
$("input[data-who=#{params.name}]").show() #show cancel button
|
|
272
|
+
document.getElementById("forum-add-admin-#{params.name}").focus()
|
|
273
|
+
|
|
274
|
+
addCancel=(params)->
|
|
275
|
+
if params.name == undefined
|
|
276
|
+
if params.obj.dataset.who == undefined then params.name = params.obj.name.split('-')[2]
|
|
277
|
+
else params.name = params.obj.dataset.who
|
|
278
|
+
button = $("[name = forum-add-#{params.name}]").get()[0]
|
|
279
|
+
button.dataset.state = 'saved'
|
|
280
|
+
button.value = button.dataset.add
|
|
281
|
+
unless params.name == 'language'
|
|
282
|
+
button2= $("[name = forum-translate-#{params.name}]").get()[0]
|
|
283
|
+
button2.dataset.state='done'
|
|
284
|
+
button2.value= button2.dataset.translate
|
|
285
|
+
showMe({obj:button2})
|
|
286
|
+
document.getElementById("forum-admins-#{params.name}-list").dataset.translating=false
|
|
287
|
+
$("input[data-who=#{params.name}]").hide()
|
|
288
|
+
hideMe({id:"forum-add-#{params.name}-input-span"})
|
|
289
|
+
showMe({obj:button})
|
|
290
|
+
showMe({name:"forum-add-#{params.name}"})
|
|
291
|
+
$("[id = forum-add-admin-#{params.name}]").val('')
|
|
292
|
+
$("[id = forum-add-admin-user]").val('me')
|
|
293
|
+
|
|
294
|
+
openEditTopic = (which_one)->
|
|
295
|
+
line= document.getElementById("edit-entry-#{which_one.dataset.id}")
|
|
296
|
+
id=which_one.dataset.id
|
|
297
|
+
if which_one.dataset.state == 'edit'
|
|
298
|
+
parent = which_one.parentNode
|
|
299
|
+
showMe({obj:parent.children[CHILD_EDIT_ENTRY]})
|
|
300
|
+
which_one.value = which_one.dataset.save
|
|
301
|
+
which_one.dataset.state = 'save'
|
|
302
|
+
line.value = parent.children[CHILD_EDIT_ITEM].innerHTML
|
|
303
|
+
hideMe({obj:parent.children[CHILD_EDIT_ITEM]})
|
|
304
|
+
line.focus()
|
|
305
|
+
else if which_one.dataset.state == 'save'
|
|
306
|
+
parent = which_one.parentNode
|
|
307
|
+
id = which_one.dataset.id
|
|
308
|
+
which_one.dataset.state = 'edit'
|
|
309
|
+
newline = line.value
|
|
310
|
+
hideMe({obj:parent.children[CHILD_EDIT_ENTRY]})
|
|
311
|
+
showMe({obj:parent.children[CHILD_EDIT_ITEM]})
|
|
312
|
+
which_one.value = which_one.dataset.edit
|
|
313
|
+
unless newline == ''
|
|
314
|
+
translating=which_one.parentNode.parentElement.dataset.translating
|
|
315
|
+
parent.children[CHILD_EDIT_ITEM].innerHTML = newline
|
|
316
|
+
$.post('forum_ajax',{function:'edit forum topic',id:id,newline:newline,translating:translating})
|
|
317
|
+
|
|
318
|
+
getAdminCategories = ->
|
|
319
|
+
$.post('forum_ajax',{function:'get categories',category:select,language:getLanguage(),list,'category',hold_test:false,restriced:false},loadAdminsList)
|
|
320
|
+
|
|
321
|
+
getAdminsTopic = ->
|
|
322
|
+
select = document.getElementById('forum-category-admin').value
|
|
323
|
+
$.post('forum_ajax',{function:'get topics',category:select,list:'topic',language:getLanguage(),hold_test:false,restricted:false},loadAdminsList)
|
|
324
|
+
|
|
325
|
+
window.loadAdminsList = (params)->
|
|
326
|
+
list_data = params.list_data
|
|
327
|
+
switch params.id
|
|
328
|
+
when 'topic'
|
|
329
|
+
which = 'forum-admins-topic-list'
|
|
330
|
+
short = 0
|
|
331
|
+
shift = true
|
|
332
|
+
when 'category'
|
|
333
|
+
which = 'forum-admins-category-list'
|
|
334
|
+
short = 1
|
|
335
|
+
shift = true
|
|
336
|
+
else
|
|
337
|
+
alist = document.getElementById(which).children
|
|
338
|
+
dummy = alist[0]
|
|
339
|
+
if dummy?
|
|
340
|
+
for i in [1...alist.length]
|
|
341
|
+
removeMe({obj:document.getElementById(which).children[1]})
|
|
342
|
+
if list_data.length>0
|
|
343
|
+
for i in [0...list_data.length-short]
|
|
344
|
+
vars = list_data[i]
|
|
345
|
+
vars.inert = i == 0||i == list_data.length-1-short
|
|
346
|
+
vars.shift = shift
|
|
347
|
+
if list_data[i].state?
|
|
348
|
+
vars.state = list_data[i].state
|
|
349
|
+
addListEntry(which,vars)
|
|
350
|
+
removeMe({obj:dummy})
|
|
351
|
+
else
|
|
352
|
+
id = dummy.children[0].dataset.target
|
|
353
|
+
document.getElementById(id).innerHTML = ''
|
|
354
|
+
|
|
355
|
+
addListEntry = (which,vars)->
|
|
356
|
+
entry = document.getElementById(which).children[0].cloneNode(true)
|
|
357
|
+
i = document.getElementById(which).children.length
|
|
358
|
+
ref = document.getElementById(which).children[i-1]
|
|
359
|
+
tag = which.split('-')[1]
|
|
360
|
+
entry.children[CHILD_DEL].dataset.id = vars.id
|
|
361
|
+
entry.children[CHILD_DEL].dataset.target = 'list-item-'+tag+'-'+i
|
|
362
|
+
if vars.inert
|
|
363
|
+
$(entry.children[CHILD_DEL]).val('----')
|
|
364
|
+
else
|
|
365
|
+
entry.children[CHILD_DEL].id = 'delete-forum-object'
|
|
366
|
+
entry.children[CHILD_DEL].value= entry.children[CHILD_DEL].dataset.del
|
|
367
|
+
entry.children[CHILD_EDIT].dataset.id = vars.id
|
|
368
|
+
entry.children[CHILD_EDIT].dataset.target = 'list-item-'+tag+'-'+i
|
|
369
|
+
entry.children[CHILD_EDIT].dataset.state = 'edit'
|
|
370
|
+
entry.children[CHILD_EDIT_ITEM].innerHTML = vars.item
|
|
371
|
+
entry.children[CHILD_EDIT_ITEM].id = 'list-item-'+tag+'-'+i
|
|
372
|
+
entry.children[CHILD_EDIT_ENTRY].children[0].id="edit-entry-#{vars.id}"
|
|
373
|
+
item=CHILD_EDIT_ITEM
|
|
374
|
+
|
|
375
|
+
if vars.closed
|
|
376
|
+
entry.children[item].className = 'forum-closed'
|
|
377
|
+
entry.children[CHILD_DEL].value = entry.children[CHILD_DEL].dataset.open
|
|
378
|
+
entry.children[CHILD_DEL].dataset.state = 'closed'
|
|
379
|
+
else
|
|
380
|
+
entry.children[CHILD_DEL].dataset.state = 'open'
|
|
381
|
+
document.getElementById(which).insertBefore(entry,ref)
|
|
382
|
+
|
|
383
|
+
loadCategorySuggestions = (params)->
|
|
384
|
+
unless !params? || params.data.length == 0
|
|
385
|
+
list = document.getElementById(params.list)
|
|
386
|
+
list.style.display = 'none'
|
|
387
|
+
for i in [0...params.data.length]
|
|
388
|
+
pushElement(list,params.data[i],params.list)
|
|
389
|
+
removeMe({obj:list.children[0]})
|
|
390
|
+
|
|
391
|
+
pushElement = (list,data,which)->
|
|
392
|
+
entry = list.children[0].cloneNode(true)
|
|
393
|
+
entry.id = 'list-' + which.split('-')[0]+ list.children.length
|
|
394
|
+
entry.dataset.the_id = data.id
|
|
395
|
+
entry.children[SUGGESTION_ACCEPT].dataset.id = list.children.length
|
|
396
|
+
entry.children[SUGGESTION_REJECT].dataset.id = list.children.length
|
|
397
|
+
entry.children[SUGGESTION].id = which.split('-')[0]+ '-item-'+ list.children.length
|
|
398
|
+
entry.children[SUGGESTION_OWNER].id = which.split('-')[0]+ '-user-'+ list.children.length
|
|
399
|
+
entry.children[SUGGESTION].innerHTML = data.suggestion
|
|
400
|
+
entry.children[SUGGESTION_OWNER].innerHTML = " |"+data.user+"| "
|
|
401
|
+
if data.category?
|
|
402
|
+
entry.children[SUGGESTION_CATEGORY].innerHTML = data.category
|
|
403
|
+
entry.children[SUGGESTION_CATEGORY].id = which.split('-')[0]+ '-category-'+ list.children.length
|
|
404
|
+
list.appendChild(entry)
|
|
405
|
+
|
|
406
|
+
handleSuggestionResponse = (which_one)->
|
|
407
|
+
if which_one.val() == 'accept'
|
|
408
|
+
id = which_one.get()[0].dataset.id
|
|
409
|
+
switch which_one.get()[0].parentNode.parentElement.id
|
|
410
|
+
when 'category-prososals-list'
|
|
411
|
+
$('#forum-add-admin-category').val($("span[id = category-item-#{id}]").get()[0].innerHTML)
|
|
412
|
+
$('#forum-add-admin-user').val($("span[id = category-user-#{id}]").get()[0].innerHTML.split('|')[1])
|
|
413
|
+
addCategory()
|
|
414
|
+
when 'topic-prososals-list'
|
|
415
|
+
$('#forum-add-admin-topic').val( $("span[id = topic-item-#{id}]").get()[0].innerHTML)
|
|
416
|
+
$('#forum-add-admin-user').val($("span[id = topic-user-#{id}]").get()[0].innerHTML.split('|')[1])
|
|
417
|
+
addTopic($("span[id = topic-category-#{id}]").get()[0].innerHTML.trim())
|
|
418
|
+
when 'language-proposal-list'
|
|
419
|
+
$('#forum-aadd-admin-language').val($("span[id = language-item-#{id}]").get()[0].innerHTML)
|
|
420
|
+
$('#forum-add-admin-user').val($("span[id = language-user-#{id}]").get()[0].innerHTML.split('|')[1])
|
|
421
|
+
addLanguage()
|
|
422
|
+
else
|
|
423
|
+
closeListItem(which_one)
|
|
424
|
+
|
|
425
|
+
closeListItem = (which_one)->
|
|
426
|
+
id = which_one.get()[0].parentNode.dataset.the_id
|
|
427
|
+
$.post('forum_ajax',{function:'suggestion close',id:id,result:which_one.val()})
|
|
428
|
+
if which_one.get()[0].parentNode.parentElement.children.length == 1
|
|
429
|
+
which_one.parentNode.parentElement.style.display = 'none'
|
|
430
|
+
else
|
|
431
|
+
removeIt(which_one.parentNode)
|
|
432
|
+
|
|
433
|
+
|