redmine_crm 0.0.23 → 0.0.53

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -1
  3. data/README.md +166 -33
  4. data/Rakefile +3 -12
  5. data/app/controllers/redmine_crm_controller.rb +26 -0
  6. data/app/views/redmine_crm/_money.html.erb +44 -0
  7. data/app/views/redmine_crm/settings.html.erb +10 -0
  8. data/bitbucket-pipelines.yml +54 -0
  9. data/config/currency_iso.json +12 -0
  10. data/config/locales/en.yml +13 -0
  11. data/config/locales/ru.yml +13 -0
  12. data/config/routes.rb +5 -0
  13. data/doc/CHANGELOG +123 -2
  14. data/lib/redmine_crm/acts_as_draftable/draft.rb +40 -0
  15. data/lib/redmine_crm/acts_as_draftable/rcrm_acts_as_draftable.rb +172 -0
  16. data/lib/redmine_crm/acts_as_list/list.rb +282 -0
  17. data/lib/redmine_crm/{rcrm_acts_as_taggable.rb → acts_as_taggable/rcrm_acts_as_taggable.rb} +112 -93
  18. data/lib/redmine_crm/acts_as_taggable/tag.rb +81 -0
  19. data/lib/redmine_crm/acts_as_taggable/tag_list.rb +111 -0
  20. data/lib/redmine_crm/acts_as_taggable/tagging.rb +16 -0
  21. data/lib/redmine_crm/acts_as_viewed/rcrm_acts_as_viewed.rb +274 -0
  22. data/lib/redmine_crm/{rcrm_acts_as_votable.rb → acts_as_votable/rcrm_acts_as_votable.rb} +15 -14
  23. data/lib/redmine_crm/acts_as_votable/rcrm_acts_as_voter.rb +20 -0
  24. data/lib/redmine_crm/{votable.rb → acts_as_votable/votable.rb} +54 -65
  25. data/lib/redmine_crm/{vote.rb → acts_as_votable/vote.rb} +6 -8
  26. data/lib/redmine_crm/{voter.rb → acts_as_votable/voter.rb} +29 -34
  27. data/lib/redmine_crm/assets_manager.rb +43 -0
  28. data/lib/redmine_crm/colors_helper.rb +192 -0
  29. data/lib/redmine_crm/compatibility/application_controller_patch.rb +33 -0
  30. data/lib/redmine_crm/currency/formatting.rb +5 -8
  31. data/lib/redmine_crm/currency/heuristics.rb +1 -1
  32. data/lib/redmine_crm/currency/loader.rb +5 -6
  33. data/lib/redmine_crm/currency.rb +28 -17
  34. data/lib/redmine_crm/engine.rb +4 -0
  35. data/lib/redmine_crm/helpers/external_assets_helper.rb +19 -0
  36. data/lib/redmine_crm/helpers/form_tag_helper.rb +76 -0
  37. data/lib/redmine_crm/helpers/tags_helper.rb +1 -3
  38. data/lib/redmine_crm/helpers/vote_helper.rb +29 -32
  39. data/lib/redmine_crm/hooks/views_layouts_hook.rb +11 -0
  40. data/lib/redmine_crm/liquid/drops/issues_drop.rb +191 -0
  41. data/lib/redmine_crm/liquid/drops/news_drop.rb +54 -0
  42. data/lib/redmine_crm/liquid/drops/projects_drop.rb +86 -0
  43. data/lib/redmine_crm/liquid/drops/time_entries_drop.rb +65 -0
  44. data/lib/redmine_crm/liquid/drops/users_drop.rb +68 -0
  45. data/lib/redmine_crm/liquid/filters/arrays.rb +187 -0
  46. data/lib/redmine_crm/liquid/filters/base.rb +217 -0
  47. data/lib/redmine_crm/liquid/filters/colors.rb +31 -0
  48. data/lib/redmine_crm/money_helper.rb +17 -18
  49. data/lib/redmine_crm/settings/money.rb +46 -0
  50. data/lib/redmine_crm/settings.rb +53 -0
  51. data/lib/redmine_crm/version.rb +1 -1
  52. data/lib/redmine_crm.rb +60 -21
  53. data/redmine_crm.gemspec +12 -6
  54. data/test/acts_as_draftable/draft_test.rb +29 -0
  55. data/test/acts_as_draftable/rcrm_acts_as_draftable_test.rb +178 -0
  56. data/test/{acts_as_taggable_test.rb → acts_as_taggable/rcrm_acts_as_taggable_test.rb} +117 -156
  57. data/test/acts_as_taggable/tag_list_test.rb +34 -0
  58. data/test/acts_as_taggable/tag_test.rb +72 -0
  59. data/test/acts_as_taggable/tagging_test.rb +15 -0
  60. data/test/{viewed_test.rb → acts_as_viewed/rcrm_acts_as_viewed_test.rb} +17 -15
  61. data/test/acts_as_votable/rcrm_acts_as_votable_test.rb +19 -0
  62. data/test/acts_as_votable/rcrm_acts_as_voter_test.rb +14 -0
  63. data/test/{votable_model_test.rb → acts_as_votable/votable_test.rb} +34 -5
  64. data/test/{voter_model_test.rb → acts_as_votable/voter_test.rb} +8 -8
  65. data/test/currency_test.rb +10 -10
  66. data/test/database.yml +14 -14
  67. data/test/fixtures/issues.yml +13 -1
  68. data/test/fixtures/news.yml +8 -0
  69. data/test/fixtures/projects.yml +10 -0
  70. data/test/fixtures/users.yml +6 -2
  71. data/test/liquid/drops/issues_drop_test.rb +34 -0
  72. data/test/liquid/drops/news_drop_test.rb +38 -0
  73. data/test/liquid/drops/projects_drop_test.rb +44 -0
  74. data/test/liquid/drops/uses_drop_test.rb +36 -0
  75. data/test/liquid/filters/arrays_filter_test.rb +31 -0
  76. data/test/liquid/filters/base_filter_test.rb +63 -0
  77. data/test/liquid/filters/colors_filter_test.rb +33 -0
  78. data/test/liquid/liquid_helper.rb +34 -0
  79. data/test/models/issue.rb +14 -0
  80. data/test/models/news.rb +3 -0
  81. data/test/models/project.rb +8 -0
  82. data/test/{fixtures → models}/user.rb +5 -1
  83. data/test/{fixtures → models}/vote_classes.rb +0 -21
  84. data/test/money_helper_test.rb +5 -5
  85. data/test/schema.rb +33 -10
  86. data/test/test_helper.rb +20 -72
  87. data/vendor/assets/images/money.png +0 -0
  88. data/vendor/assets/images/vcard.png +0 -0
  89. data/vendor/assets/javascripts/Chart.bundle.min.js +16 -0
  90. data/vendor/assets/javascripts/select2.js +2 -0
  91. data/vendor/assets/javascripts/select2_helpers.js +192 -0
  92. data/vendor/assets/stylesheets/money.css +3 -0
  93. data/vendor/assets/stylesheets/select2.css +424 -0
  94. metadata +190 -40
  95. data/lib/redmine_crm/rcrm_acts_as_viewed.rb +0 -287
  96. data/lib/redmine_crm/rcrm_acts_as_voter.rb +0 -27
  97. data/lib/redmine_crm/tag.rb +0 -81
  98. data/lib/redmine_crm/tag_list.rb +0 -112
  99. data/lib/redmine_crm/tagging.rb +0 -20
  100. data/test/fixtures/issue.rb +0 -14
  101. data/test/tag_test.rb +0 -64
  102. data/test/tagging_test.rb +0 -14
  103. data/test/votable_test.rb +0 -17
