active_leonardo 0.8.1 → 0.9.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/generators/leolay/leolay_generator.rb +14 -7
- data/lib/generators/leolay/templates/styles/active/stylesheets/app/_production.scss +26 -0
- data/lib/generators/leolay/templates/styles/active/stylesheets/app/{custom_active_admin.scss → custom_active_admin.scss.erb} +3 -2
- data/lib/generators/leolay/templates/styles/active/stylesheets/app/{stylesheet.scss → stylesheet.scss.erb} +3 -17
- data/lib/test_assets/scaffold.txt +14 -14
- metadata +5 -5
- data/lib/generators/leolay/templates/styles/active/stylesheets/app/_enviroment.scss +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a95d6f8f285ff673d7210ece18e806a08e93dce
|
4
|
+
data.tar.gz: be62c05e2d2222fd63c695fa89b188530a9225b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abf9576b59b62be6af00766ed82358f5bd235962f42b2fb5fd8617fd4ffa9bc692b56c8bb815709765ab2bde85d9c4f4cf2a745a84e05ceab9688e8a42b6d9eb
|
7
|
+
data.tar.gz: 1307a773a364a0d9878c148ce76a1dcfed8fa41b08e2fb0207db35c71c3242a1358a35f34ebf7f4cdd97a09684d1186158d370dc0a8ce8d5c60b6a34d7597c9d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
0.9.0 [☰](https://github.com/marcomd/Active_Leonardo/compare/v0.8.1...v0.9.0) March 1th, 2016
|
2
|
+
------------------------------
|
3
|
+
* Different style for production env
|
4
|
+
* Improved email to name in the user model
|
5
|
+
* User.with_role(:role) now works on rails 4+
|
6
|
+
|
1
7
|
0.8.1 [☰](https://github.com/marcomd/Active_Leonardo/compare/v0.8.0...v0.8.1) February 18th, 2016
|
2
8
|
------------------------------
|
3
9
|
* Improved the documentation
|
@@ -18,9 +18,9 @@ class LeolayGenerator < Rails::Generators::Base
|
|
18
18
|
class_option :verbose, :type => :boolean, :default => true, :desc => "Run interactive mode"
|
19
19
|
|
20
20
|
def generate_layout
|
21
|
-
template "styles/#{style_name}/stylesheets/app/stylesheet.scss", "app/assets/stylesheets/#{style_name}.scss"
|
22
|
-
template "styles/#{style_name}/stylesheets/app/custom_active_admin.scss", "app/assets/stylesheets/custom_active_admin.scss"
|
23
|
-
template "styles/#{style_name}/stylesheets/app/
|
21
|
+
template "styles/#{style_name}/stylesheets/app/stylesheet.scss.erb", "app/assets/stylesheets/#{style_name}.scss.erb"
|
22
|
+
template "styles/#{style_name}/stylesheets/app/custom_active_admin.scss.erb", "app/assets/stylesheets/custom_active_admin.scss.erb"
|
23
|
+
template "styles/#{style_name}/stylesheets/app/_production.scss", "app/assets/stylesheets/_production.scss"
|
24
24
|
|
25
25
|
copy_file "app/helpers/layout_helper.rb", "app/helpers/layout_helper.rb", :force => !options.verbose?
|
26
26
|
directory "styles/#{style_name}/images", "app/assets/images/styles/#{style_name}", :force => !options.verbose?
|
@@ -101,7 +101,7 @@ class LeolayGenerator < Rails::Generators::Base
|
|
101
101
|
inject_into_class file, auth_class do
|
102
102
|
<<-FILE.gsub(/^ /, '')
|
103
103
|
ROLES = %w[admin manager user guest]
|
104
|
-
scope :with_role,
|
104
|
+
scope :with_role, ->(role) { where("roles_mask & \#{2**ROLES.index(role.to_s)} > 0 ") }
|
105
105
|
|
106
106
|
def roles=(roles)
|
107
107
|
self.roles_mask = (roles & ROLES).map { |r| 2**ROLES.index(r) }.sum
|
@@ -124,12 +124,19 @@ class LeolayGenerator < Rails::Generators::Base
|
|
124
124
|
def admin?
|
125
125
|
self.role? 'admin'
|
126
126
|
end
|
127
|
-
def name
|
127
|
+
def name option=:fullname
|
128
128
|
return unless self.email
|
129
129
|
# Get left email text
|
130
130
|
match_data = self.email.match(/^([a-z]+)(\.|\-|\_|)([a-z]+|)/i)
|
131
|
-
|
132
|
-
|
131
|
+
case option
|
132
|
+
when :full, :fullname
|
133
|
+
name = match_data[1].capitalize
|
134
|
+
name << " \#{match_data[3].capitalize}" unless match_data[3].blank?
|
135
|
+
when :first, :firstname
|
136
|
+
name = match_data[1].capitalize
|
137
|
+
when :last, :lastname, :surname
|
138
|
+
name = match_data[3].capitalize
|
139
|
+
end
|
133
140
|
name
|
134
141
|
end
|
135
142
|
FILE
|
@@ -0,0 +1,26 @@
|
|
1
|
+
@import "active_admin/mixins";
|
2
|
+
@import "active_admin/base";
|
3
|
+
$env-color: rgb(220,60,60);
|
4
|
+
|
5
|
+
@mixin primary-gradient {
|
6
|
+
@include gradient(darken($env-color, 20%), darken($env-color, 33%));
|
7
|
+
border-bottom: 1px solid darken($env-color, 38%);
|
8
|
+
}
|
9
|
+
|
10
|
+
#header {
|
11
|
+
@include primary-gradient;
|
12
|
+
ul#tabs > li.current > a {
|
13
|
+
background-color: darken($env-color, 15%);
|
14
|
+
}
|
15
|
+
ul#tabs > li:hover > a {
|
16
|
+
background-color: darken($env-color, 10%);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
.table_tools_segmented_control li.selected {
|
20
|
+
a {
|
21
|
+
color: $env-color;
|
22
|
+
}
|
23
|
+
a:hover {
|
24
|
+
color: darken($env-color, 20%);
|
25
|
+
}
|
26
|
+
}
|
@@ -1,10 +1,11 @@
|
|
1
1
|
$style_path: styles/<%= style_name %>;
|
2
2
|
@import "active_admin/mixins";
|
3
3
|
@import "active_admin/base";
|
4
|
+
<% if Rails.env == 'production' %>
|
5
|
+
@import "production";
|
6
|
+
<% end %>
|
4
7
|
|
5
8
|
body.active_admin {
|
6
|
-
@import "enviroment";
|
7
|
-
|
8
9
|
#active_admin_content {
|
9
10
|
padding: 10px 10px;
|
10
11
|
}
|
@@ -1,8 +1,10 @@
|
|
1
1
|
@import "active_admin/mixins";
|
2
2
|
@import "active_admin/base";
|
3
|
+
<% if Rails.env == 'production' %>
|
4
|
+
@import "production";
|
5
|
+
<% end %>
|
3
6
|
|
4
7
|
body.active_admin {
|
5
|
-
@import "enviroment";
|
6
8
|
@import "active_admin/pages/logged_out";
|
7
9
|
#header {
|
8
10
|
#session {
|
@@ -26,28 +28,12 @@ body.active_admin {
|
|
26
28
|
#login {
|
27
29
|
form {
|
28
30
|
input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], textarea {
|
29
|
-
//width: 76%;
|
30
|
-
//border: 1px solid #c9d0d6;
|
31
|
-
//@include rounded;
|
32
|
-
//font-size: 0.95em;
|
33
|
-
//@include sans-family;
|
34
|
-
//outline: none;
|
35
31
|
padding: 8px 7px;
|
36
|
-
|
37
|
-
//&:focus {
|
38
|
-
// border: 1px solid #99a2aa;
|
39
|
-
// @include shadow(0,0,4px,#99a2aa);
|
40
|
-
//}
|
41
32
|
}
|
42
33
|
input[type=submit] {
|
43
34
|
@include dark-button;
|
44
35
|
margin-left: 20px;
|
45
|
-
//padding: 4px 8px;
|
46
36
|
}
|
47
|
-
//.buttons {
|
48
|
-
// margin-top: 15px;
|
49
|
-
// //input[type=submit] { margin-right: 10px; }
|
50
|
-
//}
|
51
37
|
}
|
52
38
|
}
|
53
39
|
}
|
@@ -1,15 +1,15 @@
|
|
1
|
-
# This is the main resource... i think
|
2
|
-
activity user:references name:string{100} body:text completed:boolean percentage_progression:integer{1}
|
3
|
-
#completed: when all tasks are completed
|
4
|
-
# Any other comments about fields
|
5
|
-
|
6
|
-
# This table acts as...
|
7
|
-
task user:references activity:references name:string{100} body:text completed:boolean percentage_progression:integer{1} deadline_date:date
|
8
|
-
|
9
|
-
hint user:belongs_to activity:references message:string
|
10
|
-
|
11
|
-
# I decided to add this because...
|
12
|
-
rails g migration AddFooToActivity foo:boolean
|
13
|
-
|
14
|
-
# I need this because...
|
1
|
+
# This is the main resource... i think
|
2
|
+
activity user:references name:string{100} body:text completed:boolean percentage_progression:integer{1}
|
3
|
+
#completed: when all tasks are completed
|
4
|
+
# Any other comments about fields
|
5
|
+
|
6
|
+
# This table acts as...
|
7
|
+
task user:references activity:references name:string{100} body:text completed:boolean percentage_progression:integer{1} deadline_date:date
|
8
|
+
|
9
|
+
hint user:belongs_to activity:references message:string
|
10
|
+
|
11
|
+
# I decided to add this because...
|
12
|
+
rails g migration AddFooToActivity foo:boolean
|
13
|
+
|
14
|
+
# I need this because...
|
15
15
|
rails g migration AddBarToTask bar:boolean
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_leonardo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Mastrodonato
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -63,9 +63,9 @@ files:
|
|
63
63
|
- lib/generators/leolay/templates/styles/active/images/ico_v.png
|
64
64
|
- lib/generators/leolay/templates/styles/active/images/ico_x.png
|
65
65
|
- lib/generators/leolay/templates/styles/active/images/logo.png
|
66
|
-
- lib/generators/leolay/templates/styles/active/stylesheets/app/
|
67
|
-
- lib/generators/leolay/templates/styles/active/stylesheets/app/custom_active_admin.scss
|
68
|
-
- lib/generators/leolay/templates/styles/active/stylesheets/app/stylesheet.scss
|
66
|
+
- lib/generators/leolay/templates/styles/active/stylesheets/app/_production.scss
|
67
|
+
- lib/generators/leolay/templates/styles/active/stylesheets/app/custom_active_admin.scss.erb
|
68
|
+
- lib/generators/leolay/templates/styles/active/stylesheets/app/stylesheet.scss.erb
|
69
69
|
- lib/generators/leolay/templates/styles/active/views/layout/_message.html.erb
|
70
70
|
- lib/generators/leolay/templates/styles/active/views/layout/_session.html.erb
|
71
71
|
- lib/generators/leolay/templates/styles/active/views/layout/application.html.erb
|
@@ -1,25 +0,0 @@
|
|
1
|
-
//Uncomment these lines in production to have a different color
|
2
|
-
//$env-color: rgb(250,50,50);
|
3
|
-
//
|
4
|
-
//@mixin primary-gradient {
|
5
|
-
// @include gradient(darken($env-color, 20%), darken($env-color, 33%));
|
6
|
-
// border-bottom: 1px solid darken($env-color, 38%);
|
7
|
-
//}
|
8
|
-
//
|
9
|
-
//#header {
|
10
|
-
// @include primary-gradient;
|
11
|
-
// ul#tabs > li.current > a {
|
12
|
-
// background-color: darken($env-color, 15%);
|
13
|
-
// }
|
14
|
-
// ul#tabs > li:hover > a {
|
15
|
-
// background-color: darken($env-color, 10%);
|
16
|
-
// }
|
17
|
-
//}
|
18
|
-
//.table_tools_segmented_control li.selected {
|
19
|
-
// a {
|
20
|
-
// color: $env-color;
|
21
|
-
// }
|
22
|
-
// a:hover {
|
23
|
-
// color: darken($env-color, 20%);
|
24
|
-
// }
|
25
|
-
//}
|