Skip to content

Commit 9c6a05c

Browse files
committed
v0.1.8
1 parent 41b0008 commit 9c6a05c

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

app/components/ruby_cms/admin/admin_resource_card.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ class AdminResourceCard < BaseComponent
3131
CARD_CLASS = "bg-card shadow-sm rounded-xl border border-border/60 ring-1 ring-black/[0.03] overflow-hidden"
3232
GRID_CLASS = "grid grid-cols-1 lg:grid-cols-3"
3333
MAIN_CLASS = "lg:col-span-2 p-6 space-y-6"
34-
SIDEBAR_CLASS = "border-t lg:border-t-0 lg:border-l border-border/60 bg-muted/20 p-6 space-y-6"
35-
ACTIONS_CLASS = "flex items-center justify-end gap-3 border-t border-border/60 px-6 py-4 bg-muted/20"
34+
SIDEBAR_CLASS = "border-t lg:border-t-0 lg:border-l border-border/60 bg-background p-6 space-y-6"
35+
ACTIONS_CLASS = "flex items-center justify-end gap-3 border-t border-border/60 px-6 py-4 bg-background"
3636

3737
INPUT_CLASS = "block w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground shadow-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-colors"
3838
LABEL_CLASS = "block text-sm font-medium text-foreground mb-1.5"
3939
HINT_CLASS = "mt-1 text-xs text-muted-foreground"
4040
FILE_INPUT_CLASS = "block w-full text-sm text-muted-foreground file:mr-3 file:py-1.5 file:px-3 file:rounded-lg file:border-0 file:text-sm file:font-medium file:bg-primary/10 file:text-primary hover:file:bg-primary/20 transition-colors"
4141

42-
SECTION_CLASS = "rounded-xl border border-border/60 bg-muted/30 p-5"
42+
SECTION_CLASS = "rounded-xl border border-border/60 bg-background p-5"
4343
SECTION_TITLE_CLASS = "text-sm font-semibold text-foreground tracking-tight mb-4"
4444
DETAIL_LABEL_CLASS = "text-xs font-medium text-muted-foreground uppercase tracking-wider"
4545
DETAIL_VALUE_CLASS = "mt-1 text-sm text-foreground"

app/views/ruby_cms/admin/content_blocks/show.html.erb

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,33 +78,28 @@
7878

7979
<%# ── Locale Tabs ── %>
8080
<% if @blocks_by_locale.present? %>
81-
<% active_locale = @blocks_by_locale.key?(@content_block.locale.to_s) ? @content_block.locale.to_s : @blocks_by_locale.keys.first %>
8281
<div class="rounded-xl border border-border/60 overflow-hidden" data-controller="ruby-cms--locale-tabs">
83-
<div class="flex gap-1 p-2 bg-muted/30 border-b border-border/60" role="tablist">
84-
<% @blocks_by_locale.each do |locale_s, _| %>
85-
<% selected = locale_s == active_locale %>
82+
<div class="flex gap-1 p-2 bg-background border-b border-border/60" role="tablist">
83+
<% @blocks_by_locale.each_with_index do |(locale_s, _), idx| %>
8684
<button type="button"
8785
role="tab"
88-
aria-selected="<%= selected %>"
86+
aria-selected="<%= idx == 0 %>"
8987
aria-controls="locale-panel-<%= locale_s %>"
9088
id="locale-tab-<%= locale_s %>"
9189
data-ruby-cms--locale-tabs-target="tab"
9290
data-panel-id="locale-panel-<%= locale_s %>"
93-
data-active-classes="bg-background text-primary shadow-sm ring-1 ring-border/60"
94-
data-inactive-classes="bg-transparent text-muted-foreground hover:bg-muted hover:text-foreground"
9591
data-action="click->ruby-cms--locale-tabs#switchTab"
96-
class="px-3 py-1.5 rounded-md text-xs font-medium border-none cursor-pointer transition-colors <%= selected ? 'bg-background text-primary shadow-sm ring-1 ring-border/60' : 'bg-transparent text-muted-foreground hover:bg-muted hover:text-foreground' %>">
92+
class="px-3 py-1.5 rounded-md text-xs font-medium border-none cursor-pointer transition-colors <%= idx == 0 ? 'bg-background text-primary shadow-sm ring-1 ring-border/60' : 'bg-transparent text-muted-foreground hover:bg-muted hover:text-foreground' %>">
9793
<%= ruby_cms_locale_display_name(locale_s) %>
9894
</button>
9995
<% end %>
10096
</div>
10197

102-
<% @blocks_by_locale.each do |locale_s, block| %>
103-
<% selected = locale_s == active_locale %>
98+
<% @blocks_by_locale.each_with_index do |(locale_s, block), idx| %>
10499
<div id="locale-panel-<%= locale_s %>"
105100
role="tabpanel"
106101
aria-labelledby="locale-tab-<%= locale_s %>"
107-
class="p-5 <%= selected ? '' : 'hidden' %>"
102+
class="p-5 <%= idx > 0 ? 'hidden' : '' %>"
108103
data-locale-panel>
109104

110105
<%= hidden_field_tag "content_block[locales][#{locale_s}][locale]", locale_s %>
@@ -209,8 +204,8 @@
209204
<div class="space-y-3">
210205
<% @blocks_by_locale.each do |locale_s, block| %>
211206
<% next if block.title.blank? && block.content_body.blank? %>
212-
<div class="py-1">
213-
<span class="text-[10px] font-semibold uppercase tracking-wide text-muted-foreground"><%= ruby_cms_locale_display_name(locale_s) %></span>
207+
<div class="rounded-lg border border-border/60 bg-background p-3">
208+
<span class="inline-flex items-center rounded-md bg-background px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground ring-1 ring-border/60 mb-2"><%= ruby_cms_locale_display_name(locale_s) %></span>
214209
<% if block.title.present? %>
215210
<p class="text-xs font-medium text-foreground"><%= block.title %></p>
216211
<% end %>

0 commit comments

Comments
 (0)