Skip to content

Commit 1df7ae7

Browse files
author
Mattia Roccoberton
committed
Minor improvements to blaze toggle and dialog styles
1 parent fe8d415 commit 1df7ae7

4 files changed

Lines changed: 37 additions & 10 deletions

File tree

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ To change toggle color:
9696

9797
Available: `c-toggle--brand, c-toggle--info, c-toggle--warning, c-toggle--success, c-toggle--error`
9898

99+
Standard checkbox with label on the left:
100+
101+
`f.input :boolean, as: :blaze_toggle, input_html: { simple_checkbox: true }`
102+
99103
## Blaze widgets
100104

101105
See components avaible in Blaze CSS [docs](http://blazecss.com/components/buttons/).
@@ -134,10 +138,14 @@ Show - sidebar on the left:
134138

135139
![edit](screenshot3.jpg)
136140

141+
## Do you like it? Star it!
142+
143+
If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
144+
137145
## Contributors
138146

139147
- [Mattia Roccoberton](http://blocknot.es) - creator, maintainer
140148

141149
## License
142150

143-
[MIT](LICENSE)
151+
[MIT](LICENSE.txt)

app/assets/stylesheets/activeadmin_blaze_theme/theme.scss

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ body.active_admin {
133133
label {
134134
display: inline-block;
135135
}
136+
.field_with_errors {
137+
display: inline;
138+
}
139+
.inline-errors {
140+
margin-top: 0;
141+
}
136142
}
137143

138144
// filter forms
@@ -683,12 +689,23 @@ body.active_admin {
683689
}
684690

685691
// dialogs
686-
.ui-dialog > .ui-dialog-buttonpane button.ui-button {
687-
@extend .button-base;
688-
margin-right: 10px;
689-
&:hover {
690-
background-image: none;
692+
.ui-dialog {
693+
button.ui-button {
694+
@extend .button-base;
695+
// margin-right: 10px;
696+
&:hover {
697+
background-image: none;
698+
}
699+
}
700+
.ui-dialog-titlebar {
701+
display: flex;
702+
justify-content: space-between;
703+
> * {
704+
align-self: center
705+
}
691706
}
707+
// .ui-dialog-buttonset
708+
// text-align: right
692709
}
693710

694711
// footer
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module ActiveAdminBlazeTheme
2-
VERSION = '0.4.8'
2+
VERSION = '0.4.9'
33
end

lib/formtastic/inputs/blaze_toggle_input.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def to_html
2222

2323
def toggle_label
2424
builder.label(
25-
method
25+
method,
26+
label_text
2627
)
2728
end
2829

@@ -35,11 +36,12 @@ def toggle_checkbox
3536
end
3637

3738
def label_html_options
38-
super.merge( for: input_html_options[:id], class: ['c-toggle', input_html_options[:toggle_class] ] - ['label'] )
39+
classes = input_html_options[:simple_checkbox] ? [] : [ 'c-toggle', input_html_options[:toggle_class] ]
40+
super.merge( for: input_html_options[:id], class: classes - ['label'] )
3941
end
4042

4143
def label_with_embedded_checkbox
42-
check_box_html << "" << toggle_html # << label_text
44+
check_box_html << "" << ( input_html_options[:simple_checkbox] ? '' : toggle_html ) # << label_text
4345
end
4446

4547
def toggle_html

0 commit comments

Comments
 (0)