venus 0.5.2 → 0.6.2

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.
data/Gemfile.lock ADDED
@@ -0,0 +1,64 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ venus (0.5.2)
5
+ activesupport (>= 3.1.3)
6
+ bundler (>= 1.1)
7
+ railties (>= 3.1.3)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actionpack (3.2.11)
13
+ activemodel (= 3.2.11)
14
+ activesupport (= 3.2.11)
15
+ builder (~> 3.0.0)
16
+ erubis (~> 2.7.0)
17
+ journey (~> 1.0.4)
18
+ rack (~> 1.4.0)
19
+ rack-cache (~> 1.2)
20
+ rack-test (~> 0.6.1)
21
+ sprockets (~> 2.2.1)
22
+ activemodel (3.2.11)
23
+ activesupport (= 3.2.11)
24
+ builder (~> 3.0.0)
25
+ activesupport (3.2.11)
26
+ i18n (~> 0.6)
27
+ multi_json (~> 1.0)
28
+ builder (3.0.4)
29
+ erubis (2.7.0)
30
+ hike (1.2.1)
31
+ i18n (0.6.1)
32
+ journey (1.0.4)
33
+ json (1.7.6)
34
+ multi_json (1.5.0)
35
+ rack (1.4.5)
36
+ rack-cache (1.2)
37
+ rack (>= 0.4)
38
+ rack-ssl (1.3.3)
39
+ rack
40
+ rack-test (0.6.2)
41
+ rack (>= 1.0)
42
+ railties (3.2.11)
43
+ actionpack (= 3.2.11)
44
+ activesupport (= 3.2.11)
45
+ rack-ssl (~> 1.3.2)
46
+ rake (>= 0.8.7)
47
+ rdoc (~> 3.4)
48
+ thor (>= 0.14.6, < 2.0)
49
+ rake (10.0.3)
50
+ rdoc (3.12.1)
51
+ json (~> 1.4)
52
+ sprockets (2.2.2)
53
+ hike (~> 1.2)
54
+ multi_json (~> 1.0)
55
+ rack (~> 1.0)
56
+ tilt (~> 1.1, != 1.3.0)
57
+ thor (0.17.0)
58
+ tilt (1.3.3)
59
+
60
+ PLATFORMS
61
+ ruby
62
+
63
+ DEPENDENCIES
64
+ venus!
data/README.md CHANGED
@@ -15,76 +15,106 @@ group :development do
15
15
  end
16
16
  ```
17
17
 
18
+ * Edge version
19
+
20
+ ```ruby
21
+ group :development do
22
+ ...
23
+ gem 'venus', :git => 'git@github.com:marsz/venus.git'
24
+ ...
25
+ end
26
+ ```
27
+
28
+ `bundle update venus`
29
+
18
30
  Usage
19
31
  =====
20
32
 
21
- * Setup jQuery UI (including datepicker and more jQuery-UI plugins)
33
+ * `Twitter Bootstrap` theme and `Unicorn Admin` optional.
34
+
35
+ ```
36
+ rails generate venus:bootstrap
37
+ ```
38
+
39
+ * `Carrierwave` installation and carrierwave-meta, rmagick, fog (for AWS S3) optional and give a sample uploader.
40
+
41
+ ```
42
+ rails generate venus:carrierwave
43
+ ```
44
+
45
+ * `jQuery UI` (including `datepicker` and more jQuery-UI plugins)
22
46
 
23
47
  ```
24
48
  rails generate venus:jqueryui
25
49
  ```
26
50
 
27
- * Setup chosen for jQuery (see demo: http://harvesthq.github.com/chosen/)
51
+ * `Chosen` for jQuery (see demo: http://harvesthq.github.com/chosen/)
28
52
 
29
53
  ```
30
54
  rails generate venus:chosen
31
55
  ```
32
56
 
33
- * Setup AWS api keys for official aws-sdk (including SES).
57
+ * `Amazon Web Service` api keys for official aws-sdk (including SES).
34
58
 
35
59
  ```