@@ -0,0 +1,424 @@
1
+ .select2-container {
2
+ box-sizing: border-box;
3
+ display: inline-block;
4
+ margin: 0;
5
+ position: relative;
6
+ vertical-align: middle;
7
+ }
8
+ .select2-container .select2-selection--single {
9
+ box-sizing: border-box;
10
+ cursor: pointer;
11
+ display: block;
12
+ height: 28px;
13
+ user-select: none;
14
+ -webkit-user-select: none;
15
+ }
16
+ .select2-container .select2-selection--single .select2-selection__rendered {
17
+ display: block;
18
+ padding-left: 8px;
19
+ padding-right: 20px;
20
+ overflow: hidden;
21
+ text-overflow: ellipsis;
22
+ white-space: nowrap;
23
+ }
24
+ .select2-container .select2-selection--single .select2-selection__clear {
25
+ position: relative;
26
+ }
27
+ .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
28
+ padding-right: 8px;
29
+ padding-left: 20px;
30
+ }
31
+ .select2-container .select2-selection--multiple {
32
+ box-sizing: border-box;
33
+ cursor: pointer;
34
+ display: block;
35
+ min-height: 24px;
36
+ user-select: none;
37
+ -webkit-user-select: none;
38
+ }
39
+ .select2-container .select2-selection--multiple .select2-selection__rendered {
40
+ /*display: inline-block;*/
41
+ overflow: hidden;
42
+ padding-left: 8px;
43
+ text-overflow: ellipsis;
44
+ white-space: nowrap;
45
+ }
46
+ .select2-container .select2-search--inline {
47
+ float: left;
48
+ }
49
+ .select2-container .select2-search--inline .select2-search__field {
50
+ box-sizing: border-box;
51
+ border: none;
52
+ font-size: 100%;
53
+ margin-top: 2px;
54
+ padding: 0;
55
+ }
56
+ .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
57
+ -webkit-appearance: none;
58
+ }
59
+
60
+ .select2-dropdown {
61
+ background-color: white;
62
+ border: 1px solid #aaa;
63
+ border-radius: 4px;
64
+ box-sizing: border-box;
65
+ display: block;
66
+ position: absolute;
67
+ left: -100000px;
68
+ width: 100%;
69
+ z-index: 1051;
70
+ }
71
+
72
+ .select2-results {
73
+ display: block;
74
+ }
75
+
76
+ .select2-results__options {
77
+ list-style: none;
78
+ margin: 0;
79
+ padding: 0;
80
+ }
81
+
82
+ .select2-results__option {
83
+ padding: 6px;
84
+ user-select: none;
85
+ -webkit-user-select: none;
86
+ }
87
+ .select2-results__option[aria-selected] {
88
+ cursor: pointer;
89
+ }
90
+
91
+ .select2-container--open .select2-dropdown {
92
+ left: 0;
93
+ }
94
+
95
+ .select2-container--open .select2-dropdown--above {
96
+ border-bottom: none;
97
+ border-bottom-left-radius: 0;
98
+ border-bottom-right-radius: 0;
99
+ }
100
+
101
+ .select2-container--open .select2-dropdown--below {
102
+ border-top: none;
103
+ border-top-left-radius: 0;
104
+ border-top-right-radius: 0;
105
+ }
106
+
107
+ .select2-search--dropdown {
108
+ display: block;
109
+ padding: 4px;
110
+ }
111
+ .select2-search--dropdown .select2-search__field {
112
+ padding: 4px;
113
+ width: 100%;
114
+ box-sizing: border-box;
115
+ }
116
+ .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
117
+ -webkit-appearance: none;
118
+ }
119
+ .select2-search--dropdown.select2-search--hide {
120
+ display: none;
121
+ }
122
+
123
+ .select2-close-mask {
124
+ border: 0;
125
+ margin: 0;
126
+ padding: 0;
127
+ display: block;
128
+ position: fixed;
129
+ left: 0;
130
+ top: 0;
131
+ min-height: 100%;
132
+ min-width: 100%;
133
+ height: auto;
134
+ width: auto;
135
+ opacity: 0;
136
+ z-index: 99;
137
+ background-color: #fff;
138
+ filter: alpha(opacity=0);
139
+ }
140
+
141
+ .select2-hidden-accessible {
142
+ border: 0 !important;
143
+ clip: rect(0 0 0 0) !important;
144
+ height: 1px !important;
145
+ margin: -1px !important;
146
+ overflow: hidden !important;
147
+ padding: 0 !important;
148
+ position: absolute !important;
149
+ width: 1px !important;
150
+ }
151
+
152
+ .select2-container--default .select2-selection--single {
153
+ /*background: #fff url(../images/vcard.png) no-repeat 2px 50%;*/
154
+ background-color: #fff;
155
+ height: 24px;
156
+ border: 1px solid #ccc;
157
+ border-radius: 3px;
158
+ }
159
+
160
+ .select2-container--default .select2-selection--single.icon {
161
+ background-position-x: 3px;
162
+ }
163
+
164
+ .select2-container--default .select2-selection--single .select2-selection__rendered {
165
+ line-height: 21px;
166
+ font-size: 11px;
167
+ }
168
+
169
+ .select2-container--default .select2-selection--single.icon .select2-selection__rendered {
170
+ padding-left: 2px
171
+ }
172
+
173
+ .select2-container--default .select2-selection--single .select2-selection__clear {
174
+ cursor: pointer;
175
+ float: right;
176
+ font-weight: normal;
177
+ color: #888;
178
+ }
179
+ .select2-container--default .select2-selection--single .select2-selection__placeholder {
180
+ color: #999;
181
+ }
182
+ .select2-container--default .select2-selection--single .select2-selection__arrow {
183
+ height: 24px;
184
+ position: absolute;
185
+ top: 0px;
186
+ right: 1px;
187
+ width: 20px;
188
+ }
189
+ .select2-container--default .select2-selection--single .select2-selection__arrow b {
190
+ border-color: #888 transparent transparent transparent;
191
+ border-style: solid;
192
+ border-width: 5px 4px 0 4px;
193
+ height: 0;
194
+ left: 50%;
195
+ margin-left: -4px;
196
+ margin-top: -2px;
197
+ position: absolute;
198
+ top: 50%;
199
+ width: 0;
200
+ }
201
+ .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
202
+ float: left;
203
+ }
204
+ .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
205
+ left: 1px;
206
+ right: auto;
207
+ }
208
+ .select2-container--default.select2-container--disabled .select2-selection--single {
209
+ background-color: #eee;
210
+ cursor: default;
211
+ }
212
+ .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
213
+ display: none;
214
+ }
215
+ .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
216
+ border-color: transparent transparent #888 transparent;
217
+ border-width: 0 4px 5px 4px;
218
+ }
219
+ .select2-container--default .select2-selection--multiple {
220
+ background-color: white;
221
+ border: 1px solid #ccc;
222
+ border-radius: 3px;
223
+ cursor: text;
224
+ }
225
+
226
+ #sidebar .select2-container--default .select2-selection--multiple .select2-selection__rendered,
227
+ .select2-container--default .select2-selection--multiple .select2-selection__rendered {
228
+ box-sizing: border-box;
229
+ list-style: none;
230
+ margin: 0;
231
+ padding: 0 2px 1px 2px;
232
+ width: 100%;
233
+ }
234
+ .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
235
+ list-style: none;
236
+ }
237
+ .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
238
+ color: #999;
239
+ margin-top: 5px;
240
+ float: left;
241
+ }
242
+ .select2-container--default .select2-selection--multiple .select2-selection__clear {
243
+ cursor: pointer;
244
+ float: right;
245
+ font-weight: bold;
246
+ margin-top: 2px;
247
+ margin-right: 2px;
248
+ }
249
+
250
+ #sidebar .select2-container--default .select2-selection--multiple .select2-selection__choice,
251
+ .select2-container--default .select2-selection--multiple .select2-selection__choice {
252
+ background-color: #efefef;
253
+ border-radius: 2px;
254
+ cursor: default;
255
+ float: left;
256
+ margin-right: 2px;
257
+ margin-top: 2px;
258
+ padding: 0 3px;
259
+ }
260
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
261
+ color: #aaa;
262
+ cursor: pointer;
263
+ display: inline-block;
264
+ font-weight: normal;
265
+ margin-right: 2px;
266
+ }
267
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
268
+ color: #333;
269
+ }
270
+ .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
271
+ float: right;
272
+ }
273
+ .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
274
+ margin-left: 5px;
275
+ margin-right: auto;
276
+ }
277
+ .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
278
+ margin-left: 2px;
279
+ margin-right: auto;
280
+ }
281
+ .select2-container--default.select2-container--focus .select2-selection--multiple {
282
+ border: 1px solid #5ad;
283
+ outline: none;
284
+ }
285
+ .select2-container--default.select2-container--disabled .select2-selection--multiple {
286
+ background-color: #eee;
287
+ cursor: default;
288
+ }
289
+ .select2-container--default.select2-container--disabled .select2-selection__choice__remove {
290
+ display: none;
291
+ }
292
+ .select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
293
+ border-top-left-radius: 0;
294
+ border-top-right-radius: 0;
295
+ }
296
+ .select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
297
+ border-bottom-left-radius: 0;
298
+ border-bottom-right-radius: 0;
299
+ }
300
+ .select2-container--default .select2-search--dropdown .select2-search__field {
301
+ border: 1px solid #aaa;
302
+ }
303
+ .select2-container--default .select2-search--inline .select2-search__field {
304
+ background: transparent;
305
+ border: none;
306
+ outline: 0;
307
+ box-shadow: none;
308
+ -webkit-appearance: textfield;
309
+ height: 18px;
310
+ }
311
+ .select2-container--default .select2-results > .select2-results__options {
312
+ max-height: 200px;
313
+ overflow-y: auto;
314
+ }
315
+ .select2-container--default .select2-results__option[role=group] {
316
+ padding: 0;
317
+ }
318
+ .select2-container--default .select2-results__option[aria-disabled=true] {
319
+ color: #999;
320
+ }
321
+ .select2-container--default .select2-results__option[aria-selected=true] {
322
+ background-color: #eee;
323
+ }
324
+ .select2-container--default .select2-results__option .select2-results__option {
325
+ padding-left: 1em;
326
+ }
327
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__group {
328
+ padding-left: 0;
329
+ }
330
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option {
331
+ margin-left: -1em;
332
+ padding-left: 2em;
333
+ }
334
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
335
+ margin-left: -2em;
336
+ padding-left: 3em;
337
+ }
338
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
339
+ margin-left: -3em;
340
+ padding-left: 4em;
341
+ }
342
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
343
+ margin-left: -4em;
344
+ padding-left: 5em;
345
+ }
346
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
347
+ margin-left: -5em;
348
+ padding-left: 6em;
349
+ }
350
+ .select2-container--default .select2-results__option--highlighted[aria-selected] {
351
+ background-color: #eef5fd;
352
+ }
353
+ .select2-container--default .select2-results__group {
354
+ cursor: default;
355
+ display: block;
356
+ padding: 6px;
357
+ }
358
+
359
+ .filter .select2 {
360
+ margin: 1px;
361
+ }
362
+
363
+ .filter .select2-selection--multiple .select2-search--inline .select2-search__field {
364
+ border: 0px !important;
365
+ height: inherit !important;
366
+ padding: 0px !important;
367
+ }
368
+
369
+ .filter .select2-container--default .select2-selection--multiple .select2-selection__choice {
370
+ outline: none;
371
+ border: 0px;
372
+ padding: 3px 5px;
373
+ }
374
+
375
+ /* == Theming ===
376
+
377
+ .select2-container--default .select2-selection--single {
378
+ background: #fff url(../images/vcard.png) no-repeat 2px 50%;
379
+ border: 1px solid #9EB1C2;
380
+ border-radius: 2px;
381
+ height: 21px;
382
+ }
383
+
384
+ .select2-container--default .select2-selection--single:focus {
385
+ border-color: #2996cc;
386
+ outline: none;
387
+ }
388
+
389
+ .select2-container--default .select2-selection--single .select2-selection__rendered {
390
+ padding-left: 21px;
391
+ line-height: 18px;
392
+ font-size: 11px;
393
+ }
394
+
395
+ .select2-container--default .select2-selection--single .select2-selection__arrow {
396
+ height: 20px;
397
+ top: 0px;
398
+ right: 1px;
399
+ }
400
+
401
+ .select2-container--default .select2-selection--single .select2-selection__clear {
402
+ font-weight: normal;
403
+ color: #888;
404
+ }
405
+
406
+ .select2-container--default .select2-results__option[aria-selected=true] {
407
+ background-color: #eee;
408
+ }
409
+
410
+ .select2-container--default .select2-results__option--highlighted[aria-selected] {
411
+ background-color: #eef5fd;
412
+ }
413
+
414
+ .select2-container--default .select2-selection--single .select2-selection__arrow b {
415
+ border-color: #afafaf transparent transparent transparent;
416
+ }
417
+
418
+ .select2-dropdown {
419
+ border: 1px solid #e0e2e3;
420
+ border-radius: 3px;
421
+ }
422
+
423
+ */
424
+