Skip to content

Commit

Permalink
Merge pull request #2254 from MushroomObserver/shared-notes-partial
Browse files Browse the repository at this point in the history
Tidy up third and fourth panels: Identification and Projects/Lists
  • Loading branch information
nimmolo authored Jul 24, 2024
2 parents 7dd6ef1 + b8df189 commit 17452b4
Show file tree
Hide file tree
Showing 22 changed files with 273 additions and 285 deletions.
4 changes: 2 additions & 2 deletions app/assets/stylesheets/Admin.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "defaults";

$BODY_BG_COLOR: #DE01DD; // DD00DD
$BODY_BG_COLOR: #DD00DD;

$LOGO_BORDER_COLOR: black;
$LOGO_BORDER_WIDTH: 2px; // vs 1px in default
Expand All @@ -9,7 +9,7 @@ $LOGO_BG_COLOR: yellow;
$LOGO_HOVER_FG_COLOR: purple;
$LOGO_HOVER_BG_COLOR: yellow;

$LEFT_BAR_BORDER_COLOR: gray;
$LEFT_BAR_BORDER_COLOR: #555555; // gray
$LEFT_BAR_BORDER_RADIUS: 0px;
$LEFT_BAR_HEADER_FG_COLOR: black;
$LEFT_BAR_HEADER_BG_COLOR: yellow;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/Agaricus.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "defaults";

$augustus_cap: #EbCe94; // #ECCF95
$augustus_cap: #EbCe93; // #ECCF95
$brasiliensis_gills_1: #A06463;
$brasiliensis_gills_2: #743931;
$campestris_cap: #F6F0F2;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/Amanita.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $calyptroderma_middle_cap: #c18346;
$muscaria_background: #cc2616;
$muscaria_foreground: #fff8c6;
$velosa_background: #dd9d5f;
$velosa_light_veil: #fbebd4; // faebd4
$velosa_light_veil: #fbebd3; // faebd4
$velosa_dark_veil: #f4d5a6;
$novinupta_background: #d1afa5;
$pachycolea_background: #383138;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/BlackOnWhite.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@import "defaults";

$LOGO_BORDER_COLOR: #DDDDDD;
$LEFT_BAR_BORDER_COLOR: #DeDfDf;
$LEFT_BAR_BORDER_COLOR: #DfDfDf;
$TOP_BAR_BORDER_COLOR: #DDDDDD;
$LIST_BORDER_COLOR: #DDDDDD;
$BUTTON_HOVER_BORDER_COLOR: #CCCCCC;
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/Cantharellaceae.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "defaults";

$californicus_cap: #f5ad49; // image 557 #f6ae4a
$californicus_cap: #f6ae4a; // image 557
$californicus_stipe: #fae8b8;
$cinnabarinus_dark_cap: #c12900; // image 551
$cinnabarinus_light_cap: #ff6524;
Expand All @@ -11,7 +11,7 @@ $tubaeformis_hymenium: #c2914c;
$tubaeformis_bright_stipe: #ffb230;
$tubaeformis_dark_stipe: #4b2e0c;
$tubaeformis_light_stipe: #e5bb67;
$cornucopioides_dark_hymenium: #10110b; // image 465
$cornucopioides_dark_hymenium: #11110b; // image 465 #10110b
$cornucopioides_light_hymenium: #9b9690;
$cornucopioides_dark_cap: #4f4337;
$cornucopioides_light_cap: #826c57;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/Hygrocybe.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "defaults";

$conica_stain: #36362e; // #37372f
$conica_stain: #36362d; // #37372f
$conica_cap_red: #a31404;
$conica_cap_orange: #dd6226;
$conica_cap_yellow: #ffbf01;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/Sudo.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "defaults";

$BODY_BG_COLOR: #DE7700; // #DD7700
$BODY_BG_COLOR: #DE7600; // #DD7700

$LOGO_BORDER_COLOR: black;
$LOGO_BORDER_WIDTH: 2px; // vs 1px in default
Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/mo/_form_elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,8 @@ form {
display: inline-block;
}
}

.overflow-scroll-checklist {
max-height: 30rem;
overflow-y: auto;
}
2 changes: 1 addition & 1 deletion app/views/controllers/field_slips/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<%= autocompleter_field(form: form, field: :location,
label: :LOCATION.t + ":", type: :location) %>

<%= render(partial: "shared/notes_form",
<%= render(partial: "shared/notes_fields",
locals: { form:, fields: field_slip.notes_fields }) %>

<%= autocompleter_field(form: form, field: :field_slip_id,
Expand Down
48 changes: 14 additions & 34 deletions app/views/controllers/observations/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ end

<%= form_with(
model: @observation,
url: add_query_param(action: action, id: @observation,
approved_name: @given_name,
approved_where: @place_name),
method: method,
url: add_query_param(action:, id: @observation,
approved_name: @given_name,
approved_where: @place_name),
method:,
multipart: true,
id: "observation_form",
data: data
data:
) do |f| %>

<%= if @field_code
Expand All @@ -53,43 +53,23 @@ end
<% if include_images %>
<%= render(partial: "observations/form/images", locals: { f: f }) %>
<% end # if include_images %>
<%= render(partial: "observations/form/details",
locals: { f: f, button_name: button_name, location: @location }) %>
<% end %>
<% if include_naming
# note this is not a separate form! just fields
naming_locals = {
f: f,
action: action,
button_name: button_name,
show_reasons: false,
unfocused: true,
name_help: :form_naming_name_help_leave_blank.t
} %>
<%= render(partial: "observations/namings/fields", locals: naming_locals) %>
<% ############################# Details ################################ %>
<% end # if include_naming %>
<%= render(partial: "observations/form/details",
locals: { f:, button_name:, location: @location }) %>

<%= render(partial: "observations/form/specimen_section",
locals: { f: f, button_name: button_name }) %>
<% ########################## Identification ############################ %>
<%= render(partial: "observations/form/notes", locals: { f: f }) %>
<%= render(partial: "observations/form/identification",
locals: { f:, action:, button_name:, include_naming: }) %>

<% ####################################################################### %>
<% if @projects.any? || @lists.any? %>
<%= submit_button(form: f, button: button_name, center: true) %>
<% end %>
<% if @projects.any? %>
<%= render(partial: "observations/form/projects",
locals: { f: f, button_name: button_name }) %>
<% end %>

<% if @lists.any? %>
<%= render(partial: "observations/form/species_lists", locals: { f: f }) %>
<%= render(partial: "observations/form/projects_and_lists",
locals: { f:, button_name: }) %>
<% end %>

<%= submit_button(form: f, button: button_name, center: true) %>
Expand Down
36 changes: 15 additions & 21 deletions app/views/controllers/observations/form/_collection_number.html.erb
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
<%# specimen/collection_number section of create_observation form %>

<div class="row mb-3">

<div class="col-sm-6">
<%= fields_for(:collection_number) do |fcn| %>
<%= text_field_with_label(form: fcn, field: :name,
value: @collectors_name,
label: :collection_number_name.t + ":") %>
<%= text_field_with_label(
form: fcn, field: :number, value: @collectors_number,
label: :collection_number_number.t + ":",
data: { action: "specimen#checkCheckbox" }) %>
<% end # fields_for %>
</div>
<div class="col-sm-6">
<%= help_block_with_arrow("left", id: "collection_number_help") do %>
<%= :form_observations_collection_number_help.t %>
<% end # help_block_with_arrow do %>
</div>

</div><!--.row-->
<%= tag.div(class: "mt-3") do %>
<% fields_for(:collection_number) do |fcn| %>
<%= text_field_with_label(
form: fcn, field: :name,
value: @collectors_name,
label: :collection_number_name.t + ":",
help: :form_observations_collection_number_help.t
) %>
<%= text_field_with_label(
form: fcn, field: :number, value: @collectors_number,
label: :collection_number_number.t + ":",
data: { action: "specimen#checkCheckbox" }
) %>
<% end %>
<% end %>
49 changes: 19 additions & 30 deletions app/views/controllers/observations/form/_herbarium_record.html.erb
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
<%# specimen/herbarium_record section of create_observation form %>

<div class="row mb-3">

<div class="col-sm-6">
<%= fields_for(:herbarium_record) do |fhr| %>

<%= autocompleter_field(
form: fhr, field: :herbarium_name, type: :herbarium,
value: @herbarium_name, hidden: @herbarium_id,
label: "#{:herbarium_record_herbarium_name.t}:",
) %>

<%= text_field_with_label(
form: fhr, field: :accession_number, value: @accession_number,
label: "#{:herbarium_record_accession_number.t}:",
data: { action: "specimen#checkCheckbox" }
) %>

<%= text_field_with_label(form: fhr, field: :notes, value: "",
label: "#{:herbarium_record_notes.t}:") %>

<% end # fields_for(:herbarium_record) %>
</div>
<div class="col-sm-6">
<%= help_block_with_arrow("left", id: "herbarium_record_help") do %>
<%= :form_observations_herbarium_record_help.t %>
<% end # help_block_with_arrow do %>
</div>

</div><!--.row-->
<%= tag.div(class: "mt-3") do %>
<% fields_for(:herbarium_record) do |fhr| %>
<%= autocompleter_field(
form: fhr, field: :herbarium_name, type: :herbarium,
value: @herbarium_name, hidden: @herbarium_id,
label: "#{:herbarium_record_herbarium_name.t}:",
help: :form_observations_herbarium_record_help.t
) %>
<%= text_field_with_label(
form: fhr, field: :accession_number, value: @accession_number,
label: "#{:herbarium_record_accession_number.t}:",
data: { action: "specimen#checkCheckbox" }
) %>
<%= text_field_with_label(
form: fhr, field: :notes, value: "",
label: "#{:herbarium_record_notes.t}:"
) %>
<% end %>
<% end %>
27 changes: 27 additions & 0 deletions app/views/controllers/observations/form/_identification.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<%= panel_block(id: "observation_identification",
heading: :IDENTIFICATION.l) do %>
<%= tag.div(class: "row mt-3") do %>
<%= tag.div(class: "col-xs-12 col-sm-6") do %>
<% if include_naming
naming_locals = {
f: f,
action: action,
button_name: button_name,
show_reasons: false,
unfocused: true,
name_help: :form_naming_name_help_leave_blank.t
} %>
<%= render(partial: "observations/namings/fields",
locals: naming_locals) %>
<% end %>
<%= render(partial: "observations/form/specimen_section",
locals: { f:, button_name: }) %>
<% end %>
<%= tag.div(class: "col-xs-12 col-sm-6") do %>
<%= render(partial: "shared/notes_fields",
locals: { form: f,
fields: @observation.form_notes_parts(@user) }) %>
<% end %>
<% end %>
<%= submit_button(form: f, button: button_name, center: true) %>
<% end %>
43 changes: 0 additions & 43 deletions app/views/controllers/observations/form/_notes.html.erb

This file was deleted.

Loading

0 comments on commit 17452b4

Please sign in to comment.