Skip to content

Commit 3660cbf

Browse files
author
Job Hammer
committed
Version 0.1.4
1 parent 8f1fa29 commit 3660cbf

10 files changed

Lines changed: 50 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## [Unreleased]
22

3+
## [0.1.4] - 2026-03-23
4+
5+
- Improve visual editor and settings admin UX
6+
- Update sidebar branding to use the new RubyCMS logo
7+
- Refresh README with project logo
8+
39
## [0.1.3] - 2026-03-23
410

511
- Update analytics pages (dashboard/detail views)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# RubyCMS
22

3+
![RubyCMS logo](docs/assets/ruby_cms_logo.png)
4+
35
Reusable Rails engine for a CMS-style admin: permissions, admin UI shell, content blocks, and a visual editor.
46

57
Vision: your app owns product features (pages, models, business logic); RubyCMS manages content workflows and admin screens.
309 KB
Loading

app/controllers/ruby_cms/admin/visual_editor_controller.rb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def page_preview
2222
return render_invalid_page unless template
2323

2424
load_preview_data(@page_key)
25-
render template: template, layout: "ruby_cms/minimal"
25+
render template: template, layout: "admin/minimal"
2626
end
2727

2828
def quick_update
@@ -186,7 +186,13 @@ def available_pages
186186
pages = {}
187187
add_config_pages(pages)
188188
add_auto_detected_pages(pages) if pages.empty?
189-
pages
189+
prioritize_home_page(pages)
190+
end
191+
192+
def prioritize_home_page(pages)
193+
return pages unless pages.key?("home")
194+
195+
{ "home" => pages["home"] }.merge(pages.except("home"))
190196
end
191197

192198
def add_auto_detected_pages(pages)
@@ -273,7 +279,10 @@ def skip_directory?(dir_name, relative_path)
273279
%w[
274280
layouts shared mailers components
275281
admin
276-
].include?(dir_name) || relative_path.start_with?("admin")
282+
].include?(dir_name) ||
283+
dir_name.end_with?("_mailer") ||
284+
dir_name.end_with?("_mailers") ||
285+
relative_path.start_with?("admin")
277286
end
278287

279288
def depth_exceeded?(relative_path)

app/views/layouts/ruby_cms/_admin_sidebar.html.erb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
<div class="px-5 py-5 flex-shrink-0 bg-[#FAF9F5]">
44
<div class="flex items-center gap-3" data-ruby-cms--mobile-menu-target="sidebarContent">
55
<% if respond_to?(:image_tag, true) %>
6-
<div class="w-7 h-7 flex-shrink-0 rounded-sm bg-gray-900 flex items-center justify-center text-white font-bold text-sm">
7-
<% if respond_to?(:main_app, true) && main_app.respond_to?(:image_path) %>
8-
<%= image_tag main_app.image_path("logo.png"), alt: "Logo", onerror: "this.style.display='none'", class: "w-full h-full object-contain" rescue nil %>
9-
<% end %>
6+
<div class="w-9 h-9 flex-shrink-0 rounded-md bg-white border border-gray-200 overflow-hidden">
7+
<%= image_tag "ruby_cms/logo.png",
8+
alt: "RubyCMS logo",
9+
class: "w-full h-full object-contain",
10+
onerror: "this.style.display='none'; this.parentElement.classList.add('bg-gray-900','text-white','font-bold','text-xs','flex','items-center','justify-center'); this.parentElement.innerHTML='R';" %>
1011
</div>
1112
<% end %>
1213
<p class="text-base font-semibold text-gray-900 m-0">RubyCMS</p>

app/views/ruby_cms/admin/settings/index.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222

