spina-admin-journal 0.5.0 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/spina_admin_journal_manifest.js +5 -2
  3. data/app/assets/javascripts/spina/admin/journal/application.js +0 -0
  4. data/app/components/spina/admin/journal/affiliations_list_component.rb +32 -0
  5. data/app/components/spina/admin/journal/application_component.rb +11 -0
  6. data/app/components/spina/admin/journal/articles_list_component.rb +54 -0
  7. data/app/components/spina/admin/journal/authors_list_component.rb +37 -0
  8. data/app/components/spina/admin/journal/authorships_list_component.rb +45 -0
  9. data/app/components/spina/admin/journal/empty_list_component.html.haml +1 -0
  10. data/app/components/spina/admin/journal/empty_list_component.rb +14 -0
  11. data/app/components/spina/admin/journal/institutions_list_component.rb +32 -0
  12. data/app/components/spina/admin/journal/issues_list_component.rb +47 -0
  13. data/app/components/spina/admin/journal/licences_list_component.rb +32 -0
  14. data/app/components/spina/admin/journal/list_component.html.haml +10 -0
  15. data/app/components/spina/admin/journal/list_component.rb +22 -0
  16. data/app/components/spina/admin/journal/list_item_component.html.haml +17 -0
  17. data/app/components/spina/admin/journal/list_item_component.rb +23 -0
  18. data/app/components/spina/admin/journal/volumes_list_component.rb +34 -0
  19. data/app/controllers/spina/admin/journal/application_controller.rb +3 -1
  20. data/app/controllers/spina/admin/journal/articles_controller.rb +14 -25
  21. data/app/controllers/spina/admin/journal/authors_controller.rb +15 -28
  22. data/app/controllers/spina/admin/journal/institutions_controller.rb +7 -5
  23. data/app/controllers/spina/admin/journal/issues_controller.rb +17 -24
  24. data/app/controllers/spina/admin/journal/journals_controller.rb +4 -3
  25. data/app/controllers/spina/admin/journal/licences_controller.rb +7 -5
  26. data/app/controllers/spina/admin/journal/volumes_controller.rb +9 -20
  27. data/app/models/spina/parts/admin/journal/page_range.rb +31 -0
  28. data/app/views/spina/admin/hooks/journal/_primary_navigation.html.haml +35 -26
  29. data/app/views/spina/admin/journal/articles/_form.html.haml +23 -24
  30. data/app/views/spina/admin/journal/articles/_form_authors.html.haml +1 -15
  31. data/app/views/spina/admin/journal/articles/_form_details.html.haml +27 -56
  32. data/app/views/spina/admin/journal/articles/index.html.haml +7 -17
  33. data/app/views/spina/admin/journal/authors/_form.html.haml +24 -24
  34. data/app/views/spina/admin/journal/authors/_form_affiliation.html.haml +8 -20
  35. data/app/views/spina/admin/journal/authors/_form_articles.html.haml +1 -18
  36. data/app/views/spina/admin/journal/authors/_form_details.html.haml +2 -6
  37. data/app/views/spina/admin/journal/authors/index.html.haml +7 -15
  38. data/app/views/spina/admin/journal/institutions/_form.html.haml +24 -24
  39. data/app/views/spina/admin/journal/institutions/_form_details.html.haml +2 -8
  40. data/app/views/spina/admin/journal/institutions/_form_view_affiliations.html.haml +1 -10
  41. data/app/views/spina/admin/journal/institutions/index.html.haml +7 -15
  42. data/app/views/spina/admin/journal/issues/_form.html.haml +23 -23
  43. data/app/views/spina/admin/journal/issues/_form_articles.html.haml +1 -14
  44. data/app/views/spina/admin/journal/issues/_form_details.html.haml +13 -28
  45. data/app/views/spina/admin/journal/issues/index.html.haml +7 -16
  46. data/app/views/spina/admin/journal/journals/_form.html.haml +22 -32
  47. data/app/views/spina/admin/journal/licences/_form.html.haml +19 -34
  48. data/app/views/spina/admin/journal/licences/index.html.haml +7 -16
  49. data/app/views/spina/admin/journal/volumes/_form.html.haml +25 -12
  50. data/app/views/spina/admin/journal/volumes/_form_details.html.haml +4 -10
  51. data/app/views/spina/admin/journal/volumes/_form_issues.html.haml +1 -13
  52. data/app/views/spina/admin/journal/volumes/index.html.haml +7 -16
  53. data/app/views/spina/admin/parts/admin/journal/page_ranges/_form.html.haml +6 -0
  54. data/config/locales/en.yml +25 -3
  55. data/config/routes.rb +5 -5
  56. data/db/migrate/20210626153728_create_spina_parts_admin_journal_page_ranges.rb +7 -0
  57. data/lib/spina/admin/journal/engine.rb +18 -0
  58. data/lib/spina/admin/journal/version.rb +1 -1
  59. data/lib/spina/admin/journal.rb +1 -0
  60. metadata +50 -65
  61. data/app/assets/javascripts/spina/admin/journal/application.es6 +0 -72
  62. data/app/views/layouts/spina/admin/journal/articles.html.haml +0 -10
  63. data/app/views/layouts/spina/admin/journal/authors.html.haml +0 -10
  64. data/app/views/layouts/spina/admin/journal/institutions.html.haml +0 -10
  65. data/app/views/layouts/spina/admin/journal/issues.html.haml +0 -10
  66. data/app/views/layouts/spina/admin/journal/journals.html.haml +0 -10
  67. data/app/views/layouts/spina/admin/journal/licences.html.haml +0 -10
  68. data/app/views/layouts/spina/admin/journal/volumes.html.haml +0 -10
  69. data/app/views/spina/admin/journal/affiliations/_affiliation.html.haml +0 -8
  70. data/app/views/spina/admin/journal/application/_empty_list.html.haml +0 -3
  71. data/app/views/spina/admin/journal/articles/_article.html.haml +0 -10
  72. data/app/views/spina/admin/journal/authors/_author.html.haml +0 -8
  73. data/app/views/spina/admin/journal/authorships/_authorship.html.haml +0 -9
  74. data/app/views/spina/admin/journal/institutions/_institution.html.haml +0 -9
  75. data/app/views/spina/admin/journal/issues/_issue.html.haml +0 -9
  76. data/app/views/spina/admin/journal/journals/index.html.haml +0 -27
  77. data/app/views/spina/admin/journal/licences/_licence.html.haml +0 -11
  78. data/app/views/spina/admin/journal/volumes/_volume.html.haml +0 -7
  79. data/vendor/assets/javascripts/spina/admin/journal/html5sortable.js +0 -1295
