administrate 0.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of administrate might be problematic. Click here for more details.

Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/Rakefile +37 -0
  4. data/app/assets/javascripts/administrate/application.js +3 -0
  5. data/app/assets/javascripts/administrate/components/table.js +17 -0
  6. data/app/assets/stylesheets/administrate/_show.sass +16 -0
  7. data/app/assets/stylesheets/administrate/_sidebar.scss +48 -0
  8. data/app/assets/stylesheets/administrate/application.scss +14 -0
  9. data/app/assets/stylesheets/administrate/base/_base.scss +24 -0
  10. data/app/assets/stylesheets/administrate/base/_buttons.scss +11 -0
  11. data/app/assets/stylesheets/administrate/base/_forms.scss +78 -0
  12. data/app/assets/stylesheets/administrate/base/_grid-settings.scss +15 -0
  13. data/app/assets/stylesheets/administrate/base/_lists.scss +31 -0
  14. data/app/assets/stylesheets/administrate/base/_tables.scss +74 -0
  15. data/app/assets/stylesheets/administrate/base/_typography.scss +93 -0
  16. data/app/assets/stylesheets/administrate/base/_variables.scss +93 -0
  17. data/app/assets/stylesheets/administrate/base/extends/_button.scss +23 -0
  18. data/app/assets/stylesheets/administrate/base/extends/_clearfix.scss +3 -0
  19. data/app/assets/stylesheets/administrate/base/extends/_errors.scss +11 -0
  20. data/app/assets/stylesheets/administrate/base/extends/_flashes.scss +38 -0
  21. data/app/assets/stylesheets/administrate/base/extends/_hide-text.scss +3 -0
  22. data/app/assets/stylesheets/administrate/components/_components.scss +3 -0
  23. data/app/assets/stylesheets/administrate/components/_form.scss +31 -0
  24. data/app/assets/stylesheets/administrate/components/_header.scss +10 -0
  25. data/app/assets/stylesheets/administrate/components/_table.scss +11 -0
  26. data/app/assets/stylesheets/administrate/layout.scss +28 -0
  27. data/app/assets/stylesheets/administrate/mixins/_mixins.scss +1 -0
  28. data/app/assets/stylesheets/administrate/mixins/_shadow.scss +35 -0
  29. data/app/controllers/administrate/application_controller.rb +127 -0
  30. data/app/helpers/administrate/application_helper.rb +7 -0
  31. data/app/views/administrate/application/_flashes.html.erb +7 -0
  32. data/app/views/administrate/application/_form.html.erb +28 -0
  33. data/app/views/administrate/application/_javascript.html.erb +10 -0
  34. data/app/views/administrate/application/_sidebar.html.erb +16 -0
  35. data/app/views/administrate/application/_table.html.erb +44 -0
  36. data/app/views/administrate/application/edit.html.erb +6 -0
  37. data/app/views/administrate/application/index.html.erb +10 -0
  38. data/app/views/administrate/application/new.html.erb +6 -0
  39. data/app/views/administrate/application/show.html.erb +11 -0
  40. data/app/views/fields/form/_belongs_to.html.erb +7 -0
  41. data/app/views/fields/form/_email.html.erb +2 -0
  42. data/app/views/fields/form/_has_many.html.erb +11 -0
  43. data/app/views/fields/form/_image.html.erb +2 -0
  44. data/app/views/fields/form/_string.html.erb +2 -0
  45. data/app/views/fields/index/_belongs_to.html.erb +3 -0
  46. data/app/views/fields/index/_email.html.erb +1 -0
  47. data/app/views/fields/index/_has_many.html.erb +1 -0
  48. data/app/views/fields/index/_image.html.erb +1 -0
  49. data/app/views/fields/index/_string.html.erb +1 -0
  50. data/app/views/fields/show/_belongs_to.html.erb +3 -0
  51. data/app/views/fields/show/_email.html.erb +1 -0
  52. data/app/views/fields/show/_has_many.html.erb +5 -0
  53. data/app/views/fields/show/_image.html.erb +1 -0
  54. data/app/views/fields/show/_string.html.erb +1 -0
  55. data/app/views/layouts/administrate/application.html.erb +28 -0
  56. data/config/locales/administrate.en.yml +7 -0
  57. data/config/routes.rb +2 -0
  58. data/lib/administrate.rb +4 -0
  59. data/lib/administrate/base_dashboard.rb +36 -0
  60. data/lib/administrate/engine.rb +8 -0
  61. data/lib/administrate/fields/base.rb +31 -0
  62. data/lib/administrate/fields/belongs_to.rb +19 -0
  63. data/lib/administrate/fields/email.rb +8 -0
  64. data/lib/administrate/fields/has_many.rb +38 -0
  65. data/lib/administrate/fields/image.rb +8 -0
  66. data/lib/administrate/fields/string.rb +8 -0
  67. data/lib/administrate/namespace.rb +3 -0
  68. data/lib/administrate/pages/base.rb +28 -0
  69. data/lib/administrate/pages/form.rb +28 -0
  70. data/lib/administrate/pages/show.rb +24 -0
  71. data/lib/administrate/pages/table.rb +21 -0
  72. data/lib/administrate/version.rb +3 -0
  73. data/lib/generators/administrate/dashboard/USAGE +9 -0
  74. data/lib/generators/administrate/dashboard/dashboard_generator.rb +44 -0
  75. data/lib/generators/administrate/dashboard/templates/controller.rb.erb +12 -0
  76. data/lib/generators/administrate/dashboard/templates/dashboard.rb.erb +50 -0
  77. data/lib/generators/administrate/install/install_generator.rb +52 -0
  78. data/lib/generators/administrate/install/templates/application_controller.rb +13 -0
  79. data/lib/generators/administrate/install/templates/dashboard_manifest.rb.erb +29 -0
  80. data/lib/generators/administrate/install/templates/routes.rb +7 -0
  81. data/lib/tasks/administrate_tasks.rake +4 -0
  82. metadata +179 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3f48fa7be0e027708d34f92c0584f31720d85d83
