elabs 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +6 -0
  3. data/CHANGELOG.md +83 -0
  4. data/Gemfile +3 -1
  5. data/Gemfile.lock +9 -2
  6. data/ROADMAP.md +6 -11
  7. data/app/assets/stylesheets/elabs/_icons.scss +8 -4
  8. data/app/assets/stylesheets/elabs/app/_badges.scss +11 -0
  9. data/app/assets/stylesheets/elabs/app/_layout.scss +10 -2
  10. data/app/assets/stylesheets/elabs/app/_users.scss +7 -0
  11. data/app/assets/stylesheets/elabs/app/admin-members/_indexes.scss +2 -1
  12. data/app/assets/stylesheets/elabs/app/mixins/_content-card.scss +4 -0
  13. data/app/assets/stylesheets/elabs/app/mixins/_content-full.scss +17 -5
  14. data/app/assets/stylesheets/elabs/lib/knacss/_knacss-variables.scss +16 -15
  15. data/app/assets/stylesheets/elabs/lib/knacss/_knacss.scss +1 -1
  16. data/app/assets/stylesheets/elabs/style.scss +1 -0
  17. data/app/controllers/elabs/acts_controller.rb +1 -1
  18. data/app/controllers/elabs/admin/admin_content_application_controller.rb +13 -6
  19. data/app/controllers/elabs/admin/languages_controller.rb +4 -4
  20. data/app/controllers/elabs/admin/licenses_controller.rb +2 -2
  21. data/app/controllers/elabs/admin/tags_controller.rb +3 -3
  22. data/app/controllers/elabs/concerns/elabs_controller.rb +1 -0
  23. data/app/controllers/elabs/content_application_controller.rb +1 -1
  24. data/app/controllers/elabs/elabs_application_controller.rb +0 -73
  25. data/app/controllers/elabs/elabs_public_controller.rb +80 -0
  26. data/app/controllers/elabs/languages_controller.rb +3 -3
  27. data/app/controllers/elabs/licenses_controller.rb +3 -3
  28. data/app/controllers/elabs/member/member_content_application_controller.rb +24 -14
  29. data/app/controllers/elabs/member/notifications_controller.rb +30 -0
  30. data/app/controllers/elabs/member/preferences_controller.rb +1 -1
  31. data/app/controllers/elabs/member/users_controller.rb +8 -5
  32. data/app/controllers/elabs/reports_controller.rb +2 -2
  33. data/app/controllers/elabs/tags_controller.rb +2 -2
  34. data/app/controllers/elabs/users_controller.rb +3 -3
  35. data/app/helpers/elabs/admin_content_helper.rb +8 -24
  36. data/app/helpers/elabs/application_helper.rb +1 -1
  37. data/app/helpers/elabs/content_helper.rb +39 -0
  38. data/app/helpers/elabs/form_helper.rb +22 -10
  39. data/app/helpers/elabs/member_content_helper.rb +5 -22
  40. data/app/helpers/elabs/notification_helper.rb +69 -0
  41. data/app/helpers/elabs/thumbnails_helper.rb +15 -0
  42. data/app/helpers/elabs/time_helper.rb +7 -0
  43. data/app/models/elabs/application_content_record.rb +1 -0
  44. data/app/models/elabs/application_record.rb +2 -0
  45. data/app/models/elabs/comment.rb +14 -0
  46. data/app/models/elabs/concerns/actable_entity.rb +0 -12
  47. data/app/models/elabs/concerns/content_entity.rb +23 -0
  48. data/app/models/elabs/concerns/notifiable_entity.rb +46 -0
  49. data/app/models/elabs/notification.rb +10 -0
  50. data/app/models/elabs/preference.rb +2 -0
  51. data/app/models/elabs/report.rb +10 -0
  52. data/app/models/elabs/user.rb +26 -6
  53. data/app/views/elabs/acts/_act.json.jbuilder +7 -2
  54. data/app/views/elabs/acts/index.json.jbuilder +1 -1
  55. data/app/views/elabs/admin/albums/_album.json.jbuilder +15 -2
  56. data/app/views/elabs/admin/albums/index.html.haml +1 -1
  57. data/app/views/elabs/admin/albums/index.json.jbuilder +1 -1
  58. data/app/views/elabs/admin/articles/_article.json.jbuilder +15 -2
  59. data/app/views/elabs/admin/articles/index.html.haml +1 -1
  60. data/app/views/elabs/admin/articles/index.json.jbuilder +1 -1
  61. data/app/views/elabs/admin/languages/_language.json.jbuilder +9 -2
  62. data/app/views/elabs/admin/languages/index.html.haml +1 -1
  63. data/app/views/elabs/admin/languages/index.json.jbuilder +1 -1
  64. data/app/views/elabs/admin/licenses/_license.json.jbuilder +10 -2
  65. data/app/views/elabs/admin/licenses/index.html.haml +1 -1
  66. data/app/views/elabs/admin/licenses/index.json.jbuilder +1 -1
  67. data/app/views/elabs/admin/notes/_note.json.jbuilder +13 -2
  68. data/app/views/elabs/admin/notes/index.html.haml +1 -1
  69. data/app/views/elabs/admin/notes/index.json.jbuilder +1 -1
  70. data/app/views/elabs/admin/projects/_project.json.jbuilder +20 -2
  71. data/app/views/elabs/admin/projects/index.html.haml +1 -1
  72. data/app/views/elabs/admin/projects/index.json.jbuilder +1 -1
  73. data/app/views/elabs/admin/reports/_report.json.jbuilder +10 -0
  74. data/app/views/elabs/admin/reports/index.html.haml +1 -1
  75. data/app/views/elabs/admin/reports/index.json.jbuilder +1 -1
  76. data/app/views/elabs/admin/tags/_tag.json.jbuilder +8 -2
  77. data/app/views/elabs/admin/tags/index.html.haml +1 -1
  78. data/app/views/elabs/admin/tags/index.json.jbuilder +1 -1
  79. data/app/views/elabs/admin/uploads/_upload.json.jbuilder +17 -2
  80. data/app/views/elabs/admin/uploads/index.html.haml +1 -1
  81. data/app/views/elabs/admin/uploads/index.json.jbuilder +1 -1
  82. data/app/views/elabs/admin/users/_user.json.jbuilder +14 -0
  83. data/app/views/elabs/admin/users/index.html.haml +6 -2
  84. data/app/views/elabs/admin/users/index.json.jbuilder +1 -1
  85. data/app/views/elabs/admin/users/show.html.haml +1 -1
  86. data/app/views/elabs/admin/users/show.json.jbuilder +1 -1
  87. data/app/views/elabs/albums/_album.html.haml +2 -2
  88. data/app/views/elabs/albums/_album.json.jbuilder +12 -2
  89. data/app/views/elabs/albums/index.json.jbuilder +1 -1
  90. data/app/views/elabs/albums/show.html.haml +7 -7
  91. data/app/views/elabs/albums/show.json.jbuilder +1 -1
  92. data/app/views/elabs/articles/_article.html.haml +2 -2
  93. data/app/views/elabs/articles/_article.json.jbuilder +12 -2
  94. data/app/views/elabs/articles/index.json.jbuilder +1 -1
  95. data/app/views/elabs/articles/show.html.haml +6 -6
  96. data/app/views/elabs/articles/show.json.jbuilder +1 -1
  97. data/app/views/elabs/auth/registrations/edit.html.haml +8 -5
  98. data/app/views/elabs/comments/_comment.json.jbuilder +10 -2
  99. data/app/views/elabs/comments/_comments.html.haml +2 -2
  100. data/app/views/elabs/languages/_language.json.jbuilder +9 -2
  101. data/app/views/elabs/languages/index.json.jbuilder +1 -1
  102. data/app/views/elabs/languages/show.html.haml +1 -1
  103. data/app/views/elabs/languages/show.json.jbuilder +1 -1
  104. data/app/views/elabs/layouts/_menu.html.haml +10 -5
  105. data/app/views/elabs/licenses/_license.json.jbuilder +10 -2
  106. data/app/views/elabs/licenses/index.json.jbuilder +1 -1
  107. data/app/views/elabs/licenses/show.html.haml +2 -6
  108. data/app/views/elabs/member/albums/_album.json.jbuilder +15 -2
  109. data/app/views/elabs/member/albums/index.html.haml +1 -1
  110. data/app/views/elabs/member/albums/index.json.jbuilder +1 -1
  111. data/app/views/elabs/member/articles/_article.json.jbuilder +15 -2
  112. data/app/views/elabs/member/articles/index.html.haml +1 -1
  113. data/app/views/elabs/member/articles/index.json.jbuilder +1 -1
  114. data/app/views/elabs/member/layouts/_empty.html.haml +3 -2
  115. data/app/views/elabs/member/notes/_note.json.jbuilder +13 -2
  116. data/app/views/elabs/member/notes/index.html.haml +1 -1
  117. data/app/views/elabs/member/notes/index.json.jbuilder +1 -1
  118. data/app/views/elabs/member/notifications/_notification.json.jbuilder +8 -0
  119. data/app/views/elabs/member/notifications/index.html.haml +21 -0
  120. data/app/views/elabs/member/notifications/index.json.jbuilder +1 -0
  121. data/app/views/elabs/member/preferences/_form.html.haml +6 -0
  122. data/app/views/elabs/member/preferences/edit.html.haml +2 -1
  123. data/app/views/elabs/member/projects/_project.json.jbuilder +20 -2
  124. data/app/views/elabs/member/projects/index.html.haml +1 -1
  125. data/app/views/elabs/member/projects/index.json.jbuilder +1 -1
  126. data/app/views/elabs/member/uploads/_upload.json.jbuilder +17 -2
  127. data/app/views/elabs/member/uploads/index.html.haml +1 -1
  128. data/app/views/elabs/member/uploads/index.json.jbuilder +1 -1
  129. data/app/views/elabs/member/users/_form.html.haml +14 -9
  130. data/app/views/elabs/member/users/edit.html.haml +7 -0
  131. data/app/views/elabs/notes/_note.html.haml +2 -2
  132. data/app/views/elabs/notes/_note.json.jbuilder +10 -2
  133. data/app/views/elabs/notes/index.json.jbuilder +1 -1
  134. data/app/views/elabs/notes/show.html.haml +5 -5
  135. data/app/views/elabs/notes/show.json.jbuilder +1 -1
  136. data/app/views/elabs/projects/_project.html.haml +2 -2
  137. data/app/views/elabs/projects/_project.json.jbuilder +17 -0
  138. data/app/views/elabs/projects/index.json.jbuilder +1 -1
  139. data/app/views/elabs/projects/show.html.haml +14 -11
  140. data/app/views/elabs/projects/show.json.jbuilder +1 -1
  141. data/app/views/elabs/tags/_tag.json.jbuilder +8 -2
  142. data/app/views/elabs/tags/index.json.jbuilder +1 -1
  143. data/app/views/elabs/tags/show.json.jbuilder +1 -1
  144. data/app/views/elabs/uploads/_upload.html.haml +1 -1
  145. data/app/views/elabs/uploads/_upload.json.jbuilder +14 -2
  146. data/app/views/elabs/uploads/index.json.jbuilder +1 -1
  147. data/app/views/elabs/uploads/show.html.haml +12 -3
  148. data/app/views/elabs/uploads/show.json.jbuilder +1 -1
  149. data/app/views/elabs/users/_user.html.haml +10 -3
  150. data/app/views/elabs/users/_user.json.jbuilder +14 -2
  151. data/app/views/elabs/users/index.json.jbuilder +1 -1
  152. data/app/views/elabs/users/show.html.haml +15 -10
  153. data/app/views/elabs/users/show.json.jbuilder +1 -1
  154. data/config/routes.rb +21 -16
  155. data/db/migrate/20180910000015_remove_license_timestamps.rb +6 -0
  156. data/db/migrate/20180910175012_create_notifications.rb +13 -0
  157. data/db/migrate/20180913093027_add_fields_in_preferences.rb +6 -0
  158. data/docs/migrating.md +14 -0
  159. data/docs/setup.md +1 -0
  160. data/lib/elabs.rb +3 -0
  161. data/lib/elabs/version.rb +1 -1
  162. data/lib/generators/elabs/required_assets_generator.rb +1 -1
  163. data/lib/generators/templates/elabs.rb +6 -0
  164. data/locale/app.pot +73 -14
  165. data/locale/en/app.edit.po +71 -12
  166. data/locale/en/app.po +71 -12
  167. data/locale/fr/app.edit.po +76 -17
  168. data/locale/fr/app.po +75 -16
  169. data/package.json +4 -4
  170. metadata +19 -5
  171. data/app/assets/images/elabs/preview_placeholder.png +0 -0
  172. data/app/assets/images/elabs/preview_placeholder_nsfw.png +0 -0
  173. data/app/views/elabs/admin/users/_admin_user.json.jbuilder +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b290d73dc3d912c67d96bb1be6f003e3937379450feeb5d5fb10de85e8c2d152