@@ -4,12 +4,16 @@ en:
4
4
  journal:
5
5
  navigation_title: Journal settings
6
6
  unnamed_journal: Unnamed journal
7
+ edit: Edit
8
+ sort_info: "NB: item numbers will only update after you refresh the page."
9
+ empty_list: There are no items.
7
10
  journals:
8
11
  index:
9
12
  new: New journal
10
13
  no_journals: There are currently no journals saved.
11
14
  update:
12
15
  saved: Journal saved.
16
+ failed: Failed to save journal.
13
17
  destroy:
14
18
  deleted: Journal deleted.
15
19
  form:
@@ -26,13 +30,17 @@ en:
26
30
  date: Year
27
31
  view: View
28
32
  empty: There are no volumes.
33
+ new:
34
+ created: Volume %{number} created.
29
35
  create:
30
36
  created: Volume <strong>%{number}</strong> created.
31
37
  update:
32
38
  saved: Volume saved.
39
+ form:
40
+ save: Save
41
+ delete_confirmation: "Are you sure you want to delete Volume <strong>#%{number}</strong>?"
33
42
  form_details:
34
43
  unchangeable: The volume number can be changed by clicking 'Change Order' in the index view.
35
- delete_confirmation: "Are you sure you want to delete Volume <strong>#%{number}</strong>?"
36
44
  form_issues:
37
45
  volume_number: "Volume #"
38
46
  issue_number: "Issue #"
@@ -42,6 +50,7 @@ en:
42
50
  sort_success: Sorted successfully!
43
51
  sort_error: There was an error when sorting. Check the server logs for more information.
44
52
  issues:
