activeadmin_blaze_theme 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa56215f4edbaa4ee8628bfdbd9f34676bd29241
4
- data.tar.gz: d9a2005e6ae70f401128a226a92efe10cbc4936a
3
+ metadata.gz: fc7aee2eeb76864ffe690c64e5ebb35467c45bd7
4
+ data.tar.gz: ae25d8209466f127c2c45ad849f5f85e152fdf2d
5
5
  SHA512:
6
- metadata.gz: cb7fe4496339b8d5e72c4d7f445bbbbff68185b32193acdce613c4fbf28fa96c6031fdded78e93ca9bf6b4efc79f09831b71d9ce3e3c3b25371d28dfeec163bd
7
- data.tar.gz: c7ce4c9408b631e205f604136790ba058128b8b116f20556f464e31367c012e00f1c69ddf059b2a0b460792288fc20d38a9bc08eacf680b658c8d751f2a72e5e
6
+ metadata.gz: 7e1f97d0db8ccc77f517f169346db5f0e01498ac47cf8eb83703d152398ef2a44b9a14b18754bd8a8f29a9de35a0a95cb4625424377138a7f001f0225772604e
7
+ data.tar.gz: 7579babf1e7397f7b3ad3f61e7c42e2d7a9a542773d2bd784e80a63885ea4a811eaca98bd8e936164e21c23b7b2fb8406b6680e629d7baf00eac09800c56fb27
data/README.md CHANGED
@@ -5,8 +5,10 @@ A theme for Active Admin using [Blaze CSS](http://blazecss.com/)
5
5
  Features:
6
6
 
7
7
  - clean UI
8
+ - customizable
8
9
  - compact edit form
9
- - Blaze CSS widgets
10
+ - some custom fields: toggle
11
+ - Blaze CSS widgets available
10
12
 
11
13
  ## Install
12
14
 
@@ -50,6 +52,20 @@ $height-inputs: 28px;
50
52
  $text-shadow: #000;
51
53
  ```
52
54
 
55
+ ## Custom fields
56
+
57
+ ### Toggle
58
+
59
+ In *form* \ *inputs* block:
60
+
61
+ `f.input :boolean, as: :blaze_toggle`
62
+
63
+ To change toggle color:
64
+
65
+ `f.input :boolean, as: :blaze_toggle, input_html: { toggle_class: 'c-toggle--brand' }`
66
+
67
+ Available: `c-toggle--brand, c-toggle--info, c-toggle--warning, c-toggle--success, c-toggle--error`
68
+
53
69
  ## Screenshots
54
70
 
55
71
  Index:
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Mattia Roccoberton"]
10
10
  spec.email = ["mat@blocknot.es"]
11
11
  spec.summary = "ActiveAdmin Blaze Theme"
12
- spec.description = "An ActiveAdmin theme which use Blaze CSS toolkit"
12
+ spec.description = "An ActiveAdmin theme which use Blaze CSS UI toolkit"
13
13
  spec.homepage = "https://github.com/blocknotes/activeadmin_blaze_theme"
14
14
  spec.license = "MIT"
15
15
 
@@ -17,4 +17,6 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency 'activeadmin'
20
22
  end
@@ -11,6 +11,7 @@ $bg-header: $color-brand !default; // bg header bar
11
11
  $bg-inputs: #fff !default; // bg forms inputs
12
12
  $bg-menu-active: #7b929e !default; // bg menu item current / hover
13
13
  $fg-box-title: #fff !default;
14
+ $fg-menu-items: #f8f8f8 !default;
14
15
  $fg-link2: #eee !default;
15
16
  $fg-table-borders: #e4e4e4 !default;
16
17
 
@@ -36,8 +37,14 @@ body.active_admin {
36
37
  // forms
37
38
  form {
38
39
  // inputs
40
+ input[type='datetime-local'],
41
+ input[type='email'],
39
42
  input[type='number'],
43
+ input[type='password'],
44
+ input[type='search'],
45
+ input[type='tel'],
40
46
  input[type='text'],
47
+ input[type='url'],
41
48
  select,
42
49
  textarea {
43
50
  @extend .c-field;
@@ -45,6 +52,27 @@ body.active_admin {
45
52
  display: inline-block;
46
53
  height: $height-inputs;
47
54
  }
55
+ input[type='radio'] {
56
+ margin-right: 0.4em;
57
+ }
58
+ input[type='range'] {
59
+ @extend .c-range;
60
+ background: transparent;
61
+ display: inline-block;
62
+ height: $height-inputs;
63
+ min-width: 200px;
64
+ width: 30%;
65
+ }
66
+ select[multiple], textarea {
67
+ height: auto;
68
+ }
69
+ .selectize-input {
70
+ line-height: $height-inputs;
71
+ padding-left: 8px;
72
+ }
73
+ abbr {
74
+ padding-left: 3px;
75
+ }
48
76
 
49
77
  // buttons
50
78
  button,
@@ -76,11 +104,24 @@ body.active_admin {
76
104
  @extend .c-button--success;
77
105
  }
78
106
 
107
+ // custom fields
108
+ .blaze_toggle {
109
+ label {
110
+ display: inline-block;
111
+ }
112
+ }
113
+
79
114
  // filter forms
80
115
  &.filter_form {
81
116
  .filter_form_field.filter_date_range {
117
+ input[type='datetime-local'],
118
+ input[type='email'],
82
119
  input[type='number'],
83
- input[type='text'] {
120
+ input[type='password'],
121
+ input[type='search'],
122
+ input[type='tel'],
123
+ input[type='text'],
124
+ input[type='url'], {
84
125
  max-width: 100px;
85
126
  width: auto;
86
127
  }
@@ -100,8 +141,14 @@ body.active_admin {
100
141
  background-color: transparent;
101
142
  box-shadow: none;
102
143
  padding: 0;
144
+ input[type='datetime-local'],
145
+ input[type='email'],
103
146
  input[type='number'],
147
+ input[type='password'],
148
+ input[type='search'],
149
+ input[type='tel'],
104
150
  input[type='text'],
151
+ input[type='url'],
105
152
  select,
106
153
  textarea {
107
154
  background-color: $bg-inputs;
@@ -135,8 +182,14 @@ body.active_admin {
135
182
  }
136
183
  }
137
184
  .fragment {
185
+ input[type='datetime-local'],
186
+ input[type='email'],
138
187
  input[type='number'],
188
+ input[type='password'],
189
+ input[type='search'],
190
+ input[type='tel'],
139
191
  input[type='text'],
192
+ input[type='url'],
140
193
  select {
141
194
  width: auto;
142
195
  }
@@ -146,7 +199,7 @@ body.active_admin {
146
199
  padding: 0;
147
200
  > li {
148
201
  padding: 0 0 $inputs-spacing 0;
149
- &.boolean label {
202
+ &.boolean label, &.blaze_toggle label {
150
203
  float: none;
151
204
  }
152
205
  &.has_many_container {
@@ -228,7 +281,13 @@ body.active_admin {
228
281
  .header-item {
229
282
  top: 0;
230
283
  }
284
+ .site_title {
285
+ color: $fg-menu-items;
286
+ }
231
287
  ul.tabs {
288
+ li > a {
289
+ color: $fg-menu-items;
290
+ }
232
291
  li:hover, li.current {
233
292
  background: $bg-menu-active;
234
293
  }
@@ -239,6 +298,8 @@ body.active_admin {
239
298
  }
240
299
  > ul {
241
300
  background: lighten( $bg-header, 5% );
301
+ border-radius: 0;
302
+ padding: 0;
242
303
  margin: 0;
243
304
  a {
244
305
  line-height: 2em;
@@ -251,6 +312,48 @@ body.active_admin {
251
312
  }
252
313
  }
253
314
 
315
+ // pagination
316
+ nav.pagination {
317
+ @extend .c-pagination;
318
+ span > a {
319
+ background: transparent;
320
+ background-image: none;
321
+ border: 0 none;
322
+ box-shadow: none;
323
+ color: initial;
324
+ cursor: pointer;
325
+ padding: 6px 10px;
326
+ margin: 0 auto;
327
+ text-shadow: none;
328
+ }
329
+ a:hover, span:hover > a {
330
+ background: transparent;
331
+ background-image: none;
332
+ color: #fff;
333
+ text-shadow: none;
334
+ }
335
+ .first, .prev, .next, .last {
336
+ @extend .c-pagination__control;
337
+ display: inline-block;
338
+ margin-right: 2px;
339
+ padding: 0;
340
+ }
341
+ .page {
342
+ @extend .c-pagination__page;
343
+ display: inline-block;
344
+ margin-right: 2px;
345
+ padding: 0;
346
+ &.current {
347
+ @extend .c-pagination__page--current;
348
+ background-image: none;
349
+ padding: 6px 10px;
350
+ }
351
+ &.current:hover {
352
+ background-image: none;
353
+ }
354
+ }
355
+ }
356
+
254
357
  // navbar / menu
255
358
  #tabs, #utility_nav {
256
359
  @extend .c-nav;
@@ -289,8 +392,14 @@ body.active_admin {
289
392
  @extend .c-card;
290
393
  @extend .u-high;
291
394
  .filter_form_field {
395
+ input[type='datetime-local'],
396
+ input[type='email'],
292
397
  input[type='number'],
398
+ input[type='password'],
399
+ input[type='search'],
400
+ input[type='tel'],
293
401
  input[type='text'],
402
+ input[type='url'],
294
403
  select,
295
404
  textarea {
296
405
  background-color: $bg-inputs;
@@ -429,4 +538,26 @@ body.active_admin {
429
538
  padding: 10px 0 0 0;
430
539
  text-align: center;
431
540
  }
541
+
542
+ // misc
543
+ .ui-datepicker {
544
+ > .ui-datepicker-header {
545
+ border-bottom: 0 none;
546
+ border-radius: 0;
547
+ height: auto;
548
+ margin: 0;
549
+ padding: 8px 10px;
550
+ width: 100%;
551
+ }
552
+ .ui-datepicker-calendar th {
553
+ padding: 3px 0;
554
+ }
555
+ > .ui-datepicker-calendar {
556
+ left: 0;
557
+ width: 100%;
558
+ a {
559
+ text-decoration: none;
560
+ }
561
+ }
562
+ }
432
563
  }
@@ -1,8 +1,10 @@
1
- require "activeadmin_blaze_theme/version"
1
+ require 'activeadmin_blaze_theme/version'
2
+
3
+ require 'formtastic/inputs/blaze_toggle_input'
2
4
 
3
5
  module ActiveAdminBlazeTheme
4
6
  module Rails
5
7
  class Engine < ::Rails::Engine
6
8
  end
7
9
  end
8
- end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module ActiveAdminBlazeTheme
2
- VERSION = "0.1.6"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -0,0 +1,52 @@
1
+ module Formtastic
2
+ module Inputs
3
+ class BlazeToggleInput < Formtastic::Inputs::BooleanInput
4
+ include Formtastic::Inputs::Base
5
+
6
+ # def to_html
7
+ # input_wrapping do
8
+ # # hidden_field_html <<
9
+ # label_html <<
10
+ # builder.check_box( method, input_html_options )
11
+ # # label_with_nested_checkbox
12
+ # end
13
+ # end
14
+
15
+ def to_html
16
+ input_wrapping do
17
+ toggle_label <<
18
+ hidden_field_html <<
19
+ toggle_checkbox
20
+ end
21
+ end
22
+
23
+ def toggle_label
24
+ builder.label(
25
+ method
26
+ )
27
+ end
28
+
29
+ def toggle_checkbox
30
+ builder.label(
31
+ method,
32
+ label_with_embedded_checkbox,
33
+ label_html_options
34
+ )
35
+ end
36
+
37
+ def label_html_options
38
+ super.merge( for: input_html_options[:id], class: ['c-toggle', input_html_options[:toggle_class] ] - ['label'] )
39
+ end
40
+
41
+ def label_with_embedded_checkbox
42
+ check_box_html << "" << toggle_html # << label_text
43
+ end
44
+
45
+ def toggle_html
46
+ template.content_tag( :div, Formtastic::Util.html_safe(
47
+ template.content_tag( :div, '', class: 'c-toggle__handle' )
48
+ ), class: 'c-toggle__track' )
49
+ end
50
+ end
51
+ end
52
+ end
metadata CHANGED
@@ -1,16 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_blaze_theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-19 00:00:00.000000000 Z
12
- dependencies: []
13
- description: An ActiveAdmin theme which use Blaze CSS toolkit
11
+ date: 2017-05-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activeadmin
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: An ActiveAdmin theme which use Blaze CSS UI toolkit
14
28
  email:
15
29
  - mat@blocknot.es
16
30
  executables: []
@@ -87,6 +101,7 @@ files:
87
101
  - app/assets/stylesheets/activeadmin_blaze_theme/theme.scss
88
102
  - lib/activeadmin_blaze_theme.rb
89
103
  - lib/activeadmin_blaze_theme/version.rb
104
+ - lib/formtastic/inputs/blaze_toggle_input.rb
90
105
  - screenshot1.jpg
91
106
  - screenshot2.jpg
92
107
  homepage: https://github.com/blocknotes/activeadmin_blaze_theme