lcms-engine 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +11 -15
  4. data/Dockerfile +0 -1
  5. data/README.md +13 -4
  6. data/app/assets/javascripts/lcms/engine/admin/application.js +2 -6
  7. data/app/assets/javascripts/lcms/engine/application.js +2 -2
  8. data/app/assets/javascripts/lcms/engine/initializers/{google_analytics.js → analytics.js} +0 -0
  9. data/app/assets/javascripts/lcms/engine/initializers/lessons.js +1 -1
  10. data/app/assets/stylesheets/lcms/engine/admin.scss +1 -1
  11. data/app/assets/stylesheets/lcms/engine/application.scss +4 -3
  12. data/app/assets/stylesheets/lcms/engine/components/_curriculum-cards.scss +1 -1
  13. data/app/assets/stylesheets/lcms/engine/components/_curriculum-map.scss +4 -4
  14. data/app/assets/stylesheets/lcms/engine/components/_media-resources.scss +1 -1
  15. data/app/assets/stylesheets/lcms/engine/components/_panel-dsc.scss +1 -1
  16. data/app/assets/stylesheets/lcms/engine/components/_resource.scss +6 -6
  17. data/app/assets/stylesheets/lcms/engine/pages/_home.scss +4 -4
  18. data/app/assets/stylesheets/lcms/engine/pdf.scss +1 -1
  19. data/app/assets/stylesheets/lcms/engine/themes/_settings.scss +419 -116
  20. data/app/assets/stylesheets/lcms/engine/utils/_mixins.scss +2 -2
  21. data/app/assets/stylesheets/lcms/engine/vendors/foundation_and_overrides-pdf.scss +0 -1
  22. data/app/assets/stylesheets/lcms/engine/vendors/foundation_and_overrides.scss +13 -2
  23. data/app/controllers/lcms/engine/admin/admin_controller.rb +0 -2
  24. data/app/controllers/lcms/engine/admin/association_picker_controller.rb +10 -9
  25. data/app/controllers/lcms/engine/admin/documents_controller.rb +17 -14
  26. data/app/controllers/lcms/engine/admin/materials_controller.rb +19 -23
  27. data/app/controllers/lcms/engine/admin/resource_picker_controller.rb +2 -2
  28. data/app/controllers/lcms/engine/admin/resources_controller.rb +45 -79
  29. data/app/controllers/lcms/engine/admin/sketch_compilers_controller.rb +2 -2
  30. data/app/controllers/lcms/engine/application_controller.rb +0 -15
  31. data/app/entities/lcms/engine/pagination.rb +14 -5
  32. data/app/forms/lcms/engine/material_form.rb +0 -1
  33. data/app/helpers/lcms/engine/application_helper.rb +2 -6
  34. data/app/helpers/lcms/engine/view_helper.rb +1 -3
  35. data/app/interactors/lcms/engine/explore_curriculum_interactor.rb +1 -1
  36. data/app/javascript/components/admin/ImportStatus.jsx +1 -1
  37. data/app/javascript/components/admin/association-picker/AssociationPickerResults.jsx +1 -1
  38. data/app/javascript/components/admin/picker/pickerWindowWrapper.jsx +0 -1
  39. data/app/models/lcms/engine/access_code.rb +1 -1
  40. data/app/models/lcms/engine/application_record.rb +9 -0
  41. data/app/models/lcms/engine/author.rb +1 -1
  42. data/app/models/lcms/engine/copyright_attribution.rb +1 -1
  43. data/app/models/lcms/engine/curriculum.rb +1 -1
  44. data/app/models/lcms/engine/document.rb +3 -3
  45. data/app/models/lcms/engine/document_bundle.rb +2 -2
  46. data/app/models/lcms/engine/document_part.rb +1 -1
  47. data/app/models/lcms/engine/download.rb +3 -3
  48. data/app/models/lcms/engine/download_category.rb +1 -1
  49. data/app/models/lcms/engine/leadership_post.rb +1 -1
  50. data/app/models/lcms/engine/material.rb +2 -2
  51. data/app/models/lcms/engine/material_part.rb +1 -1
  52. data/app/models/lcms/engine/page.rb +1 -1
  53. data/app/models/lcms/engine/reading_assignment_author.rb +1 -1
  54. data/app/models/lcms/engine/reading_assignment_text.rb +1 -1
  55. data/app/models/lcms/engine/resource.rb +4 -12
  56. data/app/models/lcms/engine/resource_additional_resource.rb +1 -1
  57. data/app/models/lcms/engine/resource_download.rb +1 -1
  58. data/app/models/lcms/engine/resource_reading_assignment.rb +1 -1
  59. data/app/models/lcms/engine/resource_related_resource.rb +1 -1
  60. data/app/models/lcms/engine/resource_standard.rb +1 -1
  61. data/app/models/lcms/engine/search/elastic_search_document.rb +1 -1
  62. data/app/models/lcms/engine/settings.rb +1 -1
  63. data/app/models/lcms/engine/social_thumbnail.rb +1 -1
  64. data/app/models/lcms/engine/staff_member.rb +1 -1
  65. data/app/models/lcms/engine/standard.rb +1 -1
  66. data/app/models/lcms/engine/standard_link.rb +1 -1
  67. data/app/models/lcms/engine/user.rb +3 -3
  68. data/app/presenters/lcms/engine/content_presenter.rb +1 -1
  69. data/app/queries/lcms/engine/admin_documents_query.rb +1 -1
  70. data/app/queries/lcms/engine/admin_materials_query.rb +1 -1
  71. data/app/serializers/lcms/engine/association_item_serializer.rb +0 -1
  72. data/app/serializers/lcms/engine/curriculum_resource_serializer.rb +0 -2
  73. data/app/serializers/lcms/engine/document_material_serializer.rb +0 -1
  74. data/app/serializers/lcms/engine/material_serializer.rb +0 -1
  75. data/app/serializers/lcms/engine/previews_material_serializer.rb +0 -1
  76. data/app/serializers/lcms/engine/resource_details_serializer.rb +0 -2
  77. data/app/serializers/lcms/engine/resource_instruction_serializer.rb +0 -2
  78. data/app/serializers/lcms/engine/resource_picker_serializer.rb +0 -2
  79. data/app/serializers/lcms/engine/resource_serializer.rb +0 -2
  80. data/app/serializers/lcms/engine/search_document_serializer.rb +0 -2
  81. data/app/services/lcms/engine/document_build_service.rb +1 -0
  82. data/app/services/lcms/engine/html_sanitizer.rb +2 -2
  83. data/app/services/lcms/engine/s3_service.rb +1 -1
  84. data/app/uploaders/social_thumbnail_uploader.rb +0 -4
  85. data/app/views/layouts/lcms/engine/admin.html.erb +1 -1
  86. data/app/views/lcms/engine/admin/access_codes/index.html.erb +10 -8
  87. data/app/views/lcms/engine/admin/documents/index.html.erb +2 -2
  88. data/app/views/lcms/engine/admin/materials/index.html.erb +2 -2
  89. data/app/views/lcms/engine/admin/pages/index.html.erb +3 -3
  90. data/app/views/lcms/engine/admin/standards/index.html.erb +9 -7
  91. data/app/views/lcms/engine/admin/users/index.html.erb +16 -14
  92. data/app/views/lcms/engine/resources/_children_list.html.erb +1 -1
  93. data/app/views/lcms/engine/shared/_social_sharing_menu.html.erb +4 -4
  94. data/config/initializers/carrier_wave.rb +0 -1
  95. data/config/locales/admin/en.yml +0 -2
  96. data/db/migrate/20200422130652_add_reimported_at_to_documents.rb +7 -0
  97. data/lcms-engine.gemspec +73 -87
  98. data/lib/doc_template/document.rb +2 -2
  99. data/lib/doc_template/tables/activity.rb +2 -1
  100. data/lib/doc_template/tables/base.rb +0 -4
  101. data/lib/doc_template/tables/section.rb +2 -1
  102. data/lib/doc_template/tags/link_tag.rb +1 -1
  103. data/lib/doc_template/xpath_functions.rb +1 -3
  104. data/lib/document_exporter/base.rb +1 -2
  105. data/lib/document_exporter/docx.rb +0 -1
  106. data/lib/generators/lcms/engine/install/install_generator.rb +1 -4
  107. data/lib/generators/lcms/engine/install/templates/config/lcms.yml +1 -1
  108. data/lib/lcms/engine/engine.rb +0 -16
  109. data/lib/lcms/engine/migration.rb +2 -0
  110. data/lib/lcms/engine/version.rb +1 -1
  111. data/lib/lt/lcms/metadata/context.rb +7 -5
  112. data/spec/controllers/admin/admin_controller_spec.rb +1 -1
  113. data/spec/controllers/admin/association_picker_controller_spec.rb +2 -2
  114. data/spec/controllers/admin/curriculums_controller_spec.rb +1 -2
  115. data/spec/controllers/admin/documents_controller_spec.rb +12 -41
  116. data/spec/controllers/admin/materials_controller_spec.rb +7 -67
  117. data/spec/controllers/admin/pages_controller_spec.rb +2 -2
  118. data/spec/controllers/admin/resource_bulk_edit_controller_spec.rb +3 -3
  119. data/spec/controllers/admin/sketch_compilers_controller_spec.rb +5 -4
  120. data/spec/controllers/admin/standards_controller_spec.rb +12 -9
  121. data/spec/controllers/admin/users_controller_spec.rb +2 -2
  122. data/spec/controllers/admin/welcome_controller_spec.rb +1 -1
  123. data/spec/controllers/documents_controller_spec.rb +3 -3
  124. data/spec/controllers/enhance_instruction_controller_spec.rb +1 -1
  125. data/spec/controllers/explore_curriculum_controller_spec.rb +2 -2
  126. data/spec/controllers/find_lessons_controller_spec.rb +1 -1
  127. data/spec/controllers/pages_controller_spec.rb +9 -12
  128. data/spec/controllers/resources_controller_spec.rb +2 -2
  129. data/spec/controllers/search_controller_spec.rb +1 -1
  130. data/spec/dummy/bin/spring +2 -2
  131. data/spec/dummy/config/application.rb +3 -3
  132. data/spec/dummy/config/environments/test.rb +2 -5
  133. data/spec/dummy/config/lcms-admin.yml +3 -3
  134. data/spec/dummy/config/webpack/development.js +5 -0
  135. data/spec/dummy/config/webpack/environment.js +3 -0
  136. data/spec/dummy/config/webpack/production.js +5 -0
  137. data/spec/dummy/config/webpack/test.js +5 -0
  138. data/spec/dummy/config/webpacker.yml +96 -0
  139. data/spec/dummy/db/schema.rb +251 -275
  140. data/spec/factories/document_bundles.rb +1 -1
  141. data/spec/factories/standard_links.rb +2 -0
  142. data/spec/factories/taggings.rb +1 -0
  143. data/spec/models/document_bundle_spec.rb +0 -6
  144. data/spec/models/resource_spec.rb +0 -33
  145. data/spec/rails_helper.rb +0 -1
  146. data/spec/requests/admin/curriculum_spec.rb +17 -0
  147. data/spec/services/document_build_service_spec.rb +76 -62
  148. data/spec/services/html_sanitizer_spec.rb +0 -34
  149. data/spec/support/capybara.rb +1 -3
  150. data/spec/support/concerns/searchable.rb +2 -0
  151. data/spec/support/database_cleaner.rb +5 -16
  152. data/spec/support/devise.rb +2 -0
  153. data/yarn.lock +442 -530
  154. metadata +183 -439
  155. data/Gemfile.lock +0 -752
  156. data/config/initializers/active_record.rb +0 -3
  157. data/spec/controllers/admin/resources_controller_spec.rb +0 -84
  158. data/spec/fixtures/tables/activity-metadata-3activities.html +0 -1
  159. data/spec/fixtures/tables/document-metadata-2paragpraphs.html +0 -97
  160. data/spec/fixtures/tables/document-metadata-2spans.html +0 -96
  161. data/spec/fixtures/tables/document-metadata.html +0 -96
  162. data/spec/lib/doc_template/tables/activity_spec.rb +0 -28
  163. data/spec/lib/doc_template/tables/metadata_spec.rb +0 -40
  164. data/spec/lib/doc_template/tables/shared_examples/remove_table.rb +0 -11
  165. data/spec/support/fixture_helper.rb +0 -16
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Lcms
4
4
  module Engine
