administrate 0.0.8 → 0.0.9
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/administrate/components/table.js +2 -2
- data/app/assets/stylesheets/administrate/_sidebar.scss +14 -29
- data/app/assets/stylesheets/administrate/_typography.scss +7 -0
- data/app/assets/stylesheets/administrate/application.scss +1 -0
- data/app/assets/stylesheets/administrate/base/_buttons.scss +1 -1
- data/app/assets/stylesheets/administrate/base/_forms.scss +4 -4
- data/app/assets/stylesheets/administrate/base/_tables.scss +2 -44
- data/app/assets/stylesheets/administrate/base/_typography.scss +1 -2
- data/app/assets/stylesheets/administrate/base/_variables.scss +4 -8
- data/app/assets/stylesheets/administrate/base/extends/_flashes.scss +15 -19
- data/app/assets/stylesheets/administrate/components/_header.scss +4 -4
- data/app/assets/stylesheets/administrate/components/_table.scss +6 -2
- data/app/assets/stylesheets/administrate/layout.scss +7 -9
- data/app/controllers/administrate/application_controller.rb +4 -8
- data/app/views/administrate/application/_flashes.html.erb +2 -2
- data/app/views/administrate/application/_sidebar.html.erb +3 -4
- data/app/views/administrate/application/_table.html.erb +3 -3
- data/app/views/administrate/application/show.html.erb +1 -1
- data/lib/administrate/engine.rb +6 -0
- data/lib/administrate/version.rb +1 -1
- data/lib/generators/administrate/install/templates/application_controller.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bd49855b92730b3acde97d6015d92d54d0dd858
|
4
|
+
data.tar.gz: 61010bf3e723a482ba3c1c3c5032c046c4a54592
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b55d4c98a0a5189a2b9fecd4a7b4fae8976b5664561826bf6a79b84ca1693234273d8948ecdf4e4502eb4770b514bb64eb629528e464e3585bf57c21752da4d1
|
7
|
+
data.tar.gz: 5212a82a96c557a2096ea8c3581022d24dbee052150903b346279ed52191bb90e1cd462cda21dfe0165cef6b65c36eb37aad522100cc28b0ae9371e1d3b22319
|
@@ -1,48 +1,33 @@
|
|
1
1
|
.sidebar {
|
2
|
-
flex: 0 0
|
3
|
-
|
2
|
+
flex: 0 0 auto;
|
3
|
+
max-width: 12em;
|
4
4
|
overflow-y: auto;
|
5
|
+
padding: 0 $base-spacing;
|
5
6
|
|
6
|
-
|
7
|
-
align-items: center;
|
8
|
-
display: flex;
|
7
|
+
&__logo {
|
9
8
|
height: 6em;
|
10
|
-
justify-content: space-between;
|
11
|
-
padding: 0 1em;
|
12
9
|
|
13
10
|
img {
|
14
11
|
display: block;
|
15
|
-
height:
|
16
|
-
padding-top:
|
12
|
+
height: 100%;
|
13
|
+
padding-top: $base-spacing;
|
17
14
|
}
|
18
|
-
|
19
|
-
&-heading {
|
20
|
-
color: $grey-0;
|
21
|
-
font-size: 1.6em;
|
22
|
-
}
|
23
|
-
}
|
24
|
-
|
25
|
-
&-list {
|
26
|
-
@include fill-parent;
|
27
15
|
}
|
28
16
|
|
29
|
-
|
17
|
+
&__link {
|
30
18
|
@include fill-parent;
|
31
|
-
|
32
|
-
border-top-left-radius: 4px;
|
33
|
-
color: $grey-0;
|
19
|
+
color: $base-font-color;
|
34
20
|
display: block;
|
35
|
-
padding:
|
36
|
-
transition:
|
21
|
+
padding-top: $base-spacing;
|
22
|
+
transition: color 0.05s linear;
|
37
23
|
|
38
|
-
|
39
|
-
|
40
|
-
|
24
|
+
&--active {
|
25
|
+
color: $blue;
|
26
|
+
font-weight: $bold-font-weight;
|
41
27
|
}
|
42
28
|
|
43
29
|
&:hover {
|
44
|
-
|
45
|
-
background-color: $sidebar-hover-color;
|
30
|
+
color: $blue;
|
46
31
|
}
|
47
32
|
}
|
48
33
|
}
|
@@ -29,16 +29,16 @@ label {
|
|
29
29
|
textarea,
|
30
30
|
#{$all-text-inputs},
|
31
31
|
select {
|
32
|
-
@include box-sizing(border-box);
|
33
|
-
@include transition(border-color);
|
34
32
|
background-color: white;
|
35
33
|
border-radius: $form-border-radius;
|
36
34
|
border: 1px solid $form-border-color;
|
37
35
|
box-shadow: $form-box-shadow;
|
36
|
+
box-sizing: border-box;
|
38
37
|
font-family: $form-font-family;
|
39
38
|
font-size: $form-font-size;
|
40
39
|
margin-bottom: $base-spacing / 2;
|
41
40
|
padding: ($base-spacing / 3) ($base-spacing / 3);
|
41
|
+
transition: border-color;
|
42
42
|
width: 100%;
|
43
43
|
|
44
44
|
&:hover {
|
@@ -57,7 +57,7 @@ textarea {
|
|
57
57
|
}
|
58
58
|
|
59
59
|
input[type="search"] {
|
60
|
-
|
60
|
+
appearance: none;
|
61
61
|
}
|
62
62
|
|
63
63
|
input[type="checkbox"],
|
@@ -72,7 +72,7 @@ input[type="file"] {
|
|
72
72
|
}
|
73
73
|
|
74
74
|
select {
|
75
|
-
|
75
|
+
appearance: none;
|
76
76
|
background: image-url("dropdown.svg") no-repeat 97% 50% / 10px;
|
77
77
|
margin-bottom: $base-spacing;
|
78
78
|
}
|
@@ -1,65 +1,23 @@
|
|
1
1
|
table {
|
2
|
-
border: $base-border;
|
3
2
|
border-collapse: separate;
|
4
|
-
border-radius: $base-border-radius;
|
5
|
-
margin: ($base-spacing / 2) 0;
|
6
|
-
table-layout: fixed;
|
7
3
|
width: 100%;
|
8
4
|
}
|
9
5
|
|
10
|
-
thead {
|
11
|
-
background-color: $grey-0;
|
12
|
-
}
|
13
|
-
|
14
6
|
th {
|
15
7
|
border-bottom: $dark-border;
|
16
|
-
|
17
|
-
font-size: $small-font-size;
|
18
|
-
font-weight: $normal-font-weight;
|
19
|
-
letter-spacing: 0.0357em;
|
20
|
-
padding: ($base-spacing / 2) 0;
|
8
|
+
padding-bottom: $small-spacing;
|
21
9
|
text-align: left;
|
22
|
-
text-transform: uppercase;
|
23
10
|
}
|
24
11
|
|
25
12
|
td {
|
26
13
|
border-bottom: $base-border;
|
27
14
|
overflow: hidden;
|
28
|
-
padding:
|
15
|
+
padding: $small-spacing 0;
|
29
16
|
text-overflow: ellipsis;
|
30
17
|
white-space: nowrap;
|
31
18
|
word-wrap: normal;
|
32
19
|
}
|
33
20
|
|
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
21
|
td,
|
64
22
|
th {
|
65
23
|
&:first-child {
|
@@ -1,6 +1,5 @@
|
|
1
1
|
body {
|
2
2
|
-webkit-font-smoothing: antialiased;
|
3
|
-
background-color: $base-background-color;
|
4
3
|
color: $base-font-color;
|
5
4
|
font-family: $base-font-family;
|
6
5
|
font-size: $base-font-size;
|
@@ -48,9 +47,9 @@ p {
|
|
48
47
|
}
|
49
48
|
|
50
49
|
a {
|
51
|
-
@include transition(color 0.1s linear);
|
52
50
|
color: $base-link-color;
|
53
51
|
text-decoration: none;
|
52
|
+
transition: color 0.1s linear;
|
54
53
|
|
55
54
|
&:hover {
|
56
55
|
color: $hover-link-color;
|
@@ -27,6 +27,7 @@ $header-line-height: 1.25;
|
|
27
27
|
$base-border-radius: 3px;
|
28
28
|
$base-spacing: $base-line-height * 1em;
|
29
29
|
$base-z-index: 0;
|
30
|
+
$small-spacing: $base-spacing / 2;
|
30
31
|
|
31
32
|
// Transitions
|
32
33
|
$base-easing: cubic-bezier(0.215, 0.610, 0.355, 1);
|
@@ -37,8 +38,8 @@ $base-transition: all $base-timing $base-easing;
|
|
37
38
|
$dark-blue: #293f53;
|
38
39
|
$blue: #2a94d6;
|
39
40
|
$light-blue: #4eb1cb;
|
40
|
-
$light-red: #
|
41
|
-
$light-yellow: #
|
41
|
+
$light-red: #c77067;
|
42
|
+
$light-yellow: #f0cd66;
|
42
43
|
$light-green: #4ab471;
|
43
44
|
|
44
45
|
$form-field-background-color: #fff;
|
@@ -52,8 +53,7 @@ $grey-5: #4e6a68;
|
|
52
53
|
$grey-6: #344346;
|
53
54
|
$grey-7: #293f54;
|
54
55
|
|
55
|
-
|
56
|
-
$base-background-color: $dark-blue;
|
56
|
+
$base-background-color: $grey-0;
|
57
57
|
|
58
58
|
// Font Colors
|
59
59
|
$base-font-color: $grey-7;
|
@@ -65,10 +65,6 @@ $hover-link-color: shade($blue, 10);
|
|
65
65
|
$base-button-color: $base-link-color;
|
66
66
|
$hover-button-color: $hover-link-color;
|
67
67
|
|
68
|
-
// Sidebar Colors
|
69
|
-
$sidebar-active-color: $base-link-color;
|
70
|
-
$sidebar-hover-color: $hover-link-color;
|
71
|
-
|
72
68
|
// Flash Colors
|
73
69
|
$alert-color: $light-yellow;
|
74
70
|
$error-color: $light-red;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
@mixin flash($color) {
|
2
2
|
background: $color;
|
3
3
|
color: darken($color, 60);
|
4
|
+
margin-bottom: $base-spacing;
|
4
5
|
|
5
6
|
a {
|
6
7
|
color: darken($color, 70);
|
@@ -11,28 +12,23 @@
|
|
11
12
|
}
|
12
13
|
}
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
margin-bottom: $base-spacing / 2;
|
15
|
+
.flash {
|
16
|
+
border-radius: $base-border-radius;
|
17
17
|
padding: $base-spacing / 2;
|
18
|
-
}
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
}
|
19
|
+
&--alert {
|
20
|
+
@include flash($alert-color);
|
21
|
+
}
|
24
22
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}
|
23
|
+
&--error {
|
24
|
+
@include flash($error-color);
|
25
|
+
}
|
29
26
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
27
|
+
&--notice {
|
28
|
+
@include flash($notice-color);
|
29
|
+
}
|
34
30
|
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
&--success {
|
32
|
+
@include flash($success-color);
|
33
|
+
}
|
38
34
|
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
.header {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
align-items: flex-end;
|
3
|
+
display: flex;
|
4
|
+
justify-content: space-between;
|
5
|
+
margin-bottom: $base-spacing;
|
6
6
|
|
7
7
|
&-heading {
|
8
8
|
margin-top: 0;
|
@@ -1,11 +1,15 @@
|
|
1
|
-
.
|
1
|
+
.table__row {
|
2
2
|
background-color: $white;
|
3
3
|
border-left: 2px solid transparent;
|
4
4
|
transition: $base-transition;
|
5
5
|
|
6
6
|
&:hover {
|
7
|
-
background-color: $
|
7
|
+
background-color: $base-background-color;
|
8
8
|
border-left-color: $blue;
|
9
9
|
cursor: pointer;
|
10
10
|
}
|
11
11
|
}
|
12
|
+
|
13
|
+
.table__action--destroy {
|
14
|
+
color: $error-color;
|
15
|
+
}
|
@@ -6,23 +6,21 @@ body,
|
|
6
6
|
}
|
7
7
|
|
8
8
|
body {
|
9
|
-
background: $base-background-color;
|
9
|
+
background-color: $base-background-color;
|
10
10
|
}
|
11
11
|
|
12
12
|
.main {
|
13
13
|
@include clearfix;
|
14
|
-
|
15
|
-
|
14
|
+
align-items: stretch;
|
15
|
+
display: flex;
|
16
16
|
margin: 0 auto;
|
17
17
|
max-width: 100em;
|
18
18
|
}
|
19
19
|
|
20
20
|
.content {
|
21
|
-
@include
|
22
|
-
|
23
|
-
|
24
|
-
height: 100%;
|
25
|
-
min-height: 100%;
|
21
|
+
@include card(1);
|
22
|
+
background-color: $white;
|
23
|
+
flex: 1;
|
26
24
|
overflow-y: auto;
|
27
|
-
padding:
|
25
|
+
padding: $base-spacing;
|
28
26
|
}
|
@@ -1,9 +1,3 @@
|
|
1
|
-
require "administrate/namespace"
|
2
|
-
require "administrate/page/form"
|
3
|
-
require "administrate/page/table"
|
4
|
-
require "administrate/page/show"
|
5
|
-
require "administrate/resource_resolver"
|
6
|
-
|
7
1
|
module Administrate
|
8
2
|
class ApplicationController < ActionController::Base
|
9
3
|
def index
|
@@ -65,10 +59,12 @@ module Administrate
|
|
65
59
|
|
66
60
|
private
|
67
61
|
|
68
|
-
helper_method :
|
69
|
-
def
|
62
|
+
helper_method :nav_link_state
|
63
|
+
def nav_link_state(resource)
|
70
64
|
if resource_name.to_s.pluralize == resource.to_s
|
71
65
|
:active
|
66
|
+
else
|
67
|
+
:inactive
|
72
68
|
end
|
73
69
|
end
|
74
70
|
|
@@ -1,7 +1,6 @@
|
|
1
|
-
<ul class="
|
2
|
-
<div class="
|
1
|
+
<ul class="sidebar__list">
|
2
|
+
<div class="sidebar__logo">
|
3
3
|
<%= image_tag "logo.svg" %>
|
4
|
-
<h1 class="sidebar-logo-heading">Administrate</h1>
|
5
4
|
</div>
|
6
5
|
|
7
6
|
<% DashboardManifest::DASHBOARDS.each do |resource| %>
|
@@ -9,7 +8,7 @@
|
|
9
8
|
<%= link_to(
|
10
9
|
resource.to_s.titleize,
|
11
10
|
[Administrate::NAMESPACE, resource],
|
12
|
-
class:
|
11
|
+
class: "sidebar__link sidebar__link--#{nav_link_state(resource)}"
|
13
12
|
) %>
|
14
13
|
</li>
|
15
14
|
<% end %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<thead>
|
3
3
|
<tr>
|
4
4
|
<% table_presenter.attribute_names.each do |attr_name| %>
|
5
|
-
<th><%= attr_name.to_s.titleize %></th>
|
5
|
+
<th class="attribute-label"><%= attr_name.to_s.titleize %></th>
|
6
6
|
<% end %>
|
7
7
|
<th colspan="2"></th>
|
8
8
|
</tr>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
<tbody>
|
12
12
|
<% resources.each do |resource| %>
|
13
|
-
<tr class="
|
13
|
+
<tr class="table__row"
|
14
14
|
role="link"
|
15
15
|
tabindex="0"
|
16
16
|
data-url="<%= polymorphic_path([Administrate::NAMESPACE, resource]) -%>"
|
@@ -30,7 +30,7 @@
|
|
30
30
|
<td><%= link_to(
|
31
31
|
t("administrate.actions.destroy"),
|
32
32
|
[Administrate::NAMESPACE, resource],
|
33
|
-
class: "
|
33
|
+
class: "table__action--destroy",
|
34
34
|
method: :delete,
|
35
35
|
data: { confirm: t("administrate.actions.confirm") }
|
36
36
|
) %></td>
|
data/lib/administrate/engine.rb
CHANGED
@@ -2,6 +2,12 @@ require "neat"
|
|
2
2
|
require "normalize-rails"
|
3
3
|
require "selectize-rails"
|
4
4
|
|
5
|
+
require "administrate/namespace"
|
6
|
+
require "administrate/page/form"
|
7
|
+
require "administrate/page/show"
|
8
|
+
require "administrate/page/table"
|
9
|
+
require "administrate/resource_resolver"
|
10
|
+
|
5
11
|
module Administrate
|
6
12
|
class Engine < ::Rails::Engine
|
7
13
|
isolate_namespace Administrate
|
data/lib/administrate/version.rb
CHANGED
@@ -14,7 +14,7 @@ class Admin::ApplicationController < Administrate::ApplicationController
|
|
14
14
|
def index
|
15
15
|
super
|
16
16
|
|
17
|
-
flash[:alert] =
|
17
|
+
flash.now[:alert] =
|
18
18
|
"For performance, Administrate limits the index page to show 20 items.
|
19
19
|
Customize this action to update/remove the limit,
|
20
20
|
or implement the pagination library of your choice."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administrate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grayson Wright
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: neat
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.6'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: autoprefixer-rails
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
description: |
|
84
98
|
Administrate is heavily inspired by projects like Rails Admin and ActiveAdmin,
|
85
99
|
but aims to provide a better user experience for site admins,
|
@@ -106,6 +120,7 @@ files:
|
|
106
120
|
- app/assets/javascripts/administrate/components/table.js
|
107
121
|
- app/assets/stylesheets/administrate/_show.sass
|
108
122
|
- app/assets/stylesheets/administrate/_sidebar.scss
|
123
|
+
- app/assets/stylesheets/administrate/_typography.scss
|
109
124
|
- app/assets/stylesheets/administrate/application.scss
|
110
125
|
- app/assets/stylesheets/administrate/base/_base.scss
|
111
126
|
- app/assets/stylesheets/administrate/base/_buttons.scss
|