53
+ volume_issue: "Volume %{volume_number} Issue %{issue_number}"
45
54
  issue_number: "Issue #%{number}"
46
55
  index:
47
56
  new: New issue
@@ -50,19 +59,23 @@ en:
50
59
  new: New issue
51
60
  create:
52
61
  saved: Issue saved.
62
+ failed: Failed to create issue.
53
63
  update:
54
64
  saved: Issue saved.
65
+ failed: Failed to save issue.
55
66
  destroy:
56
67
  deleted: Issue deleted.
57
68
  form:
58
69
  save: Save issue
70
+ delete_confirmation: "Are you sure you want to delete Issue <strong>#%{number}</strong>?"
59
71
  form_details:
60
72
  issue_unchangeable: The issue order can be changed in the 'Volumes' tab.
61
- delete_confirmation: "Are you sure you want to delete Issue <strong>#%{number}</strong>?"
62
73
  sort:
63
74
  sort_success: Sorted successfully!
64
75
  sort_error: There was an error when sorting. Check the server logs for more information.
65
76
  articles:
77
+ article_number: "Vol. %{volume_number}(%{issue_number}) Article #%{article_number}"
78
+ title_author: "%{title} (%{author})"
66
79
  index:
67
80
  new: New article
68
81
  empty: There are no articles.
@@ -70,16 +83,18 @@ en:
70
83
  new: New article
71
84
  create:
72
85
  saved: Article saved.
86
+ failed: Failed to create article.
73
87
  update:
74
88
  saved: Article saved.
89
+ failed: Failed to save article.
75
90
  destroy:
76
91
  deleted: Article deleted.
77
92
  form:
78
93
  save: Save article
94
+ delete_confirmation: "Are you sure you want to delete '<strong>%{title}</strong>'?"
79
95
  form_details:
80
96
  volume_issue: "Volume %{volume_number} Issue %{issue_number}"
81
97
  unchangeable: Article order can be changed in the issue.
82
- delete_confirmation: "Are you sure you want to delete '<strong>%{title}</strong>'?"
83
98
  form_authors:
84
99
  no_authors: There are no authors.
85
100
  number_of_articles: "# Articles"
@@ -89,6 +104,7 @@ en:
89
104
  sort_success: Sorted successfully!
90
105
  sort_error: There was an error when sorting. Check the server logs for more information.
91
106
  authors:
107
+ name_institution: "%{name} (%{institution})"
92
108
  index:
93
109
  new: New author
94
110
  number_of_articles: "# Articles"
@@ -96,8 +112,10 @@ en:
96
112
  new: New author
97
113
  create:
98
114
  saved: Author saved.
115
+ failed: Failed to create author.
99
116
  update:
100
117
  saved: Author saved.
118
+ failed: Failed to save author.
101
119
  destroy:
102
120
  deleted: Author deleted.
103
121
  sort:
@@ -121,8 +139,10 @@ en:
121
139
  new: New institution
122
140
  create:
123
141
  saved: Institution saved.
142
+ failed: Failed to create institution.
124
143
  update:
125
144
  saved: Institution saved.
145
+ failed: Failed to save institution.
126
146
  destroy:
127
147
  deleted: Institution deleted.
128
148
  form:
@@ -139,8 +159,10 @@ en:
139
159
  new: New licence
140
160
  create:
141
161
  saved: Licence saved.
162
+ failed: Failed to create licence.
142
163
  update:
143
164
  saved: Licence saved.
165
+ failed: Failed to save licence.
144
166
  destroy:
145
167
  deleted: Licence deleted.
146
168
  form:
data/config/routes.rb CHANGED
@@ -4,17 +4,17 @@ Spina::Engine.routes.draw do
4
4
  namespace :admin, path: Spina.config.backend_path do
5
5
  namespace :journal do
6
6
  resources :journals, only: %i[edit update destroy]
7
- resources :volumes, except: %i[show new update] do
8
- patch 'sort/:journal_id' => 'volumes#sort', as: :sort, on: :collection
7
+ resources :volumes, except: %i[show update] do
8
+ post 'sort/:journal_id' => 'volumes#sort', as: :sort, on: :collection
9
9
  end
10
10
  resources :issues, except: %i[show] do
