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
@@ -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,3 +1,4 @@
1
1
  - @page_title = _('Editing preferences')
2
2
 
3
- = render 'form', preference: @preference
3
+ .w960p.center
4
+ = render 'form', preference: @preference
@@ -1,2 +1,20 @@
1
- json.extract! project, :id, :name, :short_description, :description, :main_url, :sfw, :published, :locked, :hidden_in_history, :license_id, :language_id, :user_id, :created_at, :updated_at
2
- json.url project_url(project, format: :json)
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: 'projects/project', as: :project
1
+ json.array! @projects, partial: 'project', as: :project
@@ -1,2 +1,17 @@
1
- json.extract! upload, :id, :title, :description, :sfw, :hide_in_history, :language_id, :user_id, :license_id, :created_at, :updated_at
2
- json.url upload_url(upload, format: :json)
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: 'uploads/upload', as: :upload
1
+ json.array! @uploads, partial: 'upload', as: :upload
@@ -1,19 +1,13 @@
1
- -# haml-lint:disable InstanceVariables
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 account from being updated:',
10
- '%<nb>i errors prevented your account from being updated:',
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'
@@ -0,0 +1,7 @@
1
+ - @page_title = _('About you')
2
+
3
+ .w960p.center
4
+ .page__actions
5
+ = link_to _('Show online'), @user, class: 'btn btn--show'
6
+
7
+ = render 'form', user: @user
@@ -12,13 +12,13 @@
12
12
  %li
13
13
  = icon('user', ['fw'])
14
14
  %strong= _('User:')
15
- = link_to note.user.username, 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('copyright', ['fw'])
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, :id, :content, :sfw, :hidden_in_history, :user_id, :license_id, :language_id, :created_at, :updated_at
2
- json.url note_url(note, format: :json)
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: 'notes/note', as: :note
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.username, @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('copyright', ['fw'])
30
+ = icon('license', ['fw'])
31
31
  %b= _('License:')
32
32
  = link_to @note.license.name, @note.license
33
33
 
@@ -1 +1 @@
1
- json.partial! 'notes/note', note: @note
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.username, 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('copyright', ['fw'])
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: 'projects/project', as: :project
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= _('Author:')
12
- = link_to @project.user.username, @project.user
13
- %li
14
- = icon('home', ['fw'])
15
- %strong= _('Main url:')
16
- = @project.main_url
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
- %li
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('copyright', ['fw'])
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
- %li
39
+
40
+ %li.separator
38
41
  = icon('amount', ['fw'])
39
42
  %strong= _('Albums:')
40
43
  = @project.albums_count
@@ -1 +1 @@
1
- json.partial! 'projects/project', project: @project
1
+ json.partial! 'project', project: @project
@@ -1,2 +1,8 @@
1
- json.extract! tag, :id, :name
2
- json.url tag_url(tag, format: :json)
1
+ json.extract! tag,
2
+ :id,
3
+ :name,
4
+ :albums_count,
5
+ :articles_count,
6
+ :notes_count,
7
+ :projects_count,
8
+ :uploads_count
@@ -1 +1 @@
1
- json.array! @tags, partial: 'tags/tag', as: :tag
1
+ json.array! @tags, partial: 'tag', as: :tag
@@ -1 +1 @@
1
- json.partial! 'tags/tag', tag: @tag
1
+ json.partial! 'tag', tag: @tag
@@ -11,7 +11,7 @@
11
11
  %li
12
12
  = icon('user', ['fw'])
13
13
  %strong= _('User:')
14
- = link_to upload.user.username, upload.user
14
+ = link_to upload.user.display_name, upload.user
15
15
  %li
16
16
  = icon('language', ['fw'])
17
17
  %b= _('Language:')
@@ -1,2 +1,14 @@
1
- json.extract! upload, :id, :title, :description, :sfw, :hide_in_history, :language_id, :user_id, :license_id, :created_at, :updated_at
2
- json.url upload_url(upload, format: :json)
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: 'uploads/upload', as: :upload
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.username, @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! 'uploads/upload', upload: @upload
1
+ json.partial! 'upload', upload: @upload
@@ -1,17 +1,24 @@
1
1
  .user.user-card
2
2
  %header
3
- .icon= icon 'user', %w[3x fw]
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.username, user, class: 'title'
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, :id, :created_at, :updated_at
2
- json.url user_url(user, format: :json)
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