binda 0.1.0 → 0.1.1

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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -2
  3. data/app/assets/javascripts/binda/components/fileupload.js +11 -2
  4. data/app/assets/javascripts/binda/components/form_item.js +25 -45
  5. data/app/assets/javascripts/binda/components/form_item_choice.js +42 -32
  6. data/app/assets/javascripts/binda/components/form_item_repeater.js +29 -32
  7. data/app/assets/javascripts/binda/components/sortable.js +24 -19
  8. data/app/assets/javascripts/binda/dist/binda.bundle.js +133 -138
  9. data/app/assets/stylesheets/binda/components/b-alert.scss +24 -0
  10. data/app/assets/stylesheets/binda/components/form_item.scss +20 -17
  11. data/app/assets/stylesheets/binda/components/form_item_choice.scss +20 -0
  12. data/app/assets/stylesheets/binda/components/main_header.scss +1 -1
  13. data/app/assets/stylesheets/binda/components/main_sidebar.scss +33 -13
  14. data/app/assets/stylesheets/binda/components/main_table.scss +11 -3
  15. data/app/assets/stylesheets/binda/components/select2.scss +27 -18
  16. data/app/assets/stylesheets/binda/components/sortable.scss +1 -1
  17. data/app/assets/stylesheets/binda/components/standard-form.scss +41 -56
  18. data/app/assets/stylesheets/binda/index.scss +2 -0
  19. data/app/assets/stylesheets/binda/settings/common.scss +4 -3
  20. data/app/assets/stylesheets/binda/settings/tiny_mce_overrides.scss +21 -5
  21. data/app/assets/stylesheets/binda/settings/variables.scss +2 -2
  22. data/app/controllers/binda/components_controller.rb +3 -1
  23. data/app/controllers/binda/field_groups_controller.rb +9 -5
  24. data/app/controllers/binda/structures_controller.rb +1 -3
  25. data/app/models/binda/choice.rb +15 -9
  26. data/app/views/binda/categories/_form.html.erb +4 -6
  27. data/app/views/binda/categories/index.html.erb +3 -3
  28. data/app/views/binda/components/index.html.erb +6 -6
  29. data/app/views/binda/components/sort_index.html.erb +6 -6
  30. data/app/views/binda/field_groups/_form_body.html.erb +9 -9
  31. data/app/views/binda/field_groups/_form_item.html.erb +95 -104
  32. data/app/views/binda/field_groups/_form_item_choice.erb +5 -2
  33. data/app/views/binda/field_groups/_form_section.html.erb +5 -3
  34. data/app/views/binda/field_groups/_form_section_repeater.html.erb +6 -3
  35. data/app/views/binda/fieldable/_form_body.html.erb +5 -7
  36. data/app/views/binda/fieldable/_form_item_new_repeater.html.erb +1 -1
  37. data/app/views/binda/fieldable/_form_item_repeater.html.erb +2 -2
  38. data/app/views/binda/fieldable/_form_item_selections.html.erb +1 -1
  39. data/app/views/binda/fieldable/_form_sidebar.html.erb +4 -6
  40. data/app/views/binda/manage/users/_form_body.html.erb +4 -6
  41. data/app/views/binda/manage/users/index.html.erb +3 -3
  42. data/app/views/binda/structures/_form_body.html.erb +3 -5
  43. data/app/views/binda/structures/_form_section.html.erb +49 -25
  44. data/app/views/binda/structures/_form_sidebar.html.erb +1 -1
  45. data/app/views/binda/structures/index.html.erb +4 -4
  46. data/app/views/binda/structures/sort_index.html.erb +6 -6
  47. data/app/views/binda/users/sessions/new.html.erb +1 -1
  48. data/app/views/layouts/binda/_flash.html.erb +14 -16
  49. data/app/views/layouts/binda/_sidebar.html.erb +3 -0
  50. data/config/initializers/simple_form_custom.rb +1 -1
  51. data/config/locales/en.yml +1 -1
  52. data/config/routes.rb +1 -1
  53. data/db/migrate/1_create_binda_tables.rb +1 -0
  54. data/lib/binda.rb +1 -0
  55. data/lib/binda/version.rb +1 -1
  56. data/lib/generators/binda/setup/setup_generator.rb +3 -1
  57. metadata +26 -5
  58. data/db/migrate/20171214140451_add_preview_mode.rb +0 -5
