css-zero 0.0.55 → 0.0.57
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -42
- data/lib/css_zero/engine.rb +7 -0
- data/lib/css_zero/version.rb +1 -1
- data/lib/generators/css_zero/add/USAGE +1 -1
- data/lib/generators/css_zero/add/resources.yml +4 -2
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/input.css +1 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/zcombobox.css +3 -3
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/zdatepicker.css +4 -4
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/chart_controller.js +33 -0
- 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/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 +23 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f36de6d1d6734c0b993d5cb5408229b47934e2e6725fb995e8507deb6ebd7840
|
4
|
+
data.tar.gz: c60d2d2df8617f7a1bb53cfa4c19f935531b73675402b807d7090ea6cf03a6cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c726280266ad97bad3a106ba0000ae34d9e30c6adf6284ad6d7ab74d38d01d1d0f4f48bed7008232e5d11ce527e1afd49721a6aae7cf819353844bae8d16b39b
|
7
|
+
data.tar.gz: 2a64d4b5136d1600edfb47f7c52bf71e873e35d4a7ed59a9bc4cb4cf0593a467ccca1f13d8ab5ec1ee17cb6b98173a00b44f0f0b2c53f617b4cedea5c27682d7
|
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
|
@@ -88,6 +48,10 @@ Some icons in the examples are not copied to the project. If you are looking for
|
|
88
48
|
|
89
49
|
Check the [CSS files](app/assets/stylesheets) in the repository to see the available variables and utility classes.
|
90
50
|
|
51
|
+
## Icons
|
52
|
+
|
53
|
+
Some icons in the examples are not copied to the project. If you are looking for good ones, I recommend [Lucide](https://lucide.dev).
|
54
|
+
|
91
55
|
## Components
|
92
56
|
|
93
57
|
[<img src="https://github.com/user-attachments/assets/3a7fbd1e-5cc8-4476-a60c-52bc28efca29">](https://csszero.lazaronixon.com)
|
data/lib/css_zero/engine.rb
CHANGED
data/lib/css_zero/version.rb
CHANGED
@@ -2,7 +2,7 @@ Description:
|
|
2
2
|
This will add components into your project.
|
3
3
|
|
4
4
|
Components:
|
5
|
-
accordion alert autosave avatar badge breadcrumb button card carousel
|
5
|
+
accordion alert autosave avatar badge breadcrumb button card carousel chart check_all combobox command collapsible datepicker dialog dropdown flash form fullscreen hotkey input input_concerns inputmask layouts lightbox local_time pagination progress prose sheet skeleton switch table tabs trix upload_preview toggle web_share
|
6
6
|
|
7
7
|
Example:
|
8
8
|
bin/rails generate css_zero:add [components...]
|
@@ -22,13 +22,15 @@ carousel:
|
|
22
22
|
- app/javascript/controllers/carousel_controller.js
|
23
23
|
- app/assets/images/arrow-left.svg
|
24
24
|
- app/assets/images/arrow-right.svg
|
25
|
+
chart:
|
26
|
+
- app/javascript/controllers/chart_controller.js
|
27
|
+
check_all:
|
28
|
+
- app/javascript/controllers/check_all_controller.js
|
25
29
|
combobox:
|
26
30
|
- app/assets/stylesheets/tom-select.css
|
27
31
|
- app/assets/stylesheets/zcombobox.css
|
28
32
|
- app/javascript/controllers/combobox_controller.js
|
29
33
|
- app/assets/images/select-arrow.svg
|
30
|
-
check_all:
|
31
|
-
- app/javascript/controllers/check_all_controller.js
|
32
34
|
command:
|
33
35
|
- app/assets/stylesheets/command.css
|
34
36
|
- app/javascript/controllers/filter_controller.js
|
@@ -5,7 +5,7 @@
|
|
5
5
|
border-radius: var(--input-radius, var(--rounded-md));
|
6
6
|
font-size: var(--input-font-size, var(--text-sm));
|
7
7
|
inline-size: var(--size-full);
|
8
|
-
padding: var(--input-padding, 0.5rem
|
8
|
+
padding: var(--input-padding, 0.5rem 0.75rem);
|
9
9
|
|
10
10
|
option {
|
11
11
|
padding-block: 2px;
|
@@ -5,12 +5,11 @@
|
|
5
5
|
border-radius: var(--rounded-md);
|
6
6
|
min-block-size: var(--size-10);
|
7
7
|
color: var(--color-text);
|
8
|
-
display: flex;
|
8
|
+
display: inline-flex;
|
9
9
|
font-size: var(--text-sm);
|
10
|
-
font-weight: var(--font-medium);
|
11
10
|
gap: var(--size-1);
|
12
11
|
line-height: inherit;
|
13
|
-
padding: var(--size-
|
12
|
+
padding: var(--size-2) var(--size-3);
|
14
13
|
|
15
14
|
> input {
|
16
15
|
color: inherit; font-size: inherit;
|
@@ -85,6 +84,7 @@
|
|
85
84
|
background: var(--color-secondary);
|
86
85
|
border-radius: var(--rounded-md);
|
87
86
|
color: inherit;
|
87
|
+
line-height: var(--leading-tight);
|
88
88
|
margin: 0;
|
89
89
|
}
|
90
90
|
|
@@ -115,15 +115,15 @@
|
|
115
115
|
}
|
116
116
|
|
117
117
|
.flatpickr-day {
|
118
|
-
|
118
|
+
--day-size: var(--size-9);
|
119
119
|
border-radius: var(--rounded-md);
|
120
120
|
border-color: transparent !important;
|
121
121
|
box-shadow: none !important;
|
122
122
|
color: var(--color-text);
|
123
|
-
|
124
|
-
height: var(--size
|
123
|
+
height: var(--day-size);
|
124
|
+
line-height: var(--day-size);
|
125
125
|
margin-block-start: 1px;
|
126
|
-
max-width: var(--size
|
126
|
+
max-width: var(--day-size);
|
127
127
|
|
128
128
|
&:is(.inRange) {
|
129
129
|
border-radius: 0;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
import { Chart, registerables } from "https://cdn.skypack.dev/chart.js@4.4.6"
|
3
|
+
|
4
|
+
Chart.register(...registerables)
|
5
|
+
|
6
|
+
Chart.defaults.backgroundColor = getCssVariableValue("--color-primary")
|
7
|
+
Chart.defaults.borderColor = getCssVariableValue("--color-border")
|
8
|
+
Chart.defaults.color = getCssVariableValue("--color-text")
|
9
|
+
|
10
|
+
Chart.defaults.font.family = getCssVariableValue("--font-system-ui")
|
11
|
+
Chart.defaults.font.size = 12
|
12
|
+
|
13
|
+
export default class extends Controller {
|
14
|
+
static values = { type: { type: String, default: "line" }, data: Object, options: Object }
|
15
|
+
|
16
|
+
connect() {
|
17
|
+
this.chart = new Chart(this.element, this.#settings)
|
18
|
+
}
|
19
|
+
|
20
|
+
disconnect() {
|
21
|
+
this.chart.destroy()
|
22
|
+
}
|
23
|
+
|
24
|
+
get #settings() {
|
25
|
+
return { type: this.typeValue, data: this.dataValue, options: this.optionsValue }
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
// Helpers
|
30
|
+
|
31
|
+
function getCssVariableValue(variableName) {
|
32
|
+
return getComputedStyle(document.documentElement).getPropertyValue(variableName).trim()
|
33
|
+
}
|
@@ -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.button tag.span("Save changes"), class: "btn btn--primary btn--loading" %>
|
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.57
|
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
|
+
date: 2024-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: lazaronixon@hotmail.com
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/autosave_controller.js
|
89
89
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/autoselect_controller.js
|
90
90
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/carousel_controller.js
|
91
|
+
- lib/generators/css_zero/add/templates/app/javascript/controllers/chart_controller.js
|
91
92
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/check_all_controller.js
|
92
93
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/clearable_input_controller.js
|
93
94
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
|
@@ -110,9 +111,29 @@ files:
|
|
110
111
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/tabs_controller.js
|
111
112
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/upload_preview_controller.js
|
112
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
|
113
118
|
- lib/generators/css_zero/install/USAGE
|
114
119
|
- lib/generators/css_zero/install/install_generator.rb
|
120
|
+
- lib/generators/css_zero/install/templates/app/assets/stylesheets/application.css
|
115
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
|
116
137
|
homepage: https://github.com/lazaronixon/css-zero
|
117
138
|
licenses:
|
118
139
|
- MIT
|