11
- patch 'sort/:volume_id' => 'issues#sort', as: :sort, on: :collection
11
+ post 'sort/:volume_id' => 'issues#sort', as: :sort, on: :collection
12
12
  end
13
13
  resources :articles, except: %i[show] do
14
- patch 'sort/:issue_id' => 'articles#sort', as: :sort, on: :collection
14
+ post 'sort/:issue_id' => 'articles#sort', as: :sort, on: :collection
15
15
  end
16
16
  resources :authors, except: %i[show] do
17
- patch 'sort/:article_id' => 'authors#sort', as: :sort, on: :collection
17
+ post 'sort/:article_id' => 'authors#sort', as: :sort, on: :collection
18
18
  end
19
19
 
20
20
  resources :institutions, except: %i[show]
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CreateSpinaPartsAdminJournalPageRanges < ActiveRecord::Migration[6.1] # :nodoc:
4
+ def change
5
+ create_table :spina_parts_admin_journal_page_ranges, &:timestamps
6
+ end
7
+ end
@@ -5,12 +5,30 @@ module Spina
5
5
  module Journal
6
6
  # Registers the plugin with Spina.
7
7
  class Engine < ::Rails::Engine
8
+ isolate_namespace Spina::Admin::Journal
9
+
10
+ initializer 'spina.admin.journal.assets' do
11
+ Spina.config.importmap.draw do
12
+ pin_all_from Spina::Admin::Journal::Engine.root.join('app/assets/javascripts/spina/admin/journal/controllers'), # rubocop:disable Layout/LineLength
13
+ under: 'controllers', to: 'spina/admin/journal/controllers'
14
+ end
15
+
16
+ Spina.config.tailwind_content.concat(["#{Spina::Admin::Journal::Engine.root}/app/views/**/*.*",
17
+ "#{Spina::Admin::Journal::Engine.root}/app/components/**/*.*",
18
+ "#{Spina::Admin::Journal::Engine.root}/app/helpers/**/*.*",
19
+ "#{Spina::Admin::Journal::Engine.root}/app/assets/javascripts/**/*.js"])
20
+ end
21
+
8
22
  config.before_initialize do
9
23
  ::Spina::Plugin.register do |plugin|
10
24
  plugin.name = 'journal'
11
25
  plugin.namespace = 'journal'
12
26
  end
13
27
  end
28
+
29
+ config.after_initialize do
30
+ Spina::Part.register Spina::Parts::Admin::Journal::PageRange
31
+ end
14
32
  end
15
33
  end
16
34
  end
@@ -3,7 +3,7 @@
3
3
  module Spina
4
4
  module Admin
5
5
  module Journal
6
- VERSION = '0.5.0'
6
+ VERSION = '1.0.0.rc1'
7
7
  end
8
8
  end
9
9
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'haml-rails'
3
4
  require 'spina'
4
5
  require 'spina/admin/journal/engine'
5
6
  require 'rails-i18n'
metadata CHANGED
@@ -1,71 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spina-admin-journal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 1.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis Van Steene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-23 00:00:00.000000000 Z
11
+ date: 2022-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: babel-transpiler
14
+ name: haml-rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.7'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.7'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '6.0'
34
+ - - "<"
32
35
  - !ruby/object:Gem::Version
33
- version: '6.1'
36
+ version: '8'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
39
42
  - !ruby/object:Gem::Version
40
- version: '6.1'
43
+ version: '6.0'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '8'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: rails-i18n
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - "~>"
51
+ - - ">="
46
52
  - !ruby/object:Gem::Version
47
53
  version: '6.0'
54
+ - - "<"
55
+ - !ruby/object:Gem::Version
56
+ version: '8'
48
57
  type: :runtime
49
58
  prerelease: false
50
59
  version_requirements: !ruby/object:Gem::Requirement
51
60
  requirements:
52
- - - "~>"
61
+ - - ">="
53
62
  - !ruby/object:Gem::Version
54
63
  version: '6.0'
64
+ - - "<"
65
+ - !ruby/object:Gem::Version
66
+ version: '8'
55
67
  - !ruby/object:Gem::Dependency
56
68
  name: spina
57
69
  requirement: !ruby/object:Gem::Requirement
