elabs 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +6 -0
- data/CHANGELOG.md +83 -0
- data/Gemfile +3 -1
- data/Gemfile.lock +9 -2
- data/ROADMAP.md +6 -11
- data/app/assets/stylesheets/elabs/_icons.scss +8 -4
- data/app/assets/stylesheets/elabs/app/_badges.scss +11 -0
- data/app/assets/stylesheets/elabs/app/_layout.scss +10 -2
- data/app/assets/stylesheets/elabs/app/_users.scss +7 -0
- data/app/assets/stylesheets/elabs/app/admin-members/_indexes.scss +2 -1
- data/app/assets/stylesheets/elabs/app/mixins/_content-card.scss +4 -0
- data/app/assets/stylesheets/elabs/app/mixins/_content-full.scss +17 -5
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss-variables.scss +16 -15
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss.scss +1 -1
- data/app/assets/stylesheets/elabs/style.scss +1 -0
- data/app/controllers/elabs/acts_controller.rb +1 -1
- data/app/controllers/elabs/admin/admin_content_application_controller.rb +13 -6
- data/app/controllers/elabs/admin/languages_controller.rb +4 -4
- data/app/controllers/elabs/admin/licenses_controller.rb +2 -2
- data/app/controllers/elabs/admin/tags_controller.rb +3 -3
- data/app/controllers/elabs/concerns/elabs_controller.rb +1 -0
- data/app/controllers/elabs/content_application_controller.rb +1 -1
- data/app/controllers/elabs/elabs_application_controller.rb +0 -73
- data/app/controllers/elabs/elabs_public_controller.rb +80 -0
- data/app/controllers/elabs/languages_controller.rb +3 -3
- data/app/controllers/elabs/licenses_controller.rb +3 -3
- data/app/controllers/elabs/member/member_content_application_controller.rb +24 -14
- data/app/controllers/elabs/member/notifications_controller.rb +30 -0
- data/app/controllers/elabs/member/preferences_controller.rb +1 -1
- data/app/controllers/elabs/member/users_controller.rb +8 -5
- data/app/controllers/elabs/reports_controller.rb +2 -2
- data/app/controllers/elabs/tags_controller.rb +2 -2
- data/app/controllers/elabs/users_controller.rb +3 -3
- data/app/helpers/elabs/admin_content_helper.rb +8 -24
- data/app/helpers/elabs/application_helper.rb +1 -1
- data/app/helpers/elabs/content_helper.rb +39 -0
- data/app/helpers/elabs/form_helper.rb +22 -10
- data/app/helpers/elabs/member_content_helper.rb +5 -22
- data/app/helpers/elabs/notification_helper.rb +69 -0
- data/app/helpers/elabs/thumbnails_helper.rb +15 -0
- data/app/helpers/elabs/time_helper.rb +7 -0
- data/app/models/elabs/application_content_record.rb +1 -0
- data/app/models/elabs/application_record.rb +2 -0
- data/app/models/elabs/comment.rb +14 -0
- data/app/models/elabs/concerns/actable_entity.rb +0 -12
- data/app/models/elabs/concerns/content_entity.rb +23 -0
- data/app/models/elabs/concerns/notifiable_entity.rb +46 -0
- data/app/models/elabs/notification.rb +10 -0
- data/app/models/elabs/preference.rb +2 -0
- data/app/models/elabs/report.rb +10 -0
- data/app/models/elabs/user.rb +26 -6
- data/app/views/elabs/acts/_act.json.jbuilder +7 -2
- data/app/views/elabs/acts/index.json.jbuilder +1 -1
- data/app/views/elabs/admin/albums/_album.json.jbuilder +15 -2
- data/app/views/elabs/admin/albums/index.html.haml +1 -1
- data/app/views/elabs/admin/albums/index.json.jbuilder +1 -1
- data/app/views/elabs/admin/articles/_article.json.jbuilder +15 -2
- data/app/views/elabs/admin/articles/index.html.haml +1 -1
- data/app/views/elabs/admin/articles/index.json.jbuilder +1 -1
- data/app/views/elabs/admin/languages/_language.json.jbuilder +9 -2
- data/app/views/elabs/admin/languages/index.html.haml +1 -1
- data/app/views/elabs/admin/languages/index.json.jbuilder +1 -1
- data/app/views/elabs/admin/licenses/_license.json.jbuilder +10 -2
- data/app/views/elabs/admin/licenses/index.html.haml +1 -1
- data/app/views/elabs/admin/licenses/index.json.jbuilder +1 -1
- data/app/views/elabs/admin/notes/_note.json.jbuilder +13 -2
- data/app/views/elabs/admin/notes/index.html.haml +1 -1
- data/app/views/elabs/admin/notes/index.json.jbuilder +1 -1
- data/app/views/elabs/admin/projects/_project.json.jbuilder +20 -2
- data/app/views/elabs/admin/projects/index.html.haml +1 -1
- data/app/views/elabs/admin/projects/index.json.jbuilder +1 -1
- data/app/views/elabs/admin/reports/_report.json.jbuilder +10 -0
- data/app/views/elabs/admin/reports/index.html.haml +1 -1
- data/app/views/elabs/admin/reports/index.json.jbuilder +1 -1
- data/app/views/elabs/admin/tags/_tag.json.jbuilder +8 -2
- data/app/views/elabs/admin/tags/index.html.haml +1 -1
- data/app/views/elabs/admin/tags/index.json.jbuilder +1 -1
- data/app/views/elabs/admin/uploads/_upload.json.jbuilder +17 -2
- data/app/views/elabs/admin/uploads/index.html.haml +1 -1
- data/app/views/elabs/admin/uploads/index.json.jbuilder +1 -1
- data/app/views/elabs/admin/users/_user.json.jbuilder +14 -0
- data/app/views/elabs/admin/users/index.html.haml +6 -2
- data/app/views/elabs/admin/users/index.json.jbuilder +1 -1
- data/app/views/elabs/admin/users/show.html.haml +1 -1
- data/app/views/elabs/admin/users/show.json.jbuilder +1 -1
- data/app/views/elabs/albums/_album.html.haml +2 -2
- data/app/views/elabs/albums/_album.json.jbuilder +12 -2
- data/app/views/elabs/albums/index.json.jbuilder +1 -1
- data/app/views/elabs/albums/show.html.haml +7 -7
- data/app/views/elabs/albums/show.json.jbuilder +1 -1
- data/app/views/elabs/articles/_article.html.haml +2 -2
- data/app/views/elabs/articles/_article.json.jbuilder +12 -2
- data/app/views/elabs/articles/index.json.jbuilder +1 -1
- data/app/views/elabs/articles/show.html.haml +6 -6
- data/app/views/elabs/articles/show.json.jbuilder +1 -1
- data/app/views/elabs/auth/registrations/edit.html.haml +8 -5
- data/app/views/elabs/comments/_comment.json.jbuilder +10 -2
- data/app/views/elabs/comments/_comments.html.haml +2 -2
- data/app/views/elabs/languages/_language.json.jbuilder +9 -2
- data/app/views/elabs/languages/index.json.jbuilder +1 -1
- data/app/views/elabs/languages/show.html.haml +1 -1
- data/app/views/elabs/languages/show.json.jbuilder +1 -1
- data/app/views/elabs/layouts/_menu.html.haml +10 -5
- data/app/views/elabs/licenses/_license.json.jbuilder +10 -2
- data/app/views/elabs/licenses/index.json.jbuilder +1 -1
- data/app/views/elabs/licenses/show.html.haml +2 -6
- data/app/views/elabs/member/albums/_album.json.jbuilder +15 -2
- data/app/views/elabs/member/albums/index.html.haml +1 -1
- data/app/views/elabs/member/albums/index.json.jbuilder +1 -1
- data/app/views/elabs/member/articles/_article.json.jbuilder +15 -2
- data/app/views/elabs/member/articles/index.html.haml +1 -1
- data/app/views/elabs/member/articles/index.json.jbuilder +1 -1
- data/app/views/elabs/member/layouts/_empty.html.haml +3 -2
- data/app/views/elabs/member/notes/_note.json.jbuilder +13 -2
- data/app/views/elabs/member/notes/index.html.haml +1 -1
- data/app/views/elabs/member/notes/index.json.jbuilder +1 -1
- data/app/views/elabs/member/notifications/_notification.json.jbuilder +8 -0
- data/app/views/elabs/member/notifications/index.html.haml +21 -0
- data/app/views/elabs/member/notifications/index.json.jbuilder +1 -0
- data/app/views/elabs/member/preferences/_form.html.haml +6 -0
- data/app/views/elabs/member/preferences/edit.html.haml +2 -1
- data/app/views/elabs/member/projects/_project.json.jbuilder +20 -2
- data/app/views/elabs/member/projects/index.html.haml +1 -1
- data/app/views/elabs/member/projects/index.json.jbuilder +1 -1
- data/app/views/elabs/member/uploads/_upload.json.jbuilder +17 -2
- data/app/views/elabs/member/uploads/index.html.haml +1 -1
- data/app/views/elabs/member/uploads/index.json.jbuilder +1 -1
- data/app/views/elabs/member/users/_form.html.haml +14 -9
- data/app/views/elabs/member/users/edit.html.haml +7 -0
- data/app/views/elabs/notes/_note.html.haml +2 -2
- data/app/views/elabs/notes/_note.json.jbuilder +10 -2
- data/app/views/elabs/notes/index.json.jbuilder +1 -1
- data/app/views/elabs/notes/show.html.haml +5 -5
- data/app/views/elabs/notes/show.json.jbuilder +1 -1
- data/app/views/elabs/projects/_project.html.haml +2 -2
- data/app/views/elabs/projects/_project.json.jbuilder +17 -0
- data/app/views/elabs/projects/index.json.jbuilder +1 -1
- data/app/views/elabs/projects/show.html.haml +14 -11
- data/app/views/elabs/projects/show.json.jbuilder +1 -1
- data/app/views/elabs/tags/_tag.json.jbuilder +8 -2
- data/app/views/elabs/tags/index.json.jbuilder +1 -1
- data/app/views/elabs/tags/show.json.jbuilder +1 -1
- data/app/views/elabs/uploads/_upload.html.haml +1 -1
- data/app/views/elabs/uploads/_upload.json.jbuilder +14 -2
- data/app/views/elabs/uploads/index.json.jbuilder +1 -1
- data/app/views/elabs/uploads/show.html.haml +12 -3
- data/app/views/elabs/uploads/show.json.jbuilder +1 -1
- data/app/views/elabs/users/_user.html.haml +10 -3
- data/app/views/elabs/users/_user.json.jbuilder +14 -2
- data/app/views/elabs/users/index.json.jbuilder +1 -1
- data/app/views/elabs/users/show.html.haml +15 -10
- data/app/views/elabs/users/show.json.jbuilder +1 -1
- data/config/routes.rb +21 -16
- data/db/migrate/20180910000015_remove_license_timestamps.rb +6 -0
- data/db/migrate/20180910175012_create_notifications.rb +13 -0
- data/db/migrate/20180913093027_add_fields_in_preferences.rb +6 -0
- data/docs/migrating.md +14 -0
- data/docs/setup.md +1 -0
- data/lib/elabs.rb +3 -0
- data/lib/elabs/version.rb +1 -1
- data/lib/generators/elabs/required_assets_generator.rb +1 -1
- data/lib/generators/templates/elabs.rb +6 -0
- data/locale/app.pot +73 -14
- data/locale/en/app.edit.po +71 -12
- data/locale/en/app.po +71 -12
- data/locale/fr/app.edit.po +76 -17
- data/locale/fr/app.po +75 -16
- data/package.json +4 -4
- metadata +19 -5
- data/app/assets/images/elabs/preview_placeholder.png +0 -0
- data/app/assets/images/elabs/preview_placeholder_nsfw.png +0 -0
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 179fc820588cdbe7ae3de5e0c42a37a678fab8e0e190a173426e493302f23556
|
4
|
+
data.tar.gz: 7e720b16441c9044c6e9489f71a32b95e1e392e9d8ffb4de25ab3916d113c482
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9983023566a96ad10c252882c4b05c68c719bb477127b6361f5364b70ff6359f9e35c59158f522ab6f24b9b554da544a319241e4281cb4d1dc1673bea0e25b79
|
7
|
+
data.tar.gz: 8f2474412043a4f25ac5277ef001b3b8ea06974da8500c4328de52839c3986416923cf70c250829388cbd600a15c111f033c89c4fcd0450daae8f31d8ee1e0d7
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -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]
|
data/Gemfile.lock
CHANGED
@@ -9,7 +9,7 @@ GIT
|
|
9
9
|
PATH
|
10
10
|
remote: .
|
11
11
|
specs:
|
12
|
-
elabs (
|
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
|
-
- [
|
23
|
-
- [
|
24
|
-
- [
|
25
|
-
- [
|
26
|
-
- [
|
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
|
-
|
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); }
|
@@ -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:
|
70
|
-
|
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%);
|
@@ -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
|
-
|
26
|
-
|
27
|
-
|
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,
|
197
|
-
(primary,
|
198
|
-
(new,
|
199
|
-
(save,
|
200
|
-
(show,
|
201
|
-
(edit,
|
202
|
-
(success,
|
203
|
-
(info,
|
204
|
-
(notice,
|
205
|
-
(warning,
|
206
|
-
(lock,
|
207
|
-
(danger,
|
208
|
-
(destroy,
|
209
|
-
(inverse,
|
210
|
-
(
|
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
|
-
|
56
|
+
@import "knacss/sass/components/badges"; // badges styles
|
57
57
|
@import "knacss/sass/components/alerts"; // alerts styles
|
58
58
|
|
59
59
|
/* stylelint-enable */
|
@@ -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
|
-
|
31
|
-
|
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
|
34
|
-
|
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.')
|