Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/controllers/alma_item_set_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'date'

class AlmaItemSetController < ApplicationController
VALID_ENVS = %w[production sandbox].freeze

# TODO: - Need to make sure only certain staff access this page
before_action :authorize!
Expand All @@ -14,7 +15,9 @@ def index
# rubocop:disable Metrics/AbcSize
def update
env = params[:alma_env]
alma_set_id = params[:alma_set_id]
return head(:bad_request) unless env.in? VALID_ENVS

alma_set_id = params[:"alma_set_id_#{env}"]
num = params[:note_num]

note = new_note(params[:note_value], params[:initials])
Expand Down
20 changes: 14 additions & 6 deletions app/views/alma_item_set/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@
<%= f.label("#{rb_alma_env}_sandbox".to_sym, "Sandbox") %>
</div>
<%# Set Name %>
<div class="form-label form-group required mt-4">
<%= label_tag(:alma_set_id, 'Alma Set Name:', class: 'control-label') %>
<div id="prod-drop-down">
<div class="form-label form-group required mt-4">
<%= label_tag(:alma_set_id_production, 'Production Alma Set Name:', class: 'control-label') %>
</div>
<div class="form-input required">
<%= f.select(:alma_set_id_production, @production_sets, {}, {:class => 'form-control'}) %>
</div>
</div>
<div class="form-input required">
<%# f.text_field(:alma_set_name, class: 'narrow form-control add-required', aria: { required: true }, required: true, autofocus: true) %>
<%= f.select(:alma_set_id, @production_sets, {}, {:class => 'form-control', :id => 'prod-drop-down'}) %>
<%= f.select(:alma_set_id, @sandbox_sets, {}, {:class => 'form-control', :id => 'sand-drop-down'}) %>
<div id="sand-drop-down">
<div class="form-label form-group required mt-4">
<%= label_tag(:alma_set_id_sandbox, 'Sandbox Alma Set Name:', class: 'control-label') %>
</div>
<div class="form-input required">
<%= f.select(:alma_set_id_sandbox, @sandbox_sets, {}, {:class => 'form-control'}) %>
</div>
</div>
<%# Note Number %>
<div class="form-label form-group mt-4">
Expand Down