58
70
  requirements:
59
71
  - - "~>"
60
72
  - !ruby/object:Gem::Version
61
- version: '2.0'
73
+ version: '2.8'
62
74
  type: :runtime
63
75
  prerelease: false
64
76
  version_requirements: !ruby/object:Gem::Requirement
65
77
  requirements:
66
78
  - - "~>"
67
79
  - !ruby/object:Gem::Version
68
- version: '2.0'
80
+ version: '2.8'
69
81
  - !ruby/object:Gem::Dependency
70
82
  name: capybara
71
83
  requirement: !ruby/object:Gem::Requirement
@@ -108,20 +120,6 @@ dependencies:
108
120
  - - "~>"
109
121
  - !ruby/object:Gem::Version
110
122
  version: '1.2'
111
- - !ruby/object:Gem::Dependency
112
- name: minitest-rails
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '6.1'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '6.1'
125
123
  - !ruby/object:Gem::Dependency
126
124
  name: minitest-reporters
127
125
  requirement: !ruby/object:Gem::Requirement
@@ -212,14 +210,14 @@ dependencies:
212
210
  requirements:
213
211
  - - "~>"
214
212
  - !ruby/object:Gem::Version
215
- version: '3.142'
213
+ version: '4.1'
216
214
  type: :development
217
215
  prerelease: false
218
216
  version_requirements: !ruby/object:Gem::Requirement
219
217
  requirements:
220
218
  - - "~>"
221
219
  - !ruby/object:Gem::Version
222
- version: '3.142'
220
+ version: '4.1'
223
221
  - !ruby/object:Gem::Dependency
224
222
  name: simplecov
225
223
  requirement: !ruby/object:Gem::Requirement
@@ -234,20 +232,6 @@ dependencies:
234
232
  - - "~>"
235
233
  - !ruby/object:Gem::Version
236
234
  version: '0.21'
237
- - !ruby/object:Gem::Dependency
238
- name: spina-upgrade
239
- requirement: !ruby/object:Gem::Requirement
240
- requirements:
241
- - - ">="
242
- - !ruby/object:Gem::Version
243
- version: '0'
244
- type: :development
245
- prerelease: false
246
- version_requirements: !ruby/object:Gem::Requirement
247
- requirements:
248
- - - ">="
249
- - !ruby/object:Gem::Version
250
- version: '0'
251
235
  - !ruby/object:Gem::Dependency
252
236
  name: yard
253
237
  requirement: !ruby/object:Gem::Requirement
@@ -273,8 +257,23 @@ files:
273
257
  - README.md
274
258
  - Rakefile
275
259
  - app/assets/config/spina_admin_journal_manifest.js
276
- - app/assets/javascripts/spina/admin/journal/application.es6
260
+ - app/assets/javascripts/spina/admin/journal/application.js
277
261
  - app/assets/stylesheets/spina/admin/journal/application.css
262
+ - app/components/spina/admin/journal/affiliations_list_component.rb
263
+ - app/components/spina/admin/journal/application_component.rb
264
+ - app/components/spina/admin/journal/articles_list_component.rb
265
+ - app/components/spina/admin/journal/authors_list_component.rb
266
+ - app/components/spina/admin/journal/authorships_list_component.rb
267
+ - app/components/spina/admin/journal/empty_list_component.html.haml
268
+ - app/components/spina/admin/journal/empty_list_component.rb
269
+ - app/components/spina/admin/journal/institutions_list_component.rb
270
+ - app/components/spina/admin/journal/issues_list_component.rb
271
+ - app/components/spina/admin/journal/licences_list_component.rb
272
+ - app/components/spina/admin/journal/list_component.html.haml
273
+ - app/components/spina/admin/journal/list_component.rb
274
+ - app/components/spina/admin/journal/list_item_component.html.haml
275
+ - app/components/spina/admin/journal/list_item_component.rb
276
+ - app/components/spina/admin/journal/volumes_list_component.rb
278
277
  - app/controllers/spina/admin/journal/application_controller.rb
279
278
  - app/controllers/spina/admin/journal/articles_controller.rb
280
279
  - app/controllers/spina/admin/journal/authors_controller.rb