@@ -0,0 +1,24 @@
1
+ .b-alert
2
+ {
3
+ width: 100%;
4
+ margin: 20px auto;
5
+ color: $color-white;
6
+ padding: 6px 12px;
7
+
8
+ p
9
+ {
10
+ color: $color-white; // override default p color
11
+ margin-bottom: 0;
12
+ }
13
+ }
14
+
15
+ .b-alert--success
16
+ {
17
+ background-image: linear-gradient(to right, $color-success, lighten($color-success, 6%));
18
+ }
19
+
20
+ .b-alert--danger,
21
+ .b-alert--error
22
+ {
23
+ background-image: linear-gradient(to right, $color-danger, lighten($color-danger, 6%));
24
+ }
@@ -1,20 +1,15 @@
1
1
  .form-item
2
2
  {
3
3
  display: block;
4
- transition: all .3s linear;
5
- transform: scaleY(1);
4
+ overflow-y: hidden;
5
+ transition: max-height .6s ease-out;
6
6
 
7
7
  @extend .clearfix;
8
- // .form-group
9
- // {
10
- // margin-bottom: 20px;
11
- // }
12
8
  }
13
9
 
14
- .form-item
10
+ .form-item > p
15
11
  {
16
- overflow-y: hidden;
17
- transition: max-height .6s ease-out;
12
+ padding: 12px;
18
13
  }
19
14
 
20
15
  .form-item--half-size
@@ -27,7 +22,6 @@
27
22
  {
28
23
  border-top: none !important;
29
24
  }
30
-
31
25
  }
32
26
 
33
27
  .form-item--full-size
@@ -139,7 +133,7 @@
139
133
  ul.sortable > li
140
134
  {
141
135
  margin-top: -1px; // this solve the issue of a 2px border between 2 repeaters
142
- border: 1px solid $color-gray-darker;
136
+ border: 1px solid $color-gray-lighter;
143
137
  }
144
138
 
145
139
  ul.sortable > li > *
@@ -149,7 +143,12 @@
149
143
 
150
144
  ul.sortable
151
145
  {
152
- margin-bottom: 0px;
146
+ margin-bottom: 0;
147
+ }
148
+
149
+ .ui-sortable-handle:hover
150
+ {
151
+ background-color: transparent;
153
152
  }
154
153
 
155
154
  .sortable--toggle-text:first-child
@@ -192,10 +191,10 @@
192
191
  margin-bottom: 20px;
193
192
  }
194
193
 
195
- .form-item--repeater-header
194
+ .form-item--header
196
195
  {
197
- padding: 4px 0;
198
- background-color: $color-white !important;
196
+ padding: 4px;
197
+ background-color: $color-gray-lightest !important;
199
198
 
200
199
  p
201
200
  {
@@ -203,8 +202,10 @@
203
202
  margin-left: 8px;
204
203
  }
205
204
  }
205
+
206
206
  .form-item--collapse-btn,
