Skip to content

Commit

Permalink
Merge b88bfce into 2858ef4
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoviola authored May 20, 2020
2 parents 2858ef4 + b88bfce commit 4e31e95
Show file tree
Hide file tree
Showing 20 changed files with 399 additions and 185 deletions.
10 changes: 5 additions & 5 deletions app/controllers/collection_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def update
end

if @collection.save!
flash[:notice] = 'Collection has been updated'
flash[:notice] = t('.notice')
redirect_to action: 'edit', collection_id: @collection.id
else
render action: 'edit'
Expand All @@ -246,7 +246,7 @@ def create
end
end
if @collection.save
flash[:notice] = 'Collection has been created'
flash[:notice] = t('.notice')
if request.referrer.include?('sc_collections')
session[:iiif_collection] = @collection.id
ajax_redirect_to(request.referrer)
Expand Down Expand Up @@ -469,7 +469,7 @@ def needs_review_pages
def start_transcribing
page = find_untranscribed_page
if page.nil?
flash[:notice] = "Sorry, but there are no qualifying pages in this collection."
flash[:notice] = t('.notice')
redirect_to collection_path(@collection.owner, @collection)
else
if !user_signed_in?
Expand All @@ -482,13 +482,13 @@ def start_transcribing

def enable_ocr
@collection.enable_ocr
flash[:notice] = "OCR correction has been enabled for all works."
flash[:notice] = t('.notice')
redirect_to edit_collection_path(@collection.owner, @collection)
end

def disable_ocr
@collection.disable_ocr
flash[:notice] = "OCR correction has been disabled for all works."
flash[:notice] = t('.notice')
redirect_to edit_collection_path(@collection.owner, @collection)
end

Expand Down
4 changes: 2 additions & 2 deletions app/views/collection/_collection_works.html.slim
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

ul.collection-work-stats
li
span Work title
span Progress
span =t('.work_title')
span =t('.progress')
span.progress_bar
-@works.each do |w|
-work_stats(w)
Expand Down
20 changes: 10 additions & 10 deletions app/views/collection/_contributor_activity.html.slim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-mailer = local_assigns.has_key?(:mailer) ? true : false

-unless @recent_transcriptions.empty?
h4.nomargin Recent Transcriptions
h4.nomargin =t('.recent_transcriptions')
p
-@recent_transcriptions.each do |d|
.deed-short
Expand All @@ -10,7 +10,7 @@
=render(:partial => 'deed/deed', :locals => { :deed => d, :mailer => mailer, :long_view => true })

-unless @recent_ocr.empty?
h4.nomargin Recent OCR correction
h4.nomargin =t('.recent_ocr_correction')
p
-@recent_ocr.each do |d|
.deed-short
Expand All @@ -19,7 +19,7 @@
=render(:partial => 'deed/deed', :locals => { :deed => d, :mailer => mailer, :long_view => true })

-unless @recent_review.empty?
h4.nomargin Recent Pages Needing Review
h4.nomargin =t('.recent_pages_needing_review')
p
-@recent_review.each do |d|
.deed-short
Expand All @@ -28,7 +28,7 @@
=render(:partial => 'deed/deed', :locals => { :deed => d, :mailer => mailer, :long_view => true })

-unless @recent_translations.empty?
h4.nomargin Recent Translations
h4.nomargin =t('.recent_translations')
p
-@recent_translations.each do |d|
.deed-short
Expand All @@ -37,7 +37,7 @@
=render(:partial => 'deed/deed', :locals => { :deed => d, :mailer => mailer, :long_view => true })

-unless @recent_xlat_review.empty?
h4.nomargin Recent Translations Needing Review
h4.nomargin =t('.recent_translations_needing_review')
p
-@recent_xlat_review.each do |d|
.deed-short
Expand All @@ -46,7 +46,7 @@
=render(:partial => 'deed/deed', :locals => { :deed => d, :mailer => mailer, :long_view => true })

-unless @recent_notes.empty?
h4.nomargin Recent Notes
h4.nomargin =t('.recent_notes')
p
-@recent_notes.each do |note|
-user = link_to note.user.display_name, user_profile_path(:user_id => note.user.id)
Expand All @@ -58,7 +58,7 @@

-unless @collection.subjects_disabled
-unless @recent_articles.empty?
h4.nomargin Recent Subjects
h4.nomargin =t('.recent_subjects')
p
-@recent_articles.each do |art|
.deed-short
Expand All @@ -67,7 +67,7 @@
=render(:partial => 'deed/deed', :locals => { :deed => art, :mailer => mailer, :long_view => true })

-unless @recent_index.empty?
h4.nomargin Recent Subject Indexing
h4.nomargin =t('.recent_subject_indexing')
p
-@recent_index.each do |d|
.deed-short
Expand All @@ -76,7 +76,7 @@
=render(:partial => 'deed/deed', :locals => { :deed => d, :mailer => mailer, :long_view => true })

