css-zero 0.0.56 → 0.0.58
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -42
- data/app/assets/stylesheets/zutilities.css +2 -2
- data/lib/css_zero/engine.rb +7 -0
- data/lib/css_zero/version.rb +1 -1
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/chart_controller.js +1 -1
- data/lib/generators/css_zero/authentication/authentication_generator.rb +9 -0
- data/lib/generators/css_zero/authentication/templates/app/views/passwords/edit.html.erb.tt +11 -0
- data/lib/generators/css_zero/authentication/templates/app/views/passwords/new.html.erb.tt +10 -0
- data/lib/generators/css_zero/authentication/templates/app/views/sessions/new.html.erb.tt +19 -0
- data/lib/generators/css_zero/install/install_generator.rb +24 -0
- data/lib/generators/css_zero/install/templates/app/assets/stylesheets/application.css +27 -0
- data/lib/generators/css_zero/install/templates/app/assets/stylesheets/base.css +4 -0
- data/lib/generators/css_zero/install/templates/app/views/layouts/application.html.erb +43 -0
- data/lib/generators/css_zero/scaffold/controller/controller_generator.rb +10 -0
- data/lib/generators/css_zero/scaffold/controller/templates/view.html.erb.tt +4 -0
- data/lib/generators/css_zero/scaffold/mailer/mailer_generator.rb +10 -0
- data/lib/generators/css_zero/scaffold/mailer/templates/layout.html.erb.tt +13 -0
- data/lib/generators/css_zero/scaffold/mailer/templates/layout.text.erb.tt +1 -0
- data/lib/generators/css_zero/scaffold/mailer/templates/view.html.erb.tt +5 -0
- data/lib/generators/css_zero/scaffold/mailer/templates/view.text.erb.tt +3 -0
- data/lib/generators/css_zero/scaffold/scaffold_generator.rb +35 -0
- data/lib/generators/css_zero/scaffold/templates/_form.html.erb.tt +43 -0
- data/lib/generators/css_zero/scaffold/templates/edit.html.erb.tt +10 -0
- data/lib/generators/css_zero/scaffold/templates/index.html.erb.tt +19 -0
- data/lib/generators/css_zero/scaffold/templates/new.html.erb.tt +9 -0
- data/lib/generators/css_zero/scaffold/templates/partial.html.erb.tt +16 -0
- data/lib/generators/css_zero/scaffold/templates/show.html.erb.tt +11 -0
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fca180d08e4732fb2fda3bf012471d48a342e30d516d465ead2db4ececa9c3fe
|
4
|
+
data.tar.gz: d8197692b8a211938eceb1f8d3aa4a032d34874afdd37eefb08fa53aeb87799a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bc8734abcd9dd40f777bc5b51a952267e3a4ee3ae7ca3089ad4b500138604b1bd464d62b53e102d1d424fb452bc3613effc114d8d8e823041d897c0c5d4630e
|
7
|
+
data.tar.gz: b2a3cfadf53df3a4345f218635806cd60aa15adb1f43fa15983335ebeb2fdd113a84b53b6840c0b0bde2d631685a163849809220e802d0ad5e5ab802417c2dd8
|
data/README.md
CHANGED
@@ -10,58 +10,18 @@ Add this gem to your project.
|
|
10
10
|
bundle add css-zero
|
11
11
|
```
|
12
12
|
|
13
|
-
|
13
|
+
Run the install command.
|
14
14
|
|
15
15
|
```
|
16
16
|
bin/rails generate css_zero:install
|
17
17
|
```
|
18
18
|
|
19
|
-
Add
|
19
|
+
Add the additional components you need.
|
20
20
|
|
21
21
|
```
|
22
22
|
bin/rails generate css_zero:add --help
|
23
|
-
bin/rails generate css_zero:add layouts flash button input switch table ...
|
24
23
|
```
|
25
24
|
|
26
|
-
### Requirements
|
27
|
-
|
28
|
-
If you are using [Propshaft](https://github.com/rails/propshaft) (recommended) make sure to load all the CSS files in your layout.html.erb.
|
29
|
-
|
30
|
-
<details>
|
31
|
-
<summary>Click here to see how</summary>
|
32
|
-
|
33
|
-
```html+erb
|
34
|
-
<%= stylesheet_link_tag :all, "data-turbo-track": "reload" %>
|
35
|
-
```
|
36
|
-
</details>
|
37
|
-
|
38
|
-
If you are using [Sprockets](https://github.com/rails/sprockets) make sure to load all the CSS files in your application.css.
|
39
|
-
|
40
|
-
<details>
|
41
|
-
<summary>Click here to see how</summary>
|
42
|
-
|
43
|
-
```
|
44
|
-
/*
|
45
|
-
*= require _reset
|
46
|
-
*= require animations
|
47
|
-
*= require borders
|
48
|
-
*= require colors
|
49
|
-
*= require effects
|
50
|
-
*= require filters
|
51
|
-
*= require grid
|
52
|
-
*= require sizes
|
53
|
-
*= require transform
|
54
|
-
*= require transition
|
55
|
-
*= require typography
|
56
|
-
*= require_tree .
|
57
|
-
*= require_self
|
58
|
-
*= require zutilities
|
59
|
-
*/
|
60
|
-
```
|
61
|
-
</details>
|
62
|
-
|
63
|
-
Some icons in the examples are not copied to the project. If you are looking for good ones, I recommend [Lucide](https://lucide.dev).
|
64
|
-
|
65
25
|
## Usage
|
66
26
|
|
67
27
|
```html
|
@@ -92,6 +52,14 @@ Check the [CSS files](app/assets/stylesheets) in the repository to see the avail
|
|
92
52
|
|
93
53
|
[<img src="https://github.com/user-attachments/assets/3a7fbd1e-5cc8-4476-a60c-52bc28efca29">](https://csszero.lazaronixon.com)
|
94
54
|
|
55
|
+
## Icons
|
56
|
+
|
57
|
+
Some icons in the examples are not copied to the project. If you are looking for good ones, I recommend [Lucide](https://lucide.dev).
|
58
|
+
|
59
|
+
## Scaffold
|
60
|
+
|
61
|
+
This gem implements custom templates for scaffolds and authentication.
|
62
|
+
|
95
63
|
## Development
|
96
64
|
|
97
65
|
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
@@ -36,8 +36,8 @@
|
|
36
36
|
.font-semibold { font-weight: var(--font-semibold); }
|
37
37
|
.font-bold { font-weight: var(--font-bold); }
|
38
38
|
|
39
|
-
.underline { text-decoration
|
40
|
-
.no-underline { text-decoration
|
39
|
+
.underline { text-decoration: underline; }
|
40
|
+
.no-underline { text-decoration: none; }
|
41
41
|
|
42
42
|
.uppercase { text-transform: uppercase; }
|
43
43
|
.normal-case { text-transform: none; }
|
data/lib/css_zero/engine.rb
CHANGED
data/lib/css_zero/version.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
<%% if alert.present? %>
|
2
|
+
<div popover class="flash" style="--flash-position: 5rem;" data-controller="element-removal" data-action="animationend->element-removal#remove" role="alert"><%%= alert %></div>
|
3
|
+
<%% end %>
|
4
|
+
|
5
|
+
<h1 class="font-bold text-4xl mbe-4">Update your password</h1>
|
6
|
+
|
7
|
+
<%%= form_with url: password_path(params[:token]), method: :put, class: "flex flex-col gap" do |form| %>
|
8
|
+
<%%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72, class: "input" %>
|
9
|
+
<%%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72, class: "input" %>
|
10
|
+
<%%= form.submit "Save", class: "btn btn--primary i-min" %>
|
11
|
+
<%% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%% if alert.present? %>
|
2
|
+
<div popover class="flash" style="--flash-position: 5rem;" data-controller="element-removal" data-action="animationend->element-removal#remove" role="alert"><%%= alert %></div>
|
3
|
+
<%% end %>
|
4
|
+
|
5
|
+
<h1 class="font-bold text-4xl mbe-4">Forgot your password?</h1>
|
6
|
+
|
7
|
+
<%%= form_with url: passwords_path, class: "flex flex-col gap" do |form| %>
|
8
|
+
<%%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address], class: "input" %>
|
9
|
+
<%%= form.submit "Email reset instructions", class: "btn btn--primary i-min" %>
|
10
|
+
<%% end %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%% if alert.present? %>
|
2
|
+
<div popover class="flash" style="--flash-position: 5rem;" data-controller="element-removal" data-action="animationend->element-removal#remove" role="alert"><%%= alert %></div>
|
3
|
+
<%% end %>
|
4
|
+
|
5
|
+
<%% if notice.present? %>
|
6
|
+
<div popover class="flash" style="--flash-position: 5rem;" data-controller="element-removal" data-action="animationend->element-removal#remove" role="alert"><%%= notice %></div>
|
7
|
+
<%% end %>
|
8
|
+
|
9
|
+
<h1 class="font-bold text-4xl mbe-4">Sign in</h1>
|
10
|
+
|
11
|
+
<%%= form_with url: session_url, class: "flex flex-col gap" do |form| %>
|
12
|
+
<%%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address], class: "input" %>
|
13
|
+
<%%= form.password_field :password, required: true, autocomplete: "current-password", placeholder: "Enter your password", maxlength: 72, class: "input" %>
|
14
|
+
|
15
|
+
<div class="flex items-center gap">
|
16
|
+
<%%= form.submit "Sign in", class: "btn btn--primary" %>
|
17
|
+
<%%= link_to "Forgot password?", new_password_path, class: "text-sm font-medium underline" %>
|
18
|
+
</div>
|
19
|
+
<%% end %>
|
@@ -1,9 +1,33 @@
|
|
1
1
|
require "rails/generators/named_base"
|
2
2
|
|
3
3
|
class CssZero::InstallGenerator < Rails::Generators::Base
|
4
|
+
include Rails::Generators::AppName
|
5
|
+
|
4
6
|
source_root File.expand_path("templates", __dir__)
|
5
7
|
|
6
8
|
def copy_base_css
|
7
9
|
copy_file "app/assets/stylesheets/base.css"
|
8
10
|
end
|
11
|
+
|
12
|
+
def copy_application_css
|
13
|
+
copy_file "app/assets/stylesheets/application.css", force: true if sprockets?
|
14
|
+
end
|
15
|
+
|
16
|
+
def copy_application_layout
|
17
|
+
template "app/views/layouts/application.html.erb", force: true
|
18
|
+
end
|
19
|
+
|
20
|
+
def add_basic_components
|
21
|
+
invoke "css_zero:add", %w(layouts input switch button flash alert)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def importmaps?
|
27
|
+
Rails.root.join("config/importmap.rb").exist?
|
28
|
+
end
|
29
|
+
|
30
|
+
def sprockets?
|
31
|
+
Rails.root.join("app/assets/config/manifest.js").exist?
|
32
|
+
end
|
9
33
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
|
6
|
+
* vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require _reset
|
14
|
+
*= require animations
|
15
|
+
*= require borders
|
16
|
+
*= require colors
|
17
|
+
*= require effects
|
18
|
+
*= require filters
|
19
|
+
*= require grid
|
20
|
+
*= require sizes
|
21
|
+
*= require transform
|
22
|
+
*= require transition
|
23
|
+
*= require typography
|
24
|
+
*= require_tree .
|
25
|
+
*= require_self
|
26
|
+
*= require zutilities
|
27
|
+
*/
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%%= content_for(:title) || "<%= app_name.titleize %>" %></title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
7
|
+
<meta name="mobile-web-app-capable" content="yes">
|
8
|
+
<%%= csrf_meta_tags %>
|
9
|
+
<%%= csp_meta_tag %>
|
10
|
+
|
11
|
+
<%%= yield :head %>
|
12
|
+
|
13
|
+
<%%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
|
14
|
+
<%%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
|
15
|
+
|
16
|
+
<link rel="icon" href="/icon.png" type="image/png">
|
17
|
+
<link rel="icon" href="/icon.svg" type="image/svg+xml">
|
18
|
+
<link rel="apple-touch-icon" href="/icon.png">
|
19
|
+
|
20
|
+
<%- style_link_target = sprockets? ? "\"application\"" : ":all" -%>
|
21
|
+
<%%# Includes all stylesheet files in app/assets/stylesheets %>
|
22
|
+
<%%= stylesheet_link_tag <%= style_link_target %>, "data-turbo-track": "reload" %>
|
23
|
+
<%- if importmaps? -%>
|
24
|
+
<%%= javascript_importmap_tags %>
|
25
|
+
<%- else -%>
|
26
|
+
<%%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>
|
27
|
+
<%- end -%>
|
28
|
+
</head>
|
29
|
+
|
30
|
+
<body class="header-layout">
|
31
|
+
<header id="header">
|
32
|
+
<div class="container">
|
33
|
+
<h1 class="font-bold text-2xl"><%= app_name.titleize %></h1>
|
34
|
+
</div>
|
35
|
+
</header>
|
36
|
+
|
37
|
+
<main id="main">
|
38
|
+
<div class="container">
|
39
|
+
<%%= yield %>
|
40
|
+
</div>
|
41
|
+
</main>
|
42
|
+
</body>
|
43
|
+
</html>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require "rails/generators/erb/controller/controller_generator"
|
2
|
+
|
3
|
+
module CssZero
|
4
|
+
module Generators
|
5
|
+
class ControllerGenerator < Erb::Generators::ControllerGenerator
|
6
|
+
source_root File.expand_path("templates", __dir__)
|
7
|
+
source_paths << "lib/templates/erb/controller"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require "rails/generators/erb/mailer/mailer_generator"
|
2
|
+
|
3
|
+
module CssZero
|
4
|
+
module Generators
|
5
|
+
class MailerGenerator < Erb::Generators::MailerGenerator
|
6
|
+
source_root File.expand_path("templates", __dir__)
|
7
|
+
source_paths << "lib/templates/erb/mailer"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%%= yield %>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "rails/generators/erb/scaffold/scaffold_generator"
|
2
|
+
require "rails/generators/resource_helpers"
|
3
|
+
|
4
|
+
module CssZero
|
5
|
+
module Generators
|
6
|
+
class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
|
7
|
+
include Rails::Generators::ResourceHelpers
|
8
|
+
|
9
|
+
source_root File.expand_path("templates", __dir__)
|
10
|
+
source_paths << "lib/templates/erb/scaffold"
|
11
|
+
|
12
|
+
argument :attributes, type: :array, default: [], banner: "field:type field:type"
|
13
|
+
|
14
|
+
def create_root_folder
|
15
|
+
empty_directory File.join("app/views", controller_file_path)
|
16
|
+
end
|
17
|
+
|
18
|
+
def copy_view_files
|
19
|
+
available_views.each do |view|
|
20
|
+
formats.each do |format|
|
21
|
+
filename = filename_with_extensions(view, format)
|
22
|
+
template filename, File.join("app/views", controller_file_path, filename)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
template "partial.html.erb", File.join("app/views", controller_file_path, "_#{singular_name}.html.erb")
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
def available_views
|
31
|
+
%w(index edit show new _form)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<%%= form_with(model: <%= model_resource_name %>, html: { contents: true }) do |form| %>
|
2
|
+
<%% if <%= singular_table_name %>.errors.any? %>
|
3
|
+
<div class="alert alert--negative flex flex-col gap-half mbe-4" role="alert">
|
4
|
+
<h2 class="font-medium leading-none"><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
|
5
|
+
|
6
|
+
<ul class="text-sm mis-3" style="list-style: disc">
|
7
|
+
<%% <%= singular_table_name %>.errors.each do |error| %>
|
8
|
+
<li><%%= error.full_message %></li>
|
9
|
+
<%% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<%% end %>
|
13
|
+
|
14
|
+
<% attributes.each do |attribute| -%>
|
15
|
+
<div class="flex flex-col gap-half mbe-4">
|
16
|
+
<% if attribute.password_digest? -%>
|
17
|
+
<%%= form.label :password, class: "text-sm font-medium leading-none" %>
|
18
|
+
<%%= form.password_field :password, class: "input" %>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div class="flex flex-col gap-half mbe-4">
|
22
|
+
<%%= form.label :password_confirmation, class: "text-sm font-medium leading-none" %>
|
23
|
+
<%%= form.password_field :password_confirmation, class: "input" %>
|
24
|
+
<% elsif attribute.attachments? -%>
|
25
|
+
<%%= form.label :<%= attribute.column_name %>, class: "text-sm font-medium leading-none" %>
|
26
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: "input" %>
|
27
|
+
<% elsif attribute.field_type == :textarea -%>
|
28
|
+
<%%= form.label :<%= attribute.column_name %>, class: "text-sm font-medium leading-none" %>
|
29
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: "auto", class: "input" %>
|
30
|
+
<% elsif attribute.field_type == :checkbox -%>
|
31
|
+
<%%= form.label :<%= attribute.column_name %>, class: "text-sm font-medium leading-none" %>
|
32
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "switch" %>
|
33
|
+
<% else -%>
|
34
|
+
<%%= form.label :<%= attribute.column_name %>, class: "text-sm font-medium leading-none" %>
|
35
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "input" %>
|
36
|
+
<% end -%>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<% end -%>
|
40
|
+
<div class="inline-flex items-center mbs-2 mie-1">
|
41
|
+
<%%= form.submit class: "btn btn--primary" %>
|
42
|
+
</div>
|
43
|
+
<%% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%% content_for :title, "Editing <%= human_name.downcase %>" %>
|
2
|
+
|
3
|
+
<h1 class="font-bold text-4xl mbe-4">Editing <%= human_name.downcase %></h1>
|
4
|
+
|
5
|
+
<%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
|
6
|
+
|
7
|
+
<div class="inline-flex flex-wrap items-center gap mbs-2" style="--row-gap: .5rem">
|
8
|
+
<%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, class: "btn" %>
|
9
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "btn" %>
|
10
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%% if notice.present? %>
|
2
|
+
<div popover class="flash" style="--flash-position: 5rem;" data-controller="element-removal" data-action="animationend->element-removal#remove" role="alert"><%%= notice %></div>
|
3
|
+
<%% end %>
|
4
|
+
|
5
|
+
<%% content_for :title, "<%= human_name.pluralize %>" %>
|
6
|
+
|
7
|
+
<div class="flex items-center justify-between mbe-4">
|
8
|
+
<h1 class="font-bold text-4xl"><%= human_name.pluralize %></h1>
|
9
|
+
<%%= link_to "New <%= human_name.downcase %>", <%= new_helper(type: :path) %>, class: "btn btn--primary" %>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div id="<%= plural_table_name %>" class="flex flex-col" style="gap: 2rem;">
|
13
|
+
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
|
14
|
+
<div class="flex flex-col items-start gap">
|
15
|
+
<%%= render <%= singular_table_name %> %>
|
16
|
+
<%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(singular_table_name) %>, class: "btn" %>
|
17
|
+
</div>
|
18
|
+
<%% end %>
|
19
|
+
</div>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%% content_for :title, "New <%= human_name.downcase %>" %>
|
2
|
+
|
3
|
+
<h1 class="font-bold text-4xl mbe-4">New <%= human_name.downcase %></h1>
|
4
|
+
|
5
|
+
<%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
|
6
|
+
|
7
|
+
<div class="inline-flex flex-wrap items-center gap mbs-2" style="--row-gap: .5rem">
|
8
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "btn" %>
|
9
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div id="<%%= dom_id <%= singular_name %> %>" class="flex flex-col gap">
|
2
|
+
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
3
|
+
<div class="flex flex-col gap-half">
|
4
|
+
<h4 class="font-medium leading-none"><%= attribute.human_name %>:</h4>
|
5
|
+
<% if attribute.attachment? -%>
|
6
|
+
<%%= link_to <%= singular_name %>.<%= attribute.column_name %>.filename, <%= singular_name %>.<%= attribute.column_name %>, class: "font-medium underline" if <%= singular_name %>.<%= attribute.column_name %>.attached? %>
|
7
|
+
<% elsif attribute.attachments? -%>
|
8
|
+
<%% <%= singular_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>| %>
|
9
|
+
<div><%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %>, class: "font-medium underline" %></div>
|
10
|
+
<%% end %>
|
11
|
+
<% else -%>
|
12
|
+
<p class="leading-none"><%%= <%= singular_name %>.<%= attribute.column_name %> %></p>
|
13
|
+
<% end -%>
|
14
|
+
</div>
|
15
|
+
<% end -%>
|
16
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%% if notice.present? %>
|
2
|
+
<div popover class="flash" style="--flash-position: 5rem;" data-controller="element-removal" data-action="animationend->element-removal#remove" role="alert"><%%= notice %></div>
|
3
|
+
<%% end %>
|
4
|
+
|
5
|
+
<%%= render @<%= singular_table_name %> %>
|
6
|
+
|
7
|
+
<div class="flex flex-wrap items-center gap mbs-6" style="--row-gap: .5rem">
|
8
|
+
<%%= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, class: "btn" %>
|
9
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "btn" %>
|
10
|
+
<%%= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete, class: "btn" %>
|
11
|
+
</div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: css-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.58
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lázaro Nixon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: lazaronixon@hotmail.com
|
@@ -111,9 +111,29 @@ files:
|
|
111
111
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/tabs_controller.js
|
112
112
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/upload_preview_controller.js
|
113
113
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/web_share_controller.js
|
114
|
+
- lib/generators/css_zero/authentication/authentication_generator.rb
|
115
|
+
- lib/generators/css_zero/authentication/templates/app/views/passwords/edit.html.erb.tt
|
116
|
+
- lib/generators/css_zero/authentication/templates/app/views/passwords/new.html.erb.tt
|
117
|
+
- lib/generators/css_zero/authentication/templates/app/views/sessions/new.html.erb.tt
|
114
118
|
- lib/generators/css_zero/install/USAGE
|
115
119
|
- lib/generators/css_zero/install/install_generator.rb
|
120
|
+
- lib/generators/css_zero/install/templates/app/assets/stylesheets/application.css
|
116
121
|
- lib/generators/css_zero/install/templates/app/assets/stylesheets/base.css
|
122
|
+
- lib/generators/css_zero/install/templates/app/views/layouts/application.html.erb
|
123
|
+
- lib/generators/css_zero/scaffold/controller/controller_generator.rb
|
124
|
+
- lib/generators/css_zero/scaffold/controller/templates/view.html.erb.tt
|
125
|
+
- lib/generators/css_zero/scaffold/mailer/mailer_generator.rb
|
126
|
+
- lib/generators/css_zero/scaffold/mailer/templates/layout.html.erb.tt
|
127
|
+
- lib/generators/css_zero/scaffold/mailer/templates/layout.text.erb.tt
|
128
|
+
- lib/generators/css_zero/scaffold/mailer/templates/view.html.erb.tt
|
129
|
+
- lib/generators/css_zero/scaffold/mailer/templates/view.text.erb.tt
|
130
|
+
- lib/generators/css_zero/scaffold/scaffold_generator.rb
|
131
|
+
- lib/generators/css_zero/scaffold/templates/_form.html.erb.tt
|
132
|
+
- lib/generators/css_zero/scaffold/templates/edit.html.erb.tt
|
133
|
+
- lib/generators/css_zero/scaffold/templates/index.html.erb.tt
|
134
|
+
- lib/generators/css_zero/scaffold/templates/new.html.erb.tt
|
135
|
+
- lib/generators/css_zero/scaffold/templates/partial.html.erb.tt
|
136
|
+
- lib/generators/css_zero/scaffold/templates/show.html.erb.tt
|
117
137
|
homepage: https://github.com/lazaronixon/css-zero
|
118
138
|
licenses:
|
119
139
|
- MIT
|