36
60
  rails generate venus:aws
37
61
  ```
38
62
 
39
- * Setup Omniauth for multiple omniauth (Facebook, Twitter, Github) in model `User`.
63
+ * `Redis` client and related gems (redis-objects) for optional.
64
+
65
+ ```
66
+ rails generate venus:redis
67
+ ```
68
+
69
+ * `Omniauth` for multiple omniauth (Facebook, Twitter, Github) in model `User`.
40
70
 
41
71
  ```
42
72
  rails generate venus:omniauth
43
73
  ```
44
74
 
45
- * Setup gem 'capistrano' for deloyment.
75
+ * `Capistrano` for deloyment.
46
76
 
47
77
  ```
48
78
  rails generate venus:deploy
49
79
  ```
50
80
 
51
- * Setup gem 'simple_form' and its related gems (including 'nested_form')
81
+ * `simple_form` and its related gems (including `nested_form`)
52
82
 
53
83
  ```
54
84
  rails generate venus:simple_form
55
85
  ```
56
86
 
57
- * Essentail gems (simple_form, kminari...etc) and setup (removing public/index.html ...etc).
87
+ * Essentail gems (kminari...etc) and setup (removing public/index.html ...etc).
58
88
 
59
89
  ```
60
90
  rails generate venus:init
61
91
  ```
62
92
 
63
- * Setup Mysql connection
93
+ * `MySql` database connection
64
94
 
65
95
  ```
66
96
  rails generate venus:mysql
67
97
  ```
68
98
 
69
- * Pagination gem "kaminari"
99
+ * `kaminari` for pagination
70
100
 
71
101
  ```
72
102
  rails generate venus:paginate
73
103
  ```
74
104
 
75
- * Setup gem "settingslogic"
105
+ * `settingslogic` for all YAML configurations.
76
106
 
77
107
  ```
78
108
  rails generate venus:settingslogic
79
109
  ```
80
110
 
81
- * Setup gem 'devise', default generate model `User`
111
+ * `devise` for user login, default generate model `User`
82
112
 
83
113
  ```
84
114
  rails generate venus:devise
85
115
  ```
86
116
 
87
- * Setup Rspec testing framework
117
+ * `RSpec` testing framework
88
118
 
89
119
  ```
90
120
  rails generate venus:rspec
@@ -93,11 +123,10 @@ Usage
93
123
  TODO
94
124
  ====
95
125
 
96
- * MongoDB / Redis configuration.
97
- * Twitter Bootstrap layout.
98
- * Carrierwave with rmagick & fog.
126
+ * MongoDB configuration.
99
127
  * RailsAdmin or ActiveAdmin.
100
128
  * Sidekiq for background job.
129
+ * Amazon Elastic Cache & cells.
101
130
 
102
131
  Thanks
103
132
  ======
