Skip to content

Commit

Permalink
Move show-parent tab to the listing of the parent
Browse files Browse the repository at this point in the history
  • Loading branch information
nimmolo committed Feb 12, 2024
1 parent 75be1cc commit 112b744
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
9 changes: 6 additions & 3 deletions app/helpers/descriptions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def show_description_details_and_alternates(desc, versions, projects,

# Details of a description for a show_description page.
def show_description_details(description, versions, user = User.current)
type = description.parent.type_tag
parent = description.parent
type = parent.type_tag

read = if description.reader_groups.include?(UserGroup.all_users)
:public.l
Expand All @@ -143,8 +144,10 @@ def show_description_details(description, versions, user = User.current)
tag.div do
[
["#{:TITLE.l}:", description_title(description)].safe_join(" "),
["#{type.to_s.upcase.to_sym.t}:",
description.parent.format_name.t].safe_join(" "),
[
"#{type.to_s.upcase.to_sym.t}:",
link_to(parent.format_name.t, add_query_param(parent.show_link_args))
].safe_join(" "),
"#{:show_description_read_permissions.l}: #{read}",
"#{:show_description_write_permissions.l}: #{write}",
show_previous_version(description, versions)
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/tabs/descriptions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ module Tabs
module DescriptionsHelper
# Links for the tabset
def show_description_tabs(description:)
type = description.parent.type_tag
# type = description.parent.type_tag
# admin = is_admin?(description)
# assemble HTML for "tabset" for show_{type}_description
[
description_parent_tab(description, type)
# [
# description_parent_tab(description, type)
# edit_description_tab(description, type),
# destroy_description_tab(description, admin),
# clone_description_tab(description, type),
Expand All @@ -18,7 +18,7 @@ def show_description_tabs(description:)
# make_description_default_tab(description, type),
# description_project_tab(description),
# publish_description_draft_tab(description, type, admin)
].reject(&:empty?)
# ].reject(&:empty?)
end

def description_change_links(desc)
Expand Down
2 changes: 1 addition & 1 deletion app/views/controllers/locations/descriptions/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%
add_page_title(@description.format_name.t)
add_pager_for(@description)
add_tab_set(show_description_tabs(description: @description))
# add_tab_set(show_description_tabs(description: @description))
@container = :wide
%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/controllers/names/descriptions/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%
add_page_title(@description.format_name.t)
add_tab_set(show_description_tabs(description: @description))
# add_tab_set(show_description_tabs(description: @description))
@container = :wide
%>
Expand Down

0 comments on commit 112b744

Please sign in to comment.