pure-admin-rails 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +131 -0
  4. data/app/assets/images/menu-fade-left.png +0 -0
  5. data/app/assets/images/menu-fade-right.png +0 -0
  6. data/app/assets/images/pending.gif +0 -0
  7. data/app/assets/javascripts/pure_admin.js +6 -0
  8. data/app/assets/javascripts/pure_admin/dropdown.js +178 -0
  9. data/app/assets/javascripts/pure_admin/flash_messages.js +13 -0
  10. data/app/assets/javascripts/pure_admin/inputs.js +24 -0
  11. data/app/assets/javascripts/pure_admin/inputs/select.js +21 -0
  12. data/app/assets/javascripts/pure_admin/main_header.js +21 -0
  13. data/app/assets/javascripts/pure_admin/main_menu.js +108 -0
  14. data/app/assets/javascripts/pure_admin/modals.js +228 -0
  15. data/app/assets/javascripts/pure_admin/partial_refresh.js +92 -0
  16. data/app/assets/javascripts/pure_admin/portlets.js +139 -0
  17. data/app/assets/javascripts/pure_admin/tabs.js +14 -0
  18. data/app/assets/stylesheets/pure_admin.css.scss +23 -0
  19. data/app/assets/stylesheets/pure_admin/_dropdowns.scss +58 -0
  20. data/app/assets/stylesheets/pure_admin/_tabs.scss +76 -0
  21. data/app/assets/stylesheets/pure_admin/auth.css.scss +22 -0
  22. data/app/assets/stylesheets/pure_admin/breadcrumbs.css.scss +69 -0
  23. data/app/assets/stylesheets/pure_admin/buttons.css.scss +48 -0
  24. data/app/assets/stylesheets/pure_admin/details_panels.css.scss +99 -0
  25. data/app/assets/stylesheets/pure_admin/flash_messages.css.scss +97 -0
  26. data/app/assets/stylesheets/pure_admin/forms.css.scss +129 -0
  27. data/app/assets/stylesheets/pure_admin/inputs/select.css.scss +99 -0
  28. data/app/assets/stylesheets/pure_admin/jquery.tagsinput.css.scss +67 -0
  29. data/app/assets/stylesheets/pure_admin/main_menu.css.scss +146 -0
  30. data/app/assets/stylesheets/pure_admin/modals.css.scss +122 -0
  31. data/app/assets/stylesheets/pure_admin/pagination.css.scss +67 -0
  32. data/app/assets/stylesheets/pure_admin/portlets.css.scss +154 -0
  33. data/app/assets/stylesheets/pure_admin/scopes.css.scss +44 -0
  34. data/app/assets/stylesheets/pure_admin/shell.css.scss +222 -0
  35. data/app/assets/stylesheets/pure_admin/side_menu.css.scss +70 -0
  36. data/app/assets/stylesheets/pure_admin/table_filters.css.scss +90 -0
  37. data/app/assets/stylesheets/pure_admin/tables.css.scss +70 -0
  38. data/app/assets/stylesheets/pure_admin/tags.css.scss +37 -0
  39. data/app/assets/stylesheets/pure_admin/utilities.css.scss +24 -0
  40. data/app/assets/stylesheets/pure_admin/variables.css.scss +38 -0
  41. data/app/helpers/pure_admin/application_helper.rb +12 -0
  42. data/app/helpers/pure_admin/button_helper.rb +58 -0
  43. data/app/helpers/pure_admin/details_panel_helper.rb +121 -0
  44. data/app/helpers/pure_admin/dropdown_helper.rb +40 -0
  45. data/app/helpers/pure_admin/menu_helper.rb +120 -0
  46. data/app/helpers/pure_admin/portlet_helper.rb +75 -0
  47. data/app/helpers/pure_admin/table_filters_helper.rb +158 -0
  48. data/app/inputs/addon_input.rb +17 -0
  49. data/app/inputs/collection_select_input.rb +17 -0
  50. data/app/inputs/email_input.rb +5 -0
  51. data/app/inputs/tel_input.rb +5 -0
  52. data/lib/generators/pure_admin/layout/USAGE +10 -0
  53. data/lib/generators/pure_admin/layout/layout_generator.rb +8 -0
  54. data/lib/generators/pure_admin/layout/templates/admin.css.scss +8 -0
  55. data/lib/generators/pure_admin/layout/templates/admin.html.erb +105 -0
  56. data/lib/generators/pure_admin/scaffold/USAGE +11 -0
  57. data/lib/generators/pure_admin/scaffold/scaffold_generator.rb +66 -0
  58. data/lib/generators/pure_admin/scaffold/templates/_form.html.erb +12 -0
  59. data/lib/generators/pure_admin/scaffold/templates/_show.html.erb +11 -0
  60. data/lib/generators/pure_admin/scaffold/templates/_table.html.erb +21 -0
  61. data/lib/generators/pure_admin/scaffold/templates/models_controller.rb +69 -0
  62. data/lib/generators/pure_admin/simple_form/USAGE +8 -0
  63. data/lib/generators/pure_admin/simple_form/simple_form_generator.rb +7 -0
  64. data/lib/pure-admin-rails.rb +8 -0
  65. data/lib/pure-admin-rails/version.rb +5 -0
  66. metadata +261 -0
