iron-cms 0.4.5 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +3 -0
- data/app/assets/builds/iron.css +1154 -1395
- data/app/assets/tailwind/iron/application.css +3 -1
- data/app/assets/tailwind/iron/components/badge.css +97 -0
- data/app/assets/tailwind/iron/components/form.css +1 -1
- data/app/assets/tailwind/iron/components/input.css +2 -2
- data/app/assets/tailwind/iron/lexxy.css +366 -0
- data/app/controllers/iron/home_controller.rb +1 -0
- data/app/helpers/iron/application_helper.rb +4 -13
- data/app/helpers/iron/entries_helper.rb +0 -4
- data/app/helpers/iron/icons_helper.rb +7 -5
- data/app/helpers/iron/ui_helper.rb +22 -0
- data/app/javascript/iron/application.js +5 -3
- data/app/views/iron/block_definitions/_block_definition.html.erb +2 -2
- data/app/views/iron/content_types/_content_type.html.erb +2 -2
- data/app/views/iron/content_types/show.html.erb +1 -1
- data/app/views/iron/entries/fields/_rich_text_area.html.erb +1 -3
- data/app/views/iron/field_definitions/_field_definition.html.erb +2 -4
- data/app/views/iron/home/show.html.erb +46 -2
- data/app/views/iron/locales/_locale.html.erb +1 -1
- data/app/views/iron/users/_user.html.erb +1 -1
- data/app/views/layouts/action_text/contents/_content.html.erb +1 -1
- data/app/views/layouts/iron/_sidebar_content.html.erb +30 -6
- data/app/views/layouts/iron/_user_menu.html.erb +1 -1
- data/app/views/layouts/iron/authentication.html.erb +1 -1
- data/config/importmap.rb +2 -2
- data/lib/iron/engine.rb +2 -0
- data/lib/iron/version.rb +1 -1
- data/lib/iron.rb +0 -1
- data/lib/puma/plugin/iron_tailwindcss.rb +8 -8
- data/lib/tasks/iron_tailwindcss.rake +33 -0
- data/vendor/javascript/lexxy.js +10814 -0
- metadata +20 -8
- data/app/assets/tailwind/iron/actiontext.css +0 -550
- data/app/helpers/iron/block_helper.rb +0 -4
- data/app/helpers/iron/buttons_helper.rb +0 -14
- data/app/helpers/iron/components/badge_helper.rb +0 -70
- data/app/javascript/iron/controllers/trix_controller.js +0 -19
- data/lib/iron/cva.rb +0 -69
- data/vendor/javascript/trix.js +0 -5
|
@@ -20,14 +20,12 @@
|
|
|
20
20
|
<div class="flex flex-col sm:flex-row sm:items-center sm:gap-8 min-w-0 flex-1">
|
|
21
21
|
<div class="flex items-center gap-3 shrink-0">
|
|
22
22
|
<h3 class="text-base font-semibold text-stone-900 dark:text-white truncate"><%= field_definition.name %></h3>
|
|
23
|
-
<%= badge field_definition.humanized_type,
|
|
24
|
-
color: :blue,
|
|
25
|
-
class: "hidden sm:inline-flex" %>
|
|
23
|
+
<%= badge field_definition.humanized_type, class: "badge-blue hidden sm:inline-flex" %>
|
|
26
24
|
</div>
|
|
27
25
|
</div>
|
|
28
26
|
|
|
29
27
|
<div class="flex items-center gap-4">
|
|
30
|
-
<%= badge field_definition.humanized_type,
|
|
28
|
+
<%= badge field_definition.humanized_type, class: "badge-blue sm:hidden" %>
|
|
31
29
|
<%= icon "chevron-right", class: "text-stone-400 dark:text-stone-500" %>
|
|
32
30
|
</div>
|
|
33
31
|
</div>
|
|
@@ -1,2 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<% content_for :title, "Dashboard" %>
|
|
2
|
+
|
|
3
|
+
<div class="space-y-8">
|
|
4
|
+
<div>
|
|
5
|
+
<h1 class="page-title">Dashboard</h1>
|
|
6
|
+
<p class="text-stone-600 dark:text-stone-400 mt-1">Welcome back to Iron CMS</p>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div class="space-y-4">
|
|
10
|
+
<h2 class="text-lg font-semibold text-stone-900 dark:text-white">Recent Activity</h2>
|
|
11
|
+
|
|
12
|
+
<% if @recent_entries.any? %>
|
|
13
|
+
<div class="bg-white dark:bg-stone-800/50 rounded-lg shadow-sm divide-y divide-stone-200 dark:divide-stone-700/20 overflow-hidden">
|
|
14
|
+
<% @recent_entries.each do |entry| %>
|
|
15
|
+
<div class="relative">
|
|
16
|
+
<%= link_to edit_entry_path(entry), class: "block px-6 py-4 hover:bg-stone-50 dark:hover:bg-stone-800/50 transition-colors" do %>
|
|
17
|
+
<div class="flex items-start justify-between gap-4 pr-6">
|
|
18
|
+
<div class="flex flex-col gap-1 min-w-0 flex-1">
|
|
19
|
+
<h3 class="text-base font-semibold text-stone-900 dark:text-white truncate"><%= entry.title %></h3>
|
|
20
|
+
<div class="flex items-center gap-2 text-sm text-stone-500 dark:text-stone-400">
|
|
21
|
+
<%= badge entry.content_type.name, class: "badge-blue" %>
|
|
22
|
+
<span>·</span>
|
|
23
|
+
<span>Updated <%= time_ago_in_words(entry.updated_at) %> ago</span>
|
|
24
|
+
<% if entry.creator %>
|
|
25
|
+
<span>·</span>
|
|
26
|
+
<span>by <%= entry.creator.email_address %></span>
|
|
27
|
+
<% end %>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="absolute right-6 top-1/2 -translate-y-1/2 flex items-center gap-4">
|
|
33
|
+
<%= icon "chevron-right", class: "text-stone-400 dark:text-stone-500" %>
|
|
34
|
+
</div>
|
|
35
|
+
<% end %>
|
|
36
|
+
</div>
|
|
37
|
+
<% end %>
|
|
38
|
+
</div>
|
|
39
|
+
<% else %>
|
|
40
|
+
<div class="bg-white dark:bg-stone-800/50 rounded-lg shadow-sm p-8 text-center">
|
|
41
|
+
<p class="text-stone-500 dark:text-stone-400">No entries yet. Create your first content type to get started.</p>
|
|
42
|
+
<%= link_to "Create Content Type", new_content_type_path, class: "button-primary mt-4 inline-block" %>
|
|
43
|
+
</div>
|
|
44
|
+
<% end %>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<span class="font-medium"><%= locale.name %></span>
|
|
6
6
|
<%= badge "default" if locale.default? %>
|
|
7
7
|
</div>
|
|
8
|
-
<%= badge locale.code,
|
|
8
|
+
<%= badge locale.code, class: "badge-blue" %>
|
|
9
9
|
</div>
|
|
10
10
|
<% end %>
|
|
11
11
|
<%= button_to locale_path(locale), method: :delete, class: "absolute right-2 top-1/2 -translate-y-1/2 button-secondary button-sm" do %>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</div>
|
|
10
10
|
<div>
|
|
11
11
|
<% if user.current? %>
|
|
12
|
-
<%= badge user.role,
|
|
12
|
+
<%= badge user.role, class: ("badge-blue" if user.administrator?) %>
|
|
13
13
|
<% else %>
|
|
14
14
|
<%= form_with(model: user, class: "", data: { controller: "form", action: "change->form#submit" }) do |form| %>
|
|
15
15
|
<div class="field">
|
|
@@ -8,11 +8,31 @@
|
|
|
8
8
|
<li>
|
|
9
9
|
<div class="text-xs/6 font-semibold text-stone-400">Admin</div>
|
|
10
10
|
<ul role="list" class="-mx-2 mt-2 space-y-1">
|
|
11
|
-
<%= render "layouts/iron/sidebar_item",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
<%= render "layouts/iron/sidebar_item",
|
|
12
|
+
text: "Content Types",
|
|
13
|
+
url: content_types_path,
|
|
14
|
+
icon: "boxes",
|
|
15
|
+
current: controller_name == "content_types" %>
|
|
16
|
+
<%= render "layouts/iron/sidebar_item",
|
|
17
|
+
text: "Block definitions",
|
|
18
|
+
url: block_definitions_path,
|
|
19
|
+
icon: "blocks",
|
|
20
|
+
current: controller_name == "block_definitions" %>
|
|
21
|
+
<%= render "layouts/iron/sidebar_item",
|
|
22
|
+
text: "Locales",
|
|
23
|
+
url: locales_path,
|
|
24
|
+
icon: "languages",
|
|
25
|
+
current: controller_name == "locales" %>
|
|
26
|
+
<%= render "layouts/iron/sidebar_item",
|
|
27
|
+
text: "Users",
|
|
28
|
+
url: users_path,
|
|
29
|
+
icon: "users",
|
|
30
|
+
current: controller_name == "users" %>
|
|
31
|
+
<%= render "layouts/iron/sidebar_item",
|
|
32
|
+
text: "Settings",
|
|
33
|
+
url: settings_path,
|
|
34
|
+
icon: "settings",
|
|
35
|
+
current: controller_name == "settings" %>
|
|
16
36
|
</ul>
|
|
17
37
|
</li>
|
|
18
38
|
<% end %>
|
|
@@ -21,7 +41,11 @@
|
|
|
21
41
|
<div class="text-xs/6 font-semibold text-stone-400">Content</div>
|
|
22
42
|
<ul role="list" class="-mx-2 mt-2 space-y-1">
|
|
23
43
|
<% Iron::ContentType.all.each do |content_type| %>
|
|
24
|
-
<%= render "layouts/iron/sidebar_item",
|
|
44
|
+
<%= render "layouts/iron/sidebar_item",
|
|
45
|
+
text: content_type.name,
|
|
46
|
+
url: content_type_sidebar_url(content_type),
|
|
47
|
+
icon: content_type.icon.present? ? content_type.icon : "folder-closed",
|
|
48
|
+
current: current_content_page?(content_type) %>
|
|
25
49
|
<% end %>
|
|
26
50
|
</ul>
|
|
27
51
|
</li>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</a>
|
|
18
18
|
</div>
|
|
19
19
|
<div class="py-1">
|
|
20
|
-
<%=
|
|
20
|
+
<%= button_to session_path, method: :delete, class: "group/item w-full flex items-center px-4 py-2 text-sm text-stone-700 focus:bg-stone-100 focus:text-stone-900 focus:outline-hidden dark:text-stone-300 dark:focus:bg-white/5 dark:focus:text-white" do %>
|
|
21
21
|
<%= icon "log-out", class: "mr-3 size-5 text-stone-400 group-focus/item:text-stone-500 dark:text-stone-500 dark:group-focus/item:text-white" %>
|
|
22
22
|
Sign out
|
|
23
23
|
<% end %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html class="h-full bg-white dark:bg-stone-900">
|
|
2
|
+
<html class="h-full bg-white text-stone-950 antialiased dark:bg-stone-900 dark:text-white">
|
|
3
3
|
<head>
|
|
4
4
|
<title><%= content_for(:title).present? ? "#{content_for(:title)} | Iron CMS" : "Iron CMS" %></title>
|
|
5
5
|
<%= csrf_meta_tags %>
|
data/config/importmap.rb
CHANGED
|
@@ -2,8 +2,8 @@ pin "application-iron", to: "iron/application.js", preload: true
|
|
|
2
2
|
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
|
|
3
3
|
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
|
|
4
4
|
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
|
|
5
|
-
pin "
|
|
6
|
-
pin "
|
|
5
|
+
pin "@rails/activestorage", to: "activestorage.esm.js"
|
|
6
|
+
pin "lexxy", to: "lexxy.js"
|
|
7
7
|
|
|
8
8
|
pin_all_from Iron::Engine.root.join("app/javascript/iron/lib"), under: "lib", to: "iron/lib"
|
|
9
9
|
pin_all_from Iron::Engine.root.join("app/javascript/iron/controllers"), under: "controllers", to: "iron/controllers"
|
data/lib/iron/engine.rb
CHANGED
|
@@ -3,6 +3,7 @@ require "turbo-rails"
|
|
|
3
3
|
require "stimulus-rails"
|
|
4
4
|
require "active_storage/engine"
|
|
5
5
|
require "action_text/engine"
|
|
6
|
+
require "lexxy"
|
|
6
7
|
require "bcrypt"
|
|
7
8
|
require "ostruct"
|
|
8
9
|
require "iron/lexorank"
|
|
@@ -17,6 +18,7 @@ module Iron
|
|
|
17
18
|
initializer "iron.setup", before: "importmap" do |app|
|
|
18
19
|
app.config.assets.paths.unshift(root.join("vendor/javascript"))
|
|
19
20
|
app.config.assets.paths << root.join("app/javascript")
|
|
21
|
+
app.config.assets.paths << root.join("app/assets/builds")
|
|
20
22
|
app.config.importmap.paths << root.join("config/importmap.rb")
|
|
21
23
|
app.config.importmap.cache_sweepers << root.join("app/javascript")
|
|
22
24
|
|
data/lib/iron/version.rb
CHANGED
data/lib/iron.rb
CHANGED
|
@@ -7,20 +7,22 @@ Puma::Plugin.create do
|
|
|
7
7
|
@log_writer = launcher.log_writer
|
|
8
8
|
@puma_pid = $$
|
|
9
9
|
|
|
10
|
-
# Build the Iron engine Tailwind CSS command
|
|
11
10
|
engine_root = File.expand_path("../../..", __dir__)
|
|
11
|
+
input_path = File.join(engine_root, "app/assets/tailwind/iron/application.css")
|
|
12
|
+
output_path = File.join(engine_root, "app/assets/builds/iron.css")
|
|
13
|
+
|
|
12
14
|
command = [
|
|
13
15
|
"bundle", "exec", "tailwindcss",
|
|
14
|
-
"-i",
|
|
15
|
-
"-o",
|
|
16
|
+
"-i", input_path,
|
|
17
|
+
"-o", output_path,
|
|
16
18
|
"-w"
|
|
17
19
|
]
|
|
18
20
|
|
|
19
21
|
@iron_tailwind_pid = fork do
|
|
20
22
|
Thread.new { monitor_puma }
|
|
21
23
|
begin
|
|
22
|
-
|
|
23
|
-
IO.copy_stream(io, $stdout)
|
|
24
|
+
Dir.chdir(engine_root) do
|
|
25
|
+
IO.popen(command, "r+") { |io| IO.copy_stream(io, $stdout) }
|
|
24
26
|
end
|
|
25
27
|
rescue Interrupt
|
|
26
28
|
end
|
|
@@ -28,9 +30,7 @@ Puma::Plugin.create do
|
|
|
28
30
|
|
|
29
31
|
launcher.events.on_stopped { stop_iron_tailwind }
|
|
30
32
|
|
|
31
|
-
in_background
|
|
32
|
-
monitor_iron_tailwind
|
|
33
|
-
end
|
|
33
|
+
in_background { monitor_iron_tailwind }
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
private
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
namespace :iron do
|
|
2
|
+
namespace :tailwindcss do
|
|
3
|
+
desc "Build Tailwind CSS for the Iron engine"
|
|
4
|
+
task :build do
|
|
5
|
+
require "tailwindcss/ruby"
|
|
6
|
+
require "fileutils"
|
|
7
|
+
|
|
8
|
+
engine_root = Iron::Engine.root
|
|
9
|
+
input_path = "app/assets/tailwind/iron/application.css"
|
|
10
|
+
output_path = "app/assets/builds/iron.css"
|
|
11
|
+
|
|
12
|
+
Dir.chdir(engine_root) do
|
|
13
|
+
FileUtils.mkdir_p(File.dirname(output_path))
|
|
14
|
+
|
|
15
|
+
cmd = [
|
|
16
|
+
Tailwindcss::Ruby.executable,
|
|
17
|
+
"-i", input_path,
|
|
18
|
+
"-o", output_path
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
system(*cmd) || raise("Tailwind build failed for Iron engine")
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
if Rake::Task.task_defined?("build")
|
|
28
|
+
Rake::Task["build"].enhance([ "iron:tailwindcss:build" ])
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
if Rake::Task.task_defined?("release")
|
|
32
|
+
Rake::Task["release"].enhance([ "iron:tailwindcss:build" ])
|
|
33
|
+
end
|