xforum 0.0.23

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.
Files changed (93) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +139 -0
  4. data/Rakefile +31 -0
  5. data/app/assets/images/xforum/addphoto.jpg +0 -0
  6. data/app/assets/images/xforum/bg-input-focus.png +0 -0
  7. data/app/assets/images/xforum/internet.png +0 -0
  8. data/app/assets/images/xforum/silver_selector.png +0 -0
  9. data/app/assets/javascripts/xforum/application.js +25 -0
  10. data/app/assets/javascripts/xforum/forum_admin.js.coffee +477 -0
  11. data/app/assets/javascripts/xforum/forum_basic.js.coffee +321 -0
  12. data/app/assets/javascripts/xforum/forum_translator.js.coffee +116 -0
  13. data/app/assets/javascripts/xforum/forum_user.js.coffee +403 -0
  14. data/app/assets/javascripts/xforum/global_java.js +141 -0
  15. data/app/assets/javascripts/xforum/help.js.coffee +10 -0
  16. data/app/assets/stylesheets/xforum/application.css.scss +15 -0
  17. data/app/assets/stylesheets/xforum/custom.css.scss +295 -0
  18. data/app/controllers/xforum/application_controller.rb +25 -0
  19. data/app/controllers/xforum/forums_controller.rb +123 -0
  20. data/app/helpers/xforum/application_helper.rb +4 -0
  21. data/app/mailers/xforum/user_mailer.rb +15 -0
  22. data/app/models/xforum/category.rb +76 -0
  23. data/app/models/xforum/forum.rb +217 -0
  24. data/app/models/xforum/hyperlink.rb +42 -0
  25. data/app/models/xforum/language.rb +104 -0
  26. data/app/models/xforum/people_list.rb +189 -0
  27. data/app/models/xforum/photo.rb +60 -0
  28. data/app/models/xforum/topic.rb +140 -0
  29. data/app/models/xforum/translation.rb +92 -0
  30. data/app/views/layouts/xforum/application.html.erb +14 -0
  31. data/app/views/user_mailer/xforum/note_to_forum_users.html.erb +32 -0
  32. data/app/views/xforum/forums/_dummy.html.erb +0 -0
  33. data/app/views/xforum/forums/_forum.html.erb +18 -0
  34. data/app/views/xforum/forums/_forum_admin.html.erb +139 -0
  35. data/app/views/xforum/forums/_forum_comments.html.erb +45 -0
  36. data/app/views/xforum/forums/_forum_entry.html.erb +44 -0
  37. data/app/views/xforum/forums/_forum_video.html.erb +7 -0
  38. data/app/views/xforum/forums/newphoto.js.erb +1 -0
  39. data/app/views/xforum/forums/the_page.html.erb +3 -0
  40. data/config/intiializers/xforum.rb +2 -0
  41. data/config/locales/forum.de.yml +93 -0
  42. data/config/locales/forum.en.yml +96 -0
  43. data/config/locales/forum.es.yml +94 -0
  44. data/config/locales/forum.fr.yml +94 -0
  45. data/config/routes.rb +10 -0
  46. data/db/migrate/20140600_add_forum_to_users.rb +20 -0
  47. data/db/migrate/20140601_create_forum_forums.rb +147 -0
  48. data/db/migrate/20140602_add_restricted_to_category.rb +6 -0
  49. data/db/migrate/20140602_change_suggestion_default.rb +7 -0
  50. data/lib/tasks/xforum_tasks.rake +65 -0
  51. data/lib/xforum.rb +95 -0
  52. data/lib/xforum/engine.rb +6 -0
  53. data/lib/xforum/set.yml +209 -0
  54. data/lib/xforum/user_include.rb +13 -0
  55. data/lib/xforum/version.rb +3 -0
  56. data/test/dummy/README.rdoc +28 -0
  57. data/test/dummy/Rakefile +6 -0
  58. data/test/dummy/app/assets/javascripts/application.js +13 -0
  59. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  60. data/test/dummy/app/controllers/application_controller.rb +5 -0
  61. data/test/dummy/app/helpers/application_helper.rb +2 -0
  62. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  63. data/test/dummy/bin/bundle +3 -0
  64. data/test/dummy/bin/rails +4 -0
  65. data/test/dummy/bin/rake +4 -0
  66. data/test/dummy/config.ru +4 -0
  67. data/test/dummy/config/application.rb +23 -0
  68. data/test/dummy/config/boot.rb +5 -0
  69. data/test/dummy/config/database.yml +25 -0
  70. data/test/dummy/config/environment.rb +5 -0
  71. data/test/dummy/config/environments/development.rb +37 -0
  72. data/test/dummy/config/environments/production.rb +83 -0
  73. data/test/dummy/config/environments/test.rb +39 -0
  74. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  75. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  76. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  77. data/test/dummy/config/initializers/inflections.rb +16 -0
  78. data/test/dummy/config/initializers/mime_types.rb +4 -0
  79. data/test/dummy/config/initializers/session_store.rb +3 -0
  80. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  81. data/test/dummy/config/locales/en.yml +23 -0
  82. data/test/dummy/config/routes.rb +4 -0
  83. data/test/dummy/config/secrets.yml +22 -0
  84. data/test/dummy/db/development.sqlite3 +0 -0
  85. data/test/dummy/log/development.log +0 -0
  86. data/test/dummy/public/404.html +67 -0
  87. data/test/dummy/public/422.html +67 -0
  88. data/test/dummy/public/500.html +66 -0
  89. data/test/dummy/public/favicon.ico +0 -0
  90. data/test/integration/navigation_test.rb +10 -0
  91. data/test/test_helper.rb +15 -0
  92. data/test/xforum_test.rb +7 -0
  93. metadata +327 -0
@@ -0,0 +1,141 @@
1
+ /*jslint browser:true */
2
+ /*global $, jQuery, alert*/
3
+
4
+ function getHomeName() {
5
+ "use strict";
6
+ return 'the_page';
7
+ }
8
+
9
+ function showPageName() {
10
+ "use strict";
11
+ return 'show-page';
12
+ }
13
+
14
+ function checkPage(page) {
15
+ "use strict";
16
+ var path;
17
+ path = window.location.href.split("/").pop();
18
+ return (path === "" || path === page || path === page + '#' || path.length === 2);
19
+ }
20
+
21
+ function whatsup1(message) {
22
+ "use strict";
23
+ document.getElementById('whatsup1').innerHTML = message;
24
+ }
25
+
26
+ function whatsup2(message) {
27
+ "use strict";
28
+ document.getElementById('whatsup2').innerHTML = message;
29
+ }
30
+
31
+ function getSelectValues(params) {
32
+ "use strict";
33
+ var select, result = [], options, opt, i, iLen;
34
+ if (params.id !== undefined && params.id !== null) {
35
+ select = document.getElementById(params.id);
36
+ } else if (params.name !== undefined && params.name !== null) {
37
+ select = $('[name =' + params.name + ']').get()[0];
38
+ } else if (params.obj !== undefined && params.obj !== null) {
39
+ select = params.obj;
40
+ }
41
+ options = select && select.options;
42
+ if (options !== null) {
43
+ for (i = 0, iLen = options.length; i < iLen; i += 1) {
44
+ opt = options[i];
45
+ if (opt.selected) {
46
+ if (params.ref) {
47
+ result.push(opt.text || opt.value);
48
+ } else {
49
+ result.push(opt.value || opt.text);
50
+ }
51
+ }
52
+ }
53
+ }
54
+ return result;
55
+ }
56
+
57
+ function showMe(params) {
58
+ "use strict";
59
+ var me, test;
60
+ if (params.id !== undefined && params.id !== null) {
61
+ me = document.getElementById(params.id);
62
+ } else if (params.name !== undefined && params.name !== null) {
63
+ test = "[name=" + params.name + "]";
64
+ me = $(test).get()[0];
65
+ } else if (params.obj !== undefined && params.obj !== null) {
66
+ me = params.obj;
67
+ }
68
+ if (me !== null && me !== undefined) {
69
+ me.style.display = 'inline';
70
+ }
71
+ return true;
72
+ }
73
+
74
+ function blockMe(params) {
75
+ "use strict";
76
+ var me, test;
77
+ if (params.id !== undefined && params.id !== null) {
78
+ me = document.getElementById(params.id);
79
+ } else if (params.name !== undefined && params.name !== null) {
80
+ test = "[name=" + params.name + "]";
81
+ me = $(test).get()[0];
82
+ } else if (params.obj !== undefined && params.obj !== null) {
83
+ me = params.obj;
84
+ }
85
+ if (me !== null && me !== undefined) {me.style.display = 'block'; }
86
+ return true;
87
+ }
88
+ function hideMe(params) {
89
+ "use strict";
90
+ var me, test;
91
+ if (params.id !== undefined && params.id !== null) {
92
+ me = document.getElementById(params.id);
93
+ } else if (params.name !== undefined && params.name !== null) {
94
+ test = "[name=" + params.name + "]";
95
+ me = $(test).get()[0];
96
+ } else if (params.obj !== undefined && params.obj !== null) {
97
+ me = params.obj;
98
+ }
99
+ if (me !== null && me !== undefined) {me.style.display = 'none'; }
100
+ return true;
101
+ }
102
+ function removeMe(params) {
103
+ "use strict";
104
+ var me, test;
105
+ if (params.id !== undefined && params.id !== null) {
106
+ me = document.getElementById(params.id);
107
+ } else if (params.name !== undefined && params.name !== null) {
108
+ test = "[name=" + params.name + "]";
109
+ me = $(test).get()[0];
110
+ } else if (params.obj !== undefined && params.obj !== null) {
111
+ me = params.obj;
112
+ }
113
+ if (me !== null && me !== undefined) {me.parentNode.removeChild(me); }
114
+ return true;
115
+ }
116
+
117
+ function removeIt(obj) {
118
+ "use strict";
119
+ obj.parentNode.removeChild(obj);
120
+ return true;
121
+ }
122
+ function setMyValue(id, value) {
123
+ "use strict";
124
+ document.getElementById(id).value = value;
125
+ return true;
126
+ }
127
+
128
+ function getMyValue(id) {
129
+ "use strict";
130
+ return document.getElementById(id).value.trim();
131
+ }
132
+
133
+ function deleteMyData(obj) {
134
+ 'use strict';
135
+ var the_keys, ref, i;
136
+ the_keys = Object.keys(obj.dataset);
137
+ for (i = 0; i < the_keys.length; i += 1) {
138
+ ref = 'data-' + the_keys[i];
139
+ obj.removeAttribute(ref);
140
+ }
141
+ }
@@ -0,0 +1,10 @@
1
+ jQuery ->
2
+ unless checkPage(getHomeName()) then return
3
+ $('#gotoforumhelp').click ->
4
+ startForumHelp()
5
+
6
+ startForumHelp=->
7
+ startForum()
8
+ hideMe({id:'forum-category'})
9
+ $.post('xforum/forum_ajax', {function: 'get topics',list:'forum-topic', category: 'help', hold_test: true, restricted: true}, loadList)
10
+
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+
13
+ *= require_self
14
+ *= require_tree .
15
+ */
@@ -0,0 +1,295 @@
1
+
2
+ /* mixins, variables, etc. */
3
+
4
+ $grayMediumLight: #eaeaea;
5
+ $grayLighter: #f0f0f0;
6
+ $grayLight: #c0c0c0;
7
+ $blue: #a0a0ff;
8
+ @mixin box_sizing {
9
+ -moz-box-sizing: border-box;
10
+ -webkit-box-sizing: border-box;
11
+ box-sizing: border-box;
12
+ }
13
+ .row{
14
+ width: 100%
15
+ }
16
+ .admin-edit-field{
17
+ width:150px;
18
+ font-size: 10px;
19
+ padding:3px;
20
+ margin-left:10px;
21
+ }
22
+ .forum-comment {
23
+ margin-top: 3px;
24
+ margin-bottom: 3px;
25
+ word-wrap: normal;
26
+ }
27
+ .forum-comment-new{
28
+ @extend .forum-comment;
29
+ background:rgb(235,255,240);
30
+ }
31
+ .forum-comment-reject {
32
+ @extend .forum-comment;
33
+ background: rgb(255, 235, 235);
34
+ }
35
+ .admin-edit-field{
36
+ width:150px;
37
+ font-size: 10px;
38
+ padding:3px;
39
+ margin-left:10px;
40
+ }
41
+ input{
42
+ border: 1px solid rgb(187, 187, 187);
43
+ width: 95%;
44
+ padding: 10px;
45
+ margin-bottom: 15px;
46
+ }
47
+ .senate-row{
48
+ padding:0;
49
+ }
50
+ .forum-email-subject{
51
+ width:75%;
52
+ margin-top:20px;
53
+ margin-left:40px;
54
+ }
55
+ .forum-email-body{
56
+ width:75%;
57
+ margin-top:20px;
58
+ margin-left:40px;
59
+ min-height:250px;
60
+ }
61
+ .forum-select{
62
+ width:auto;
63
+ min-width:230px;
64
+ }
65
+ .forum-select-multiple{
66
+ width:auto;
67
+ max-height:35px;
68
+ padding:7px;
69
+ }
70
+ .forum-translation-choice{
71
+ cursor: arrow;
72
+ margin-left: 15px;
73
+ }
74
+ .forum-senate{
75
+ width:100%;
76
+ height:570px;
77
+ background:rgb(235,235,245);
78
+ overflow-y: scroll;
79
+ padding:20px;
80
+ }
81
+ .forum-closed{
82
+ background:rgb(200,200,245);
83
+ color: rgb(180, 0, 0)
84
+ }
85
+ .forum-add-photo,.forum-add-internet{
86
+ width:40px;
87
+ height:25px;
88
+ }
89
+ .forum-photo{
90
+ max-width:150;
91
+ max-height:100px;
92
+ padding-right:20px;
93
+ z-index: 1;
94
+ }
95
+ .forum-big-photo{
96
+ max-width:600px;
97
+ max-height:400;
98
+ padding-right:20px;
99
+ z-index: 2;
100
+ }
101
+ .forum-tab{
102
+ width:20px;
103
+ display:inline;
104
+ }
105
+ .biggest-forum-photo{
106
+ max-width:1140px;
107
+ height:600px;
108
+ }
109
+ .comment-new-span{
110
+ position:aboslute;
111
+ min-width:500px;
112
+ max-width:850px;
113
+ background-color:white;
114
+ padding:5px;
115
+ z-index: 4;
116
+ }
117
+ .gap{
118
+ }
119
+ .senate-new{
120
+ max-width:710px;
121
+ min-width: 500px;
122
+ max-height:75px;
123
+ margin: 5px 20px 20px;
124
+ overflow-y: scroll;
125
+ word-wrap: normal;
126
+ }
127
+ .forum-topic{
128
+ font-size: 1.5em;
129
+ font-weight:bold;
130
+ }
131
+ .comment-btn{
132
+ width:auto;
133
+ margin-top:5px;
134
+ margin-left:5px;
135
+ padding-left:15px;
136
+ padding-right:15px;
137
+ height:22px;
138
+ }
139
+ .pad-10L{
140
+ padding-left:10px;
141
+ }
142
+ .pad-10R{
143
+ margin-right:10px;
144
+ margin-top:5px;
145
+ }
146
+ .button-image{
147
+ max-width:40px;
148
+ max-height:25px;
149
+ padding:0;
150
+ }
151
+ .needy{
152
+ background-color: rgb(220, 150, 150);
153
+ }
154
+ .vote-green{
155
+ background:rgb(0,180,0);
156
+ }
157
+ .vote-red{
158
+ background:rgb(180,0,0);
159
+ }
160
+ .forum-vote {
161
+ min-width: 60px;
162
+ }
163
+ .forum-vote-down {
164
+ @extend .forum-vote;
165
+ color:rgb(200,0,0);
166
+ }
167
+ .forum-vote-up {
168
+ @extend .forum-vote;
169
+ color:rgb(0,200,0) ;
170
+ }
171
+ .cool-selector{
172
+ background: Transparent no-repeat;
173
+ border: none;
174
+ width:automatic;
175
+ }
176
+ .silver-selector{
177
+ border: none;
178
+ width:automatic;
179
+ min-width:150px;
180
+ min-height:25px;
181
+ background: Transparent url(xforum/silver_selector.png) no-repeat;
182
+ padding-top:0px;
183
+ padding-bottom:0px;
184
+ vertical-align:text-top;
185
+ margin:0;
186
+ }
187
+ .silver-ellipse {
188
+ -moz-box-shadow:inset 0px 1px 0px 0px white;
189
+ -webkit-box-shadow:inset 0px 1px 0px 0px white;
190
+ box-shadow:inset 0px 1px 0px 0px white;
191
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #c7c7c7) );
192
+ background:-moz-linear-gradient( center top, #f9f9f9 5%, #c7c7c7 100% );
193
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#c7c7c7');
194
+ background-color: rgb(249, 249, 249);
195
+ -webkit-border-radius: 33px;
196
+ -moz-border-radius: 33px;
197
+ border-radius: 33px;
198
+ text-indent:0;
199
+ border:1px solid rgb(220, 220, 220);
200
+ display:inline-block;
201
+ color: rgb(102, 102, 102);
202
+ font-family:Arial;
203
+ font-size:12px;
204
+ font-weight:bold;
205
+ font-style:normal;
206
+ height:2px;
207
+ line-height:2px;
208
+ width:auto;
209
+ text-decoration:none;
210
+ text-align:center;
211
+ text-shadow:1px 1px 0px white;
212
+ }
213
+ .forum-translation-scroll{
214
+ max-height:200px;
215
+ overflow-y:scroll;
216
+ }
217
+ .drop-menus{
218
+ position:absolute;
219
+ width:200px;
220
+ background-color:$grayMediumLight;
221
+ list-style-type: none;
222
+ z-index:0
223
+ }
224
+ .drop-menu {
225
+ cursor: arrow;
226
+ margin-left: 20px;
227
+ }
228
+ .drop-menu:hover{
229
+ padding: 3px;
230
+ border: 1px rgb(255, 255, 255) outset;
231
+ }
232
+ .drop-menu:active{
233
+ color: rgb(0, 0, 249);
234
+ }
235
+ .silver-ellipse:hover {
236
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, rgb(199, 199, 199)), color-stop(1, rgb(249, 249, 249)) );
237
+ background:-moz-linear-gradient( center top, rgb(199, 199, 199) 5%, rgb(249, 249, 249) 100% );
238
+ background-color: rgb(199, 199, 199);
239
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#c7c7c7');
240
+ }
241
+ .silver-ellipse:active {
242
+ position:relative;
243
+ top:1px;
244
+ }
245
+ .red-ellipse{
246
+ @extend .silver-ellipse ;
247
+ color: rgb(180, 0, 0);
248
+ }
249
+ .red-ellipse:hover{
250
+ @extend .silver-ellipse:hover;
251
+ }
252
+ .hot{
253
+ border: 3px crimson;
254
+ }
255
+ .red-elisps:active {
256
+ @extend .silver-ellipse:active;
257
+ }
258
+ .green-ellipse {
259
+ @extend .silver-ellipse;
260
+ color: rgb(0, 180, 0);
261
+ }
262
+ .green-ellipse:hover {
263
+ @extend .silver-ellipse:hover;
264
+ }
265
+
266
+ .green-ellipse:active {
267
+ @extend .silver-ellipse:active;
268
+ }
269
+ .blue-ellipse {
270
+ @extend .silver-ellipse;
271
+ color: rgb(0, 0, 180);
272
+ }
273
+ .blue-ellipse:hover {
274
+ @extend .silver-ellipse:hover;
275
+ }
276
+ .blue-ellipse:active {
277
+ @extend .silver-ellipse:active;
278
+ }
279
+ .left{
280
+ float:left;
281
+ }
282
+ .right{
283
+ float:right;
284
+ }
285
+ /* users index */
286
+ /* miscellaneous */
287
+
288
+ .debug_dump {
289
+ clear: both;
290
+ float: left;
291
+ width: 100%;
292
+ margin-top: 45px;
293
+ @include box_sizing;
294
+ }
295
+