Skip to content

Commit

Permalink
wip: カーリル連番印刷の作成フォームを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
kimihito committed Sep 2, 2023
1 parent e9c23a9 commit d645c88
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/controllers/calil/barcodes_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
class Calil::BarcodesController < ApplicationController
def new
@library = Library.friendly.find(params[:library_id])
authorize @library

@calil_barcode = Calil::Barcode.new(name: @library.name)
end

def create
Expand Down
29 changes: 27 additions & 2 deletions app/views/calil/barcodes/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
<h1>Calil::Barcodes#new</h1>
<p>Find me in app/views/calil/barcodes/new.html.erb</p>
<div id="content_detail" class="ui-corner-all ui-widget-content">
<h1 class="title"><%= @library.display_name.localize -%></h1>
<div id="content_list">
<%= render 'page/required_field' %>
<%= form_with(model: @calil_barcode, url: library_barcodes_path, method: :post) do |f| %>
<%= error_messages(@calil_barcode) %>
<div class="field">
<%= f.label :name %>
<%= f.text_field :name, class: 'short_name' %>
</div>

<div class="field">
<%= f.label :initial_number %>
<%= f.text_field :initial_number, class: 'short_name' %>
</div>

<div class="field">
<%= f.label :number_of_sheets %>
<%= f.number_field :number_of_sheets, class: 'short_name' %>
</div>

<% end %>
</div>
</div>

<div id="submenu" class="ui-corner-all ui-widget-content">
</div>
1 change: 1 addition & 0 deletions app/views/libraries/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
<li><%= link_to t('page.new', model: t('activerecord.models.event')), new_event_path(library_id: @library.id) -%></li>
<%- end -%>
<%- end -%>
<li><%= link_to "連番を作成する", new_library_barcode_path(library_id: @library.name) -%></li>
<li><%= link_to t('page.listing', model: t('activerecord.models.library')), libraries_path -%></li>
</ul>
</div>

0 comments on commit d645c88

Please sign in to comment.