-unless @recent_xlat_index.empty?
h4.nomargin Recent Translation Subject Indexing
h4.nomargin =t('.recent_translation_subject_indexing')
p
-@recent_xlat_index.each do |d|
.deed-short
Expand All @@ -85,7 +85,7 @@
=render(:partial => 'deed/deed', :locals => { :deed => d, :mailer => mailer, :long_view => true })

-unless @recent_work_add.empty?
h4.nomargin Recent Works Added
h4.nomargin =t('.recent_works_added')
p
-@recent_work_add.each do |d|
.deed-short
Expand Down
28 changes: 14 additions & 14 deletions app/views/collection/_contributors_body.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,54 @@
-unless @collection_deeds.empty?

-unless @new_transcribers.empty?
h3.nomargin New Collaborators
h3.nomargin =t('.new_collaborators')
p
- @new_transcribers.each do |t|
=link_to t.display_name, user_profile_path(:user_id => t.id, only_path: false)
|
=t.email
| <br>

h4.legend.fglight Collaborator Stats #{@start_deed} through #{@end_deed}
h4.legend.fglight =t('.collaborator_stats', start_deed: @start_deed, end_deed: @end_deed)
=render({ :partial => 'statistics/recent_statistics',
:locals => { :stats => @stats, :subjects_disabled => @collection.subjects_disabled }})

=link_to('View Activity ', deed_list_path(:collection_id => @collection.id, :start_date => @start_deed, :end_date => @end_deed), :class => 'button btnExport')
=link_to(t('.view_activity'), deed_list_path(:collection_id => @collection.id, :start_date => @start_deed, :end_date => @end_deed), :class => 'button btnExport')
| &nbsp;
=link_to(collection_activity_download_path(:collection_id => @collection.id, :start_date => @start_deed, :end_date => @end_deed), :class => 'button btnExport')
=svg_symbol '#icon-export', class: 'icon'
span Export Activity as CSV
span =t('.export_activity_as_csv')

-else
h3 No activity in this time frame
h3 =t('.no_activity_this_time_frame')

.contributor-users
h3 Active Collaborators
h3 =t('.active_collaborators')

-unless @active_transcribers.empty?
p
-@active_transcribers.each do |user|
=link_to user.display_name, user_profile_path(:user_id => user.id, only_path: false)
=" (Collection: #{(@user_time_proportional[user.id] / 60 + 1).floor} minutes | Total: #{(@user_time[user.id] / 60 + 1).floor} minutes)" if @user_time[user.id]
=t('.collection', collection_time: (@user_time_proportional[user.id] / 60 + 1).floor, total_time: (@user_time[user.id] / 60 + 1).floor) if @user_time[user.id]
| <br>
p
-total_minutes = (@user_time.values.sum / 60).floor + 1
="Total time: #{(total_minutes / 60)} hours, #{(total_minutes % 60)} minutes."
=t('.total_time', hours: (total_minutes / 60), minutes: (total_minutes % 60))
p
=link_to(collection_contributors_download_path(:collection_id => @collection.id, :start_date => @start_deed, :end_date => @end_deed), :class => 'button btnExport')
=svg_symbol '#icon-export', class: 'icon'
span Export as CSV
span =t('.export_as_csv')
-else
h3 Collaborators
p No Collaborators
p A detailed spreadsheet export of all collaborators is available on your owner dashboard.
h3 =t('.collaborators')
p =t('.no_collaborators')
p =t('.detailed_spreadsheet_export')

h3 All Collaborator Emails
h3 =t('.all_collaborator_emails')
p#collaborators
-unless @all_collaborators.empty?
=@all_collaborators
-else
|No collaborators
=t('.no_collaborators')

-content_for :javascript
javascript:
Expand Down
10 changes: 5 additions & 5 deletions app/views/collection/contributors.html.slim
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
=render({ :partial => '/shared/collection_tabs', :locals => { :selected => 4, :collection_id => @collection }})


h2.nomargin ="Contributions Between #{@start_deed} and #{@end_deed}"
h2.nomargin =t('.contributions', start_deed: @start_deed, end_deed: @end_deed)

h4.normargin Select a new date range
h4.normargin =t('.select_new_date')

=form_tag(contributors_collection_path(@collection.owner, @collection), method: "get") do
=hidden_field_tag(:collection_id, @collection)
=label_tag(:start_date, "Start date")
=label_tag(:start_date, t('.start_date'))
|
=text_field_tag(:start_date, @start_deed, style: "width:30%")
|
=label_tag(:end_date, "End date")
=label_tag(:end_date, t('.end_date'))
|
=text_field_tag(:end_date, @end_deed, style: "width:30%")
|
=submit_tag("Update")
=submit_tag(t('.update'))
br/

=render "contributors_body"
Expand Down
Loading

0 comments on commit 4e31e95

Please sign in to comment.