@@ -293,27 +292,17 @@ files:
293
292
  - app/models/spina/admin/journal/journal.rb
294
293
  - app/models/spina/admin/journal/licence.rb
295
294
  - app/models/spina/admin/journal/volume.rb
295
+ - app/models/spina/parts/admin/journal/page_range.rb
296
296
  - app/validators/spina/admin/journal/uri_validator.rb
297
- - app/views/layouts/spina/admin/journal/articles.html.haml
298
- - app/views/layouts/spina/admin/journal/authors.html.haml
299
- - app/views/layouts/spina/admin/journal/institutions.html.haml
300
- - app/views/layouts/spina/admin/journal/issues.html.haml
301
- - app/views/layouts/spina/admin/journal/journals.html.haml
302
- - app/views/layouts/spina/admin/journal/licences.html.haml
303
- - app/views/layouts/spina/admin/journal/volumes.html.haml
304
297
  - app/views/spina/admin/hooks/journal/_head.html.haml
305
298
  - app/views/spina/admin/hooks/journal/_primary_navigation.html.haml
306
299
  - app/views/spina/admin/hooks/journal/_website_secondary_navigation.html.haml
307
- - app/views/spina/admin/journal/affiliations/_affiliation.html.haml
308
- - app/views/spina/admin/journal/application/_empty_list.html.haml
309
- - app/views/spina/admin/journal/articles/_article.html.haml
310
300
  - app/views/spina/admin/journal/articles/_form.html.haml
311
301
  - app/views/spina/admin/journal/articles/_form_authors.html.haml
312
302
  - app/views/spina/admin/journal/articles/_form_details.html.haml
313
303
  - app/views/spina/admin/journal/articles/edit.html.haml
314
304
  - app/views/spina/admin/journal/articles/index.html.haml
315
305
  - app/views/spina/admin/journal/articles/new.html.haml
316
- - app/views/spina/admin/journal/authors/_author.html.haml
317
306
  - app/views/spina/admin/journal/authors/_form.html.haml
318
307
  - app/views/spina/admin/journal/authors/_form_affiliation.html.haml
319
308
  - app/views/spina/admin/journal/authors/_form_articles.html.haml
@@ -321,37 +310,32 @@ files:
321
310
  - app/views/spina/admin/journal/authors/edit.html.haml
322
311
  - app/views/spina/admin/journal/authors/index.html.haml
323
312
  - app/views/spina/admin/journal/authors/new.html.haml
324
- - app/views/spina/admin/journal/authorships/_authorship.html.haml
325
313
  - app/views/spina/admin/journal/institutions/_form.html.haml
326
314
  - app/views/spina/admin/journal/institutions/_form_details.html.haml
327
315
  - app/views/spina/admin/journal/institutions/_form_view_affiliations.html.haml
328
- - app/views/spina/admin/journal/institutions/_institution.html.haml
329
316
  - app/views/spina/admin/journal/institutions/edit.html.haml
330
317
  - app/views/spina/admin/journal/institutions/index.html.haml
331
318
  - app/views/spina/admin/journal/institutions/new.html.haml
332
319
  - app/views/spina/admin/journal/issues/_form.html.haml
333
320
  - app/views/spina/admin/journal/issues/_form_articles.html.haml
334
321
  - app/views/spina/admin/journal/issues/_form_details.html.haml
335
- - app/views/spina/admin/journal/issues/_issue.html.haml
336
322
  - app/views/spina/admin/journal/issues/edit.html.haml
337
323
  - app/views/spina/admin/journal/issues/index.html.haml
338
324
  - app/views/spina/admin/journal/issues/new.html.haml
339
325
  - app/views/spina/admin/journal/journals/_form.html.haml
340
326
  - app/views/spina/admin/journal/journals/edit.html.haml
341
- - app/views/spina/admin/journal/journals/index.html.haml
342
327
  - app/views/spina/admin/journal/journals/new.html.haml
343
328
  - app/views/spina/admin/journal/licences/_form.html.haml
344
- - app/views/spina/admin/journal/licences/_licence.html.haml
345
329
  - app/views/spina/admin/journal/licences/edit.html.haml
346
330
  - app/views/spina/admin/journal/licences/index.html.haml
