-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
637 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
$(document).on('ready page:load', function() { | ||
$('#shelf_selection_report_lib').change(function() { | ||
$("#shelf_selection_report_loc_array option").remove(); | ||
lib = $('#shelf_selection_report_lib').find(':selected').text(); | ||
$.ajax({ | ||
url: '/shelf_selection_reports/home_locations', | ||
cache: false, | ||
data: { lib: lib }, | ||
success: function(html){ | ||
$('#shelf_selection_report_loc_array').append(html); | ||
} | ||
}) | ||
}) | ||
$('input[type="radio"]').click(function (){ | ||
$('#lc-show-hide').css('display', ($(this).val() == 'lc') ? 'block' : 'none'); | ||
$('#classic-show-hide').css('display', ($(this).val() == 'classic') ? 'block' : 'none'); | ||
$('#other-show-hide').css('display', ($(this).val() == 'other') ? 'block' : 'none'); | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
### | ||
# Controller to handle the shelf selection report | ||
### | ||
class ShelfSelectionReportsController < ApplicationController | ||
def new | ||
@shelf_selection_report = ShelfSelectionReport.new | ||
end | ||
|
||
# def create | ||
# @shelf_selection_report = ShelfSelectionReport.new(params[:shelf_selection_report]) | ||
# if @shelf_selection_report.valid? | ||
# flash[:notice] = 'Shelf Selection Report params submitted!' | ||
# redirect_to root_url | ||
# else | ||
# render action: 'new' | ||
# end | ||
# end | ||
|
||
def home_locations | ||
@home_locations = UniLibsLocs.home_locations_from(params[:lib]) | ||
render layout: false | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# app/models/circulation_statistics_report_format.rb | ||
class CirculationStatisticsReportFormat < ActiveRecord::Base | ||
self.table_name = 'circ_stats_rpt_fmts' | ||
|
||
def self.formats | ||
select(:format).distinct.order(:format).pluck(:format) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# app/models/shelf_sel_item_cat1.rb | ||
class ShelfSelItemCat1 < ActiveRecord::Base | ||
self.table_name = 'shelf_sel_item_cat1s' | ||
|
||
def self.item_category1s | ||
select(:item_category1).distinct.order(:item_category1).pluck(:item_category1) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# app/model/shelf_sel_search.rb | ||
class ShelfSelSearch < ActiveRecord::Base | ||
self.table_name = 'shelf_sel_searches' | ||
# TODO: make saved_cursors return more than just my own | ||
def self.saved_cursors(sunet_id) | ||
own_saved_cursor(sunet_id) | ||
end | ||
|
||
def self.own_saved_cursor(sunet_id) | ||
where(user_name: sunet_id).order(:search_name).pluck(:search_name, :user_name).map { |a| a.join(', ') } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# app/models/shelf_selection_item_type.rb | ||
class ShelfSelectionItemType < ActiveRecord::Base | ||
self.table_name = 'shelf_sel_item_types' | ||
|
||
def self.item_types | ||
select(:item_type).distinct.order(:item_type).pluck(:item_type) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# app/model/shelf_selection_report.rb | ||
class ShelfSelectionReport | ||
include ActiveModel::Model | ||
attr_accessor :email, :lib, :loc_array, :cloc_diff, :fmt_array, | ||
:itype_array, :icat1_array, :lang, :min_yr, :max_yr, | ||
:min_circ, :max_circ, :shadowed, :digisent, :url, | ||
:mhlds, :has_dups, :multvol, :multcop, :no_boundw, | ||
:range_type, :lc_call_lo, :lc_call_hi, :classic_call_lo, | ||
:classic_call_hi, :other_call_hi, :call_alpha, :subj_name, | ||
:save_opt | ||
|
||
def self.generic_options | ||
[["Doesn't matter", 0], ['INCLUDE only', 1], ['EXCLUDE', 2]] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<% @home_locations.each do |home_location| %> | ||
<option><%= home_location %></option> | ||
<% end %> |
Oops, something went wrong.