@@ -0,0 +1,129 @@
1
+ .pure-form {
2
+ font-size: 14px;
3
+
4
+ label {
5
+ font-size: 14px;
6
+ }
7
+
8
+ input[type="text"],
9
+ input[type="password"],
10
+ input[type="email"],
11
+ input[type="url"],
12
+ input[type="date"],
13
+ input[type="month"],
14
+ input[type="time"],
15
+ input[type="datetime"],
16
+ input[type="datetime-local"],
17
+ input[type="week"],
18
+ input[type="number"],
19
+ input[type="search"],
20
+ input[type="tel"],
21
+ input[type="color"],
22
+ input[type="file"],
23
+ textarea,
24
+ select {
25
+ margin-bottom: 0;
26
+ }
27
+
28
+ .hint, .error {
29
+ word-wrap: break-word;
30
+ }
31
+ }
32
+
33
+ .pure-form-aligned {
34
+ label {
35
+ font-size: 14px;
36
+ text-transform: uppercase;
37
+ }
38
+
39
+ .pure-control-group {
40
+ @media (min-width: 35.5em) {
41
+ .input-wrapper {
42
+ margin-left: $base-font-size * 12;
43
+ }
44
+ }
45
+
46
+ label:not(.addon-label) {
47
+ line-height: 2.4em;
48
+ margin-bottom: 0;
49
+
50
+ @media (min-width: 35.5em) {
51
+ width: $base-font-size * 11;
52
+ }
53
+
54
+ &.checkbox,
55
+ &.radio {
56
+ margin: 0 1em 0 0;
57
+ min-width: $base-font-size;
58
+ width: auto;
59
+
60
+ input {
61
+ margin: -0.2em 0.5em 0 0;
62
+ width: auto;
63
+ }
64
+ }
65
+ }
66
+
67
+ .checkbox,
68
+ .radio {
69
+ label {
70
+ line-height: 2.4em;
71
+ padding-left: 1.5em;
72
+ text-align: left;
73
+ width: $base-font-size * 11;
74
+
75
+ input {
76
+ margin: -0.2em 0.5em 0 -1.5em;
77
+ width: auto;
78
+ }
79
+ }
80
+ }
81
+
82
+ label.radio + .hint,
83
+ label.checkbox + .hint {
84
+ clear: both;
85
+ }
86
+ }
87
+
88
+ input.file {
89
+ padding: 0.55em;
90
+ }
91
+
92
+ @mixin pure-form-indented {
93
+ @media (min-width: 35.5em) {
94
+ padding-left: $base-font-size * 12;
95
+ }
96
+ }
97
+
98
+ .pure-controls {
99
+ padding-top: $base-font-size;
100
+ padding-bottom: $base-font-size;
101
+ border-top: 2px solid #e8e8e8;
102
+
103
+ @include pure-form-indented;
104
+
105
+ .pure-button {
106
+ margin-right: $base-font-size * 0.25;
107
+ }
108
+ }
109
+
110
+ .pure-form-indented {
111
+ @include pure-form-indented;
112
+ }
113
+
114
+ .details-panel-item label {
115
+ float: none;
116
+ color: inherit;
117
+ }
118
+ }
119
+
120
+ .editor-field {
121
+ min-height: 400px;
122
+ font-family: monospace !important;
123
+ line-height: 1.3em;
124
+ width: 100%;
125
+
126
+ @media (min-width: 80em) {
127
+ width: 64em;
128
+ }
129
+ }
@@ -0,0 +1,99 @@
1
+ .select2-container--pure-admin {
2
+ display: table !important;
3
+ table-layout: fixed;
4
+
5
+ &.select2-container--disabled {
6
+ background: $grey-light;
7
+
8
+ .select2-selection--single {
9
+ cursor: not-allowed;
10
+ }
11
+ }
12
+
13
+ .select2-selection {
14
+ color: inherit;
15
+ border: 1px solid $input-border;
16
+ box-shadow: none;
17
+ border-radius: 0;
18
+ height: 2.5em !important;
19
+
20
+ &:focus {
21
+ outline: 0;
22
+ border-color: $input-active;
23
+ }
24
+
25
+ .select2-selection__arrow {
26
+ height: 2.3em;
27
+ position: absolute;
28
+ right: 1px;
29
+ top: 1px;
30
+ width: 20px;
31
+
32
+ b {
33
+ border-color: $text-color transparent transparent transparent;
34
+ border-style: solid;
35
+ border-width: 5px 4px 0 4px;
36
+ height: 0;
37
+ left: 50%;
38
+ margin-left: -4px;
39
+ margin-top: -2px;
40
+ position: absolute;
41
+ top: 50%;
42
+ width: 0;
43
+ }
44
+ }
45
+ }
46
+
47
+ .select2-selection__rendered {
48
+ line-height: 2.3em;
49
+ padding-left: 0.6em;
50
+ }
51
+
52
+ .select2-dropdown {
53
+ color: inherit;
54
+ font-size: 14px;
55
+ border: 1px solid $input-border;
56
+ border-top: 0;
57
+ border-radius: 0;
58
+
59
+ box-shadow: 0 1px 5px 0 $input-border;
60
+
61
+ .select2-search__field {
62
+ padding: 0.5em 0.6em;
63
+ &:focus {
64
+ outline: 0;
65
+ border: 1px solid $input-active;
66
+ }
67
+ }
68
+
69
+ .select2-results {
70
+ .select2-results__options {
71
+ overflow-y: auto;
72
+ max-height: 200px;
73
+ }
74
+
75
+ .select2-results__option {
76
+ white-space: nowrap;
77
+ overflow: hidden;
78
+ text-overflow: ellipsis;
79
+
80
+ &.select2-results__option--highlighted {
81
+ color: $white;
82
+ background-color: $input-active;
83
+ }
84
+ }
85
+ }
86
+ }
87
+
88
+ &.select2-container--open {
89
+ .select2-selection--single {
90
+ .select2-selection__arrow {
91
+ height: 2.2em;
92
+ b {
93
+ border-color: transparent transparent #555 transparent;
94
+ border-width: 0 4px 5px 4px;
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
@@ -0,0 +1,67 @@
1
+ div.tagsinput {
2
+ width: 100%;
3
+ height: 100px;
4
+ overflow-y: auto;
5
+ overflow-x: hidden;
6
+ }
7
+
8
+ div.tagsinput div {
9
+ display: block;
10
+ float: left;
11
+ width: 100%;
12
+ }
13
+
14
+ div.tagsinput span.tag {
15
+ border: 1px solid darken($link-color, 5%);
16
+ display: block;
17
+ float: left;
18
+ padding: 0em 0.5em;
19
+ text-decoration: none;
20
+ background: lighten($link-color, 10%);
21
+ color: $link-color;
22
+ margin-right: 5px;
23
+ margin-bottom: 5px;
24
+ font-family: helvetica;
25
+ font-size: 13px;
26
+ }
27
+
28
+ div.tagsinput span.tag a {
29
+ font-weight: bold;
30
+ text-decoration: none;
31
+ font-size: 14px;
32
+ position: relative;
33
+ top: 0px;
34
+ }
35
+
36
+ div.tagsinput input {
37
+ width: 100% !important;
38
+ margin: 0px;
39
+ font-family: helvetica;
40
+ font-size: 13px;
41
+ border: 1px solid #cccccc !important;
42
+ border-radius: 0 !important;
43
+ box-shadow: none !important;
44
+ padding: 0.7em !important;
45
+ background: transparent;
46
+ color: #000;
47
+ outline: 0px;
48
+ margin-right: 5px;
49
+ margin-bottom: 5px;
50
+ display: block;
51
+ }
52
+
53
+ div.tagsinput div {
54
+ display:block;
55
+ float: left;
56
+ }
57
+
58
+ .tags_clear {
59
+ clear: both;
60
+ width: 100%;
61
+ height: 0px;
62
+ }
63
+
64
+ .not_valid {
65
+ background: #FBD8DB !important;
66
+ color: #90111A !important;
67
+ }
@@ -0,0 +1,146 @@
1
+ #main-menu, #sub-menu {
2
+ width: 100%;
3
+ padding: 0;
4
+ overflow: hidden;
5
+ font-size: 14px;
6
+ position: relative;
7
+
8
+ nav {
9
+ padding: 0;
10
+ height: 100px;
11
+ }
12
+
13
+ ul.pure-menu-list {
14
+ max-height: 40px;
15
+
16
+ @media (min-width: 48em) {
17
+ max-height: 32px;
18
+ }
19
+ }
20
+
21
+ .pure-menu-link {
22
+ color: #ffffff;
23
+ padding: 0.85em 1em;
24
+ cursor: pointer;
25
+
26
+ @media (min-width: 48em) {
27
+ padding: 0.55em 1em;
28
+ }
29
+
30
+ .fa {
31
+ margin-right: 0.2em;
32
+ }
33
+ }
34
+
35
+ .fade-left, .fade-right {
36
+ position: absolute;
37
+ top: 0;
38
+ width: 64px;
39
+ height: 40px;
40
+ color: #ffffff;
41
+ font-size: 1.5em;
42
+ line-height: 1.9em;
43
+ pointer-events: none;
44
+ display: none;
45
+
46
+ @media (min-width: 35.5em) {
47
+ pointer-events: auto;
48
+ }
49
+
50
+ @media (min-width: 48em) {
51
+ height: 32px;
52
+ line-height: 1.5em;
53
+ }
54
+
55
+ .fa {
56
+ cursor: pointer;
57
+ padding: 0.25em;
58
+ }
59
+ }
60
+
61
+ .fade-left {
62
+ left: 0;
63
+ text-align: left;
64
+ background: image-url('menu-fade-left.png');
65
+
66
+ .fa {
67
+ padding-left: 0.5em;
68
+ }
69
+ }
70
+
71
+ .fade-right {
72
+ right: 0;
73
+ text-align: right;
74
+ background: image-url('menu-fade-right.png');
75
+
76
+ .fa {
77
+ padding-right: 0.5em;
78
+ }
79
+ }
80
+ }
81
+
82
+ #main-menu {
83
+ border-top: 2px solid darken($menu-color, 20%);
84
+ background: $menu-color;
85
+ max-height: 42px;
86
+
87
+ @media (min-width: 48em) {
88
+ max-height: 34px;
89
+ }
90
+
91
+ .sub-menu {
92
+ display: none !important;
93
+ }
94
+
95
+ li.pure-menu-item {
96
+ &.current, &.menu-active {
97
+ .pure-menu-link {
98
+ background: darken($menu-color, 7.5%);
99
+ }
100
+ }
101
+ }
102
+
103
+ .pure-menu-link {
104
+ &:active, &:focus, &:hover {
105
+ background: darken($menu-color, 7.5%);
106
+ }
107
+ }
108
+
109
+ &.navigating {
110
+ li.pure-menu-item {
111
+ &.current:not(.menu-active) {
112
+ .pure-menu-link:not(:hover) {
113
+ background: none;
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }
119
+
120
+ #sub-menu {
121
+ background: darken($menu-color, 7.5%);
122
+ border-top: 1px solid darken($menu-color, 12.5%);
123
+ max-height: 41px;
124
+
125
+ @media (min-width: 48em) {
126
+ max-height: 33px;
127
+ }
128
+
129
+ li.pure-menu-item {
130
+ &.current {
131
+ .pure-menu-link {
132
+ background: darken($menu-color, 12.5%);
133
+ }
134
+ }
135
+ }
136
+
137
+ .pure-menu-link {
138
+ &:active, &:focus, &:hover {
139
+ background: darken($menu-color, 12.5%);
140
+ }
141
+ }
142
+ }
143
+
144
+ #main-menu-container:hover #sub-menu {
145
+ display: block;
146
+ }
@@ -0,0 +1,122 @@
1
+ body {
2
+ &.no-scroll {
3
+ overflow: hidden;
4
+ }
5
+ }
6
+
7
+ .modal-container {
8
+ position: fixed;
9
+ top: 0;
10
+ left: 0;
11
+ z-index: 1000;
12
+ width: 100%;
13
+ height: 100%;
14
+ }
15
+
16
+ .modal-background {
17
+ position: absolute;
18
+ top: 0;
19
+ left: 0;
20
+ background: rgba(0, 0, 0, 0.5);
21
+ width: 100%;
22
+ height: 100%;
23
+ }
24
+
25
+ .modal-loading {
26
+ background: image-url('pending.gif');
27
+ background-size: 96px 48px;
28
+ background-position: 50% 50%;
29
+ background-repeat: no-repeat;
30
+ top: 146px;
31
+ width: 100%;
32
+ height: 48px;
33
+ position: absolute;
34
+ top: 130px;
35
+ opacity: 0;
36
+ -webkit-transition: all 0.2s linear;
37
+ -moz-transition: all 0.2s linear;
38
+ -ms-transition: all 0.2s linear;
39
+ -o-transition: all 0.2s linear;
40
+ transition: all 0.2s linear;
41
+ }
42
+
43
+ .modal {
44
+ background: #ffffff;
45
+ border: 4px solid #cccccc;
46
+ width: 90%;
47
+ max-width: 480px;
48
+ max-height: 94%;
49
+ margin: 0 auto;
50
+ position: relative;
51
+ top: 16px;
52
+ overflow: hidden;
53
+ -webkit-box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.3);
54
+ -moz-box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.3);
55
+ box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.3);
56
+
57
+ @media (min-width: 35.5em) {
58
+ top: 75px;
59
+ width: 480px;
60
+ max-width: none;
61
+ }
62
+
63
+ > span.fa-question-circle,
64
+ > span.fa-info-circle,
65
+ > span.fa-exclamation-circle {
66
+ color: #f4f4f4;
67
+ position: absolute;
68
+ bottom: -0.2em;
69
+ left: -0.2em;
70
+ font-size: 12em;
71
+ }
72
+ }
73
+
74
+ .modal-body {
75
+ z-index: 1001;
76
+ position: relative;
77
+ margin: 0 1em;
78
+ }
79
+
80
+ .modal-controls {
81
+ padding: 1em;
82
+ padding-top: 0;
83
+ z-index: 1001;
84
+ position: relative;
85
+ text-align: right;
86
+
87
+ .pure-button {
88
+ margin-left: 0.5em;
89
+ min-width: 70px;
90
+ }
91
+ }
92
+
93
+ .modal.confirm, .modal.alert {
94
+ top: 130px;
95
+
96
+ @media (min-width: 48em) {
97
+ width: 480px;
98
+ }
99
+
100
+ .modal-body {
101
+ margin: 1.5em 1em;
102
+ }
103
+ }
104
+
105
+ .modal.ajax, .modal.html {
106
+ @media (min-width: 48em) {
107
+ top: 130px;
108
+ width: 35.5em;
109
+ }
110
+
111
+ @media (min-width: 64em) {
112
+ width: 48em;
113
+ }
114
+
115
+ @media (min-width: 80em) {
116
+ min-width: 64em;
117
+ }
118
+ }
119
+
120
+ .modal.ajax {
121
+ display: none;
122
+ }