207
- .form-item--delete-repeater-item
207
+ .form-item--delete-repeater-item,
208
+ .form-item--edit-item
208
209
  {
209
210
  float: right;
210
211
  margin-top: 8px;
@@ -213,8 +214,10 @@
213
214
 
214
215
  a.form-item--delete-repeater-item
215
216
  {
217
+ cursor: pointer;
216
218
  transition: color .2s ease;
217
219
  color: $color-danger;
220
+
218
221
  &:hover
219
222
  {
220
223
  color: $color-danger-hover;
@@ -293,4 +296,4 @@ a.form-item--delete-repeater-item
293
296
  .form-item--new-choice .form-item--delete-choice
294
297
  {
295
298
  display: none;
296
- }
299
+ }
@@ -0,0 +1,20 @@
1
+ .form-item--full-size {
2
+
3
+ input[type="checkbox"] {
4
+
5
+ margin-left: 0px;
6
+ }
7
+ }
8
+
9
+ .form-group.allow-null {
10
+
11
+ padding-left: 12px;
12
+ padding-bottom: 0px;
13
+ }
14
+
15
+ .field_group_field_settings_allow_null {
16
+
17
+ border-top: none !important;
18
+ padding-bottom: 10px !important;
19
+ padding-top: 10px !important;
20
+ }
@@ -6,7 +6,7 @@
6
6
  .main-header--title
7
7
  {
8
8
  @extend .b-h3;
9
- display: inline-block;
9
+ display: block;
10
10
  }
11
11
 
12
12
  .main-header--buttons
@@ -7,8 +7,7 @@
7
7
  overflow-y: auto;
8
8
  width: 200px;
9
9
  height: 100%;
10
- border-right: 1px solid $color-gray-lighter;
11
- background-color: $color-white;
10
+ background-image: linear-gradient( to bottom, $color-gray-darkest, $color-gray-darker);
12
11
  }
13
12
 
14
13
  .main-sidebar--brand
@@ -18,14 +17,14 @@
18
17
  height: 124px;
19
18
  transition: background-color .3s ease;
20
19
 
21
- a {
22
- height: 100%;
20
+ a
21
+ {
23
22
  width: 100%;
23
+ height: 100%;
24
24
  }
25
25
 
26
26
  &:hover
27
27
  {
28
-
29
28
  .main-sidebar--view-website
30
29
  {
31
30
  transform: translateX( 0px );
@@ -57,17 +56,22 @@
57
56
  transition: transform .3s ease;
58
57
  transform: translateX(200px);
59
58
 
60
- i {
59
+ i
60
+ {
61
61
  padding-right: 6px;
62
62
  }
63
63
  }
64
64
 
65
65
  .main-sidebar--nav
66
66
  {
67
- width: 100%;
67
+ position: fixed;
68
+ width: 200px;
68
69
  margin: 0;
69
70
  padding: 0;
70
71
  list-style: none;
72
+ top: 0;
73
+ left: 0;
74
+ margin-bottom: 48px; // create space for sideba-footer
71
75
 
72
76
  li
73
77
  {
@@ -78,15 +82,15 @@
78
82
  padding: 12px;
79
83
  transition: all .3s ease;
80
84
  text-decoration: none;
81
- color: $text-color;
85
+ color: $color-gray;
82
86
 
83
87
  &:hover
84
88
  {
85
89
  padding-left: 16px;
86
90
  text-decoration: none;
87
- color: $text-color;
91
+ color: $color-white;
88
92
  border-bottom: none;
89
- background-color: $color-gray-lightest;
93
+ background-image: linear-gradient( to right, lighten( $color-gray-darker, 2% ), $color-gray-darker );
90
94
  }
91
95
 
92
96
  &:active,
@@ -104,7 +108,7 @@
104
108
  text-indent: 0;
105
109
  }
106
110
 
107
- .main-sidebar--nav li a.main-sidebar--logout
111
+ .main-sidebar--nav li a.main-sidebar--logout p
108
112
  {
109
113
  color: $color-danger;
110
114
  }
@@ -112,10 +116,26 @@
112
116
  .main-sidebar--structure,
113
117
  .main-sidebar--nav li:last-child
114
118
  {
115
- border-bottom: 1px solid $color-gray-lightest;
119
+ border-bottom: 1px solid $color-gray-darker;
116
120
  }
117
121
 
118
122
  .main-sidebar--first-structure
119
123
  {
120
- border-top: 1px solid $color-gray-lightest;
124
+ border-top: 1px solid $color-gray-darker;
121
125
  }
126
+
127
+ .main-sidebar--footer {
128
+ position: fixed;
129
+ left: 0;
130
+ bottom: 0;
131
+ padding: 16px;
132
+ background-color: $color-gray-darker;
133
+
134
+ a {
135
+ color: $color-gray;
136
+ transition: color .3s;
137
+ }
138
+ a:hover {
139
+ color: $color-gray-lighter;
140
+ }
141
+ }
@@ -3,6 +3,12 @@
3
3
  table
4
4
  {
5
5
  width: 100%;
6
+ background-color: $color-gray-lightest;
7
+
8
+ th
9
+ {
10
+ padding: 6px 12px;
11
+ }
6
12
 
7
13
  td
8
14
  {
@@ -43,7 +49,8 @@
43
49
  border-bottom: 1px solid $color-gray-darker;
44
50
  }
45
51
 
46
- tr.ui-sortable-handle:hover {
52
+ tr.ui-sortable-handle:hover
53
+ {
47
54
  border: 1px solid transparent;
48
55
  }
49
56
  }
@@ -65,9 +72,10 @@
65
72
  }
66
73
  }
67
74
 
68
- .main-table--hover {
69
- background: $color-gray-lightest;
75
+ .main-table--hover
76
+ {
70
77
  transition: background .3s ease;
78
+ background: $color-gray-lightest;
71
79
 
72
80
  &:hover
73
81
  {
@@ -1,22 +1,30 @@
1
1
  .select2-container,
2
+ .select2-selection
3
+ {
4
+ // https://stackoverflow.com/a/24222873/1498118
5
+ &:focus,
6
+ &:focus:active
7
+ {
8
+ border: 1px solid $color-gray-dark;
9
+ outline: none;
10
+ background-image: none;
11
+ box-shadow: none;
12
+ }
13
+ }
14
+
2
15
  .select2-selection {
3
- // https://stackoverflow.com/a/24222873/1498118
4
- &:focus,
5
- &:focus:active {
6
- box-shadow: none;
7
- border: 1px solid $color-gray-dark;
8
- background-image: none;
9
- outline: none;
10
- }
16
+ height: auto !important;
17
+ padding: 3px;
18
+ padding-top: 2px;
11
19
  }
12
20
 
13
21
  .select2-container--default .select2-selection--multiple,
14
22
  .select2-container--default .select2-selection--single
15
23
  {
16
- border-radius: 0;
17
- background-color: $color-white;
18
24
  transition: border .3s ease;
19
25
  border: 1px solid transparent;
26
+ border-radius: 0;
27
+ background-color: $color-gray-lightest;
20
28
 
21
29
  &:hover
22
30
  {
@@ -52,7 +60,8 @@
52
60
  border-color: $text-color transparent transparent transparent;
53
61
  }
54
62
 
55
- .select2-container--default.select2-container--open .select2-selection--single {
63
+ .select2-container--default.select2-container--open .select2-selection--single
64
+ {
56
65
  border: 1px solid $color-gray-lighter;
57
66
  }
58
67
 
@@ -88,7 +97,7 @@
88
97
 
89
98
  .select2-container--default.select2-container--disabled .select2-selection--multiple
90
99
  {
91
- background-color: $color-gray-lightest;
100
+ background-color: $color-gray-light;
92
101
  }
93
102
 
94
103
  .select2-container--default .select2-search--inline .select2-search__field
@@ -100,11 +109,12 @@
100
109
  {
101
110
  border: 1px solid $color-gray-lighter;
102
111
 
103
- &:focus {
104
- border: 1px solid $color-gray-dark;
105
- box-shadow: none;
106
- background-image: none;
107
- outline: none;
112
+ &:focus
113
+ {
114
+ border: 1px solid $color-gray-dark;
115
+ outline: none;
116
+ background-image: none;
117
+ box-shadow: none;
108
118
  }
109
119
  }
110
120
 
@@ -123,4 +133,3 @@
123
133
  color: $color-white;
124
134
  background-color: $color-gray-darker;
125
135
  }
126
-
@@ -34,7 +34,7 @@ ul#sortable
34
34
  {
35
35
  height: 48px;
36
36
  z-index: 0;
37
- background-color: $color-gray-dark;
37
+ background-color: $color-gray-lighter;
38
38
  }
39
39
 
40
40
  ul#sortable > li > *,
@@ -29,14 +29,15 @@
29
29
  .standard-form--container
30
30
  {
31
31
  overflow-y: hidden;
32
- margin-bottom: 20px;
33
- border: 1px solid $color-gray-darker;
34
-
35
- &.field-settings-container {
32
+ margin-bottom: 48px;
33
+ border-bottom: 1px solid $color-gray-lighter;
34
+ background-color: $color-white;
36
35
 
36
+ &.field-settings-container
37
+ {
37
38
  margin-bottom: 0 !important;
38
- border-left: none !important;
39
39
  border-right: none !important;
40
+ border-left: none !important;
40
41
  }
41
42
 
42
43
  &.table-sort
@@ -58,11 +59,21 @@
58
59
  @extend .text-muted;
59
60
  }
60
61
 
62
+ .has-error
63
+ {
64
+ .control-label-required,
65
+ .control-label,
66
+ span.help-block
67
+ {
68
+ color: $color-danger;
69
+ }
70
+ }
71
+
61
72
  .form-group
62
73
  {
63
74
  margin-bottom: 0;
64
75
  padding: 20px 12px 28px;
65
- border-top: 1px solid $color-gray-darker;
76
+ border-top: 1px solid $color-gray-lightest;
66
77
  }
67
78
 
68
79
  .form-control
@@ -70,12 +81,13 @@
70
81
  transition: border .3s ease-in-out;
71
82
  border: none;
72
83
  border: 1px solid transparent;
84
+ background-color: $color-gray-lightest;
73
85
  box-shadow: none;
74
86
 
75
87
  &:hover,
76
88
  &:focus
77
89
  {
78
- border: 1px solid $color-gray;
90
+ border: 1px solid $color-gray-lighter;
79
91
  outline: none;
80
92
  background-image: none;
81
93
  box-shadow: none;
@@ -84,7 +96,7 @@
84
96
  &.disabled
85
97
  {
86
98
  color: $color-gray-lighter;
87
- background-color: $color-white;
99
+ background-color: $color-gray-lightest;
88
100
 
89
101
  &:hover
90
102
  {
@@ -103,53 +115,17 @@
103
115
 
104
116
  .standard-form--header
105
117
  {
106
- padding: 12px 12px;
118
+ padding: 6px 12px;
107
119
  color: $color-white;
108
- background-color: $color-gray-darker;
120
+ background-image: linear-gradient(to right, $color-gray-darker, lighten( $color-gray-darker, 6%));
109
121
 
110
- p
122
+ a,
123
+ small
111
124
  {
112
125
  // font-weight: bold;
113
126
  margin-bottom: 0;
114
127
  color: $color-white;
115
128
  }
116
-
117
- a
118
- {
119
- margin-bottom: 0;
120
- color: white;
121
- }
122
- }
123
-
124
- .standard-form--secondary-header
125
- {
126
- padding: 4px 0;
127
- background-color: $color-white !important;
128
- p
129
- {
130
- display: inline-block;
131
- width: 92%;
132
- margin-top: 8px;
133
- margin-left: 8px;
134
-
135
-
136
- }
137
-
138
- a {
139
- margin-right: 10px;
140
- }
141
-
142
- &.main-actions-header
143
- {
144
- padding: 6px 12px;
145
- background-color: $color-gray-light !important;
146
-
147
- a
148
- {
149
- margin-left: 8px;
150
- }
151
- }
152
-
153
129
  }
154
130
 
155
131
  .standard-form--boolean,
@@ -198,24 +174,28 @@
198
174
  {
199
175
  display: inline-block;
200
176
  width: 100%;
201
- padding: 0px 12px 28px;
177
+ padding: 0 12px 28px;
202
178
 
203
- .b-btn-settings:last-child {
179
+ .b-btn-settings:last-child
180
+ {
204
181
  margin-bottom: 0;
205
182
  }
206
183
  }
207
184
 
208
- .standard-form--main-actions {
185
+ .standard-form--main-actions
186
+ {
209
187
  display: block;
188
+ float: left;
210
189
  width: 100%;
211
190
  padding: 20px 12px; // Padding bottom is 20px instead of 28px because there shouldn't be any heading (or label) preceding the main-actions buttons
212
- border-top: 1px solid $text-color;
213
- float: left;
191
+ border-top: 1px solid $color-gray-lightest;
214
192
  }
215
193
 
216
194
  .standard-form--secondary-actions,
217
- .standard-form--main-actions {
218
- .b-btn-settings:last-child {
195
+ .standard-form--main-actions
196
+ {
197
+ .b-btn-settings:last-child
198
+ {
219
199
  margin-bottom: 0;
220
200
  }
221
201
  }
@@ -224,5 +204,10 @@
224
204
  {
225
205
  width: 100%;
226
206
  padding: 20px 12px;
227
- border-top: 1px solid $text-color;
207
+ border-top: 1px solid $color-gray-lightest;
228
208
  }
209
+
210
+ .standard-form--hint-on-new-record
211
+ {
212
+ padding: 12px;
213
+ }