4
+ data.tar.gz: 05d560cc12794547edfeecf5076da5335b1d13bb
5
+ SHA512:
6
+ metadata.gz: b7eb8fd1f7243912e881c98cbd92a21b4570c99ac68a02bb6e1e7a9d5ad7b32d3eeeefa3686b13ab54be37d7755942a5b5f1a942c9fe8a7eab23555576564de4
7
+ data.tar.gz: a810977c34fe3d1df147532261d786e67f9a699349dd0b3d5b82a95922260128a76e17c6ec9eca1452e97e57c0780096bd1b0096d1b997d0d2fc254865b44e40
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2015 Grayson Wright
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,37 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Administrate'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+ load 'rails/tasks/statistics.rake'
22
+
23
+
24
+
25
+ Bundler::GemHelper.install_tasks
26
+
27
+ require 'rake/testtask'
28
+
29
+ Rake::TestTask.new(:test) do |t|
30
+ t.libs << 'lib'
31
+ t.libs << 'test'
32
+ t.pattern = 'test/**/*_test.rb'
33
+ t.verbose = false
34
+ end
35
+
36
+
37
+ task default: :test
@@ -0,0 +1,3 @@
1
+ //= require jquery
2
+ //= require jquery_ujs
3
+ //= require_tree .
@@ -0,0 +1,17 @@
1
+ $(function() {
2
+ var keycodes = { space: 32, enter: 13 };
3
+
4
+ var visitDataUrl = function(event) {
5
+ if (event.type=="click" ||
6
+ event.keyCode == keycodes.space ||
7
+ event.keyCode == keycodes.enter) {
8
+
9
+ if(!event.target.href) {
10
+ window.location = $(event.target).closest("tr").data("url");
11
+ }
12
+ }
13
+ };
14
+
15
+ $("table").on("click", ".table-row", visitDataUrl);
16
+ $("table").on("keydown", ".table-row", visitDataUrl);
17
+ });
@@ -0,0 +1,16 @@
1
+ h1
2
+ margin-top: 1rem
3
+
4
+ dl
5
+ @include fill-parent
6
+ @include clearfix
7
+ margin-top: $gutter
8
+ dt
9
+ @include span-columns(2 of 12)
10
+ margin-top: 0
11
+ text-align: right
12
+ color: #bbb
13
+ dd
14
+ @include span-columns(10 of 12)
15
+ @include omega
16
+ margin-bottom: $gutter
@@ -0,0 +1,48 @@
1
+ .sidebar {
2
+ flex: 0 0 280px;
3
+ height: 100%;
4
+ overflow-y: auto;
5
+
6
+ &-logo {
7
+ align-items: center;
8
+ display: flex;
9
+ height: 6em;
10
+ justify-content: space-between;
11
+ padding: 0 1em;
12
+
13
+ img {
14
+ display: block;
15
+ height: 80%;
16
+ padding-top: 1em;
17
+ }
18
+
19
+ &-heading {
20
+ color: $grey-0;
21
+ font-size: 1.6em;
22
+ }
23
+ }
24
+
25
+ &-list {
26
+ @include fill-parent;
27
+ }
28
+
29
+ a {
30
+ @include fill-parent;
31
+ border-bottom-left-radius: 4px;
32
+ border-top-left-radius: 4px;
33
+ color: $grey-0;
34
+ display: block;
35
+ padding: 0.5em 1em;
36
+ transition: background-color 0.05s linear;
37
+
38
+ &.active {
39
+ @include card(1);
40
+ background-color: $sidebar-active-color;
41
+ }
42
+
43
+ &:hover {
44
+ @include card(1);
45
+ background-color: $sidebar-hover-color;
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,14 @@
1
+ @charset "utf-8";
2
+
3
+ @import "normalize-rails";
4
+ @import "bourbon";
5
+ @import "base/grid-settings";
6
+ @import "neat";
7
+ @import "mixins/mixins";
8
+ @import "base/base";
9
+
10
+ @import "layout";
11
+ @import "sidebar";
12
+ @import "show";
13
+
14
+ @import "components/components";
@@ -0,0 +1,24 @@
1
+ /* Bitters 0.10.0
2
+ * http://bitters.bourbon.io
3
+ * Copyright 2013–2014 thoughtbot, inc.
4
+ * MIT License */
5
+
6
+ // Variables
7
+ @import "variables";
8
+
9
+ // Neat Settings -- uncomment if using Neat -- must be imported before Neat
10
+ // @import "grid-settings";
11
+
12
+ // Extends
13
+ @import "extends/button";
14
+ @import "extends/clearfix";
15
+ @import "extends/errors";
16
+ @import "extends/flashes";
17
+ @import "extends/hide-text";
18
+
19
+ // Typography and Elements
20
+ @import "typography";
21
+ @import "forms";
22
+ @import "tables";
23
+ @import "lists";
24
+ @import "buttons";
@@ -0,0 +1,11 @@
1
+ button,
2
+ input[type="submit"],
3
+ .button {
4
+ @extend %button;
5
+ @include appearance(none);
6
+ border: none;
7
+ cursor: pointer;
8
+ user-select: none;
9
+ vertical-align: middle;
10
+ white-space: nowrap;
11
+ }
@@ -0,0 +1,78 @@
1
+ fieldset {
2
+ background: lighten($base-border-color, 10);
3
+ border: $base-border;
4
+ margin: 0 0 ($base-spacing / 2) 0;
5
+ padding: $base-spacing;
6
+ }
7
+
8
+ input,
9
+ label,
10
+ select {
11
+ display: block;
12
+ font-family: $form-font-family;
13
+ font-size: $form-font-size;
14
+ }
15
+
16
+ label {
17
+ font-weight: bold;
18
+ margin-bottom: $base-spacing / 4;
19
+
20
+ &.required:after {
21
+ content: "*";
22
+ }
23
+
24
+ abbr {
25
+ display: none;
26
+ }
27
+ }
28
+
29
+ textarea,
30
+ #{$all-text-inputs},
31
+ select {
32
+ @include box-sizing(border-box);
33
+ @include transition(border-color);
34
+ background-color: white;
35
+ border-radius: $form-border-radius;
36
+ border: 1px solid $form-border-color;
37
+ box-shadow: $form-box-shadow;
38
+ font-family: $form-font-family;
39
+ font-size: $form-font-size;
40
+ margin-bottom: $base-spacing / 2;
41
+ padding: ($base-spacing / 3) ($base-spacing / 3);
42
+ width: 100%;
43
+
44
+ &:hover {
45
+ border-color: $form-border-color-hover;
46
+ }
47
+
48
+ &:focus {
49
+ border-color: $form-border-color-focus;
50
+ box-shadow: $form-box-shadow-focus;
51
+ outline: none;
52
+ }
53
+ }
54
+
55
+ textarea {
56
+ resize: vertical;
57
+ }
58
+
59
+ input[type="search"] {
60
+ @include appearance(none);
61
+ }
62
+
63
+ input[type="checkbox"],
64
+ input[type="radio"] {
65
+ display: inline;
66
+ margin-right: $base-spacing / 4;
67
+ }
68
+
69
+ input[type="file"] {
70
+ padding-bottom: $base-spacing / 2;
71
+ width: 100%;
72
+ }
73
+
74
+ select {
75
+ @include appearance(none);
76
+ background: image-url("dropdown.svg") no-repeat 97% 50% / 10px;
77
+ margin-bottom: $base-spacing;
78
+ }
@@ -0,0 +1,15 @@
1
+ @import "neat-helpers"; // or "../neat/neat-helpers" when not in Rails
2
+
3
+ // Neat Overrides
4
+ // $column: 90px;
5
+ // $grid-columns: 12;
6
+ // $max-width: em(1088);
7
+
8
+ $gutter: 2em;
9
+
10
+ // Neat Breakpoints
11
+ $medium-screen: em(640);
12
+ $large-screen: em(860);
13
+
14
+ $medium-screen-up: new-breakpoint(min-width $medium-screen 4);
15
+ $large-screen-up: new-breakpoint(min-width $large-screen 8);
@@ -0,0 +1,31 @@
1
+ ul,
2
+ ol {
3
+ margin: 0;
4
+ padding: 0;
5
+ list-style-type: none;
6
+
7
+ &%default-ul {
8
+ list-style-type: disc;
9
+ margin-bottom: $base-spacing / 2;
10
+ padding-left: $base-spacing;
11
+ }
12
+
13
+ &%default-ol {
14
+ list-style-type: decimal;
15
+ margin-bottom: $base-spacing / 2;
16
+ padding-left: $base-spacing;
17
+ }
18
+ }
19
+
20
+ dl {
21
+ margin-bottom: $base-spacing / 2;
22
+
23
+ dt {
24
+ font-weight: bold;
25
+ margin-top: $base-spacing / 2;
26
+ }
27
+
28
+ dd {
29
+ margin: 0;
30
+ }
31
+ }
@@ -0,0 +1,74 @@
1
+ table {
2
+ border: $base-border;
3
+ border-collapse: separate;
4
+ border-radius: $base-border-radius;
5
+ margin: ($base-spacing / 2) 0;
6
+ table-layout: fixed;
7
+ width: 100%;
8
+ }
9
+
10
+ thead {
11
+ background-color: $grey-0;
12
+ }
13
+
14
+ th {
15
+ border-bottom: $dark-border;
16
+ color: $grey-4;
17
+ font-size: $small-font-size;
18
+ font-weight: $normal-font-weight;
19
+ letter-spacing: 0.0357em;
20
+ padding: ($base-spacing / 2) 0;
21
+ text-align: left;
22
+ text-transform: uppercase;
23
+ }
24
+
25
+ td {
26
+ border-bottom: $base-border;
27
+ overflow: hidden;
28
+ padding: ($base-spacing / 2) 0;
29
+ text-overflow: ellipsis;
30
+ white-space: nowrap;
31
+ word-wrap: normal;
32
+ }
33
+
34
+ tr {
35
+ &:first-child {
36
+ td {
37
+ &:first-child {
38
+ border-top-left-radius: $base-border-radius;
39
+ }
40
+
41
+ &:last-child {
42
+ border-top-right-radius: $base-border-radius;
43
+ }
44
+ }
45
+ }
46
+
47
+ &:last-child {
48
+ td {
49
+ border-bottom: 0;
50
+
51
+ &:first-child {
52
+ border-bottom-left-radius: $base-border-radius;
53
+ }
54
+
55
+ &:last-child {
56
+ border-bottom-right-radius: $base-border-radius;
57
+ }
58
+ }
59
+ }
60
+ }
61
+
62
+
63
+ td,
64
+ th {
65
+ &:first-child {
66
+ padding-left: 1em;
67
+ }
68
+ }
69
+
70
+ tr,
71
+ td,
72
+ th {
73
+ vertical-align: middle;
74
+ }
@@ -0,0 +1,93 @@
1
+ body {
2
+ -webkit-font-smoothing: antialiased;
3
+ background-color: $base-background-color;
4
+ color: $base-font-color;
5
+ font-family: $base-font-family;
6
+ font-size: $base-font-size;
7
+ line-height: $base-line-height;
8
+ }
9
+
10
+ h1,
11
+ h2,
12
+ h3,
13
+ h4,
14
+ h5,
15
+ h6 {
16
+ font-family: $header-font-family;
17
+ line-height: $header-line-height;
18
+ margin: 0;
19
+ text-rendering: optimizeLegibility; // Fix the character spacing for headings
20
+ }
21
+
22
+ h1 {
23
+ font-size: $h1-font-size;
24
+ }
25
+
26
+ h2 {
27
+ font-size: $h2-font-size;
28
+ }
29
+
30
+ h3 {
31
+ font-size: $h3-font-size;
32
+ }
33
+
34
+ h4 {
35
+ font-size: $h4-font-size;
36
+ }
37
+
38
+ h5 {
39
+ font-size: $h5-font-size;
40
+ }
41
+
42
+ h6 {
43
+ font-size: $h6-font-size;
44
+ }
45
+
46
+ p {
47
+ margin: 0 0 ($base-spacing / 2);
48
+ }
49
+
50
+ a {
51
+ @include transition(color 0.1s linear);
52
+ color: $base-link-color;
53
+ text-decoration: none;
54
+
55
+ &:hover {
56
+ color: $hover-link-color;
57
+ }
58
+
59
+ &:active, &:focus {
60
+ color: $hover-link-color;
61
+ outline: none;
62
+ }
63
+ }
64
+
65
+ hr {
66
+ border-bottom: $base-border;
67
+ border-left: none;
68
+ border-right: none;
69
+ border-top: none;
70
+ margin: $base-spacing 0;
71
+ }
72
+
73
+ img,
74
+ picture {
75
+ margin: 0;
76
+ max-width: 100%;
77
+ }
78
+
79
+ blockquote {
80
+ border-left: 2px solid $base-border-color;
81
+ color: lighten($base-font-color, 15);
82
+ margin: $base-spacing 0;
83
+ padding-left: $base-spacing / 2;
84
+ }
85
+
86
+ cite {
87
+ color: lighten($base-font-color, 25);
88
+ font-style: italic;
89
+
90
+ &:before {
91
+ content: "\2014 \00A0";
92
+ }
93
+ }