Skip to content

Commit

Permalink
Merge 9ddd6cf into 881a584
Browse files Browse the repository at this point in the history
  • Loading branch information
benwbrum committed Apr 8, 2022
2 parents 881a584 + 9ddd6cf commit b606c81
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
7 changes: 6 additions & 1 deletion app/controllers/page_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ def create

def update
page = Page.find(params[:id])
page.update(page_params)
attributes = page_params.to_h
if page_params[:status].blank?
attributes['status'] = nil
end
page.update_columns(attributes) # bypass page version callbacks
flash[:notice] = t('.page_updated')
page.work.work_statistic.recalculate if page.work.work_statistic

if params[:page][:base_image]
process_uploaded_file(page, page_params[:base_image])
Expand Down
1 change: 1 addition & 0 deletions app/controllers/sc_collections_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def import
render 'explore_manifest', at_id: at_id
end
rescue => e
logger.error(e)
case params[:source]
when 'contentdm'
flash[:error] = t('.no_manifest_exist', url: params[:source_url])
Expand Down
2 changes: 1 addition & 1 deletion app/models/work.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Work < ApplicationRecord
after_create :alert_intercom

validates :title, presence: true, length: { minimum: 3, maximum: 255 }
validates :slug, uniqueness: { case_sensitive: true }, format: { with: /[[:alpha:]]/ }
validates :slug, uniqueness: { case_sensitive: true }, format: { with: /[-_[:alpha:]]/ }
validate :document_date_is_edtf

mount_uploader :picture, PictureUploader
Expand Down
1 change: 0 additions & 1 deletion app/views/display/_pages_view.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
-if page.work.description_status == Work::DescriptionStatus::NEEDS_REVIEW && current_user.can_review?(@collection)
=link_to t('.review_metadata'), describe_collection_work_path(@collection.owner, @collection, page.work), class: 'button review-button'


.work-page
.work-page_thumbnail
-if page.ia_leaf
Expand Down
18 changes: 10 additions & 8 deletions app/views/work/pages_tab.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@
table.datagrid
tr
th Page Title
th Page Status
-unless @work.ia_work || @work.sc_manifest
th Image Status
th Actions
th Position
-@work.pages.each do |page|
tr
td.w100 =link_to page.title, { controller: 'display', action: 'display_page', page_id: page.id }
td.nowrap.fgfaded
-if page.base_image.empty?
=svg_symbol '#icon-warning-sign', class: 'icon'
=="#{link_to 'Upload', { controller: 'page', action: 'edit', page_id: page.id }} page image"
-else
=svg_symbol '#icon-check-sign', class: 'icon a50'
=="Ready to #{link_to 'transcribe', { controller: 'transcribe', action: 'display_page', page_id: page.id }}"
-unless @work.ia_work || @work.sc_manifest
td.nowrap.fgfaded
-if page.base_image.empty?
=svg_symbol '#icon-warning-sign', class: 'icon'
=="#{link_to 'Upload', { controller: 'page', action: 'edit', page_id: page.id }} page image"
-else
=svg_symbol '#icon-check-sign', class: 'icon a50'
=="Ready to #{link_to 'transcribe', { controller: 'transcribe', action: 'display_page', page_id: page.id }}"
td.nowrap.fglight
-if @work.featured_page == page.id
b &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Featured Page &nbsp;&nbsp;&nbsp;
Expand Down

0 comments on commit b606c81

Please sign in to comment.