5
- class StandardLink < ActiveRecord::Base
5
+ class StandardLink < ApplicationRecord
6
6
  belongs_to :standard_begin, class_name: 'Standard', foreign_key: 'standard_begin_id'
7
7
  belongs_to :standard_end, class_name: 'Standard', foreign_key: 'standard_end_id'
8
8
  end
@@ -4,7 +4,7 @@ require 'devise'
4
4
 
5
5
  module Lcms
6
6
  module Engine
7
- class User < ActiveRecord::Base
7
+ class User < ApplicationRecord
8
8
  # Include default devise modules. Others available are:
9
9
  # :lockable, :timeoutable and :omniauthable
10
10
  devise :database_authenticatable, :registerable, :confirmable,
@@ -12,9 +12,9 @@ module Lcms
12
12
 
13
13
  enum role: { admin: 1, user: 0 }
14
14
 
15
- validates_presence_of :access_code, on: :create, unless: 'admin?'
15
+ validates_presence_of :access_code, on: :create, unless: :admin?
16
16
  validates_presence_of :email, :role
17
- validate :access_code_valid?, on: :create, unless: 'admin?'
17
+ validate :access_code_valid?, on: :create, unless: :admin?
18
18
 
19
19
  def full_name
20
20
  [
@@ -71,7 +71,7 @@ module Lcms
71
71
  end
72
72
 
73
73
  def layout_content(context_type)
74
- layout(context_type)&.content.to_s
74
+ layout(context_type).content
75
75
  end
76
76
  end
77
77
  end
@@ -36,7 +36,7 @@ module Lcms
36
36
  def sorted_scope
37
37
  @scope = @scope.order_by_curriculum if q.sort_by.blank? || q.sort_by == 'curriculum'
38
38
  @scope = @scope.order(updated_at: :desc) if q.sort_by == 'last_update'
39
- @scope.uniq.order(active: :desc)
39
+ @scope.distinct.order(active: :desc)
40
40
  end
41
41
  end
42
42
  end
@@ -45,7 +45,7 @@ module Lcms
45
45
  def sorted_scope
46
46
  @scope = @scope.reorder(:identifier) if q.sort_by.blank? || q.sort_by == 'identifier'
47
47
  @scope = @scope.reorder(updated_at: :desc) if q.sort_by == 'last_update'
48
- @scope.uniq
48
+ @scope.distinct
49
49
  end
50
50
  end
51
51
  end
@@ -3,7 +3,6 @@
3
3
  module Lcms
4
4
  module Engine
5
5
  class AssociationItemSerializer < ActiveModel::Serializer
6
- self.root = false
7
6
  attributes :id, :name
8
7
  end
9
8
  end
@@ -3,8 +3,6 @@
3
3
  module Lcms
4
4
  module Engine
5
5
  class CurriculumResourceSerializer < ActiveModel::Serializer
6
- self.root = false
7
-
8
6
  attributes :children, :id, :lesson_count, :module_count, :module_sizes,
9
7
  :resource, :type, :unit_count, :unit_sizes
10
8
 
@@ -3,7 +3,6 @@
3
3
  module Lcms
4
4
  module Engine
5
5
  class DocumentMaterialSerializer < ActiveModel::Serializer
6
- self.root = false
7
6
  attributes :data
8
7
 
9
8
  def initialize(document, materials)
@@ -3,7 +3,6 @@
3
3
  module Lcms
4
4
  module Engine
5
5
  class MaterialSerializer < ActiveModel::Serializer
6
- self.root = false
7
6
  attributes :anchors, :id, :identifier, :gdoc_url, :orientation, :pdf_url, :source_type, :subtitle, :title,
8
7
  :thumb_url, :pdf?
9
8
  delegate :anchors, :gdoc_url, :lesson, :orientation, :pdf_url, :source_type, :subtitle, :title,
@@ -3,7 +3,6 @@
3
3
  module Lcms
4
4
  module Engine
5
5
  class PreviewsMaterialSerializer < ActiveModel::Serializer
6
- self.root = false
7
6
  attributes :activity, :color, :content_type, :data, :for_group, :lesson, :subject
8
7
  attr_reader :document
9
8
  delegate :content_type, :subject, to: :document
@@ -8,8 +8,6 @@ module Lcms
8
8
  class ResourceDetailsSerializer < ResourceSerializer
9
9
  include ResourceHelper
10
10
 
11
- self.root = false
12
-
13
11
  attributes :breadcrumb_title, :copyright, :downloads, :grade, :has_related, :id,
14
12
  :opr_description, :opr_standards, :path, :short_title, :subject, :teaser, :time_to_teach,
15
13
  :title, :type
@@ -5,8 +5,6 @@ module Lcms
5
5
  class ResourceInstructionSerializer < ActiveModel::Serializer
6
6
  include ResourceHelper
7
7
 
8
- self.root = false
9
-
10
8
  attributes :id, :title, :subject, :teaser, :path, :img, :instruction_type,
11
9
  :grade_avg, :time_to_teach
12
10
 
@@ -3,8 +3,6 @@
3
3
  module Lcms
4
4
  module Engine
5
5
  class ResourcePickerSerializer < ActiveModel::Serializer
6
- self.root = false
7
-
8
6
  attributes :id, :title
9
7
  end
10
8
  end
@@ -8,8 +8,6 @@ module Lcms
8
8
  class ResourceSerializer < ActiveModel::Serializer
9
9
  include ResourceHelper
10
10
 
11
- self.root = false
12
-
13
11
  attributes :breadcrumb_title, :grade, :id, :is_assessment, :is_foundational, :is_opr, :is_prerequisite, :path,
14
12
  :short_title, :subject, :teaser, :time_to_teach, :title, :type
15
13
 
@@ -3,8 +3,6 @@
3
3
  module Lcms
4
4
  module Engine
5
5
  class SearchDocumentSerializer < ActiveModel::Serializer
6
- self.root = false
7
-
8
6
  attributes :id, :model_id, :model_type, :title, :path, :type_name, :teaser,
9
7
  :breadcrumbs, :subject, :grade
10
8
 
@@ -143,6 +143,7 @@ module Lcms
143
143
  last_author_email: downloader.file.last_modifying_user.try(:email_address),
144
144
  last_author_name: downloader.file.last_modifying_user.try(:display_name),
145
145
  metadata: template.metadata,
146
+ reimported_at: Time.current,
146
147
  sections_metadata: template.metadata_service.try(:section_metadata),
147
148
  version: downloader.file.version
148
149
  }