347
331
  - app/views/spina/admin/journal/licences/new.html.haml
348
332
  - app/views/spina/admin/journal/volumes/_form.html.haml
349
333
  - app/views/spina/admin/journal/volumes/_form_details.html.haml
350
334
  - app/views/spina/admin/journal/volumes/_form_issues.html.haml
351
- - app/views/spina/admin/journal/volumes/_volume.html.haml
352
335
  - app/views/spina/admin/journal/volumes/edit.html.haml
353
336
  - app/views/spina/admin/journal/volumes/index.html.haml
354
337
  - app/views/spina/admin/journal/volumes/new.html.haml
338
+ - app/views/spina/admin/parts/admin/journal/page_ranges/_form.html.haml
355
339
  - config/locales/en.yml
356
340
  - config/routes.rb
357
341
  - db/migrate/20201216152147_create_spina_admin_journal_journals.rb
@@ -370,15 +354,16 @@ files:
370
354
  - db/migrate/20210521121318_add_status_to_spina_admin_journal_articles.rb
371
355
  - db/migrate/20210618090155_create_spina_admin_journal_licences.rb
372
356
  - db/migrate/20210618094533_add_licence_to_spina_admin_journal_articles.rb
357
+ - db/migrate/20210626153728_create_spina_parts_admin_journal_page_ranges.rb
373
358
  - lib/spina/admin/journal.rb
374
359
  - lib/spina/admin/journal/engine.rb
375
360
  - lib/spina/admin/journal/version.rb
376
361
  - lib/tasks/spina/admin/journal_tasks.rake
377
- - vendor/assets/javascripts/spina/admin/journal/html5sortable.js
378
362
  homepage: https://github.com/louis-vs/spina-admin-journal
379
363
  licenses:
380
364
  - MIT
381
- metadata: {}
365
+ metadata:
366
+ rubygems_mfa_required: 'true'
382
367
  post_install_message:
383
368
  rdoc_options: []
384
369
  require_paths:
@@ -390,9 +375,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
390
375
  version: '2.7'
391
376
  required_rubygems_version: !ruby/object:Gem::Requirement
392
377
  requirements:
393
- - - ">="
378
+ - - ">"
394
379
  - !ruby/object:Gem::Version
395
- version: '0'
380
+ version: 1.3.1
396
381
  requirements: []
397
382
  rubygems_version: 3.1.6
398
383
  signing_key:
