basecoat 1.0.1 → 2.0.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/README.md +41 -112
- data/basecoat-dark-form.png +0 -0
- data/basecoat-index.png +0 -0
- data/basecoat-login.png +0 -0
- data/lib/basecoat/version.rb +1 -1
- data/lib/generators/basecoat/templates/layouts/_aside.html.erb +1 -1
- data/lib/generators/basecoat/templates/layouts/_header.html.erb +1 -1
- data/lib/generators/basecoat/templates/shared/_empty.html.erb +16 -0
- data/lib/tasks/basecoat.rake +46 -10
- data/lib/templates/erb/scaffold/_form.html.erb.tt +3 -3
- data/lib/templates/erb/scaffold/index.html.erb.tt +1 -10
- metadata +5 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 30c46abb1310bf79995534b1fcd52074a67f327d42ea93a933065b46b02d8563
|
|
4
|
+
data.tar.gz: 509ac587a90f7be78362d5d92d0506de9528dc3e773d0c20b7bdfa2050eedc30
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f01fd3115a85191fb41f999662adfda41666f022d54f53e46242987ba5b61fc4459322f41d48f238b1dc2537573a161b2514baf8faee83762fff80e2e7faa11d
|
|
7
|
+
data.tar.gz: c58e1ced83b1ad2b8083e0cbc7481476fe06ba8abe26cc95280f4047d1c0174596b129dcfcaf5f1bfa9b5d77c27689649dfb6334743251a6bf9c42607b1c5651
|
data/README.md
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Basecoat (shadcn) powered views for Rails
|
|
2
2
|
|
|
3
|
-
This gem provides you with amazing
|
|
4
|
-
It is especially powerful for admin applications with a lot of CRUD actions.
|
|
3
|
+
This gem provides you with amazing layouts, scaffolds, views and partials based on [Basecoat UI](https://basecoatui.com).
|
|
4
|
+
It is especially powerful for admin applications with a lot of CRUD actions.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
Beautiful responsive, dark & light mode Rails scaffolds, pages for authentication and Devise, and pagy styling.
|
|
7
|
+
|
|
8
|
+
Login:
|
|
9
|
+

|
|
10
|
+
Index:
|
|
11
|
+

|
|
12
|
+
Form, mobile dark mode:
|
|
13
|
+

|
|
8
14
|
|
|
9
15
|
## Why?
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
However... in many (most?) applications you don't need complicated components -
|
|
14
|
-
e.g. an input field can just be a html tag, not a separate component with its own shadow DOM.
|
|
17
|
+
Shadcn has quickly become the default ui for the web. However, sometimes we don't _really_ need all the React components.
|
|
18
|
+
Especially with backend applications - where Rails shines as full stack solution.
|
|
15
19
|
|
|
16
|
-
This is where basecoat-
|
|
20
|
+
This is where basecoat-ui comes in. The reason why I love basecoat is because it combines tailwind with clean css classes (like daisy-ui).
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
but most of your application is just the simple rails views, leveraging the power of Rails.
|
|
22
|
+
If you need more complex components; enrich the views with https://railsblocks.com/ or https://shadcn.rails-components.com/ or just the shadcn React components themselves.
|
|
20
23
|
|
|
21
24
|
## Installation
|
|
22
25
|
|
|
23
|
-
Add this line to your application's Gemfile:
|
|
26
|
+
Add this line to your application's Gemfile in the development group:
|
|
24
27
|
|
|
25
28
|
```ruby
|
|
26
29
|
gem 'basecoat'
|
|
@@ -45,22 +48,7 @@ Install the Basecoat application layout and partials:
|
|
|
45
48
|
```bash
|
|
46
49
|
rake basecoat:install
|
|
47
50
|
```
|
|
48
|
-
|
|
49
|
-
This will:
|
|
50
|
-
- Install `basecoat-css` via yarn/npm (if package.json exists) or importmap
|
|
51
|
-
- Add basecoat-css import to `app/javascript/application.js`
|
|
52
|
-
- Add view transition JavaScript for turbo frames
|
|
53
|
-
- Add dark mode toggle functionality
|
|
54
|
-
- Add view transition CSS animations and form validation styles
|
|
55
|
-
- Copy application layout to `app/views/layouts/application.html.erb`
|
|
56
|
-
- Copy layout partials (`_head.html.erb`, `_header.html.erb`, `_aside.html.erb`, `_notice.html.erb`, `_alert.html.erb`, `_form_errors.html.erb`)
|
|
57
|
-
- Copy scaffold hook initializer to `config/initializers/scaffold_hook.rb`
|
|
58
|
-
|
|
59
|
-
The scaffold templates are automatically available from the gem, so you can immediately generate scaffolds:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
rails generate scaffold Post title:string body:text published:boolean
|
|
63
|
-
```
|
|
51
|
+
NB: This could overwrite exising files!
|
|
64
52
|
|
|
65
53
|
The generated views will include:
|
|
66
54
|
* Basecoat CSS styling
|
|
@@ -72,43 +60,20 @@ The generated views will include:
|
|
|
72
60
|
* Boolean fields styled as switches
|
|
73
61
|
* Automatic sidebar navigation links
|
|
74
62
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
Install the Basecoat-styled Devise views and layout:
|
|
63
|
+
The scaffold templates are automatically available from the gem, so you can immediately generate scaffolds:
|
|
78
64
|
|
|
79
65
|
```bash
|
|
80
|
-
|
|
66
|
+
rails generate scaffold Post title:string body:text published:boolean
|
|
81
67
|
```
|
|
82
68
|
|
|
83
|
-
|
|
84
|
-
- All Devise views to `app/views/devise/`
|
|
85
|
-
- Devise layout to `app/views/layouts/devise.html.erb`
|
|
86
|
-
|
|
87
|
-
The Devise views include:
|
|
88
|
-
- Beautiful login/signup forms
|
|
89
|
-
* Two-column layout with image placeholder
|
|
90
|
-
* Dark mode toggle
|
|
91
|
-
* Responsive design
|
|
92
|
-
* Password reset flows
|
|
93
|
-
* Email confirmation views
|
|
94
|
-
|
|
95
|
-
### Install Pagy Pagination Styles
|
|
69
|
+
### Install Devise Views
|
|
96
70
|
|
|
97
|
-
Install the Basecoat-styled
|
|
71
|
+
Install the Basecoat-styled Devise views and layout:
|
|
98
72
|
|
|
99
73
|
```bash
|
|
100
|
-
rake basecoat:install:
|
|
74
|
+
rake basecoat:install:devise
|
|
101
75
|
```
|
|
102
|
-
|
|
103
|
-
This will copy:
|
|
104
|
-
- Pagy styles to `app/assets/stylesheets/pagy.scss`
|
|
105
|
-
|
|
106
|
-
The Pagy styles include:
|
|
107
|
-
|
|
108
|
-
* Basecoat CSS button styling using `@apply`
|
|
109
|
-
* Proper spacing and layout
|
|
110
|
-
* Active page highlighting
|
|
111
|
-
* Disabled state styling
|
|
76
|
+
NB: This will overwrite exising files!
|
|
112
77
|
|
|
113
78
|
### Install Authentication Views
|
|
114
79
|
|
|
@@ -117,78 +82,42 @@ Install the Basecoat-styled authentication views (for Rails built-in authenticat
|
|
|
117
82
|
```bash
|
|
118
83
|
rake basecoat:install:authentication
|
|
119
84
|
```
|
|
85
|
+
NB: This will overwrite exising files!
|
|
120
86
|
|
|
121
|
-
|
|
122
|
-
- Sessions views to `app/views/sessions/`
|
|
123
|
-
- Passwords views to `app/views/passwords/`
|
|
124
|
-
- Sessions layout to `app/views/layouts/sessions.html.erb`
|
|
125
|
-
- Adds `layout "sessions"` to `app/controllers/passwords_controller.rb`
|
|
126
|
-
|
|
127
|
-
The authentication views include:
|
|
128
|
-
|
|
129
|
-
* Beautiful sign in form
|
|
130
|
-
* Password reset flows
|
|
131
|
-
* Two-column layout with image placeholder
|
|
132
|
-
* Dark mode toggle
|
|
133
|
-
* Responsive design
|
|
134
|
-
* Consistent styling with Devise views
|
|
135
|
-
|
|
136
|
-
## Features
|
|
137
|
-
|
|
138
|
-
### Application Layout
|
|
139
|
-
|
|
140
|
-
- **Sidebar Navigation**: Collapsible sidebar with automatic active state detection
|
|
141
|
-
- **Header**: User dropdown with sign out functionality
|
|
142
|
-
- **Alerts & Notices**: Beautiful toast notifications for flash messages
|
|
143
|
-
- **Form Errors**: Consistent error message styling
|
|
144
|
-
- **Dark Mode**: Built-in theme toggle
|
|
145
|
-
|
|
146
|
-
### Scaffold Templates
|
|
147
|
-
|
|
148
|
-
- **Modern UI**: Clean, professional design using Basecoat CSS
|
|
149
|
-
- **Turbo Frames**: SPA-like navigation without full page reloads
|
|
150
|
-
- **View Transitions**: Smooth slide animations between pages
|
|
151
|
-
- **Smart Forms**: Automatic required field detection based on database schema
|
|
152
|
-
- **Auto Sidebar Links**: New scaffolds automatically add navigation links to sidebar
|
|
153
|
-
- **Dark Mode**: Built-in dark mode support
|
|
154
|
-
- **Responsive**: Mobile-first responsive design
|
|
87
|
+
### Install Pagy Pagination Styles
|
|
155
88
|
|
|
156
|
-
|
|
89
|
+
Install the Basecoat-styled Pagy pagination:
|
|
157
90
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
- **Dark Mode**: Toggle between light and dark themes
|
|
162
|
-
- **Accessible**: ARIA labels and semantic HTML
|
|
91
|
+
```bash
|
|
92
|
+
rake basecoat:install:pagy
|
|
93
|
+
```
|
|
163
94
|
|
|
164
95
|
## Requirements
|
|
165
96
|
|
|
166
97
|
- Rails 8.0+
|
|
167
98
|
- Tailwind CSS ([installation instructions](https://github.com/rails/tailwindcss-rails))
|
|
168
99
|
- Basecoat CSS
|
|
169
|
-
- Turbo Rails (for scaffold templates)
|
|
170
100
|
- Stimulus (for the theme toggle, can be moved to something else if you desire...)
|
|
171
101
|
|
|
172
|
-
## How It Works
|
|
173
|
-
|
|
174
|
-
The gem uses Rails' template resolution system to provide scaffold templates automatically. When you run `rails generate scaffold`, Rails will use the templates from the Basecoat gem instead of the default ones.
|
|
175
|
-
|
|
176
|
-
The application layout and partials are copied to your application so you can customize them as needed.
|
|
177
|
-
|
|
178
102
|
## Discussion
|
|
179
103
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
However, I have my doubts with the index page reusing the show partial. Especially in admin applications you might want
|
|
184
|
-
to have a (responsive) table in the index.
|
|
104
|
+
The scaffolds are more opinionated than the default - it includes a main turbo frame.
|
|
105
|
+
I also strongly feel that the index should not reuse the partial used in show - it defeats the purpose of the show page.
|
|
106
|
+
A responsive table was the best I could come up with - closer to the OG scaffolds before Hotwire.
|
|
185
107
|
|
|
186
|
-
Also, the arguably
|
|
108
|
+
Also, the (arguably) most messy part of the views are the svg tags which contain the lovely lucide icons.
|
|
187
109
|
Since these icons are the default for shadcn I'm considering including https://github.com/heyvito/lucide-rails to clean up the views.
|
|
188
110
|
|
|
111
|
+
## Issues
|
|
112
|
+
|
|
113
|
+
* The javascript included by basecoat needs some improvement. It's not automatically initialized on turbo:load - included is a hack that I hope is temporary.
|
|
114
|
+
* We include extra css for the definition list. Hopefully this will be part of basecoat-css someday.
|
|
115
|
+
* Rails adds class="field_with_errors", so we need extra css for this. I hope Rails will at some point have aria-invalid="true" on the input, basecoat will apply the correct styling.
|
|
116
|
+
* Can the views even be prettier? Probably! I'm more than happy to discuss improvements:
|
|
117
|
+
|
|
189
118
|
## Contributing
|
|
190
119
|
|
|
191
|
-
Bug reports and pull requests are welcome on GitHub
|
|
120
|
+
Bug reports and pull requests are more than welcome on GitHub!
|
|
192
121
|
|
|
193
122
|
## License
|
|
194
123
|
|
|
Binary file
|
data/basecoat-index.png
ADDED
|
Binary file
|
data/basecoat-login.png
ADDED
|
Binary file
|
data/lib/basecoat/version.rb
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M9 3v18"></path></svg>
|
|
5
5
|
</button>
|
|
6
6
|
<%= render "layouts/theme_toggle" %>
|
|
7
|
-
<!--
|
|
7
|
+
<!-- AUTHENTICATION_DROPDOWN -->
|
|
8
8
|
</div>
|
|
9
9
|
</header>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<div class="flex mt-10 flex-1 flex-col items-center justify-center gap-6">
|
|
2
|
+
<header class="flex max-w-sm flex-col items-center gap-2 text-center">
|
|
3
|
+
<div class="mb-2 bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg">
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 10.5 8 13l2 2.5" /><path d="m14 10.5 2 2.5-2 2.5" /><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z" /></svg>
|
|
5
|
+
</div>
|
|
6
|
+
<h3 class="text-lg font-medium tracking-tight">No <%= resource_name %> yet</h3>
|
|
7
|
+
<p class="text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4">
|
|
8
|
+
Get started by creating your first <%= resource_name.singularize %>.
|
|
9
|
+
</p>
|
|
10
|
+
</header>
|
|
11
|
+
<section class="flex w-full max-w-sm flex-col items-center gap-4 text-sm text-balance">
|
|
12
|
+
<div class="flex gap-2">
|
|
13
|
+
<%= link_to "New #{resource_name.singularize}", new_path, class: "btn", data: { turbo_action: "advance" } %>
|
|
14
|
+
</div>
|
|
15
|
+
</section>
|
|
16
|
+
</div>
|
data/lib/tasks/basecoat.rake
CHANGED
|
@@ -32,7 +32,7 @@ namespace :basecoat do
|
|
|
32
32
|
|
|
33
33
|
unless importmap_content.include?("basecoat-css")
|
|
34
34
|
File.open(importmap_path, "a") do |f|
|
|
35
|
-
f.puts "\npin \"basecoat-css/all\", to: \"https://cdn.jsdelivr.net/npm/basecoat-css@0.3.
|
|
35
|
+
f.puts "\npin \"basecoat-css/all\", to: \"https://cdn.jsdelivr.net/npm/basecoat-css@0.3.3/dist/js/all.js\""
|
|
36
36
|
end
|
|
37
37
|
puts " Added: basecoat-css to config/importmap.rb"
|
|
38
38
|
end
|
|
@@ -58,16 +58,10 @@ namespace :basecoat do
|
|
|
58
58
|
puts " Added: basecoat-css import to app/javascript/application.js"
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
# Add
|
|
61
|
+
# Add cool view transition to application.js
|
|
62
62
|
js_content = File.read(js_path)
|
|
63
63
|
unless js_content.include?("Re-initialize basecoat-css components")
|
|
64
64
|
basecoat_js = <<~JS
|
|
65
|
-
|
|
66
|
-
// Re-initialize basecoat-css components after Turbo navigation
|
|
67
|
-
document.addEventListener('turbo:load', () => {
|
|
68
|
-
document.dispatchEvent(new Event('DOMContentLoaded', { bubbles: true, cancelable: false }))
|
|
69
|
-
})
|
|
70
|
-
|
|
71
65
|
// View transitions for turbo frame navigation
|
|
72
66
|
addEventListener("turbo:before-frame-render", (event) => {
|
|
73
67
|
if (document.startViewTransition) {
|
|
@@ -80,7 +74,7 @@ namespace :basecoat do
|
|
|
80
74
|
})
|
|
81
75
|
JS
|
|
82
76
|
File.open(js_path, "a") { |f| f.write(basecoat_js) }
|
|
83
|
-
puts " Added:
|
|
77
|
+
puts " Added: cool view transition to app/javascript/application.js"
|
|
84
78
|
end
|
|
85
79
|
|
|
86
80
|
# Copy theme_controller.js
|
|
@@ -179,6 +173,17 @@ namespace :basecoat do
|
|
|
179
173
|
puts " Created: app/views/layouts/#{filename}"
|
|
180
174
|
end
|
|
181
175
|
|
|
176
|
+
# Copy shared partials
|
|
177
|
+
shared_source = File.expand_path("../generators/basecoat/templates/shared", __dir__)
|
|
178
|
+
shared_destination = Rails.root.join("app/views/shared")
|
|
179
|
+
|
|
180
|
+
FileUtils.mkdir_p(shared_destination)
|
|
181
|
+
Dir.glob("#{shared_source}/*").each do |file|
|
|
182
|
+
filename = File.basename(file)
|
|
183
|
+
FileUtils.cp(file, shared_destination.join(filename))
|
|
184
|
+
puts " Created: app/views/shared/#{filename}"
|
|
185
|
+
end
|
|
186
|
+
|
|
182
187
|
# Copy scaffold hook initializer
|
|
183
188
|
initializer_source = File.expand_path("../generators/basecoat/templates/scaffold_hook.rb", __dir__)
|
|
184
189
|
initializer_destination = Rails.root.join("config/initializers/scaffold_hook.rb")
|
|
@@ -236,7 +241,7 @@ namespace :basecoat do
|
|
|
236
241
|
</div>
|
|
237
242
|
<% end %>
|
|
238
243
|
HTML
|
|
239
|
-
updated_content = header_content.sub("<!--
|
|
244
|
+
updated_content = header_content.sub("<!-- AUTHENTICATION_DROPDOWN -->", user_dropdown)
|
|
240
245
|
File.write(header_path, updated_content)
|
|
241
246
|
puts " Added: User dropdown to app/views/layouts/_header.html.erb"
|
|
242
247
|
end
|
|
@@ -317,6 +322,37 @@ namespace :basecoat do
|
|
|
317
322
|
end
|
|
318
323
|
end
|
|
319
324
|
|
|
325
|
+
# Add user dropdown to header partial
|
|
326
|
+
header_path = Rails.root.join("app/views/layouts/_header.html.erb")
|
|
327
|
+
if File.exist?(header_path)
|
|
328
|
+
header_content = File.read(header_path)
|
|
329
|
+
unless header_content.include?("dropdown-user")
|
|
330
|
+
user_dropdown = <<~HTML
|
|
331
|
+
|
|
332
|
+
<% if defined?(Current) && defined?(Current.user) && Current.user %>
|
|
333
|
+
<div id="dropdown-user" class="dropdown-menu">
|
|
334
|
+
<button type="button" id="dropdown-user-trigger" aria-haspopup="menu" aria-controls="dropdown-user-menu" aria-expanded="false" class="btn-icon-ghost rounded-full size-8">
|
|
335
|
+
<img alt="<%= Current.user.email_address %>" src="https://github.com/lafeber.png" class="size-8 shrink-0 rounded-full">
|
|
336
|
+
</button>
|
|
337
|
+
<div id="dropdown-user-popover" data-popover="" aria-hidden="true" data-align="end">
|
|
338
|
+
<div role="menu" id="dropdown-user-menu" aria-labelledby="dropdown-user-trigger">
|
|
339
|
+
<div class="px-1 py-1.5">
|
|
340
|
+
<%= button_to session_path, method: :delete, class: "btn-link" do %>
|
|
341
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg>
|
|
342
|
+
Log out
|
|
343
|
+
<% end %>
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
346
|
+
</div>
|
|
347
|
+
</div>
|
|
348
|
+
<% end %>
|
|
349
|
+
HTML
|
|
350
|
+
updated_content = header_content.sub("<!-- AUTHENTICATION_DROPDOWN -->", user_dropdown)
|
|
351
|
+
File.write(header_path, updated_content)
|
|
352
|
+
puts " Added: User dropdown to app/views/layouts/_header.html.erb"
|
|
353
|
+
end
|
|
354
|
+
end
|
|
355
|
+
|
|
320
356
|
puts "\n✓ Basecoat authentication views installed successfully!"
|
|
321
357
|
puts " Make sure you have Rails authentication configured in your application."
|
|
322
358
|
end
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<%%= form_with(model: <%= model_resource_name %>, class: "space-y-
|
|
1
|
+
<%%= form_with(model: <%= model_resource_name %>, class: "space-y-4") do |form| %>
|
|
2
2
|
<%%= render "/layouts/form_errors", object: <%= singular_table_name %> if <%= singular_table_name %>.errors.any? %>
|
|
3
3
|
|
|
4
4
|
<% attributes.each do |attribute| -%>
|
|
5
5
|
<% required = attribute.to_s.include?('{null}') -%>
|
|
6
|
-
<div class="
|
|
6
|
+
<div class="field">
|
|
7
7
|
<% if attribute.password_digest? -%>
|
|
8
8
|
<%%= form.label :password, class: "label" %>
|
|
9
9
|
<%%= form.password_field :password, class: "input", required: true %>
|
|
10
10
|
</div>
|
|
11
11
|
|
|
12
|
-
<div class="
|
|
12
|
+
<div class="field">
|
|
13
13
|
<%%= form.label :password_confirmation, class: "label" %>
|
|
14
14
|
<%%= form.password_field :password_confirmation, class: "input", required: true %>
|
|
15
15
|
<% elsif attribute.attachments? -%>
|
|
@@ -45,15 +45,6 @@
|
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
47
|
<%% if @<%= plural_table_name %>.empty? %>
|
|
48
|
-
|
|
49
|
-
<div class="mb-4">
|
|
50
|
-
<svg class="mx-auto h-12 w-12" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
51
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2M4 13h2m13-8V4a1 1 0 00-1-1H7a1 1 0 00-1 1v1h10z" />
|
|
52
|
-
</svg>
|
|
53
|
-
</div>
|
|
54
|
-
<h3 class="text-lg font-medium mb-2">No <%= human_name.pluralize.downcase %> yet</h3>
|
|
55
|
-
<p class="mb-6">Get started by creating your first <%= human_name.downcase %>.</p>
|
|
56
|
-
<%%= link_to "New <%= human_name.downcase %>", <%= new_helper(type: :path) %>, class: "btn", data: { turbo_action: "advance" } %>
|
|
57
|
-
</div>
|
|
48
|
+
<%%= render "shared/empty", resource_name: "<%= human_name.pluralize.downcase %>", new_path: <%= new_helper(type: :path) %> %>
|
|
58
49
|
<%% end %>
|
|
59
50
|
<%% end %>
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: basecoat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martijn Lafeber
|
|
@@ -40,6 +40,9 @@ files:
|
|
|
40
40
|
- LICENSE.txt
|
|
41
41
|
- README.md
|
|
42
42
|
- Rakefile
|
|
43
|
+
- basecoat-dark-form.png
|
|
44
|
+
- basecoat-index.png
|
|
45
|
+
- basecoat-login.png
|
|
43
46
|
- lib/basecoat.rb
|
|
44
47
|
- lib/basecoat/railtie.rb
|
|
45
48
|
- lib/basecoat/version.rb
|
|
@@ -72,6 +75,7 @@ files:
|
|
|
72
75
|
- lib/generators/basecoat/templates/scaffold_hook.rb
|
|
73
76
|
- lib/generators/basecoat/templates/sessions.html.erb
|
|
74
77
|
- lib/generators/basecoat/templates/sessions/new.html.erb
|
|
78
|
+
- lib/generators/basecoat/templates/shared/_empty.html.erb
|
|
75
79
|
- lib/generators/basecoat/templates/theme_controller.js
|
|
76
80
|
- lib/tasks/basecoat.rake
|
|
77
81
|
- lib/templates/erb/scaffold/_form.html.erb.tt
|