@@ -10,7 +10,7 @@ module Lcms
10
10
  GDOC_REMOVE_EMPTY_SELECTOR = '.o-ld-activity'
11
11
  LINK_UNDERLINE_REGEX = /text-decoration\s*:\s*underline/i
12
12
  SKIP_P_CHECK = %w(ul ol table).freeze
13
- STRIP_ELEMENTS = %w(a div h1 h2 h3 h4 h5 h6 p span table text).freeze
13
+ STRIP_ELEMENTS = %w(a div h1 h2 h3 h4 h5 h6 p span table).freeze
14
14
 
15
15
  class << self
16
16
  def clean_content(html, context_type)
@@ -35,7 +35,7 @@ module Lcms
35
35
  # Removes all empty nodes before first one filled in
36
36
  #
37
37
  def strip_content(nodes)
38
- nodes.children.each do |node|
38
+ nodes.xpath('./*').each do |node|
39
39
  break if keep_node?(node)
40
40
 
41
41
  node.remove
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'aws-sdk-rails'
3
+ require 'aws-sdk-s3'
4
4
 
5
5
  module Lcms
6
6
  module Engine
@@ -4,8 +4,4 @@ class SocialThumbnailUploader < CarrierWave::Uploader::Base
4
4
  def store_dir
5
5
  "social_thumbnails/#{mounted_as}/#{model.id}"