2323
<%# Single card: category rail | separator | content (Todoist-like) %>
2424
<div class="rounded-2xl border border-border bg-card shadow-sm ring-1 ring-black/[0.03] overflow-hidden">
25-
<div class="flex flex-col lg:flex-row lg:min-h-[min(100vh-12rem,52rem)]">
25+
<div class="flex flex-col lg:flex-row lg:h-[min(100vh-12rem,64rem)]">
2626
<%# Left: sections (icons from TAB_CONFIG) %>
2727
<aside class="shrink-0 border-b border-border lg:w-56 lg:border-b-0 lg:border-r bg-muted/25">
28-
<div class="p-3 sm:p-4">
28+
<div class="p-3 sm:p-4 lg:h-full lg:overflow-y-auto">
2929
<p class="mb-3 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground">
3030
<%= t("ruby_cms.admin.settings.categories_title", default: "Sections") %>
3131
</p>
@@ -50,7 +50,7 @@
5050
</aside>
5151

5252
<%# Right: active section %>
53-
<div class="flex min-w-0 flex-1 flex-col bg-background">
53+
<div class="flex min-w-0 flex-1 flex-col bg-background min-h-0">
5454
<% tab_description = settings_tab_description(@active_tab) %>
5555

5656
<div class="border-b border-border/80 px-5 py-4 sm:px-6 sm:py-5">
@@ -88,7 +88,7 @@
8888
<% end %>
8989
</div>
9090

91-
<div class="flex flex-1 flex-col px-5 py-5 sm:px-6 sm:py-6">
91+
<div class="flex flex-1 flex-col px-5 py-5 sm:px-6 sm:py-6 min-h-0 overflow-y-auto">
9292
<% if is_navigation %>
9393
<% if nav_sub == "order" %>
9494
<%= form_with url: settings_url, method: :patch, local: true, html: { id: "nav_order_form", class: "flex flex-1 flex-col space-y-6", data: { turbo: false } } do %>

app/views/ruby_cms/admin/visual_editor/index.html.erb

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,29 @@
55
<!-- Header -->
66
<div class="flex flex-wrap items-center justify-between gap-4">
77
<h1 class="text-lg font-semibold tracking-tight text-gray-900">Visual Editor</h1>
8-
<%= form_with url: ruby_cms_admin_visual_editor_path, method: :get, class: "flex items-center gap-2", data: { turbo: false } do %>
8+
<%= form_with url: ruby_cms_admin_visual_editor_path, method: :get, class: "flex items-center gap-2", data: { turbo: false, controller: "visual-editor-page-select" } do %>
99
<%= hidden_field_tag :edit_mode, @edit_mode %>
1010

1111
<% if @available_pages && @available_pages.size > 1 %>
12-
<%= select_tag(
13-
:page,
14-
options_for_select(@available_pages.map { |k, v| [v[:name], k] }, @current_page),
15-
class: "h-9 rounded-md border border-gray-200 bg-white px-3 text-sm shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-200",
16-
onchange: "this.form.requestSubmit()"
17-
) %>
12+
<% selected_page_name = @available_pages.dig(@current_page, :name) || @current_page.to_s.humanize %>
13+
<%= Select(class: "min-w-56") do %>
14+
<%= SelectInput(name: :page, value: @current_page, data: { action: "change->visual-editor-page-select#submit" }) %>
15+
<%= SelectTrigger(class: "h-9 bg-white font-medium") do %>
16+
<%= SelectValue(placeholder: selected_page_name) { selected_page_name } %>
17+
<% end %>
18+
<%= SelectContent do %>
19+
<%= SelectGroup do %>
20+
<% @available_pages.each do |key, page| %>
21+
<% is_selected = key.to_s == @current_page.to_s %>
22+
<%= SelectItem(
23+
value: key,
24+
aria_selected: is_selected.to_s,
25+
class: (is_selected ? "bg-primary/10 text-primary ring-1 ring-primary/20" : nil)
26+
) { page[:name] } %>
27+
<% end %>
28+
<% end %>
29+
<% end %>
30+
<% end %>
1831
<% else %>
1932
<%= hidden_field_tag :page, @current_page %>
2033
<% end %>

docs/assets/ruby_cms_logo.png

309 KB
Loading

lib/ruby_cms/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module RubyCms
4-
VERSION = "0.1.3.1"
4+
VERSION = "0.1.4"
55
end

ruby_cms-0.1.4.gem

373 KB
Binary file not shown.

0 commit comments

Comments
 (0)