adminlte-generators 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ff05ee523693517ca3b146b8c90a8bd360c235fb
4
+ data.tar.gz: d80b1e94569cb6c6fc528a50573df140d243f617
5
+ SHA512:
6
+ metadata.gz: c3021010ed57d086d81bccbb1a0f8c9c1b476e61abc6494af078b8a71fd4c1858b1a722260f3c9b0b4ec24ce3ea7a081852afc04f9793a562b6373e50cb9392b
7
+ data.tar.gz: e714d49bd0ad571eed48cb34b0eeeb371c212a323724b27aff6d83c4157836083339d60bf1d7544f6735f349fce5ab3832ea93989ad2abd22a24f39f06c4c6d2
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ *.gem
15
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in adminlte-generators.gemspec
4
+ gemspec
5
+
6
+ gem 'rails', ">= 4.0.0"
7
+ gem 'adminlte', ">= 1.3.0.1"
8
+ gem 'sass-rails'
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Pavlo Babenko
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,70 @@
1
+ # Adminlte Generators
2
+
3
+ AdminLTE generators provides easy [AdminLTE](http://almsaeedstudio.com/AdminLTE) integration with Rails 4.
4
+ AdminLTE is a rich [Twitter Bootstrap](http://getbootstrap.com/) admin template.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile (you'll need (adminlte)[https://github.com/chukcha-wtf/adminlte] gem installed):
9
+
10
+ ```ruby
11
+ gem 'adminlte'
12
+ gem 'adminlte-generators'
13
+ ```
14
+
15
+ Run bundle install:
16
+
17
+ bundle install
18
+
19
+ ## Generators
20
+
21
+ Get started:
22
+
23
+ $ rails generate adminlte:install
24
+
25
+ From now on, any time you generate a controller or scaffold, you'll get AdminLTE template.
26
+ Sidebar and Header are also generated just for you.
27
+
28
+
29
+ ## Usage
30
+
31
+ To print the options and usage run the command `rails generate adminlte:install --help`
32
+
33
+ ## Options
34
+
35
+ #### Template engines
36
+
37
+ Currently only **erb** is supported.
38
+
39
+ #### Stylesheet engines
40
+
41
+ Currently only **scss** is supported.
42
+
43
+ #### Named layout
44
+
45
+ You could provide a name for generated layout (usefull if you've got few layouts in your app).
46
+
47
+ Simply run:
48
+
49
+ rails generate bootstrap:install --layout_name=admin
50
+
51
+ #### Default skin
52
+
53
+ AdminLTE comes with **blue** skin by default. If you wish to change it to **black** just run:
54
+
55
+ rails generate bootstrap:install --skin=black
56
+
57
+ #### Skip turbolinks
58
+
59
+ Run the generator with option `--skip-turbolinks` to remove turbolinks references from the generated layout.
60
+
61
+ ## Contributing
62
+
63
+ 1. Fork it ( https://github.com/[my-github-username]/adminlte-generators/fork )
64
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
65
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
66
+ 4. Push to the branch (`git push origin my-new-feature`)
67
+ 5. Create a new Pull Request
68
+
69
+ ## TODO:
70
+ Write tests for generators
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'adminlte/generators/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "adminlte-generators"
8
+ spec.version = Adminlte::Generators::VERSION
9
+ spec.authors = ["Pavlo Babenko"]
10
+ spec.email = ["pavlo.babenko@gmail.com"]
11
+ spec.summary = %q{AdminLTE-generators provides AdminLTE generators for Rails 4.}
12
+ spec.description = %q{AdminLTE-generators provides AdminLTE generators for Rails 4.}
13
+ spec.homepage = "https://github.com/chukcha-wtf/adminlte-generators"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+
24
+ spec.add_runtime_dependency "railties", ">= 3.1.0"
25
+ spec.add_runtime_dependency "adminlte", ">= 1.3.0.1"
26
+ end
@@ -0,0 +1,15 @@
1
+ require "rails"
2
+
3
+ module Adminlte
4
+ module Generators
5
+ class Engine < ::Rails::Engine
6
+ config.app_generators.stylesheets false
7
+
8
+ initializer 'adminlte-generators.setup', group: :all do |app|
9
+ app.config.assets.paths << ::Rails.root.join('app', 'assets', 'fonts')
10
+
11
+ app.config.assets.precompile << /\.(?:svg|eot|woff|ttf)$/
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ module Adminlte
2
+ module Generators
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,45 @@
1
+ require 'rails/generators'
2
+
3
+ module Adminlte
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+ desc 'Copy AdminLTE Generators default files'
7
+ source_root ::File.expand_path('../templates', __FILE__)
8
+
9
+ class_option :template_engine, :default => 'erb'
10
+ class_option :stylesheet_engine, :default => 'scss'
11
+ class_option :layout_name, :default => 'application'
12
+ class_option :skin, :default => 'blue', desc: 'AdminLTE skin color'
13
+ class_option :skip_turbolinks, :type => :boolean, :default => false, :desc => "Skip Turbolinks on assets"
14
+
15
+ def copy_lib
16
+ directory "lib/templates/#{options[:template_engine]}"
17
+ end
18
+
19
+ def copy_form_builder
20
+ copy_file "form_builder/_form.html.#{options[:template_engine]}", "lib/templates/#{options[:template_engine]}/scaffold/_form.html.#{options[:template_engine]}"
21
+ end
22
+
23
+ def create_layout
24
+ template "layouts/dashboard.html.#{options[:template_engine]}", "app/views/layouts/#{options[:layout_name]}.html.#{options[:template_engine]}"
25
+ template "layouts/_header.html.#{options[:template_engine]}", "app/views/layouts/_#{options[:layout_name]}_header.html.#{options[:template_engine]}"
26
+ template "layouts/_sidebar.html.#{options[:template_engine]}", "app/views/layouts/_#{options[:layout_name]}_sidebar.html.#{options[:template_engine]}"
27
+ end
28
+
29
+ def create_stylesheets
30
+ copy_file "assets/stylesheets/adminlte_overrides.#{options[:stylesheet_engine]}", "app/assets/stylesheets/adminlte_overrides.#{options[:stylesheet_engine]}"
31
+ end
32
+
33
+ def inject_adminlte
34
+ application_js_path = "app/assets/javascripts/#{options[:layout_name]}.js"
35
+
36
+ if ::File.exists?(::File.join(destination_root, application_js_path))
37
+ inject_into_file application_js_path, before: '//= require_tree' do
38
+ "//= require adminlte/bootstrap\n"+
39
+ "//= require adminlte/app\n"
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,55 @@
1
+ /*
2
+ *= require AdminLTE
3
+ *= require_self
4
+ */
5
+
6
+ /* Removing stupid default logo font */
7
+ body .header .logo {
8
+ font-family: 'Source Sans Pro', sans-serif;
9
+ }
10
+
11
+ .btn.pull-right {
12
+ margin-left: 8px;
13
+ }
14
+
15
+ .spinner {
16
+ position: fixed;
17
+ top: 150px;
18
+ right: 0px;
19
+ border: 1px solid rgba(0, 0, 0, 0.701961);
20
+ background-color: #fff;
21
+ border-top-left-radius: 5px;
22
+ border-top-right-radius: 0px;
23
+ border-bottom-right-radius: 0px;
24
+ border-bottom-left-radius: 5px;
25
+ padding: 10px 15px;
26
+ font-size: 16px;
27
+ z-index: 999999;
28
+ /* cursor: pointer; */
29
+ color: #dddddd;
30
+ }
31
+
32
+ i.glyphicon-sort {
33
+ cursor: pointer;
34
+ }
35
+
36
+ .thumbnail {
37
+ padding: 0;
38
+ border-radius: 0;
39
+ }
40
+
41
+ .btn {
42
+ border-radius: 1px;
43
+ }
44
+
45
+ .box {
46
+ border-radius: 1px;
47
+ }
48
+
49
+ .label {
50
+ border-radius: 0.05em;
51
+ }
52
+
53
+ .box-header a.btn {
54
+ color: #fff;
55
+ }
@@ -0,0 +1,56 @@
1
+ @import "AdminLTE";
2
+
3
+ /* Removing stupid default logo font */
4
+ body {
5
+ .header {
6
+ .logo {
7
+ font-family: 'Source Sans Pro', sans-serif;
8
+ }
9
+ }
10
+ }
11
+
12
+ .btn.pull-right {
13
+ margin-left: 8px;
14
+ }
15
+
16
+ .spinner {
17
+ position: fixed;
18
+ top: 150px;
19
+ right: 0px;
20
+ border: 1px solid rgba(0, 0, 0, 0.701961);
21
+ background-color: #fff;
22
+ border-top-left-radius: 5px;
23
+ border-top-right-radius: 0px;
24
+ border-bottom-right-radius: 0px;
25
+ border-bottom-left-radius: 5px;
26
+ padding: 10px 15px;
27
+ font-size: 16px;
28
+ z-index: 999999;
29
+ /* cursor: pointer; */
30
+ color: #dddddd;
31
+ }
32
+
33
+ i.glyphicon-sort {
34
+ cursor: pointer;
35
+ }
36
+
37
+ .thumbnail {
38
+ padding: 0;
39
+ border-radius: 0;
40
+ }
41
+
42
+ .btn {
43
+ border-radius: 1px;
44
+ }
45
+
46
+ .box {
47
+ border-radius: 1px;
48
+ }
49
+
50
+ .label {
51
+ border-radius: 0.05em;
52
+ }
53
+
54
+ .box-header a.btn {
55
+ color: #fff;
56
+ }
@@ -0,0 +1,30 @@
1
+ <section class="content invoice">
2
+ <div class="row">
3
+ <div class="col-md-10">
4
+ <%%= form_for(@<%= singular_table_name %>, :html => { :role => "form" }) do |f| %>
5
+ <%% if @<%= singular_table_name %>.errors.any? %>
6
+ <div class="alert alert-danger alert-dismissable" role="alert">
7
+ <button type="button" class="close" data-dismiss="alert" aria-hidden="true">x</button>
8
+ <h4><%%= pluralize(@<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h4>
9
+
10
+ <ul>
11
+ <%% @<%= singular_table_name %>.errors.full_messages.each do |msg| %>
12
+ <li><%%= msg %></li>
13
+ <%% end %>
14
+ </ul>
15
+ </div>
16
+ <%% end %>
17
+
18
+ <% attributes.each do |attribute| -%>
19
+ <div class="form-group">
20
+ <%%= f.label :<%= attribute.name %> %>
21
+ <%%= f.<%= attribute.field_type %> :<%= attribute.name %>, :class => "form-control" %>
22
+ </div>
23
+ <% end -%>
24
+ <div class="form-group">
25
+ <%%= f.submit :class => "btn btn-primary" %>
26
+ </div>
27
+ <%% end %>
28
+ </div>
29
+ </div>
30
+ </section>
@@ -0,0 +1,133 @@
1
+ <header class="header">
2
+ <a href="#" class="logo">
3
+ <!-- Add the class icon to your logo image or logo icon to add the margining -->
4
+ AdminLTE
5
+ </a>
6
+ <!-- Header Navbar: style can be found in header.less -->
7
+ <nav class="navbar navbar-static-top" role="navigation">
8
+ <!-- Sidebar toggle button-->
9
+ <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
10
+ <span class="sr-only">Toggle navigation</span>
11
+ <span class="icon-bar"></span>
12
+ <span class="icon-bar"></span>
13
+ <span class="icon-bar"></span>
14
+ </a>
15
+ <div class="navbar-right">
16
+ <ul class="nav navbar-nav">
17
+ <li class="dropdown messages-menu">
18
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
19
+ <i class="fa fa-envelope"></i>
20
+ <span class="label label-success">4</span>
21
+ </a>
22
+ <ul class="dropdown-menu">
23
+ <li class="header">You have 4 messages</li>
24
+ <li>
25
+ <!-- inner menu: contains the actual data -->
26
+ <ul class="menu">
27
+ <li><!-- start message -->
28
+ <a href="#">
29
+ <div class="pull-left">
30
+ <img src="/assets/avatar3.png" class="img-circle" alt="User Image"/>
31
+ </div>
32
+ <h4>
33
+ Support Team
34
+ <small><i class="fa fa-clock-o"></i> 5 mins</small>
35
+ </h4>
36
+ <p>Why not buy a new awesome theme?</p>
37
+ </a>
38
+ </li><!-- end message -->
39
+ <li>
40
+ <a href="#">
41
+ <div class="pull-left">
42
+ <img src="/assets/avatar2.png" class="img-circle" alt="user image"/>
43
+ </div>
44
+ <h4>
45
+ AdminLTE Design Team
46
+ <small><i class="fa fa-clock-o"></i> 2 hours</small>
47
+ </h4>
48
+ <p>Why not buy a new awesome theme?</p>
49
+ </a>
50
+ </li>
51
+ <li>
52
+ <a href="#">
53
+ <div class="pull-left">
54
+ <img src="/assets/avatar.png" class="img-circle" alt="user image"/>
55
+ </div>
56
+ <h4>
57
+ Developers
58
+ <small><i class="fa fa-clock-o"></i> Today</small>
59
+ </h4>
60
+ <p>Why not buy a new awesome theme?</p>
61
+ </a>
62
+ </li>
63
+ <li>
64
+ <a href="#">
65
+ <div class="pull-left">
66
+ <img src="/assets/avatar2.png" class="img-circle" alt="user image"/>
67
+ </div>
68
+ <h4>
69
+ Sales Department
70
+ <small><i class="fa fa-clock-o"></i> Yesterday</small>
71
+ </h4>
72
+ <p>Why not buy a new awesome theme?</p>
73
+ </a>
74
+ </li>
75
+ <li>
76
+ <a href="#">
77
+ <div class="pull-left">
78
+ <img src="/assets/avatar.png" class="img-circle" alt="user image"/>
79
+ </div>
80
+ <h4>
81
+ Reviewers
82
+ <small><i class="fa fa-clock-o"></i> 2 days</small>
83
+ </h4>
84
+ <p>Why not buy a new awesome theme?</p>
85
+ </a>
86
+ </li>
87
+ </ul>
88
+ </li>
89
+ <li class="footer"><a href="#">See All Messages</a></li>
90
+ </ul>
91
+ </li>
92
+ <!-- User Account: style can be found in dropdown.less -->
93
+ <li class="dropdown user user-menu">
94
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
95
+ <i class="glyphicon glyphicon-user"></i>
96
+ <span>Jane Doe <i class="caret"></i></span>
97
+ </a>
98
+ <ul class="dropdown-menu">
99
+ <!-- User image -->
100
+ <li class="user-header bg-light-blue">
101
+ <img src="/assets/avatar3.png" class="img-circle" alt="User Image" />
102
+ <p>
103
+ Jane Doe - Web Developer
104
+ <small>Member since Nov. 2012</small>
105
+ </p>
106
+ </li>
107
+ <!-- Menu Body -->
108
+ <li class="user-body">
109
+ <div class="col-xs-4 text-center">
110
+ <a href="#">Followers</a>
111
+ </div>
112
+ <div class="col-xs-4 text-center">
113
+ <a href="#">Sales</a>
114
+ </div>
115
+ <div class="col-xs-4 text-center">
116
+ <a href="#">Friends</a>
117
+ </div>
118
+ </li>
119
+ <!-- Menu Footer-->
120
+ <li class="user-footer">
121
+ <div class="pull-left">
122
+ <a href="#" class="btn btn-default btn-flat">Profile</a>
123
+ </div>
124
+ <div class="pull-right">
125
+ <a href="#" class="btn btn-default btn-flat">Sign out</a>
126
+ </div>
127
+ </li>
128
+ </ul>
129
+ </li>
130
+ </ul>
131
+ </div>
132
+ </nav>
133
+ </header>
@@ -0,0 +1,43 @@
1
+ <section class="sidebar">
2
+ <!-- Sidebar user panel -->
3
+ <div class="user-panel">
4
+ <div class="pull-left image">
5
+ <img src="/assets/avatar3.png" class="img-circle" alt="User Image" />
6
+ </div>
7
+ <div class="pull-left info">
8
+ <p>Hello, Jane</p>
9
+
10
+ <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
11
+ </div>
12
+ </div>
13
+ <!-- search form -->
14
+ <form action="#" method="get" class="sidebar-form">
15
+ <div class="input-group">
16
+ <input type="text" name="q" class="form-control" placeholder="Search..."/>
17
+ <span class="input-group-btn">
18
+ <button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>
19
+ </span>
20
+ </div>
21
+ </form>
22
+ <!-- /.search form -->
23
+ <!-- sidebar menu: : style can be found in sidebar.less -->
24
+ <ul class="sidebar-menu">
25
+ <li class="active">
26
+ <a href="#">
27
+ <i class="fa fa-dashboard"></i> <span>Dashboard</span>
28
+ </a>
29
+ </li>
30
+ <li class="treeview">
31
+ <a href="#">
32
+ <i class="fa fa-bar-chart-o"></i>
33
+ <span>Charts</span>
34
+ <i class="fa fa-angle-left pull-right"></i>
35
+ </a>
36
+ <ul class="treeview-menu">
37
+ <li><a href="#"><i class="fa fa-angle-double-right"></i> Morris</a></li>
38
+ <li><a href="#"><i class="fa fa-angle-double-right"></i> Flot</a></li>
39
+ <li><a href="#"><i class="fa fa-angle-double-right"></i> Inline charts</a></li>
40
+ </ul>
41
+ </li>
42
+ </ul>
43
+ </section>
@@ -0,0 +1,54 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
7
+ <meta name="description" content="">
8
+ <meta name="author" content="">
9
+ <title>AdminLTE::Dashboard</title>
10
+
11
+ <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
12
+ <!--[if lt IE 9]>
13
+ <%%= javascript_include_tag "https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js", "https://oss.maxcdn.com/respond/1.4.2/respond.min.js" %>
14
+ <![endif]-->
15
+
16
+ <%- if options[:skip_turbolinks] -%>
17
+ <%%= stylesheet_link_tag '<%= options[:layout_name] %>', media: 'all' %>
18
+ <%%= javascript_include_tag '<%= options[:layout_name] %>' %>
19
+ <%- else -%>
20
+ <%%= stylesheet_link_tag '<%= options[:layout_name] %>', media: 'all', 'data-turbolinks-track' => true %>
21
+ <%%= javascript_include_tag '<%= options[:layout_name] %>', 'data-turbolinks-track' => true %>
22
+ <%- end -%>
23
+ <%%= csrf_meta_tags %>
24
+ </head>
25
+ <body class="skin-<%= options[:skin] %>">
26
+
27
+ <%%= render "layouts/<%= options[:layout_name] %>_header" %>
28
+
29
+ <div class="wrapper row-offcanvas row-offcanvas-left">
30
+ <aside class="left-side sidebar-offcanvas">
31
+ <%%= render "layouts/<%= options[:layout_name] %>_sidebar" %>
32
+ </aside>
33
+ <aside class="right-side">
34
+ <%%= yield(:content_header) %>
35
+
36
+ <%% flash.each do |name, msg| %>
37
+ <div class="pad margin no-print">
38
+ <%%= content_tag :div, :class => "alert alert-#{ name == :error ? "danger" : "success" } alert-dismissable", :role => "alert" do %>
39
+ <button type="button" class="close" data-dismiss="alert" aria-hidden="true">x</button>
40
+ <%%= msg %>
41
+ <%% end %>
42
+ </div>
43
+ <%% end %>
44
+
45
+ <%%= yield %>
46
+ </aside>
47
+ </div>
48
+
49
+ <div class="spinner no-print hidden">
50
+ <img src="/assets/ajax-loader.gif" alt="">
51
+ </div>
52
+
53
+ </body>
54
+ </html>
@@ -0,0 +1,9 @@
1
+ <%% content_for :content_header do %>
2
+ <section class="content-header">
3
+ <h1><%= class_name %> <small>#<%= @action %></small></h1>
4
+ </section>
5
+ <%% end %>
6
+
7
+ <section class="content invoice">
8
+ <p>Find me in <%= @path %></p>
9
+ </section>
@@ -0,0 +1,15 @@
1
+ <%% content_for :content_header do %>
2
+ <section class="content-header">
3
+ <h1>
4
+ Editing <small><%%= link_to <%=singular_table_name %>, @<%= singular_table_name %> %></small>
5
+
6
+ <ol class="breadcrumb">
7
+ <li><a href="/"><i class="fa fa-dashboard"></i> Home</a></li>
8
+ <li><%%= link_to "<%= plural_table_name.capitalize %>", <%= plural_table_name %>_path %></li>
9
+ <li class="active">Edit</li>
10
+ </ol>
11
+ </h1>
12
+ </section>
13
+ <%% end %>
14
+
15
+ <%%= render 'form' %>
@@ -0,0 +1,52 @@
1
+ <%% content_for :content_header do %>
2
+ <section class="content-header">
3
+ <h1>Listing <small><%= plural_table_name %></small></h1>
4
+
5
+ <ol class="breadcrumb">
6
+ <li><a href="/"><i class="fa fa-dashboard"></i> Home</a></li>
7
+ <li class="active"><%= plural_table_name %></li>
8
+ </ol>
9
+ </section>
10
+ <%% end %>
11
+
12
+ <section class="content">
13
+ <div class="row">
14
+ <div class="col-xs-12">
15
+ <div class="box box-primary">
16
+ <div class="box-header">
17
+ <div class="box-tools pull-right">
18
+ <%%= link_to new_<%= singular_table_name %>_path(@<%= singular_table_name %>), :class => 'btn btn-success' do %>
19
+ <span class="glyphicon glyphicon-plus"></span>
20
+ New <%= human_name %>
21
+ <%% end %>
22
+ </div>
23
+ </div>
24
+ <div class="box-body table-responsive">
25
+ <table class="table table-hover">
26
+ <thead>
27
+ <tr>
28
+ <% attributes.each do |attribute| -%>
29
+ <th><%= attribute.human_name %></th>
30
+ <% end -%>
31
+ <th></th>
32
+ <th></th>
33
+ <th></th>
34
+ </tr>
35
+ </thead>
36
+ <tbody>
37
+ <%%= content_tag_for(:tr, @<%= plural_table_name %>) do |<%= singular_table_name %>| %>
38
+ <% attributes.each do |attribute| -%>
39
+ <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
40
+ <% end -%>
41
+ <td><%%= link_to 'Show', <%= singular_table_name %> %></td>
42
+ <td><%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %></td>
43
+ <td><%%= link_to 'Destroy', <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' } %></td>
44
+ <%% end %>
45
+ </tbody>
46
+ </table>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </section>
52
+
@@ -0,0 +1,13 @@
1
+ <%% content_for :content_header do %>
2
+ <section class="content-header">
3
+ <h1>New <small><%= singular_table_name %></small></h1>
4
+
5
+ <ol class="breadcrumb">
6
+ <li><a href="/"><i class="fa fa-dashboard"></i> Home</a></li>
7
+ <li><%%= link_to "<%= plural_table_name %>", <%= plural_table_name %>_path %></li>
8
+ <li class="active">New</li>
9
+ </ol>
10
+ </section>
11
+ <%% end %>
12
+
13
+ <%%= render 'form' %>
@@ -0,0 +1,38 @@
1
+ <%% content_for :content_header do %>
2
+ <section class="content-header">
3
+ <h1>Show <small><%= singular_table_name %></small></h1>
4
+
5
+ <ol class="breadcrumb">
6
+ <li><a href="/"><i class="fa fa-dashboard"></i> Home</a></li>
7
+ <li><%%= link_to "<%= plural_table_name.capitalize %>", <%= plural_table_name %>_path %></li>
8
+ <li class="active">Show</li>
9
+ </ol>
10
+ </section>
11
+ <%% end %>
12
+
13
+ <section class="content">
14
+ <div class="row">
15
+ <div class="col-md-12">
16
+ <div class="box box-primary">
17
+ <div class="box-header">
18
+ <div class="box-tools pull-right">
19
+ <%%= link_to edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), :class => 'btn btn-primary' do %>
20
+ <span class="glyphicon glyphicon-pencil"></span>
21
+ Edit
22
+ <%% end %>
23
+ </div>
24
+ </div>
25
+ <div class="box-body">
26
+ <dl class="dl-horizontal">
27
+ <%- attributes.each do |attribute| -%>
28
+ <dt><%= attribute.human_name %>:</dt>
29
+ <dd><%%= @<%= singular_table_name %>.<%= attribute.name %> %></dd>
30
+
31
+ <%- end -%>
32
+ </dl>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </section>
38
+
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: adminlte-generators
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Pavlo Babenko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: railties
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 3.1.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 3.1.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: adminlte
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 1.3.0.1
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 1.3.0.1
69
+ description: AdminLTE-generators provides AdminLTE generators for Rails 4.
70
+ email:
71
+ - pavlo.babenko@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - MIT-LICENSE
79
+ - README.md
80
+ - Rakefile
81
+ - adminlte-generators.gemspec
82
+ - lib/adminlte-generators.rb
83
+ - lib/adminlte/generators/version.rb
84
+ - lib/generators/adminlte/install/install_generator.rb
85
+ - lib/generators/adminlte/install/templates/assets/stylesheets/adminlte_overrides.css
86
+ - lib/generators/adminlte/install/templates/assets/stylesheets/adminlte_overrides.scss
87
+ - lib/generators/adminlte/install/templates/form_builder/_form.html.erb
88
+ - lib/generators/adminlte/install/templates/layouts/_header.html.erb
89
+ - lib/generators/adminlte/install/templates/layouts/_sidebar.html.erb
90
+ - lib/generators/adminlte/install/templates/layouts/dashboard.html.erb
91
+ - lib/generators/adminlte/install/templates/lib/templates/erb/controller/view.html.erb
92
+ - lib/generators/adminlte/install/templates/lib/templates/erb/scaffold/edit.html.erb
93
+ - lib/generators/adminlte/install/templates/lib/templates/erb/scaffold/index.html.erb
94
+ - lib/generators/adminlte/install/templates/lib/templates/erb/scaffold/new.html.erb
95
+ - lib/generators/adminlte/install/templates/lib/templates/erb/scaffold/show.html.erb
96
+ homepage: https://github.com/chukcha-wtf/adminlte-generators
97
+ licenses:
98
+ - MIT
99
+ metadata: {}
100
+ post_install_message:
101
+ rdoc_options: []
102
+ require_paths:
103
+ - lib
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ requirements: []
115
+ rubyforge_project:
116
+ rubygems_version: 2.2.2
117
+ signing_key:
118
+ specification_version: 4
119
+ summary: AdminLTE-generators provides AdminLTE generators for Rails 4.
120
+ test_files: []