6
6
  end
7
-
8
- # def fog_attributes
9
- # { 'Content-Disposition' => 'attachment' }
10
- # end
11
7
  end
@@ -13,7 +13,7 @@
13
13
  <%= csrf_meta_tags %>
14
14
  <%# NOTE: JS served via Assets pipeline should be added first %>
15
15
  <%= javascript_include_tag 'lcms/engine/admin/application', 'data-turbolinks-track' => 'reload' %>
16
- <%= lcms_engine_javascript_pack_tag 'admin' %>
16
+ <%= javascript_pack_tag 'admin' %>
17
17
  </head>
18
18
  <body>
19
19
  <%= render partial: 'lcms/engine/shared/unsupported' %>
@@ -1,7 +1,7 @@
1
1
  <div class=o-page>
2
2
  <div class=clearfix>
3
3
  <div class=pull-right>
4
- <%= link_to t('.new_access_code'), :new_admin_access_code, class: 'btn btn-success', 'data-turbolinks' => false %>
4
+ <%= link_to t('.new_access_code'), :new_admin_access_code, class: 'button success', 'data-turbolinks' => false %>
5
5
  </div>
6
6
  </div>
7
7
 
@@ -17,13 +17,15 @@
17
17
  </tr>
18
18
 
19
19
  <% @access_codes.each do |access_code| %>