@@ -1,72 +0,0 @@
1
- //= require spina/admin/journal/html5sortable
2
- /* global sortable */
3
-
4
- $(document).on('turbolinks:load', () => {
5
- // html5sortable configuration
6
- sortable('.html5sortable', {
7
- items: 'tr',
8
- itemSerializer: (serializedItem) => {
9
- return {
10
- position: serializedItem.index + 1,
11
- id: serializedItem.node.getAttribute('data-id')
12
- };
13
- },
14
- containerSerializer: (serializedContainer) => {
15
- return {
16
- name: serializedContainer.node.getAttribute('data-sorted-collection')
17
- };
18
- }
19
- });
20
-
21
- // add sorting event listener if there is a sortable container on the page
22
- if(typeof sortable('.html5sortable')[0] !== 'undefined') {
23
- sortable('.html5sortable')[0].addEventListener('sortupdate', e => {
24
- let container = e.detail.destination.container;
25
- let serialized = sortable('.html5sortable', 'serialize')[0];
26
- let data = serialized.items.reduce((map, obj) => {
27
- map[`${serialized.container.name}[list[${obj.id}]]`] = obj.position;
28
- return map;
29
- }, {});
30
-
31
- let displayError = (...args) => {
32
- let message = 'An unknown error occured.'; // not translateable (but should never happen)
33
- if(typeof args[0] === 'string') {
34
- message = args[0];
35
- }
36
- // display error message
37
- $('.sort-message').html('');
38
- $('.sort-message').removeClass('animate-fadein success');
39
- $('.sort-message').width(); // trigger reflow
40
- $('.sort-message').html(message).addClass('error animate-fadein');
41
- // TODO: return element to its origin
42
- // this needs to be done manually, but may not really be necessary since the displayed
43
- // numbers won't change
44
- };
45
-
46
- // send sort request
47
- $.ajax({
48
- url: $('.html5sortable').eq(0).data('sort-url'),
49
- type: 'PATCH',
50
- dataType: 'json',
51
- data: data,
52
- success: (data) => {
53
- if(data.success) {
54
- // display success message
55
- $('.sort-message').html(''); // clear message
56
- $('.sort-message').removeClass('animate-fadein error');
57
- $('.sort-message').width(); // trigger reflow (for animation to work)
58
- $('.sort-message').html(data.message).addClass('success animate-fadein');
59
- // update displayed position number
60
- // NB this is done entirely clientside, so there is the potential for desync
61
- for(let i = 0; i < container.children.length; i++) {
62
- container.children[i].getElementsByClassName('position-display')[0].innerHTML = (i+1).toString();
63
- }
64
- } else {
65
- displayError(data.message);
66
- }
67
- },
68
- error: displayError
69
- });
70
- });
71
- }
72
- });
@@ -1,10 +0,0 @@
1
- - content_for :application do
2
- %header#header
3
- #header_actions
4
- = yield :header_actions
5
-
6
- = render partial: 'spina/admin/shared/breadcrumbs'
7
-
8
- = yield
9
-
10
- = render template: 'layouts/spina/admin/admin'
@@ -1,10 +0,0 @@
1
- - content_for :application do
2
- %header#header
3
- #header_actions
4
- = yield :header_actions
5
-
6
- = render partial: 'spina/admin/shared/breadcrumbs'
7
-
8
- = yield
9
-
10
- = render template: 'layouts/spina/admin/admin'
@@ -1,10 +0,0 @@
1
- - content_for :application do
2
- %header#header
3
- #header_actions
4
- = yield :header_actions
5
-
6
- = render partial: 'spina/admin/shared/breadcrumbs'
7
-
8
- = yield
9
-
10
- = render template: 'layouts/spina/admin/admin'
@@ -1,10 +0,0 @@
1
- - content_for :application do
2
- %header#header
3
- #header_actions
4
- = yield :header_actions
5
-
6
- = render partial: 'spina/admin/shared/breadcrumbs'
7
-
8
- = yield
9
-
10
- = render template: 'layouts/spina/admin/admin'
@@ -1,10 +0,0 @@
1
- - content_for :application do
2
- %header#header
3
- #header_actions
4
- = yield :header_actions
5
-
6
- = render partial: 'spina/admin/shared/breadcrumbs'
7
-
8
- = yield
9
-
10
- = render template: 'layouts/spina/admin/admin'
@@ -1,10 +0,0 @@
1
- - content_for :application do
2
- %header#header
3
- #header_actions
4
- = yield :header_actions
5
-
6
- = render partial: 'spina/admin/shared/breadcrumbs'
7
-
8
- = yield
9
-
10
- = render template: 'layouts/spina/admin/admin'
@@ -1,10 +0,0 @@
1
- - content_for :application do
2
- %header#header
3
- #header_actions
4
- = yield :header_actions
5
-
6
- = render partial: 'spina/admin/shared/breadcrumbs'
7
-
8
- = yield
9
-
10
- = render template: 'layouts/spina/admin/admin'
@@ -1,8 +0,0 @@
1
- %tr{ data: { id: affiliation.id } }
2
- %td= affiliation.name
3
- %td= affiliation.institution.name
4
- %td= affiliation.articles.count
5
- %td.nowrap.align-right
6
- = link_to edit_admin_journal_author_path(affiliation.author.id), class: 'button button-link' do
7
- = icon 'pencil-outline'
8
- = t '.view'
@@ -1,3 +0,0 @@
1
- %tr
2
- %td.align-center{ colspan: 1000 }
3
- %em= message
@@ -1,10 +0,0 @@
1
- %tr{ data: { id: article.id } }
2
- %td= article.issue.volume.number
3
- %td= article.issue.number
4
- %td.position-display= article.number
5
- %td= time_tag article.issue.date, format: :iso8601
6
- %td= article.title
7
- %td.nowrap.align-right
8
- = link_to edit_admin_journal_article_path(article.id), class: 'button button-link' do
9
- = icon 'pencil-outline'
10
- = t '.view'