tkh_admin_panel 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # TKH Admin Panel
2
2
 
3
3
 
4
+
5
+ ## 0.0.6
6
+
7
+ * Removed _admin_sidebar.html.erb dependency by having a placeholder template in this gem
8
+ * Create installer to create an admin_sidebar template in host app
9
+ * Included login_info partial to the layout
10
+ * Polished language switcher to not show link of current language
11
+
12
+
4
13
  ## 0.0.5
5
14
 
6
15
  * Added language switcher
data/README.md CHANGED
@@ -16,11 +16,21 @@ And then execute:
16
16
 
17
17
  $ bundle
18
18
 
19
- And then of course restart your server! Typically:
19
+ Install the admin_sidebar partial
20
+
21
+ $ rails g tkh_admin_panel:install
22
+
23
+ And then of course start or restart your server!
20
24
 
21
25
  $ rails s
22
26
 
23
27
 
28
+
29
+ ## Pre-requisite
30
+
31
+ You need an authentication system with the current_user helper method
32
+
33
+
24
34
  ## Usage
25
35
 
26
36
  In your controller(s):
@@ -41,6 +41,11 @@ footer {
41
41
  input, textarea {
42
42
  width: 450px;
43
43
  }
44
+
45
+ .login-info {
46
+ margin: 1em;
47
+ text-align: left;
48
+ }
44
49
  //
45
50
  //.navbar { margin-bottom: 0; }
46
51
  //
@@ -23,6 +23,7 @@
23
23
  <div class="container-fluid">
24
24
  <div class="row-fluid">
25
25
  <div class="span12">
26
+ <%= render 'shared/login_info' %>
26
27
  <h1>Admin Panel<%= " for #{SETTINGS['site_name']}" if defined?(SETTINGS) && SETTINGS['site_name'] %></h1>
27
28
 
28
29
  <% flash.each do |name, msg| %>
@@ -0,0 +1,8 @@
1
+ <% content_for :admin_sidebar do %>
2
+ <h2>Sections</h2>
3
+ <ul>
4
+ <li>links go here</li>
5
+ </ul>
6
+
7
+ <p>To override this, run "rails g tkh_admin_panel:install" and customize the new partial to your liking</p>
8
+ <% end %>
@@ -12,7 +12,7 @@
12
12
  </a>
13
13
  <ul class="dropdown-menu">
14
14
  <% for loc in I18n.available_locales %>
15
- <%= link_to full_language_name(loc), :locale => loc %>
15
+ <%= link_to full_language_name(loc), :locale => loc unless loc.to_s == I18n.locale.to_s %>
16
16
  <% end %>
17
17
  </ul>
18
18
  </div>
@@ -0,0 +1,17 @@
1
+ require 'rails/generators/migration'
2
+
3
+ module TkhAdminPanel
4
+ module Generators
5
+ class FullInstallGenerator < ::Rails::Generators::Base
6
+
7
+ source_root File.expand_path('../templates', __FILE__)
8
+
9
+ desc "add a fully populated admin_sidebar partial"
10
+ def copy_view_partial
11
+ puts 'creating an admin_sidebar partial'
12
+ copy_file "_admin_sidebar.html.erb", "app/views/shared/_admin_sidebar.html.erb"
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,7 @@
1
+ <% content_for :admin_sidebar do %>
2
+ <h2>Sections</h2>
3
+ <ul>
4
+ <li><%= link_to 'illustrations', illustrations_path %></li>
5
+ <li><%= link_to 'users', users_path %></li>
6
+ </ul>
7
+ <% end %>
@@ -0,0 +1,17 @@
1
+ require 'rails/generators/migration'
2
+
3
+ module TkhAdminPanel
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+
7
+ source_root File.expand_path('../templates', __FILE__)
8
+
9
+ desc "add a sample admin_sidebar partial"
10
+ def copy_view_partial
11
+ puts 'creating an admin_sidebar partial'
12
+ copy_file "_admin_sidebar.html.erb", "app/views/shared/_admin_sidebar.html.erb"
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,6 @@
1
+ <% content_for :admin_sidebar do %>
2
+ <h2>Sections</h2>
3
+ <ul>
4
+ <li><%= link_to 'scaffold name', '#' %></li>
5
+ </ul>
6
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module TkhAdminPanel
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_admin_panel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-28 00:00:00.000000000 Z
12
+ date: 2012-07-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -78,7 +78,12 @@ files:
78
78
  - app/assets/stylesheets/admin.css.scss
79
79
  - app/assets/stylesheets/bootstrap_and_overrides.css.scss
80
80
  - app/views/layouts/admin.html.erb
81
+ - app/views/shared/_admin_sidebar.html.erb
81
82
  - app/views/shared/_language_switcher.html.erb
83
+ - lib/generators/tkh_admin_panel/full_install/full_install_generator.rb
84
+ - lib/generators/tkh_admin_panel/full_install/templates/_admin_sidebar.html.erb
85
+ - lib/generators/tkh_admin_panel/install/install_generator.rb
86
+ - lib/generators/tkh_admin_panel/install/templates/_admin_sidebar.html.erb
82
87
  - lib/tkh_admin_panel.rb
83
88
  - lib/tkh_admin_panel/version.rb
84
89
  - public/.DS_Store