20
- <tr id="access_code_<%= access_code.id %>">
21
- <td><%= link_to access_code.code, edit_admin_access_code_path(access_code) %>
22
- <td><%= access_code.active ? 'YES' : 'NO' %>
23
- <td>
24
- <%= button_to t('ui.delete'), admin_access_code_path(access_code), class: 'btn btn-danger', data: { confirm: t('ui.are_you_sure') }, form_class: 'inline', method: :delete %>
25
- </td>
26
- </tr>
20
+ <% cache access_code do %>
21
+ <tr id="access_code_<%= access_code.id %>">
22
+ <td><%= link_to access_code.code, edit_admin_access_code_path(access_code) %>
23
+ <td><%= access_code.active ? 'YES' : 'NO' %>
24
+ <td>
25
+ <%= button_to t('ui.delete'), admin_access_code_path(access_code), class: 'button alert', data: { confirm: t('ui.are_you_sure') }, form_class: 'inline', method: :delete %>
26
+ </td>
27
+ </tr>
28
+ <% end %>
27
29
  <% end %>
28
30
  </table>
29
31
  </div>
@@ -34,7 +34,7 @@
34
34
  <th>Title</th>
35
35
  <th>File Name</th>
36
36
  <th>Materials</th>
37
- <th>Last Update</th>
37
+ <th>Reimported at</th>
38
38
  <th>Status</th>
