Skip to content

Commit

Permalink
adding subtab "Details" and API cotextual button to Collections
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammedBkf committed Sep 13, 2024
1 parent dc0fd3f commit 4a802ff
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/collections_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def index
end

def show
redirect_to(ontology_path(id: params[:ontology_id], p: 'collections', collectionid: params[:id], lang: request_lang)) and return unless turbo_frame_request?
redirect_to(ontology_path(id: params[:ontology], p: 'collections', collectionid: params[:id], lang: request_lang)) and return if turbo_frame_request?

@collection = get_request_collection
end
Expand Down
17 changes: 17 additions & 0 deletions app/views/collections/_show.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
= render TurboFrameComponent.new(id: 'collection_show', data: {"turbo-frame-target": "frame"}) do
- if @collection
- if @collection.errors
= render Display::AlertComponent.new(type:'info', message: @collection.errors.join)
- else

= render TabsContainerComponent.new(type:'outline') do |c|
- apikey = "#{get_apikey}"
- c.pinned_right do
%div{'data-concepts-json-target': 'button'}
.concepts_json_button
= render RoundedButtonComponent.new(link: "#{@ontology.id}/collections/#{escape(@collection.id)}?display=all&apikey=#{apikey}", target:'_blank')

- c.item(title: t('concepts.details'), path: '#details', selected: true, json_link: "#{@ontology.id}/collections/#{escape(@collection.id)}?display=all&apikey=#{apikey}")

- c.item_content do
= render :partial =>'/collections/collection', locals: {collection: @collection}
1 change: 0 additions & 1 deletion app/views/collections/show.html.haml

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/ontologies/sections/_collections.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
%div#collection_contents{data:{'container-splitter-target': 'container'}}
= render TurboFrameComponent.new(id: 'collection') do
- if @collection
= render partial: 'collections/collection', locals: {collection: @collection}
= render partial: 'collections/show', locals: {collection: @collection}


0 comments on commit 4a802ff

Please sign in to comment.