Commit cb184d39 authored by Klaus Stein's avatar Klaus Stein
Browse files

Add part field to signature

parent 6eccb551
......@@ -76,6 +76,6 @@ class MapsController < ApplicationController
puts params.require(:map).inspect
params.require(:map).permit(:title, :place_id, :repository_id,
:description, :district, :basemap, :scale, :orientation, :papersize, :techniques, :platenumber, :creator, :legend, :damage_categories, :doi, :repository, :repo_location, :repo_doc_ref, :repo_url, :copyright, :copyright_holder, category_ids: [], itemdates_attributes: [:id, :edtfdate, :description, :_destroy], image_maps_attributes: [:id, :name, :anchors, :clip, :image, :_destroy])
:description, :district, :basemap, :scale, :orientation, :papersize, :techniques, :platenumber, :creator, :legend, :damage_categories, :doi, :repository, :repo_location, :repo_doc_ref, :repo_doc_ref_part, :repo_url, :copyright, :copyright_holder, category_ids: [], itemdates_attributes: [:id, :edtfdate, :description, :_destroy], image_maps_attributes: [:id, :name, :anchors, :clip, :image, :_destroy])
end
end
......@@ -16,6 +16,7 @@
# papersize(e.g. 1233mm × 855mm) :string
# platenumber :string
# repo_doc_ref :string
# repo_doc_ref_part :string
# scale(e.g. 1:50000) :string
# techniques :string
# title :string
......
......@@ -29,7 +29,7 @@
<tr class="field"><th><%= form.label :place_id %></th><td><%= form.collection_select(:place_id, Place.with_name, :id, :name, {include_blank: true}) %></td></tr>
<tr class="field"><th><%= form.label :categories %></th><td><%= form.collection_select(:category_ids, Category.all, :id, :name, {label: 'Category(s)'}, {multiple: true}) %></td></tr>
<tr class="field"><th><%= form.label :description %></th><td><%= form.text_area :description %></td></tr>
<tr class="field"><th><%= form.label :repo_doc_ref %></th><td><%= form.text_field :repo_doc_ref %></td></tr>
<tr class="field"><th><%= form.label :repo_doc_ref %></th><td><%= form.text_field :repo_doc_ref %> <%= form.text_field :repo_doc_ref_part %></td></tr>
<tr class="field"><th><%= form.label :repository %></th><td><%= form.collection_select(:repository_id, Repository.order(:name), :id, :name_with_location, include_blank: true) %></td></tr>
<tr class="field" data-controller="nested-form"><th>Dates:</th>
<td><div class="instructions">[Date format: <kbd>yyyy-mm-dd</kbd> (e.g. <kbd>1944-02-11</kbd>)]</div>
......
......@@ -65,7 +65,7 @@
%>
<%= td(place, a: map.place, klass: 'wide') %>
<%= td(map.categories.map{|c| c.name}.join(' • '), klass: 'narrow') %>
<%= td(map.repo_doc_ref , klass: 'wide') %>
<%= td((map.repo_doc_ref||'') + (map.repo_doc_ref_part || '') , klass: 'full') %>
<% repo = [map.repository&.name, map.repository&.location].compact.join(', ') %>
<%= td(repo, a: map.repository , klass: 'wide') %>
<%= td(map.description, klass: 'narrow') %>
......
......@@ -10,7 +10,7 @@
<%= editlink @map %>
</header>
<p class="repo">
<span class="signature"><%= @map.repo_doc_ref || '–?–' %></span>
<span class="signature"><%= @map.repo_doc_ref || '–?–' %> <%= @map.repo_doc_ref_part %></span>
<% if @map.repository %>
<%= link_to @map.repository.name, @map.repository, class: 'repository' %>
<% else %>
......
class AddRepoDocRefPartToMap < ActiveRecord::Migration[6.1]
def change
add_column :maps, :repo_doc_ref_part, :string
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_11_16_120511) do
ActiveRecord::Schema.define(version: 2021_12_16_064141) do
# These are extensions that must be enabled in order to support this database
enable_extension "adminpack"
......@@ -136,6 +136,7 @@ ActiveRecord::Schema.define(version: 2021_11_16_120511) do
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.bigint "repository_id"
t.string "repo_doc_ref_part"
t.index ["place_id"], name: "index_maps_on_place_id"
t.index ["repository_id"], name: "index_maps_on_repository_id"
end
......
......@@ -16,6 +16,7 @@
# papersize(e.g. 1233mm × 855mm) :string
# platenumber :string
# repo_doc_ref :string
# repo_doc_ref_part :string
# scale(e.g. 1:50000) :string
# techniques :string
# title :string
......
......@@ -16,6 +16,7 @@
# papersize(e.g. 1233mm × 855mm) :string
# platenumber :string
# repo_doc_ref :string
# repo_doc_ref_part :string
# scale(e.g. 1:50000) :string
# techniques :string
# title :string
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment