Skip to content
Snippets Groups Projects
Commit f2c64995 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

short names

parent 276d3e3a
No related branches found
No related tags found
No related merge requests found
Showing
with 31 additions and 7 deletions
......@@ -55,7 +55,7 @@ class Admin::Research::Laboratory::AxesController < Admin::Research::Laboratory:
def axis_params
params.require(:research_laboratory_axis)
.permit(:name, :description, :text)
.permit(:name, :short_name, :description, :text)
.merge(university_id: current_university.id)
end
end
......@@ -6,6 +6,7 @@
# description :text
# name :string
# position :integer
# short_name :string
# created_at :datetime not null
# updated_at :datetime not null
# research_laboratory_id :uuid not null
......
......@@ -6,8 +6,15 @@
<h5 class="card-title mb-0"><%= t('content') %></h5>
</div>
<div class="card-body">
<%= f.input :name %>
<%= f.input :description, as: :text, input_html: { rows: 8 } %>
<div class="row">
<div class="col-lg-8 col-xxl-9">
<%= f.input :name %>
</div>
<div class="col-lg-4 col-xxl-3">
<%= f.input :short_name %>
</div>
</div>
<%= f.input :description, as: :text, input_html: { rows: 2 } %>
<%= f.input :text, as: :rich_text_area %>
</div>
</div>
......
......@@ -2,6 +2,7 @@
<thead>
<tr>
<th><%= Research::Laboratory::Axis.model_name.human %></th>
<th><%= Research::Laboratory::Axis.human_attribute_name('short_name') %></th>
<th></th>
</tr>
</thead>
......@@ -11,6 +12,7 @@
<td>
<%= link_to axis, admin_research_laboratory_axis_path(laboratory_id: axis.laboratory, id: axis) %>
</td>
<td><%= axis.short_name %></td>
<td class="text-end">
<div class="btn-group" role="group">
<%= link_to t('edit'),
......
......@@ -7,7 +7,11 @@
<h2 class="card-title mb-0 h5"><%= t('content') %></h2>
</div>
<div class="card-body">
<h3 class="h5"><%= Research::Laboratory::Axis.human_attribute_name('description') %></h3>
<% unless @axis.short_name.empty? %>
<h3 class="h5"><%= Research::Laboratory::Axis.human_attribute_name('short_name') %></h3>
<%= @axis.short_name %>
<% end %>
<h3 class="h5 mt-4"><%= Research::Laboratory::Axis.human_attribute_name('description') %></h3>
<%= simple_format @axis.description %>
<h3 class="h5 mt-4"><%= Research::Laboratory::Axis.human_attribute_name('text') %></h3>
<%= @axis.text %>
......
......@@ -54,6 +54,7 @@ en:
research/laboratory/axis:
description: Description
name: Name
short_name: Short name
text: Text
research/thesis:
abstract: Abstract
......
......@@ -54,6 +54,7 @@ fr:
research/laboratory/axis:
description: Description
name: Nom
short_name: Nom court
text: Texte
research/thesis:
abstract: Résumé
......
class AddShortNameToResearchLaboratoryAxes < ActiveRecord::Migration[6.1]
def change
add_column :research_laboratory_axes, :short_name, :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: 2022_01_20_111315) do
ActiveRecord::Schema.define(version: 2022_01_21_091710) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
......@@ -519,6 +519,7 @@ ActiveRecord::Schema.define(version: 2022_01_20_111315) do
t.integer "position"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "short_name"
t.index ["research_laboratory_id"], name: "index_research_laboratory_axes_on_research_laboratory_id"
t.index ["university_id"], name: "index_research_laboratory_axes_on_university_id"
end
......
# Labs
# Laboratories
## Axes (research axis/axes) ou équipes
......
......@@ -20,6 +20,7 @@
- university:references
- research_laboratory:references
- name:string
- short_name:string
- position:integer
- description:text
- text:html
......
......@@ -6,6 +6,7 @@
# description :text
# name :string
# position :integer
# short_name :string
# created_at :datetime not null
# updated_at :datetime not null
# research_laboratory_id :uuid not null
......
......@@ -29,7 +29,6 @@
# fk_rails_... (research_laboratory_id => research_laboratories.id)
# fk_rails_... (university_id => universities.id)
#
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
university: one
......
......@@ -6,6 +6,7 @@
# description :text
# name :string
# position :integer
# short_name :string
# created_at :datetime not null
# updated_at :datetime not null
# research_laboratory_id :uuid not null
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment