Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Herbarium form modal (reusable Location-creation UI) #2260

Merged
merged 105 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
cd40a68
Initial form refactor
nimmolo Jul 26, 2024
48d7ccb
Fix modal_identifier h_r
nimmolo Jul 27, 2024
943ccd9
Add turbo modal handlers for new/edit
nimmolo Jul 27, 2024
65df429
Merge branch 'main' into herbarium-form-modal
nimmolo Jul 28, 2024
11d73e6
Attempt to use map controller in form
nimmolo Jul 28, 2024
2dba63f
Update _form.erb
nimmolo Jul 28, 2024
b683974
Update _form.erb
nimmolo Jul 30, 2024
ad5ddd3
Merge branch 'main' into herbarium-form-modal
nimmolo Jul 30, 2024
9e30615
Update _form.erb
nimmolo Jul 30, 2024
5ac2376
restore .map-outlet
nimmolo Jul 31, 2024
be1a4e9
field_options between_end
nimmolo Jul 31, 2024
c66eb06
Update observation_form_system_test.rb
nimmolo Jul 31, 2024
af6d20d
geocode_targets
nimmolo Jul 31, 2024
436d494
hidden fields partial
nimmolo Jul 31, 2024
5d2897e
bounds_fields partial
nimmolo Aug 1, 2024
013d24e
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 1, 2024
6179906
Be sure there is a hidden id before assigning .has-id
nimmolo Aug 1, 2024
e0e41ca
ac geocode_outlet arg
nimmolo Aug 1, 2024
5797ea4
herbaria form - geocode_outlet
nimmolo Aug 1, 2024
939af86
hardcode map-outlet, geocode-outlet
nimmolo Aug 2, 2024
18a0972
herbaria form - Use geocode-outlet
nimmolo Aug 2, 2024
428c3bb
Update _details.html.erb
nimmolo Aug 2, 2024
1ccdc7e
Add debugging
nimmolo Aug 2, 2024
cd3cb2a
missing functions geocode
nimmolo Aug 2, 2024
398bdc3
Update map_controller.js
nimmolo Aug 2, 2024
7d6577c
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 3, 2024
71cfe0a
Update autocompleter_controller.js
nimmolo Aug 3, 2024
d80e74a
geocode bug fixed, but it's not setting id to -1
nimmolo Aug 3, 2024
9c83dc8
Guard functions: tryToGeolocate and tryToGeocode (used in checkForBox)
nimmolo Aug 3, 2024
918c5eb
reorg autocompleter_field
nimmolo Aug 3, 2024
339d205
Move commit button
nimmolo Aug 3, 2024
a795e95
Remove `skip` for system tests
nimmolo Aug 3, 2024
ad9a0d6
Clean up recent changes
nimmolo Aug 4, 2024
39afc50
Fix missing hidden field
nimmolo Aug 4, 2024
bf31724
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 4, 2024
f662e76
Change ac arg to `hidden_value`
nimmolo Aug 4, 2024
45d6fc4
Re-remove field_args
nimmolo Aug 4, 2024
70c5e95
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 4, 2024
e3ebce2
Change CSS class name from .observation-form-map to .form-map
nimmolo Aug 4, 2024
e516b03
Switch herbarium form to map controller
nimmolo Aug 4, 2024
0350ebd
`bounds_hidden_fields` partial: change local arg to `target_controller`
nimmolo Aug 4, 2024
f85cbc1
Update _form.erb
nimmolo Aug 4, 2024
4cf8bdc
Fix two stimulus errors
nimmolo Aug 4, 2024
e490511
Update _form.erb
nimmolo Aug 4, 2024
250f95e
CSS for .form-map
nimmolo Aug 4, 2024
52fc750
remove outlet from form
nimmolo Aug 4, 2024
3085024
Update BlackOnWhite.scss
nimmolo Aug 4, 2024
4ca74a7
Split form_location_map partial
nimmolo Aug 4, 2024
10abed0
autocompleter - new behavior for create mode
nimmolo Aug 5, 2024
54511a9
Herbarium form - add map to form
nimmolo Aug 5, 2024
df40a6d
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 6, 2024
d72132e
Build out autocompleter_modal_create_link
nimmolo Aug 6, 2024
2e781c5
Update herbaria_controller.rb
nimmolo Aug 6, 2024
34d69f6
ac/map Stimulus bugs
nimmolo Aug 6, 2024
bad5526
Update herbaria_controller.rb
nimmolo Aug 6, 2024
04121fa
Update _herbarium_record.html.erb
nimmolo Aug 6, 2024
113a4b5
Remove top tab "create fungarium" from form
nimmolo Aug 6, 2024
bec6fc1
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 6, 2024
b145d4d
Disable rubocop for already existing methods
nimmolo Aug 6, 2024
568b850
Update herbaria_controller.rb
nimmolo Aug 6, 2024
6841790
Give autocompleters custom map outlets to avoid confusion
nimmolo Aug 7, 2024
87fa4d0
Try to straighten out action events to outlet actions
nimmolo Aug 7, 2024
6dd575b
Use .map-outlet class also with id
nimmolo Aug 7, 2024
19aff88
Use .map-outlet and fix field addons for obs form
nimmolo Aug 7, 2024
f777753
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 7, 2024
343ad9c
Switch from outlet_class
nimmolo Aug 7, 2024
5e29b9d
add map_open arg, debug map, autocompleter
nimmolo Aug 8, 2024
87d2866
Update map_controller.js
nimmolo Aug 8, 2024
08f9b66
Resolve merge conflits
nimmolo Aug 8, 2024
491ddee
Update autocompleter_controller.js
nimmolo Aug 8, 2024
4c6f79a
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 9, 2024
e96a9b1
Use `Locationable` in HerbariaController
nimmolo Aug 9, 2024
63a0322
Update herbaria_controller.rb
nimmolo Aug 9, 2024
95d10d1
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 17, 2024
fc29d9a
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 19, 2024
2d98814
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 20, 2024
42bdf78
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 20, 2024
de1c951
Merge branch 'main' into herbarium-form-modal
nimmolo Aug 20, 2024
7dc5d0b
Create herbarium_form_system_test.rb
nimmolo Aug 20, 2024
5d7c1dc
Form map: Remove d-none and wrap id
nimmolo Aug 20, 2024
c322b8e
Debugging, rephrasing stimulus
nimmolo Aug 20, 2024
5a34ac9
Autocompleter helper: Move hidden field after dropdown
nimmolo Aug 20, 2024
a7e98a8
Update _form.erb
nimmolo Aug 20, 2024
d24972b
Bunch of stuff
nimmolo Aug 21, 2024
4572bd4
Fix form markup
nimmolo Aug 21, 2024
5a4aec0
More adjustments
nimmolo Aug 21, 2024
5d48c42
Revert to toggle click
nimmolo Aug 21, 2024
b5ed293
Make Form submit turbo when appropriate
nimmolo Aug 21, 2024
d4eb753
Add turbo-stream action to update the observation
nimmolo Aug 21, 2024
86ad158
Clear hidden id when form cleared
nimmolo Aug 21, 2024
9ba7ebe
Clean up controllers for testing
nimmolo Aug 21, 2024
a956e02
App - Give better created notices
nimmolo Aug 24, 2024
7c8f579
Remove "create fungarium" button when form committed OK
nimmolo Aug 24, 2024
e02e108
Add classes for autocompleter UI buttons, and an ID for the create bu…
nimmolo Aug 24, 2024
424f77e
Update geocode_controller.js
nimmolo Aug 24, 2024
2372947
Fix turbo submit on herbarium form
nimmolo Aug 24, 2024
f4e358a
Add location.text_name to show herbarium
nimmolo Aug 24, 2024
79494f2
Check location creation
nimmolo Aug 24, 2024
057450e
Update herbarium_form_system_test.rb
nimmolo Aug 25, 2024
2bb35e7
Fix the keep/edit box situation
nimmolo Aug 25, 2024
002faf7
Fix notes help for plain "Other" notes text area
nimmolo Aug 25, 2024
af14f64
Update autocompleter_controller.js
nimmolo Aug 25, 2024
6b7cf3c
Update panel_helper.rb
nimmolo Aug 25, 2024
2ad9853
Update some translations
nimmolo Aug 25, 2024
67b7a5d
Update geocode_controller.js
nimmolo Aug 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/stylesheets/Admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $LOGO_BG_COLOR: yellow;
$LOGO_HOVER_FG_COLOR: purple;
$LOGO_HOVER_BG_COLOR: yellow;

$LEFT_BAR_BORDER_COLOR: #535454; // gray
$LEFT_BAR_BORDER_COLOR: #535354; // 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,7 +1,7 @@
@import "defaults";

$augustus_cap: #ECCF95;
$brasiliensis_gills_1: #BF6362; // #A06463
$brasiliensis_gills_1: #BF6262; // #A06463
$brasiliensis_gills_2: #743931;
$campestris_cap: #F6F0F2;
$cupreobrunneus_gills: #3B2821;
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: #f9e9d3; // faebd4
$velosa_light_veil: #f9e8d3; // 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 @@ -4,7 +4,7 @@

$LOGO_BORDER_COLOR: #DDDDDD;
$LEFT_BAR_BORDER_COLOR: #DDDDDD;
$TOP_BAR_BORDER_COLOR: #D9D9Da;
$TOP_BAR_BORDER_COLOR: #D9D9D9;
$LIST_BORDER_COLOR: #DDDDDD;
$BUTTON_HOVER_BORDER_COLOR: #CCCCCC;
$BUTTON_BG_COLOR: #CCCCCC;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/Cantharellaceae.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $tubaeformis_hymenium: #c2914c;
$tubaeformis_bright_stipe: #ffb230;
$tubaeformis_dark_stipe: #4b2e0c;
$tubaeformis_light_stipe: #e5bb67;
$cornucopioides_dark_hymenium: #12120d; // image 465 #10110b
$cornucopioides_dark_hymenium: #13120d; // 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: #34342d; // #37372f
$conica_stain: #34342c; // #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: #DE7200; // #DD7700
$BODY_BG_COLOR: #DE7201; // #DD7700

$LOGO_BORDER_COLOR: black;
$LOGO_BORDER_WIDTH: 2px; // vs 1px in default
Expand Down
9 changes: 9 additions & 0 deletions app/assets/stylesheets/mo/_autocomplete.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
}
}

.keep-btn {
display: none;
}
.create {
.keep-btn {
display: inline-block;
}
}

// initially we may not have id, but we also don't offer create
// until they've typed something
.create-button {
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,12 @@ def flash_object_errors(obj)
def save_with_log(obj)
type_sym = obj.class.to_s.underscore.to_sym
if obj.save
flash_notice(:runtime_created_at.t(type: type_sym))
notice = if obj.respond_to?(:text_name) && (name = obj.text_name)
:runtime_created_name.t(type: type_sym, value: name)
else
:runtime_created_at.t(type: type_sym)
end
flash_notice(notice)
true
else
flash_error(:runtime_no_save.t(type: type_sym))
Expand Down
94 changes: 88 additions & 6 deletions app/controllers/herbaria_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
# See https://tinyurl.com/ynapvpt7

# View and modify Herbaria (displayed as "Fungaria")
# rubocop:disable Metrics/ClassLength
class HerbariaController < ApplicationController
include ::Locationable

before_action :login_required
# only: [:create, :destroy, :edit, :new, :update]
before_action :store_location, only: [:create, :edit, :new, :show, :update]
Expand Down Expand Up @@ -99,24 +102,69 @@ def show

def new
@herbarium = Herbarium.new
respond_to do |format|
format.turbo_stream { render_modal_herbarium_form }
format.html
end
end

def edit
@herbarium = find_or_goto_index(Herbarium, params[:id])
return unless @herbarium
return unless make_sure_can_edit!
return unless @herbarium && make_sure_can_edit!

set_up_herbarium_for_edit
respond_to do |format|
format.turbo_stream { render_modal_herbarium_form }
format.html
end
end

def set_up_herbarium_for_edit
@herbarium.place_name = @herbarium.location.try(&:name)
@herbarium.personal = @herbarium.personal_user_id.present?
@herbarium.personal_user_name = @herbarium.personal_user.try(&:login)
end

def render_modal_herbarium_form
render(partial: "shared/modal_form",
locals: { title: modal_title, action: modal_form_action,
identifier: modal_identifier, local: false,
form: "herbaria/form" }) and return
end

def modal_identifier
case action_name
when "new", "create"
"herbarium"
when "edit", "update"
"herbarium_#{@herbarium.id}"
end
end

def modal_title
case action_name
when "new", "create"
:create_herbarium_title.l
when "edit", "update"
:edit_herbarium_title.l
end
end

def modal_form_action
case action_name
when "new", "create" then :create
when "edit", "update" then :update
end
end

# ---------- Actions to Modify data: (create, update, destroy, etc.) ---------

def create
@herbarium = Herbarium.new(herbarium_params)
normalize_parameters
return render(:new) unless validate_herbarium!
create_location_object_if_new(@herbarium)
try_to_save_location_if_new(@herbarium)
return render(:new) unless validate_herbarium! && !@any_errors

@herbarium.save
@herbarium.add_curator(@user) if @herbarium.personal_user
Expand All @@ -130,7 +178,9 @@ def update

@herbarium.attributes = herbarium_params
normalize_parameters
return unless validate_herbarium!
create_location_object_if_new(@herbarium)
try_to_save_location_if_new(@herbarium)
return unless validate_herbarium! && !@any_errors

@herbarium.save
redirect_to_create_location_or_referrer_or_show_location
Expand Down Expand Up @@ -265,6 +315,10 @@ def validate_admin_personal_user!
flash_notice(
:edit_herbarium_successfully_made_personal.t(user: user.login)
)
update_personal_herbarium(user)
end

def update_personal_herbarium(user)
@herbarium.curators.clear
@herbarium.add_curator(user)
@herbarium.personal_user_id = user.id
Expand Down Expand Up @@ -326,7 +380,7 @@ def user_can_destroy_herbarium?

def redirect_to_create_location_or_referrer_or_show_location
redirect_to_create_location || redirect_to_referrer ||
redirect_with_query(herbarium_path(@herbarium))
show_modal_flash_or_show_herbarium
end

def redirect_to_create_location
Expand All @@ -339,11 +393,39 @@ def redirect_to_create_location
true
end

# this updates both the form and the flash
def reload_herbarium_modal_form_and_flash
render(
partial: "shared/modal_form_reload",
locals: { identifier: modal_identifier, form: "herbaria/form" }
) and return true
end

# What to do if the save succeeds
def show_modal_flash_or_show_herbarium
respond_to do |format|
format.html do
redirect_with_query(herbarium_path(@herbarium)) and return
end
format.turbo_stream do
# Context here is the obs form.
flash_notice(
:runtime_created_name.t(type: :herbarium, value: @herbarium.name)
)
flash_notice(
:runtime_added_to.t(type: :herbarium, name: :observation)
)
render(partial: "herbaria/update_observation") and return
end
end
end

def herbarium_params
return {} unless params[:herbarium]

params.require(:herbarium).
permit(:name, :code, :email, :mailing_address, :description,
permit(:name, :code, :email, :mailing_address, :description, :location_id,
:place_name, :personal, :personal_user_name)
end
end
# rubocop:enable Metrics/ClassLength
8 changes: 8 additions & 0 deletions app/extensions/string_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
# gsub_html_special_chars:: auxiliary to html_to_ascii
# unescape_html:: Render special encoded characters as regular characters
# as_displayed:: Render everything humanly legible, for integration tests
# id_of_nested_field:: Rails generates `observation_notes` for the ID of a
# nested field like `observation[notes]`
# ---
# break_name:: Break a taxon name at the author
# small_author:: Wrap the author in a <small> span
Expand Down Expand Up @@ -546,6 +548,12 @@ def as_displayed
strip_html.unescape_html.strip_squeeze
end

# Rails generates an id for a nested field like "foo[bar]" that's snake_case
# - no brackets. This gets you that string. (used in forms_helper)
def id_of_nested_field
gsub(/[\[\]]+/, "_").chop
end

# Insert a line break between the scientific name and the author
# (for styling taxonomic names legibly)
def break_name
Expand Down
35 changes: 26 additions & 9 deletions app/helpers/autocompleter_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def autocompleter_field(**args)
ac_args[:wrap_data] = { autocompleter_target: "wrap" }
ac_args[:label_after] = autocompleter_label_after(args)
ac_args[:label_end] = autocompleter_label_end(args)
ac_args[:append] = autocompleter_dropdown
ac_args[:append] = autocompleter_append(args)

tag.div(id: args[:controller_id],
data: autocompleter_controller_data(args)) do
Expand Down Expand Up @@ -61,8 +61,8 @@ def autocompleter_label_after(args)
[
autocompleter_has_id_indicator,
autocompleter_find_button(args),
autocompleter_keep_button(args),
autocompleter_hidden_field(**args)
autocompleter_keep_box_button(args),
autocompleter_edit_box_button(args)
].safe_join
end
end
Expand All @@ -85,8 +85,9 @@ def autocompleter_create_button(args)

icon_link_to(
args[:create_text], "#",
id: "create_#{args[:type]}_btn", class: "ml-3 create-button",
icon: :plus, show_text: true, icon_class: "text-primary",
name: "create_#{args[:type]}", class: "ml-3 create-button",
name: "create_#{args[:type]}",
data: { autocompleter_target: "createBtn",
action: "autocompleter#swapCreate:prevent" }
)
Expand All @@ -110,22 +111,33 @@ def autocompleter_find_button(args)
icon_link_to(
args[:find_text], "#",
icon: :find_on_map, show_text: false, icon_class: "text-primary",
name: "find_#{args[:type]}", class: "ml-3 d-none",
name: "find_#{args[:type]}", class: "ml-3 find-btn d-none",
data: { map_target: "showBoxBtn",
action: "map#showBox:prevent" }
)
end

def autocompleter_keep_button(args)
def autocompleter_keep_box_button(args)
return unless args[:keep_text]

icon_link_to(
args[:keep_text], "#",
icon: :apply, show_text: false, icon_class: "text-primary",
active_icon: :edit, active_content: args[:edit_text],
name: "keep_#{args[:type]}", class: "ml-3 d-none",
name: "keep_#{args[:type]}", class: "ml-3 keep-btn d-none",
data: { autocompleter_target: "keepBtn", map_target: "lockBoxBtn",
action: "map#toggleBoxLock:prevent" }
action: "map#toggleBoxLock:prevent form-exif#showFields" }
)
end

def autocompleter_edit_box_button(args)
return unless args[:keep_text]

icon_link_to(
args[:edit_text], "#",
icon: :edit, show_text: false, icon_class: "text-primary",
name: "edit_#{args[:type]}", class: "ml-3 edit-btn d-none",
data: { autocompleter_target: "editBtn", map_target: "editBoxBtn",
action: "map#toggleBoxLock:prevent form-exif#showFields" }
)
end

Expand All @@ -150,6 +162,11 @@ def autocompleter_type_to_model(type)
end
end

def autocompleter_append(args)
[autocompleter_dropdown,
autocompleter_hidden_field(**args)].safe_join
end

def autocompleter_dropdown
tag.div(class: "auto_complete dropdown-menu",
data: { autocompleter_target: "pulldown",
Expand Down
6 changes: 5 additions & 1 deletion app/helpers/forms_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,11 @@ def check_for_help_block(args)
return args
end

id = "#{args[:form].object_name}_#{args[:field]}_help"
id = [
args[:form].object_name.to_s.id_of_nested_field,
args[:field].to_s,
"help"
].join("_")
args[:between] = capture do
concat(args[:between])
concat(collapse_info_trigger(id))
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/panel_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def help_block(element = :div, string = "", **args, &block)

# draw a help block with an arrow
def help_block_with_arrow(direction = nil, **args, &block)
div_class = "well well-sm help-block position-relative"
div_class = "well well-sm mb-3 help-block position-relative"
div_class += " mt-3" if direction == "up"

tag.div(class: div_class, id: args[:id]) do
Expand All @@ -182,7 +182,7 @@ def help_block_with_arrow(direction = nil, **args, &block)
end

def collapse_help_block(direction = nil, string = nil, **args, &block)
div_class = "well well-sm help-block position-relative"
div_class = "well well-sm mb-3 help-block position-relative"
div_class += " mt-3" if direction == "up"
content = block ? capture(&block) : string

Expand Down
4 changes: 2 additions & 2 deletions app/helpers/tabs/herbaria_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ def herbaria_curator_request_tabs(herbarium:)
end

def new_herbarium_tab
[:create_herbarium.t, add_query_param(new_herbarium_path),
[:create_herbarium.l, add_query_param(new_herbarium_path),
{ class: tab_id(__method__.to_s) }]
end

def edit_herbarium_tab(herbarium)
[:edit_herbarium.t,
[:edit_herbarium.l,
add_query_param(edit_herbarium_path(herbarium.id)),
{ class: tab_id(__method__.to_s) }]
end
Expand Down
Loading