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
@@ -0,0 +1,21 @@
|
|
1
|
+
- @page_title = _('Notifications')
|
2
|
+
|
3
|
+
- if @notifications.length.zero?
|
4
|
+
= render 'elabs/member/layouts/empty'
|
5
|
+
- else
|
6
|
+
%table.notifications-list
|
7
|
+
%thead
|
8
|
+
%tr
|
9
|
+
%th
|
10
|
+
%th= member_order_by_link _('Date'), 'created_at'
|
11
|
+
%th
|
12
|
+
%tbody
|
13
|
+
- @notifications.each do |notification|
|
14
|
+
%tr.notification
|
15
|
+
%td.btn-group
|
16
|
+
= member_destroy_link('notification', notification, false)
|
17
|
+
%td= short_date notification.created_at
|
18
|
+
%td
|
19
|
+
= notification_icon notification.event
|
20
|
+
= notification_message notification
|
21
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
json.array! @notifications, partial: 'notification', as: :notification
|
@@ -15,6 +15,12 @@
|
|
15
15
|
.field
|
16
16
|
= f.label :locale
|
17
17
|
.field-input= f.collection_select(:locale, Elabs::Language.available_site_translations, :iso639_1, :name)
|
18
|
+
.field
|
19
|
+
= f.label :writing_language
|
20
|
+
.field-input= language_selector f, :writing_language_id
|
21
|
+
.field
|
22
|
+
= f.label :writing_license
|
23
|
+
.field-input= license_selector f, :writing_license_id
|
18
24
|
|
19
25
|
.actions
|
20
26
|
= f.submit 'Save', class: 'btn btn--save'
|
@@ -1,2 +1,20 @@
|
|
1
|
-
json.extract! project,
|
2
|
-
|
1
|
+
json.extract! project,
|
2
|
+
:id,
|
3
|
+
:name,
|
4
|
+
:short_description,
|
5
|
+
:description,
|
6
|
+
:main_url,
|
7
|
+
:sfw,
|
8
|
+
:published,
|
9
|
+
:locked,
|
10
|
+
:hidden_in_history,
|
11
|
+
:albums_count,
|
12
|
+
:articles_count,
|
13
|
+
:notes_count,
|
14
|
+
:uploads_count,
|
15
|
+
:user_id,
|
16
|
+
:license_id,
|
17
|
+
:language_id,
|
18
|
+
:published_at,
|
19
|
+
:created_at,
|
20
|
+
:updated_at
|
@@ -34,7 +34,7 @@
|
|
34
34
|
%td.is-icon= boolean_icon_tag project.published
|
35
35
|
%td.is-icon= boolean_icon_tag project.locked, 'lock', 'unlock'
|
36
36
|
%td.is-icon= boolean_icon_tag project.hidden_in_history
|
37
|
-
%td= project.published_at
|
37
|
+
%td= short_date project.published_at
|
38
38
|
%td
|
39
39
|
= license_icon project.license
|
40
40
|
= project.license.name
|
@@ -1 +1 @@
|
|
1
|
-
json.array! @projects, partial: '
|
1
|
+
json.array! @projects, partial: 'project', as: :project
|
@@ -1,2 +1,17 @@
|
|
1
|
-
json.extract! upload, :id,
|
2
|
-
|
1
|
+
json.extract! upload, :id,
|
2
|
+
:title,
|
3
|
+
:description,
|
4
|
+
:sfw,
|
5
|
+
:published,
|
6
|
+
:locked,
|
7
|
+
:hidden_in_history,
|
8
|
+
:user_id,
|
9
|
+
:license_id,
|
10
|
+
:language_id,
|
11
|
+
:published_at,
|
12
|
+
:created_at,
|
13
|
+
:updated_at
|
14
|
+
json.file content_type: upload.file.content_type,
|
15
|
+
url: main_app.url_for(upload.file),
|
16
|
+
filename: upload.file.filename,
|
17
|
+
metadata: upload.file.metadata
|
@@ -40,7 +40,7 @@
|
|
40
40
|
%td.is-icon= boolean_icon_tag upload.published
|
41
41
|
%td.is-icon= boolean_icon_tag upload.locked, 'lock', 'unlock'
|
42
42
|
%td.is-icon= boolean_icon_tag upload.hidden_in_history
|
43
|
-
%td= upload.published_at
|
43
|
+
%td= short_date upload.published_at
|
44
44
|
%td= upload.language.name
|
45
45
|
%td
|
46
46
|
= license_icon upload.license
|
@@ -1 +1 @@
|
|
1
|
-
json.array! @uploads, partial: '
|
1
|
+
json.array! @uploads, partial: 'upload', as: :upload
|
@@ -1,19 +1,13 @@
|
|
1
|
-
|
2
|
-
- user = @user || current_user
|
3
|
-
-# haml-lint:enable InstanceVariables
|
4
|
-
|
5
|
-
= form_for user, url: { controller: 'elabs/member/users', action: :update } do |f|
|
6
|
-
|
1
|
+
= form_for user, url: member_update_infos_path do |f|
|
7
2
|
- if user.errors.any?
|
8
3
|
.error
|
9
|
-
%h2= format(n_('An error prevented your
|
10
|
-
'%<nb>i errors prevented your
|
4
|
+
%h2= format(n_('An error prevented your infos from being updated:',
|
5
|
+
'%<nb>i errors prevented your infos from being updated:',
|
11
6
|
user.errors.count), nb: user.errors.count)
|
12
7
|
%ul
|
13
8
|
- user.errors.full_messages.each do |message|
|
14
9
|
%li= message
|
15
10
|
|
16
|
-
|
17
11
|
.field
|
18
12
|
= f.label :real_name
|
19
13
|
.field-input= f.text_field :real_name
|
@@ -27,6 +21,17 @@
|
|
27
21
|
_('Preview'),
|
28
22
|
href: '#',
|
29
23
|
onclick: 'mdPreviewBiography(event)'))
|
24
|
+
- if Elabs.use_avatars
|
25
|
+
.alert.alert--experimental
|
26
|
+
%p
|
27
|
+
= icon 'experience', ['fw']
|
28
|
+
= _('This feature is experimental. If you provide an invalid file, your current avatar will be deleted.')
|
29
|
+
|
30
|
+
.field
|
31
|
+
= f.label :avatar
|
32
|
+
.field-input
|
33
|
+
= f.file_field :avatar
|
34
|
+
.field-hint= format(_('Your picture should be in "png" or "jpg", preferably a square of 512px.'))
|
30
35
|
|
31
36
|
.actions
|
32
37
|
= f.submit _('Save'), class: 'btn btn--save'
|
@@ -12,13 +12,13 @@
|
|
12
12
|
%li
|
13
13
|
= icon('user', ['fw'])
|
14
14
|
%strong= _('User:')
|
15
|
-
= link_to note.user.
|
15
|
+
= link_to note.user.display_name, note.user
|
16
16
|
%li
|
17
17
|
= icon('language', ['fw'])
|
18
18
|
%strong= _('Language:')
|
19
19
|
= link_to note.language.name, note.language
|
20
20
|
%li
|
21
|
-
= icon('
|
21
|
+
= icon('license', ['fw'])
|
22
22
|
%strong= _('License:')
|
23
23
|
= link_to note.license.name, note.license
|
24
24
|
%li
|
@@ -1,2 +1,10 @@
|
|
1
|
-
json.extract! note,
|
2
|
-
|
1
|
+
json.extract! note,
|
2
|
+
:id,
|
3
|
+
:content,
|
4
|
+
:sfw,
|
5
|
+
:user_id,
|
6
|
+
:license_id,
|
7
|
+
:language_id,
|
8
|
+
:published_at,
|
9
|
+
:created_at,
|
10
|
+
:updated_at
|
@@ -1 +1 @@
|
|
1
|
-
json.array! @notes, partial: '
|
1
|
+
json.array! @notes, partial: 'note', as: :note
|
@@ -9,16 +9,16 @@
|
|
9
9
|
%li
|
10
10
|
= icon('user', ['fw'])
|
11
11
|
%b= _('Author:')
|
12
|
-
= link_to @note.user.
|
12
|
+
= link_to @note.user.display_name, @note.user
|
13
13
|
%li
|
14
14
|
= icon('calendar-check', ['fw'])
|
15
15
|
%b= _('Published at:')
|
16
|
-
= @note.published_at
|
16
|
+
= short_date @note.published_at
|
17
17
|
%li
|
18
18
|
= icon('calendar', ['fw'])
|
19
19
|
%b= _('Updated at:')
|
20
|
-
= @note.updated_at
|
21
|
-
%li
|
20
|
+
= short_date @note.updated_at
|
21
|
+
%li.separator
|
22
22
|
= icon('info', ['fw'])
|
23
23
|
%b= _('SFW:')
|
24
24
|
= boolean_icon_tag @note.sfw, 'is-sfw', 'is-nsfw'
|
@@ -27,7 +27,7 @@
|
|
27
27
|
%b= _('Language:')
|
28
28
|
= link_to @note.language.name, @note.language
|
29
29
|
%li
|
30
|
-
= icon('
|
30
|
+
= icon('license', ['fw'])
|
31
31
|
%b= _('License:')
|
32
32
|
= link_to @note.license.name, @note.license
|
33
33
|
|
@@ -1 +1 @@
|
|
1
|
-
json.partial! '
|
1
|
+
json.partial! 'note', note: @note
|
@@ -11,13 +11,13 @@
|
|
11
11
|
%li
|
12
12
|
= icon('user', ['fw'])
|
13
13
|
%strong= _('User:')
|
14
|
-
= link_to project.user.
|
14
|
+
= link_to project.user.display_name, project.user
|
15
15
|
%li
|
16
16
|
= icon('language', ['fw'])
|
17
17
|
%strong= _('Language:')
|
18
18
|
= link_to project.language.name, project.language
|
19
19
|
%li
|
20
|
-
= icon('
|
20
|
+
= icon('license', ['fw'])
|
21
21
|
%strong= _('License:')
|
22
22
|
= link_to project.license.name, project.license
|
23
23
|
%li
|
@@ -0,0 +1,17 @@
|
|
1
|
+
json.extract! project,
|
2
|
+
:id,
|
3
|
+
:name,
|
4
|
+
:short_description,
|
5
|
+
:description,
|
6
|
+
:main_url,
|
7
|
+
:sfw,
|
8
|
+
:albums_count,
|
9
|
+
:articles_count,
|
10
|
+
:notes_count,
|
11
|
+
:uploads_count,
|
12
|
+
:user_id,
|
13
|
+
:license_id,
|
14
|
+
:language_id,
|
15
|
+
:published_at,
|
16
|
+
:created_at,
|
17
|
+
:updated_at
|
@@ -1 +1 @@
|
|
1
|
-
json.array! @projects, partial: '
|
1
|
+
json.array! @projects, partial: 'project', as: :project
|
@@ -8,33 +8,36 @@
|
|
8
8
|
%ul
|
9
9
|
%li
|
10
10
|
= icon('user', ['fw'])
|
11
|
-
%strong= _('
|
12
|
-
= link_to @project.user.
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
%strong= _('Creator:')
|
12
|
+
= link_to @project.user.display_name, @project.user
|
13
|
+
- if @project.main_url.present?
|
14
|
+
%li
|
15
|
+
= icon('home', ['fw'])
|
16
|
+
%strong= _('Main url:')
|
17
|
+
= @project.main_url
|
17
18
|
%li
|
18
19
|
= icon('calendar-check', ['fw'])
|
19
20
|
%strong= _('Published at:')
|
20
|
-
= @project.published_at
|
21
|
+
= short_date @project.published_at
|
21
22
|
%li
|
22
23
|
= icon('calendar', ['fw'])
|
23
24
|
%strong= _('Updated at:')
|
24
|
-
= @project.updated_at
|
25
|
-
|
25
|
+
= short_date @project.updated_at
|
26
|
+
|
27
|
+
%li.separator
|
26
28
|
= icon('info', ['fw'])
|
27
29
|
%strong= _('SFW:')
|
28
30
|
= boolean_icon_tag @project.sfw, 'is-sfw', 'is-nsfw'
|
29
31
|
%li
|
30
|
-
= icon('
|
32
|
+
= icon('license', ['fw'])
|
31
33
|
%strong= _('License:')
|
32
34
|
= link_to @project.license.name, @project.license
|
33
35
|
%li
|
34
36
|
= icon('language', ['fw'])
|
35
37
|
%strong= _('Language:')
|
36
38
|
= link_to @project.language.name, @project.language
|
37
|
-
|
39
|
+
|
40
|
+
%li.separator
|
38
41
|
= icon('amount', ['fw'])
|
39
42
|
%strong= _('Albums:')
|
40
43
|
= @project.albums_count
|
@@ -1 +1 @@
|
|
1
|
-
json.partial! '
|
1
|
+
json.partial! 'project', project: @project
|
@@ -1 +1 @@
|
|
1
|
-
json.array! @tags, partial: '
|
1
|
+
json.array! @tags, partial: 'tag', as: :tag
|
@@ -1 +1 @@
|
|
1
|
-
json.partial! '
|
1
|
+
json.partial! 'tag', tag: @tag
|
@@ -1,2 +1,14 @@
|
|
1
|
-
json.extract! upload, :id,
|
2
|
-
|
1
|
+
json.extract! upload, :id,
|
2
|
+
:title,
|
3
|
+
:description,
|
4
|
+
:sfw,
|
5
|
+
:user_id,
|
6
|
+
:license_id,
|
7
|
+
:language_id,
|
8
|
+
:published_at,
|
9
|
+
:created_at,
|
10
|
+
:updated_at
|
11
|
+
json.file content_type: upload.file.content_type,
|
12
|
+
url: main_app.url_for(upload.file),
|
13
|
+
filename: upload.file.filename,
|
14
|
+
metadata: upload.file.metadata
|
@@ -1 +1 @@
|
|
1
|
-
json.array! @uploads, partial: '
|
1
|
+
json.array! @uploads, partial: 'upload', as: :upload
|
@@ -9,16 +9,25 @@
|
|
9
9
|
%li
|
10
10
|
= icon('user', ['fw'])
|
11
11
|
%b= _('Author:')
|
12
|
-
= link_to @upload.user.
|
12
|
+
= link_to @upload.user.display_name, @upload.user
|
13
13
|
%li
|
14
14
|
= icon('calendar-check', ['fw'])
|
15
15
|
%b= _('Published at:')
|
16
|
-
= @upload.published_at
|
16
|
+
= short_date @upload.published_at
|
17
17
|
%li
|
18
18
|
= icon('calendar', ['fw'])
|
19
19
|
%b= _('Updated at:')
|
20
|
-
= @upload.updated_at
|
20
|
+
= short_date @upload.updated_at
|
21
21
|
%li
|
22
|
+
= icon('font', ['fw'])
|
23
|
+
%b= _('Original name:')
|
24
|
+
= @upload.file.filename
|
25
|
+
%li
|
26
|
+
= icon('mime-type', ['fw'])
|
27
|
+
%b= _('Mime type:')
|
28
|
+
= @upload.file.content_type
|
29
|
+
|
30
|
+
%li.separator
|
22
31
|
= icon('info', ['fw'])
|
23
32
|
%b= _('Is SFW:')
|
24
33
|
= @upload.sfw
|
@@ -1 +1 @@
|
|
1
|
-
json.partial! '
|
1
|
+
json.partial! 'upload', upload: @upload
|
@@ -1,17 +1,24 @@
|
|
1
1
|
.user.user-card
|
2
2
|
%header
|
3
|
-
.icon
|
3
|
+
.icon
|
4
|
+
- if Elabs.use_avatars && user.avatar.attached?
|
5
|
+
= image_tag main_app.url_for(avatar_image(user.avatar, :small).processed)
|
6
|
+
- else
|
7
|
+
= icon 'user', %w[3x fw]
|
4
8
|
.headers
|
5
|
-
%h3= link_to user.
|
9
|
+
%h3= link_to user.display_name, user, class: 'title'
|
6
10
|
|
7
11
|
%ul.informations
|
12
|
+
- if user.real_name
|
13
|
+
%li
|
14
|
+
%b @#{user.username}
|
8
15
|
%li
|
9
16
|
%b= _('Role:')
|
10
17
|
= user.role
|
11
18
|
|
12
19
|
%li
|
13
20
|
%b= _('Since:')
|
14
|
-
= user.created_at
|
21
|
+
= short_date user.created_at
|
15
22
|
|
16
23
|
.content
|
17
24
|
= link_to user_projects_path(user), class: 'btn btn--block' do
|
@@ -1,2 +1,14 @@
|
|
1
|
-
json.extract! user,
|
2
|
-
|
1
|
+
json.extract! user,
|
2
|
+
:id,
|
3
|
+
:confirmed_at,
|
4
|
+
:created_at,
|
5
|
+
:updated_at,
|
6
|
+
:username,
|
7
|
+
:real_name,
|
8
|
+
:biography,
|
9
|
+
:role,
|
10
|
+
:albums_count,
|
11
|
+
:articles_count,
|
12
|
+
:notes_count,
|
13
|
+
:projects_count,
|
14
|
+
:uploads_count
|