4
- data.tar.gz: 895e5179cadaf4ca0dc9cd616cfcae0df47955d0330cb803cd4d65d6cc3423c9
3
+ metadata.gz: 179fc820588cdbe7ae3de5e0c42a37a678fab8e0e190a173426e493302f23556
4
+ data.tar.gz: 7e720b16441c9044c6e9489f71a32b95e1e392e9d8ffb4de25ab3916d113c482
5
5
  SHA512:
6
- metadata.gz: dfadce23c0741913e150116ae8388e78e2f39287604036231116163b29174e1510ebf40a62ae067a02012b3041528dfa5531aaf66cf06aa05ba2373d402165af
7
- data.tar.gz: 971646fbaee841718146fd8161fc8429ef6fa40fac4b1659034232eee7a997ea0442e579db580e66ea39da38e3108dad35c2686af68a8a1012f1a8229b5edd26
6
+ metadata.gz: 9983023566a96ad10c252882c4b05c68c719bb477127b6361f5364b70ff6359f9e35c59158f522ab6f24b9b554da544a319241e4281cb4d1dc1673bea0e25b79
7
+ data.tar.gz: 8f2474412043a4f25ac5277ef001b3b8ea06974da8500c4328de52839c3986416923cf70c250829388cbd600a15c111f033c89c4fcd0450daae8f31d8ee1e0d7
data/.gitignore CHANGED
@@ -47,3 +47,9 @@ yarn-error.log
47
47
  # Ignore installation-specific files
