Skip to content

Commit

Permalink
Add tabs component to LinkDialog
Browse files Browse the repository at this point in the history
Move the last piece of the link view to a view component and remove the original view.
  • Loading branch information
sascha-karnatz committed Mar 4, 2024
1 parent 973286c commit e1c200e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
21 changes: 21 additions & 0 deletions app/components/alchemy/admin/link_dialog/tabs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

module Alchemy
module Admin
module LinkDialog
class Tabs < ViewComponent::Base
erb_template <<~ERB
<sl-tab-group id="overlay_tabs">
<% tabs.each do |tab| %>
<%= render tab.new %>
<% end %>
</sl-tab-group>
ERB

def tabs
Alchemy.link_dialog_tabs
end
end
end
end
end
1 change: 1 addition & 0 deletions app/controllers/alchemy/admin/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def destroy
end

def link
render LinkDialog::Tabs.new
end

def fold
Expand Down
5 changes: 0 additions & 5 deletions app/views/alchemy/admin/pages/link.html.erb

This file was deleted.

0 comments on commit e1c200e

Please sign in to comment.