Skip to content

Commit

Permalink
Styles buttons and assigns primary key for oracle table.
Browse files Browse the repository at this point in the history
  • Loading branch information
shelleydoljack committed Feb 20, 2018
1 parent 086cb7b commit 3c6d7cd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
4 changes: 4 additions & 0 deletions app/models/accession_number.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
###
class AccessionNumber < ActiveRecord::Base
self.table_name = 'catnums'
self.primary_key = 'id'

# catnums has sequence name 'catnums_seq' in order to increment primary key by 1

attr_accessor :seq_num_incrementer

validates :item_type, :location, :prefix, presence: true
Expand Down
3 changes: 2 additions & 1 deletion app/views/accession_number_updates/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div class="home-page-section">
<h1>Accession Number Generator</h1>
<% if /[AY]/ === current_user.accession_number %>
<p>Get accession numbers to assign to material in Symphony. See <a href="https://consul.stanford.edu/x/eaNuCQ">Call numbers--Non-print materials</a> for more information.</p>
<h3>What would you like to do? </h3>
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
Expand Down Expand Up @@ -45,7 +46,7 @@
</div>
<div id="collapseThree" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingThree">
<div class="panel-body">
<li><%= link_to "Accession numbers", accession_numbers_path %></li>
<li><%= link_to "Accession number table", accession_numbers_path %></li>
</div>
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions app/views/accession_numbers/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
<%= f.label :prefix %><br>
<%= f.text_field :prefix %>
</div>
<div class="actions">
<%= f.submit %>
<div class="btn-group">
<br />
<%= f.submit 'Save', class: 'btn btn-primary btn-md btn-default btn-full'%>
</div>
<% end %>
10 changes: 3 additions & 7 deletions app/views/accession_numbers/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
<%= render 'form' %>


<%= link_to 'Show', @accession_number, class: 'btn btn-md btn-default btn-full' %>
<%= link_to 'Cancel', accession_numbers_path, class: 'btn btn-md btn-default btn-full' %>


<div class="btn-group">
<%= main_menu_button %>
<%= accession_menu_button %>
<br />
<%= link_to 'Show', @accession_number, class: 'btn btn-md btn-default btn-full' %>
<%= link_to 'Cancel', accession_numbers_path, class: 'btn btn-md btn-default btn-full' %>
</div>
6 changes: 4 additions & 2 deletions app/views/accession_numbers/generate_number_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
{:class => 'form-control'} %>
</div>
<div class="actions">
<%= f.submit 'Get number(s)' %>
<br />
<%= f.submit 'Get number(s)', class: 'btn btn-primary btn-md btn-default btn-full' %>
</div>
<% end %>

<%= link_to 'Cancel', :back, class: 'btn btn-md btn-default btn-full' %>

<div class="btn-group">
<br />
<%= link_to 'Cancel', :back, class: 'btn btn-md btn-default btn-full' %>
<%= main_menu_button %>
<%= accession_menu_button %>
</div>
5 changes: 4 additions & 1 deletion app/views/accession_numbers/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

<%= render 'form' %>

<%= link_to 'Back', accession_numbers_path %>
<div class="btn-group">
<br />
<%= link_to 'Cancel', accession_numbers_path, class: 'btn btn-md btn-default btn-full' %>
</div>

0 comments on commit 3c6d7cd

Please sign in to comment.