39
39
  <th></th>
40
40
  </tr>
@@ -60,7 +60,7 @@
60
60
  <% end %>
61
61
  </td>
62
62
  <td><%= render partial: 'lcms/engine/admin/documents/materials_links', locals: { lesson: lesson } %></td>
63
- <td class="u-text--small"><%= lesson.updated_at.to_s %></td>
63
+ <td class="u-txt--small"><%= lesson.reimported_at.to_s.presence || lesson.updated_at.to_s %>
64
64
  <td class="lessons-table__status">
65
65
  <%= lesson.active? ? 'active' : 'inactive' %>
66
66
  <% unless lesson.reimported %>
@@ -44,7 +44,7 @@
44
44
  <th>Name-Date
45
45
  <th>Header-Footer
46
46
  <th>Connected Lessons
47
- <th>Last Update
47
+ <th>Reimported at
48
48
  <th>
49
49
  </tr>
50
50
 
@@ -71,7 +71,7 @@
71
71
  <% lesson = ::Lcms::Engine::DocumentGenerator.document_presenter.new lesson %>
72
72
  <li class="u-text--small">
73
73
  <a href="<%= lesson.file_url%>" target="_blank" class="materials-table__lessons--file"><i class="ub-icon ub-file-gdoc"></i></a>
74
- <%= link_to lesson.title, ::Lcms::Engine::Admin::AdminController.document_path(lesson, request.query_parameters), target: '_blank' %>
74
+ <%= link_to lesson.title, lesson, target: '_blank' %>
75
75
  </li>
76
76
  <% end %>
77
77
  </ul>
@@ -1,6 +1,6 @@
1
1
  <div class=o-page>
2
2
  <div class=pull-right>
3
- <%= link_to t('.new_page'), :new_admin_page, class: 'btn btn-success' %>
3
+ <%= link_to t('.new_page'), :new_admin_page, class: 'button success' %>
4
4
  </div>
5
5
 
6
6
  <h2 class=text-center><%= t('.page_title') %></h2>
@@ -17,8 +17,8 @@
17
17
  <td><%= page.id %>
18
18
  <td><%= page.title %>
19
19
  <td>
20
- <%= link_to t('ui.edit'), edit_admin_page_path(page), class: 'btn btn-default' %>
21
- <%= button_to t('ui.delete'), admin_page_path(page), class: 'btn btn-danger', data: { confirm: t('ui.are_you_sure') }, form_class: 'inline', method: :delete %>
20
+ <%= link_to t('ui.edit'), edit_admin_page_path(page), class: 'button primary' %>
21
+ <%= button_to t('ui.delete'), admin_page_path(page), class: 'button alert', data: { confirm: t('ui.are_you_sure') }, form_class: 'inline', method: :delete %>
22
22
  </tr>