@@ -0,0 +1,59 @@
1
+ module Venus
2
+ module Generators
3
+ class BootstrapGenerator < Base
4
+ desc "Setup for bootstrap theme"
5
+
6
+ def name
7
+ "bootstrap"
8
+ end
9
+
10
+ def asks
11
+ @target_js = ask?('target content append for js file?', 'application.js')
12
+ @target_css = ask?('target content append for css file?', 'application.css')
13
+ @example_layout = ask?("Export example layout", 'bootstrap')
14
+ @unicorn = ask?("Use theme unicorn admin", true)
15
+ end
16
+
17
+ def gemfile
18
+ add_gem('anjlab-bootstrap-rails', ">= 2.3', :require => 'bootstrap-rails")
19
+ bundle_install
20
+ end
21
+
22
+ def assets
23
+ css_assets_require(@target_css, "twitter/bootstrap")
24
+ css_assets_require(@target_css, "twitter/bootstrap-responsive", :after => "twitter/bootstrap")
25
+ js_assets_require(@target_js, "twitter/bootstrap")
26
+ end
27
+
28
+ def unicorn
29
+ if @unicorn
30
+ template("unicorn.js", "app/assets/javascripts/unicorn.js")
31
+ template("unicorn.main.css", "app/assets/stylesheets/unicorn.main.css")
32
+ template("unicorn.grey.css", "app/assets/stylesheets/unicorn.grey.css")
33
+ css_assets_require(@target_css, "unicorn.main", :after => "twitter/bootstrap-responsive")
34
+ css_assets_require(@target_css, "unicorn.grey", :after => "unicorn.main")
35
+ js_assets_require(@target_js, "unicorn", :after => "twitter/bootstrap")
36
+
37
+ end
38
+ end
39
+
40
+ def copy_example_layout
41
+ to_file = "app/views/layouts/#{@example_layout}.html.erb"
42
+ copy_file("img/glyphicons-halflings-white.png", "app/assets/images/img/glyphicons-halflings-white.png")
43
+ copy_file("img/glyphicons-halflings.png", "app/assets/images/img/glyphicons-halflings.png")
44
+ if @unicorn
45
+ copy_file("unicorn.layout", to_file)
46
+ copy_file("img/breadcrumb.png", "app/assets/images/img/breadcrumb.png")
47
+ copy_file("img/menu-active.png", "app/assets/images/img/menu-active.png")
48
+ puts "see more uncorn admin example: http://wrapbootstrap.com/preview/WB0F35928"
49
+ else
50
+ copy_file("bootstrap.layout", to_file)
51
+ end
52
+ replace_in_file(to_file, "@target_css", @target_css)
53
+ replace_in_file(to_file, "@target_js", @target_js)
54
+ puts "see more bootdtrap usage: http://twitter.github.com/bootstrap/"
55
+ end
56
+
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,54 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Bootstrap</title>
5
+ <%= stylesheet_link_tag "@target_css" %>
6
+ <%= javascript_include_tag "@target_js" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <div class="navbar navbar-fixed-top ">
12
+ <div class="navbar-inner top ">
13
+ <div class="container">
14
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
15
+ <span class="icon-bar"></span>
16
+ <span class="icon-bar"></span>
17
+ <span class="icon-bar"></span>
18
+ </a>
19
+ <%= link_to("Bootstrap", "/", :class => "brand" )%>
20
+ <div class="nav-collapse">
21
+ <ul class="nav">
22
+ <li><%= link_to("Menu#1", "#") %></li>
23
+ <li><%= link_to("Menu#2", "#") %></li>
24
+ <li><%= link_to("Menu#3", "#") %></li>
25
+ </ul>
26
+ <ul class="nav pills pull-right">
27
+ <li><%= link_to("Menu#4", "#") %></li>
28
+ <li><%= link_to("Menu#5", "#") %></li>
29
+ </ul>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+
35
+ <div class="container">
36
+ <%- flash.each do |k, message| %>
37
+ <div class="alert fade in alert-<%=k%>">
38
+ <a href="#" class="close" data-dismiss="alert">x</a>
39
+ <%= message %>
40
+ </div>
41
+ <% end %>
42
+
43
+ <div class="content">
44
+ <div class="row">
45
+ <%= yield %>
46
+ </div>
47
+ </div>
48
+
49
+ <footer class="footer">
50
+ <p class="copyright">Copyright @2013 Bootstrap All rights reserved.</p>
51
+ </footer>
52
+ </div>
53
+ </body>
54
+ </html>
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Unicorn Admin Template
3
+ * Diablo9983 -> diablo9983@gmail.com
4
+ **/
5
+ body {
6
+ background-color: #444444;
7
+ }
8
+
9
+ #header {
10
+ box-shadow: 0 1px 0 #333333;
11
+ background-color: #333333;
12
+ background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#3F3F3F), to(#222222));
13
+ background-image: -webkit-linear-gradient(top, #3F3F3F 0%, #222222 100%);
14
+ background-image: -moz-linear-gradient(top, #3F3F3F 0%, #222222 100%);
15
+ background-image: -ms-linear-gradient(top, #3F3F3F 0%, #222222 100%);
16
+ background-image: -o-linear-gradient(top, #3F3F3F 0%, #222222 100%);
17
+ background-image: linear-gradient(top, #3F3F3F 0%, #222222 100%);
18
+ border-bottom: 1px solid #555555;
19
+ }
20
+
21
+ #search input[type=text], #search button {
22
+ background-color: #222222;
23
+ }
24
+ #search input[type=text]:focus {
25
+ color: #777777;
26
+ }
27
+
28
+ #sidebar > ul {
29
+ border-top: 1px solid #393939;
30
+ border-bottom: 1px solid #4E4E4E;
31
+ }
32
+ #sidebar > ul > li {
33
+ border-top: 1px solid #4E4E4E;
34
+ border-bottom: 1px solid #393939;
35
+ }
36
+ #sidebar > ul > li.active {
37
+ background-color: #3a3a3a;
38
+ background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#333333), to(#3F3F3F));
39
+ background-image: -webkit-linear-gradient(top, #333333 0%, #3F3F3F 100%);
40
+ background-image: -moz-linear-gradient(top, #333333 0%, #3F3F3F 100%);
41
+ background-image: -ms-linear-gradient(top, #333333 0%, #3F3F3F 100%);
42
+ background-image: -o-linear-gradient(top, #333333 0%, #3F3F3F 100%);
43
+ background-image: linear-gradient(top, #333333 0%, #3F3F3F 100%);
44
+ }
45
+
46
+ #sidebar > ul > li.open.submenu > a {
47
+ border-bottom: 1px solid #393939;
48
+ }
49
+ #sidebar > ul > li.open.active.submenu > a {
50
+ border-bottom: 1px solid #2A2A2A;
51
+ }
52
+ #sidebar > ul > li > a > .label {
53
+ background-color: #333333;
54
+ }
55
+ #sidebar > ul > li > a:hover {
56
+ background-color: #4A4A4A;
57
+ }
58
+ #sidebar > ul ul {
59
+ border-top: 1px solid #4E4E4E;
60
+ background-color: #2A2A2A;
61
+ }
62
+ #sidebar > ul ul li a {
63
+ border-top: 1px solid #333333;
64
+ border-bottom: 1px solid #202020;
65
+ }
66
+ #sidebar > ul ul li a:hover, #sidebar > ul ul li.active a {
67
+ color: #CCCCCC;
68
+ background-color: #272727;
69
+ }
70
+
71
+ .dropdown-menu li a:hover, .dropdown-menu .active a, .dropdown-menu .active a:hover {
72
+ color: #eeeeee;
73
+ background-color: #444444;
74
+ background-image: -webkit-gradient(linear, 0 0%, 0 100%, #555555, #222222);
75
+ background-image: -webkit-linear-gradient(top, #555555 0%, #222222 100%);
76
+ background-image: -moz-linear-gradient(top, #555555 0%, #222222 100%);
77
+ background-image: -ms-linear-gradient(top, #555555 0%, #222222 100%);
78
+ background-image: -o-linear-gradient(top, #555555 0%, #222222 100%);
79
+ background-image: linear-gradient(top, #555555 0%, #222222 100%);
80
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#555555', endColorstr='#222222',GradientType=0 ); /* IE6-9 */
81
+ }
82
+
83
+ @media (max-width: 480px) {
84
+ #sidebar > a {
85
+ background-image: -moz-linear-gradient(top, #464646 0%, #404040 100%);
86
+ border-bottom: 1px solid #6e6e6e;
87
+ }
88
+ #sidebar > ul {
89
+ background-color: #444444;
90
+ }
91
+ }
92
+ @media (min-width: 481px) and (max-width: 767px) {
93
+ #sidebar > ul ul:before {
94
+ border-right: 7px solid rgba(0, 0, 0, 0.2);
95
+ }
96
+ #sidebar > ul ul:after {
97
+ border-right: 6px solid #222222;
98
+ }
99
+ }
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Unicorn Admin Template
3
+ * Diablo9983 -> diablo9983@gmail.com
4
+ **/
5
+ $(document).ready(function(){
6
+
7
+
8
+
9
+ // === Sidebar navigation === //
10
+
11
+ $('.submenu > a').click(function(e)
12
+ {
13
+ e.preventDefault();
14
+ var submenu = $(this).siblings('ul');
15
+ var li = $(this).parents('li');
16
+ var submenus = $('#sidebar li.submenu ul');
17
+ var submenus_parents = $('#sidebar li.submenu');
18
+ if(li.hasClass('open'))
19
+ {
20
+ if(($(window).width() > 768) || ($(window).width() < 479)) {
21
+ submenu.slideUp();
22
+ } else {
23
+ submenu.fadeOut(250);
24
+ }
25
+ li.removeClass('open');
26
+ } else
27
+ {
28
+ if(($(window).width() > 768) || ($(window).width() < 479)) {
29
+ submenus.slideUp();
30
+ submenu.slideDown();
31
+ } else {
32
+ submenus.fadeOut(250);
33
+ submenu.fadeIn(250);
34
+ }
35
+ submenus_parents.removeClass('open');
36
+ li.addClass('open');
37
+ }
38
+ });
39
+
40
+ var ul = $('#sidebar > ul');
41
+
42
+ $('#sidebar > a').click(function(e)
43
+ {
44
+ e.preventDefault();
45
+ var sidebar = $('#sidebar');
46
+ if(sidebar.hasClass('open'))
47
+ {
48
+ sidebar.removeClass('open');
49
+ ul.slideUp(250);
50
+ } else
51
+ {
52
+ sidebar.addClass('open');
53
+ ul.slideDown(250);
54
+ }
55
+ });
56
+
57
+ // === Resize window related === //
58
+ $(window).resize(function()
59
+ {
60
+ if($(window).width() > 479)
61
+ {
62
+ ul.css({'display':'block'});
63
+ $('#content-header .btn-group').css({width:'auto'});
64
+ }
65
+ if($(window).width() < 479)
66
+ {
67
+ ul.css({'display':'none'});
68
+ fix_position();
69
+ }
70
+ if($(window).width() > 768)
71
+ {
72
+ $('#user-nav > ul').css({width:'auto',margin:'0'});
73
+ $('#content-header .btn-group').css({width:'auto'});
74
+ }
75
+ });
76
+
77
+ if($(window).width() < 468)
78
+ {
79
+ ul.css({'display':'none'});
80
+ fix_position();
81
+ }
82
+ if($(window).width() > 479)
83
+ {
84
+ $('#content-header .btn-group').css({width:'auto'});
85
+ ul.css({'display':'block'});
86
+ }
87
+
88
+ // === Tooltips === //
89
+ $('.tip').tooltip();
90
+ $('.tip-left').tooltip({ placement: 'left' });
91
+ $('.tip-right').tooltip({ placement: 'right' });
92
+ $('.tip-top').tooltip({ placement: 'top' });
93
+ $('.tip-bottom').tooltip({ placement: 'bottom' });
94
+
95
+ // === Search input typeahead === //
96
+ // $('#search input[type=text]').typeahead({
97
+ // source: ['Dashboard','Form elements','Common Elements','Validation','Wizard','Buttons','Icons','Interface elements','Support','Calendar','Gallery','Reports','Charts','Graphs','Widgets'],
98
+ // items: 4
99
+ // });
100
+
101
+ // === Fixes the position of buttons group in content header and top user navigation === //
102
+ function fix_position()
103
+ {
104
+ var uwidth = $('#user-nav > ul').width();
105
+ $('#user-nav > ul').css({width:uwidth,'margin-left':'-' + uwidth / 2 + 'px'});
106
+
107
+ var cwidth = $('#content-header .btn-group').width();
108
+ $('#content-header .btn-group').css({width:cwidth,'margin-left':'-' + uwidth / 2 + 'px'});
109
+ }
110
+
111
+ // === Style switcher === //
112
+ $('#style-switcher i').click(function()
113
+ {
114
+ if($(this).hasClass('open'))
115
+ {
116
+ $(this).parent().animate({marginRight:'-=190'});
117
+ $(this).removeClass('open');
118
+ } else
119
+ {
120
+ $(this).parent().animate({marginRight:'+=190'});
121
+ $(this).addClass('open');
122
+ }
123
+ $(this).toggleClass('icon-arrow-left');
124
+ $(this).toggleClass('icon-arrow-right');
125
+ });
126
+
127
+ $('#style-switcher a').click(function()
128
+ {
129
+ var style = $(this).attr('href').replace('#','');
130
+ $('.skin-color').attr('href','css/unicorn.'+style+'.css');
131
+ $(this).siblings('a').css({'border-color':'transparent'});
132
+ $(this).css({'border-color':'#aaaaaa'});
133
+ });
134
+ });
@@ -0,0 +1,93 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Unicorn Admin</title>
5
+ <meta content="width=device-width, initial-scale=1.0" name="viewport" />
6
+ <%= stylesheet_link_tag "@target_css" %>
7
+ <%= javascript_include_tag "@target_js" %>
8
+ <%= csrf_meta_tags %>
9
+ </head>
10
+ <body>
11
+
12
+ <div id="header">
13
+ <h1><%= link_to "Unicorn Admin", "/" %></h1>
14
+ </div>
15
+
16
+ <div id="user-nav" class="navbar navbar-inverse">
17
+ <ul class="nav btn-group">
18
+ <li class="btn btn-inverse">
19
+ <%= link_to("#") do %>
20
+ <i class="icon icon-user"></i>
21
+ <span class="text">Setting</span>
22
+ <% end %>
23
+ </li>
24
+ <li class="btn btn-inverse">
25
+ <%= link_to("#", :method => :delete) do %>
26
+ <i class="icon icon-share-alt"></i>
27
+ <span class="text">Logout</span>
28
+ <% end %>
29
+ </li>
30
+ <li class="btn btn-inverse">
31
+ <%= link_to "Login", "#" %>
32
+ </li>
33
+ </ul>
34
+ </div>
35
+
36
+ <div id="sidebar">
37
+ <%= link_to "#", :class => 'visible-phone' do %>
38
+ <i class="icon icon-user"></i>
39
+ <span>Sidebar Menu</span>
40
+ <% end %>
41
+ <ul>
42
+ <li>
43
+ <%= link_to "#" do %>
44
+ <i class="icon icon-star"></i>
45
+ <span>Sidebar Menu Link #1</span>
46
+ <% end %>
47
+ </li>
48
+ <li class="active">
49
+ <%= link_to "#" do %>
50
+ <i class="icon icon-user"></i>
51
+ <span>Sidebar Menu Link #2</span>
52
+ <% end %>
53
+ </li>
54
+ <li>
55
+ <%= link_to "#" do %>
56
+ <i class="icon icon-tag"></i>
57
+ <span>Sidebar Menu Link #3</span>
58
+ <% end %>
59
+ </li>
60
+ </ul>
61
+ </div>
62
+
63
+ <div id="content">
64
+ <div id="content-header">
65
+ <h1>Page Title</h1>
66
+ <div class="btn-group">
67
+ <a href="#" class="btn btn-primary">Buttons#1</a>
68
+ <a href="#" class="btn btn-primary">Buttons#2</a>
69
+ </div>
70
+ </div>
71
+ <div id="breadcrumb">
72
+ <a href="#">Home</a>
73
+ <a href="#">Page</a>
74
+ </div>
75
+ <div class="container-fluid">
76
+ <div class="row-fluid">
77
+ <%- flash.each do |k, message| %>
78
+ <div class="alert fade in alert-<%=k%>">
79
+ <a href="#" class="close" data-dismiss="alert">x</a>
80
+ <%= message %>
81
+ </div>
82
+ <% end %>
83
+ <%= yield %>
84
+ </div>
85
+ <div class="row-fluid">
86
+ <div id="footer" class="span12">
87
+ Footer
88
+ </div>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ </body>
93
+ </html>