48
48
  /spec/dummy/config/database.yml
49
49
  /spec/dummy/db/schema.rb
50
+
51
+ # Dev server files
52
+ /tmp/pids/server.pid
53
+
54
+ # Packaged gems
55
+ /pkg
@@ -1,6 +1,89 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [3.0.0] - 2018-09-17 - Notifications and avatars
5
+ ### Added
6
+
7
+ - User model:
8
+ - new `admins` scope to find all admins
9
+ - new `display_name` method to return the real name or username as
10
+ fallback
11
+ - Experimental avatar support (ActiveStorage attachment `avatar`).
12
+ **NOTE** that there are issues with uploads validation
13
+ ([ActiveStorage validations are not supported for now](https://stackoverflow.com/questions/51872521/how-to-prevent-active-storage-updating-model-when-validation-fails)),
14
+ leading to the uploaded file being saved even if validation fails.
15
+ To prevent this, the attached file is deleted on failure,
16
+ resulting on avatar suppression.To disable avatar support, set
17
+ `Elabs::use_avatars` to false in the initializer.
18
+
19
+ - Notifications:
20
+ - MVC for simple notification system
21
+ - Updated reports/comments to use notifications on save. Updated
22
+ admin actions as "lock", "unlock", "delete" to notify the authors
23
+ - New `NotifiableEntity` concern for content models
24
+
25
+ - Misc:
26
+ - Date helper: new `short_date(date)` method
27
+
28
+ ### Changed
29
+
30
+ - Views:
31
+ - `members/layout/_empty`: button to create content is now optional
32
+ - Updated views to use `user.display_name` when needed
33
+ - License icon is now a balance-scale icon
34
+ - Short dates
35
+ - Separators between information types on "show" views
36
+ - Reordered menus
37
+ - `ActableEntity` concern: moved `current_publish_action`,
38
+ `current_lock_action` and `current_update_action` to the
39
+ `ContentEntity` concern, as they are now shared between "actable"
40
+ and "notifiable" concerns
41
+
42
+ ### Improved
43
+
44
+ - Factorized some helper methods from "admin_content_helper" and
45
+ "member_content_helper" in "content_helper"
46
+ - Methods for public controllers are now in a `ElabsPublicController`.
47
+ All custom public controller should extend this new controller instead
48
+ of `ElabsApplicationController`
49
+ - Improved `xxx_selector` methods to be able to specify the field name
50
+ and the `multiple` select variant.
51
+
52
+ ### Removed
53
+
54
+ ### Fixed
55
+
56
+ - Fixed `current_publish_action` and `current_lock_action`: they now
57
+ return `:nothing` if content is already unpublished or locked.
58
+ - Sort order in public views for users, tags, languages and licenses
59
+
60
+ ## Planned
61
+
62
+ Note that the elements in this list may change during development; it' a
63
+ general idea of what will be done next.
64
+ - [3.0.0] - Notifications
65
+ - [4.0.0] - Urls table to attach urls to content, share favorites
66
+ - [5.0.0] - Teams to attach user and distant people to projects
67
+ - [6.0.0] - Projects: commits aggregation
68
+ - [7.0.0] - Users: service status aggregation without storage for now
69
+ - [8.0.0] - Raw content for everything
70
+
71
+ ## [2.0.1] - 2018-09-10 - JSON views
72
+ ### Added
73
+
74
+ - Added "Active" and "Password reset" columns in admin users list to
75
+ have a better understanding of the users statuses
76
+
77
+ ### Improved
78
+
79
+ - Reviewed and updated all JSON views for future use in ajax requests
80
+
81
+ ### Removed
82
+
83
+ - Removed the timestamps from the licenses table. You'll need to
84
+ create a migration that drops `created_at` and `updated_at` on the
85
+ `licenses` table
86
+
4
87
  ## [2.0.0] - 2018-09-08 - Rails engine
5
88
  Everything seems to run fine, it's enough for a major version.
6
89
 
data/Gemfile CHANGED
@@ -15,6 +15,7 @@ group :development, :test do
15
15
  # -------------------------------------------------------
16
16
  # Gems needed for the dummy application
17
17
  # -------------------------------------------------------
18
+ gem 'jbuilder', '~> 2.5'
18
19
  # See https://github.com/rails/execjs#readme for more supported runtimes
19
20
  gem 'mini_racer', platforms: :ruby
20
21
  # Use ActiveStorage variant
@@ -26,10 +27,11 @@ group :development, :test do
26
27
  gem 'devise'
27
28
  gem 'haml-rails'
28
29
  gem 'kaminari'
29
- gem 'rails', '~> 5.2.1'
30
+ # gem 'rails', '~> 5.2.1'
30
31
  gem 'sass-rails', '~> 5.0'
31
32
  # Translations
32
33
  gem 'gettext_i18n_rails'
34
+ gem 'rails-i18n'
33
35
 
34
36
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
35
37
  gem 'byebug', platforms: %i[mri mingw x64_mingw]
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- elabs (2.0.0)
12
+ elabs (3.0.0)
13
13
  rails (~> 5.2.1)
14
14
 
15
15
  GEM
@@ -160,6 +160,9 @@ GEM
160
160
  concurrent-ruby (~> 1.0)
161
161
  io-like (0.3.0)
162
162
  jaro_winkler (1.5.1)
163
+ jbuilder (2.7.0)
164
+ activesupport (>= 4.2.0)
165
+ multi_json (>= 1.2)
163
166
  json (2.1.0)
164
167
  kaminari (1.1.1)
165
168
  activesupport (>= 4.1.0)
@@ -236,6 +239,9 @@ GEM
236
239
  nokogiri (>= 1.6)
237
240
  rails-html-sanitizer (1.0.4)
238
241
  loofah (~> 2.2, >= 2.2.2)
242
+ rails-i18n (5.1.1)
243
+ i18n (>= 0.7, < 2)
244
+ railties (>= 5.0, < 6)
239
245
  railties (5.2.1)
240
246
  actionpack (= 5.2.1)
241
247
  activesupport (= 5.2.1)
@@ -354,13 +360,14 @@ DEPENDENCIES
354
360
  gettext_i18n_rails
355
361
  haml-rails
356
362
  haml_lint
363
+ jbuilder (~> 2.5)
357
364
  kaminari
358
365
  listen (>= 3.0.5, < 3.2)
359
366
  mini_magick (~> 4.8)
360
367
  mini_racer
361
368
  pg
362
- rails (~> 5.2.1)
363
369
  rails-controller-testing
370
+ rails-i18n
364
371
  rspec-rails
365
372
  rubocop
366
373
  ruby_parser
data/ROADMAP.md CHANGED
@@ -19,26 +19,21 @@ See the [issues](https://gitlab.com/experimentslabs/website/website/issues) for
19
19
 
20
20
  Note that the elements in this list may change during development; it' a
21
21
  general idea of what will be done next.
22
- - [2.0.0 (currently working on)] - Make an engine
23
- - [1.1.0] - JSON views for everything
24
- - [2.2.0] - Notifications
25
- - [2.3.0] - Urls table to attach urls to content, share favorites
26
- - [2.4.0] - Teams to attach user and distant people to projects
27
- - [2.5.0] - Projects: commits aggregation
28
- - [2.6.0] - Users: service status aggregation without storage for now
29
- - [2.7.0] - Raw content for everything
22
+ - [4.0.0] - Urls table to attach urls to content, share favorites
23
+ - [5.0.0] - Teams to attach user and distant people to projects
24
+ - [6.0.0] - Projects: commits aggregation
25
+ - [7.0.0] - Users: service status aggregation without storage for now
26
+ - [8.0.0] - Raw content for everything
30
27
 
31
28
  ## Wonderland
32
29
  - ~~Rails engine~~ (since 2.0.0)
33
- - Avatars for authors
34
- - Support for custom fields ?
35
30
  - Move HTML helpers to decorators (https://github.com/drapergem/draper)
36
31
  AND/OR use a better templating system, as [Cells](http://trailblazer.to/gems/cells/)
32
+ - Support for custom fields ?
37
33
  - Export raw content (markdown, files)
38
34
  - Content translations (community made)
39
35
  - Teams (people with common projects)
40
36
  - Projects users
41
- - Sharing across instances
42
37
  - Urls management (lists of URLs, favorites, sources,...)
43
38
  - Content: code snippets
44
39
  - Content references (reference others work in your own work)
@@ -1,9 +1,13 @@
1
- /* stylelint-disable rule-empty-line-before */
2
-
3
1
  // Icons in this file are only fontawesome icons with a more semantic name
2
+
4
3
  .#{$fa-css-prefix}-amount:before { content: fa-content($fa-var-hashtag); }
4
+
5
5
  .#{$fa-css-prefix}-is-sfw:before { content: fa-content($fa-var-check); }
6
+
6
7
  .#{$fa-css-prefix}-is-nsfw:before { content: fa-content($fa-var-times); }
7
- .#{$fa-css-prefix}-license:before { content: fa-content($fa-var-copyright); }
8
8
 
9
- /* stylelint-enable rule-empty-line-before */
9
+ .#{$fa-css-prefix}-license:before { content: fa-content($fa-var-balance-scale); }
10
+
11
+ .#{$fa-css-prefix}-experience:before { content: fa-content($fa-var-flask); }
12
+
13
+ .#{$fa-css-prefix}-mime-type:before { content: fa-content($fa-var-wrench); }
@@ -0,0 +1,11 @@
1
+ .badge {
2
+
3
+ &--notification {
4
+ min: {
5
+ width: 2rem;
6
+ height: 1rem;
7
+ }
8
+ text-align: center;
9
+ font-size: $font-size-base - .4rem;
10
+ }
11
+ }
@@ -1,6 +1,13 @@
1
1
  .page {
2
2
  background-color: $color-brand;
3
3
 
4
+ // Admin pages variation ------------
5
+
6
+ &--admin {
7
+ border: 5px solid $color-danger;
8
+ min-height: 100vh;
9
+ }
10
+
4
11
  // Page menu ------------------------
5
12
 
6
13
  &__menu {
@@ -66,8 +73,9 @@
66
73
  &--admin {
67
74
  background-color: $color-red-50;
68
75
  border-bottom-color: darken($color-red-50, 5%);
69
- box-shadow: inset 0 3px 8px -4px $color-borders,
70
- 0 3px 8px -4px $color-borders;
76
+ box-shadow:
77
+ inset 0 3px 8px -4px $color-borders,
78
+ 0 3px 8px -4px $color-borders;
71
79
 
72
80
  a {
73
81
  color: darken($color-red-50, 15%);
@@ -3,4 +3,11 @@
3
3
  .users-list {
4
4
  @include grid(4, $spacer-small);
5
5
  @include classifier-card('user', $el-user-bg);
6
+
7
+ .user-card {
8
+
9
+ header {
10
+ height: 64px;
11
+ }
12
+ }
6
13
  }
@@ -18,7 +18,8 @@
18
18
  .licenses-list,
19
19
  .tags-list,
20
20
  .reports-list,
21
- .users-list {
21
+ .users-list,
22
+ .notifications-list{
22
23
  display: table;
23
24
  width: 100%;
24
25
  font-size: .8em;
@@ -17,6 +17,10 @@
17
17
  padding: 0;
18
18
  flex: none;
19
19
  margin-right: $spacer-tiny;
20
+
21
+ img {
22
+ border-radius: $border-radius;
23
+ }
20
24
  }
21
25
 
22
26
  h3 {
@@ -19,12 +19,24 @@
19
19
  padding-top: $spacer-tiny;
20
20
  border-top: 1px dashed $color-borders;
21
21
  }
22
- }
23
- }
24
22
 
25
- .date,
26
- .license {
27
- margin-left: $spacer-small-plus;
23
+ &.image {
24
+ padding: 0;
25
+ margin: (-$spacer-tiny) (-$spacer-small) ($spacer-small) (-$spacer-small);
26
+
27
+ /* stylelint-disable max-nesting-depth */
28
+
29
+ img {
30
+ width: 100%;
31
+ border-top: {
32
+ left-radius: $border-radius-lg;
33
+ right-radius: $border-radius-lg;
34
+ }
35
+ }
36
+
37
+ /* stylelint-enable max-nesting-depth */
38
+ }
39
+ }
28
40
  }
29
41
  }
30
42
 
@@ -193,21 +193,22 @@ $switch-border-radius: 3em;
193
193
  // Components: buttons, badges, alerts color variants list
194
194
  // Convention is: name - background-color - color - border
195
195
  $variants-list: (
196
- (download, $color-brand, $white, none),
197
- (primary, $color-primary, $white, none),
198
- (new, $color-primary, $white, none),
199
- (save, $color-success, $white, none),
200
- (show, $color-primary, $white, none),
201
- (edit, $color-primary, $white, none),
202
- (success, $color-success, $white, none),
203
- (info, $color-info, $black, none),
204
- (notice, $color-info, $black, none),
205
- (warning, $color-warning, $black, none),
206
- (lock, $color-warning, $black, none),
207
- (danger, $color-danger, $white, none),
208
- (destroy, $color-danger, $white, none),
209
- (inverse, $color-inverse, $white, none),
210
- (ghost, $color-ghost, $white, 0 0 0 1px $white inset)
196
+ (download, $color-brand, $white, none),
197
+ (primary, $color-primary, $white, none),
198
+ (new, $color-primary, $white, none),
199
+ (save, $color-success, $white, none),
200
+ (show, $color-primary, $white, none),
201
+ (edit, $color-primary, $white, none),
202
+ (success, $color-success, $white, none),
203
+ (info, $color-info, $black, none),
204
+ (notice, $color-info, $black, none),
205
+ (warning, $color-warning, $black, none),
206
+ (lock, $color-warning, $black, none),
207
+ (danger, $color-danger, $white, none),
208
+ (destroy, $color-danger, $white, none),
209
+ (inverse, $color-inverse, $white, none),
210
+ (experimental, $color-brand, $color-base, none),
211
+ (ghost, $color-ghost, $white, 0 0 0 1px $white inset)
211
212
  ) !default;
212
213
 
213
214
  // Component: tabs
@@ -53,7 +53,7 @@
53
53
  //@import "knacss/sass/components/tabs"; // tabs styles
54
54
  //@import "knacss/sass/components/arrows"; // arrows styles
55
55
  //@import "knacss/sass/components/tags"; // tags styles
56
- //@import "knacss/sass/components/badges"; // badges styles
56
+ @import "knacss/sass/components/badges"; // badges styles
57
57
  @import "knacss/sass/components/alerts"; // alerts styles
58
58
 
59
59
  /* stylelint-enable */
@@ -37,6 +37,7 @@
37
37
  // App specific elements
38
38
  @import 'app/acts';
39
39
  @import 'app/alerts';
40
+ @import 'app/badges';
40
41
  @import 'app/buttons';
41
42
  @import 'app/comments';
42
43
  @import 'app/content';
@@ -1,5 +1,5 @@
1
1
  module Elabs
2
- class ActsController < ElabsApplicationController
2
+ class ActsController < ElabsPublicController
3
3
  ALLOWED_ORDER_FROM = %w[created_at].freeze
4
4
  DEFAULT_ORDER = { created_at: :desc }.freeze
5
5
 
@@ -18,6 +18,7 @@ module Elabs
18
18
  # DELETE /<entity>/1
19
19
  # DELETE /<entity>/1.json
20
20
  def destroy
21
+ @entity.changed_by = current_user
21
22
  @entity.destroy
22
23
  respond_to do |format|
23
24
  format.html { redirect_to index_url, notice: format(_('%<model_name>s was successfully destroyed.'), model_name: self.class::SINGULAR_NAME.capitalize) }
@@ -25,21 +26,23 @@ module Elabs
25
26
  end
26
27
  end
27
28
 
29
+ # rubocop:disable Metrics/AbcSize
28
30
  # PUT /<entity>/1/toggle_lock
29
31
  def toggle_lock
30
- if @entity.toggle(:locked).save
31
- respond_to do |format|
32
+ @entity.changed_by = current_user
33
+ respond_to do |format|
34
+ if @entity.toggle(:locked).save
32
35
  format.html { redirect_to index_url, notice: lock_message(@entity) }
33
- format.json { render :show, status: :ok }
34
- end
35
- else
36
- respond_to do |format|
36
+ format.json { render partial_name, status: :ok, locals: { "#{self.class::SINGULAR_NAME}": @entity } }
37
+ else
37
38
  format.html { redirect_to index_url, error: 'An error prevented to update this entity' }
38
39
  format.json { render json: @entity.errors, status: :unprocessable_entity }
39
40
  end
40
41
  end
41
42
  end
42
43
 
44
+ # rubocop:enable Metrics/AbcSize
45
+
43
46
  private
44
47
 
45
48
  # Use callbacks to share common setup or constraints between actions.
@@ -53,6 +56,10 @@ module Elabs
53
56
  "admin_#{self.class::PLURAL_NAME}".to_sym
54
57
  end
55
58
 
59
+ def partial_name
60
+ "_#{self.class::SINGULAR_NAME}".to_sym
61
+ end
62
+
56
63
  def lock_message(entity)
57
64
  message = if entity.locked?
58
65
  _('%<model_name>s was successfully locked.')