23
23
  <% end %>
24
24
  </table>
@@ -16,13 +16,15 @@
16
16
  </tr>
17
17
 
18
18
  <% @standards.each do |std| %>
19
- <tr id="std<%= std.id %>">
20
- <td><b><%= std.name %></b></td>
21
- <td><%= std.subject %></td>
22
- <td><%= std.grades.join(', ') %></td>
23
- <td><%= std.alt_names.join(' / ') %></td>
24
- <td><%= link_to 'edit', edit_admin_standard_path(std), class: 'button btn o-btn' %></td>
25
- </tr>
19
+ <% cache std do %>
20
+ <tr id="std<%= std.id %>">
21
+ <td><b><%= std.name %></b></td>
22
+ <td><%= std.subject %></td>
23
+ <td><%= std.grades.join(', ') %></td>
24
+ <td><%= std.alt_names.join(' / ') %></td>
25
+ <td><%= link_to 'edit', edit_admin_standard_path(std), class: 'button btn o-btn' %></td>
26
+ </tr>
27
+ <% end %>
26
28
  <% end %>
27
29
  </table>
28
30
  </div>
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div class="row">
9
9
  <div class="flex-pull-right">
10
- <%= link_to t('.new_user'), :new_admin_user, class: 'button primary' %>
10
+ <%= link_to t('.new_user'), :new_admin_user, class: 'button success' %>
11
11
  </div>
12
12
  <table class="table">
13
13
  <tr>
@@ -25,19 +25,21 @@
25
25
  </tr>
26
26
 
27
27
  <% @users.each do |user| %>
28
- <tr id="user_<%= user.id %>">
29
- <td><%= link_to user.id, edit_admin_user_path(user) %>
30
- <td><%= link_to user.survey&.fetch('first_name', nil) || user.name, edit_admin_user_path(user) %>
31
- <td><%= raw user.survey&.fetch('last_name', nil) %>
32
- <td><%= user.email %>
33
- <td><%= user.role %>
34
- <td><%= user.access_code.presence || '-' %>
35
- <td><%= user.confirmed? ? 'YES' : 'NO' %>
36
- <td class="u-txt--small"><%= user.created_at.to_s %>
37
- <td><%= link_to content_tag(:i, nil, class: 'fa fa-pencil').html_safe, edit_admin_user_path(user), class: 'button small primary' %>
38
- <td><%= button_to t('.reset_password_btn'), reset_password_admin_user_path(user), class: 'button small', data: { confirm: t('ui.are_you_sure') }, form_class: 'inline', method: :post %>
39
- <td><%= button_to t('ui.delete'), admin_user_path(user), class: 'button small alert', data: { confirm: t('ui.are_you_sure') }, form_class: 'inline', method: :delete %></td>
40
- </tr>
28
+ <% cache user do %>
29
+ <tr id="user_<%= user.id %>">
30
+ <td><%= link_to user.id, edit_admin_user_path(user) %>
31
+ <td><%= link_to user.survey&.fetch('first_name', nil) || user.name, edit_admin_user_path(user) %>
32
+ <td><%= raw user.survey&.fetch('last_name', nil) %>
33
+ <td><%= user.email %>
34
+ <td><%= user.role %>
35
+ <td><%= user.access_code.presence || '-' %>
36
+ <td><%= user.confirmed? ? 'YES' : 'NO' %>
37
+ <td class="u-txt--small"><%= user.created_at.to_s %>
38
+ <td><%= link_to content_tag(:i, nil, class: 'fas fa-pencil-alt').html_safe, edit_admin_user_path(user), class: 'button small primary' %>
39
+ <td><%= button_to t('.reset_password_btn'), reset_password_admin_user_path(user), class: 'button small', data: { confirm: t('ui.are_you_sure') }, form_class: 'inline', method: :post %>
40
+ <td><%= button_to t('ui.delete'), admin_user_path(user), class: 'button small alert', data: { confirm: t('ui.are_you_sure') }, form_class: 'inline', method: :delete %></td>
41
+ </tr>
42
+ <% end %>
41
43
  <% end %>
42
44
  </table>
43
45
  </div>
@@ -4,7 +4,7 @@
4
4
  <ul class="o-resource__list o-resource__list--icons o-resource__list--<%= color_code %>">
5
5
  <% resource.children.each do |item| %>
6
6
  <li>
7
- <i class="fa fa-square"></i>
7
+ <i class="far fa-square"></i>
8
8
  <span>
9
9
  <% title = "#{item.short_title}: " %>
10
10
  <% if item.document.present? %>
@@ -2,7 +2,7 @@
2
2
  <li class="<%= cls %>__submenu-link">
3
3
  <a class="addthis_button_twitter" rel="nofollow" data-turbolinks="false" addthis:title="<%= social_media.twitter.title %>" addthis:description="<%= social_media.twitter.description %>" addthis:media="<%= social_media.twitter.image %>">
4
4
  <span class="fa-stack">
5
- <i class="fa fa-circle fa-stack-2x fa-header-bg"></i>
5
+ <i class="far fa-circle fa-stack-2x fa-header-bg"></i>
6
6
  <i class="fa-2x ub-twitter fa-stack-1x"></i>
7
7
  </span>
8
8
  </a>
@@ -10,7 +10,7 @@
10
10
  <li class="<%= cls %>__submenu-link">
11
11
  <a class="addthis_button_facebook" rel="nofollow" data-turbolinks="false" addthis:title="<%= social_media.facebook.title %>" addthis:description="<%= social_media.facebook.description %>" addthis:media="<%= social_media.facebook.image %>">
12
12
  <span class="fa-stack">
13
- <i class="fa fa-circle fa-stack-2x fa-header-bg"></i>
13
+ <i class="far fa-circle fa-stack-2x fa-header-bg"></i>
14
14
  <i class="fa-2x ub-facebook fa-stack-1x"></i>
15
15
  </span>
16
16
  </a>
@@ -18,7 +18,7 @@
18
18
  <li class="<%= cls %>__submenu-link">
19
19
  <a class="addthis_button_pinterest_share" rel="nofollow" data-turbolinks="false" addthis:title="<%= social_media.pinterest.title %>" addthis:description="<%= social_media.pinterest.description %>" addthis:media="<%= social_media.pinterest.image %>">
20
20
  <span class="fa-stack">
21
- <i class="fa fa-circle fa-stack-2x fa-header-bg"></i>
21
+ <i class="far fa-circle fa-stack-2x fa-header-bg"></i>
22
22
  <i class="fa-2x ub-pinterest fa-stack-1x"></i>
23
23
  </span>
24
24
  </a>
@@ -26,7 +26,7 @@
26
26
  <li class="<%= cls %>__submenu-link">
27
27
  <a class="addthis_button_email" rel="nofollow" data-turbolinks="false">
28
28
  <span class="fa-stack">
29
- <i class="fa fa-circle fa-stack-2x fa-header-bg"></i>
29
+ <i class="far fa-circle fa-stack-2x fa-header-bg"></i>
30
30
  <i class="fa-2x ub-arrow-share fa-stack-1x"></i>
31
31
  </span>
32
32
  </a>
@@ -4,7 +4,6 @@ CarrierWave.configure do |config|
4
4
  if (Rails.env.development? && ENV['AWS_ACCESS_KEY_ID'].blank?) || Rails.env.test?
5
5
  config.storage = :file
6
6
  else
7
- config.fog_provider = 'fog/aws'
8
7
  config.fog_credentials = {
9
8
  provider: 'AWS',
10
9
  aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
@@ -214,7 +214,6 @@ en:
214
214
  title: Lesson Manager
215
215
  unit_bundles: Generate Unit Bundles
216
216
  create:
217
- empty_folder: Google Documents folder is empty
218
217
  error: Error
219
218
  success: Lesson %{name} parsed successfully.
220
219
  new:
@@ -229,7 +228,6 @@ en:
229
228
  materials:
230
229
  create:
231
230
  bulk_import: Imported %{count} Materials from %{folder}
232
- empty_folder: Google Documents folder is empty
233
231
  error: Error
234
232
  success: Material %{name} parsed successfully.
235
233
  destroy:
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddReimportedAtToDocuments < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :documents, :reimported_at, :datetime
6
+ end
7
+ end