tkh_admin_panel 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
 
4
4
 
5
5
 
6
+
7
+ ## 0.0.8
8
+
9
+ * Added a link to public web site in admin panel header
10
+ * Refactored the setup rake task and generators. Although there are no needed translations now. The generator is ready to accommodate any which would be needed in the future.
11
+ * There is now a 'rake tkh_admin_panel task
12
+
13
+
6
14
  ## 0.0.7
7
15
 
8
16
  * Added a switch_to_admin_layout controller extended instance method
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Swami Atma - Ten Thousand Hours
1
+ Copyright (c) 2012 | Ten Thousand Hours - Swami Atma
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -18,14 +18,13 @@ And then execute:
18
18
 
19
19
  Install the admin_sidebar partial
20
20
 
21
- $ rails g tkh_admin_panel:install
21
+ $ rake tkh_admin_panel:setup
22
22
 
23
23
  And then of course start or restart your server!
24
24
 
25
25
  $ rails s
26
26
 
27
27
 
28
-
29
28
  ## Pre-requisite
30
29
 
31
30
  You need an authentication system with the current_user helper method
@@ -24,7 +24,7 @@
24
24
  <div class="row-fluid">
25
25
  <div class="span12">
26
26
  <%= render 'shared/login_info' %>
27
- <h1>Admin Panel<%= " for #{SETTINGS['site_name']}" if defined?(SETTINGS) && SETTINGS['site_name'] %></h1>
27
+ <h1>Admin Panel<%= " for #{link_to(SETTINGS['site_name'], root_path) if defined?(SETTINGS) && SETTINGS['site_name']}".html_safe %></h1>
28
28
 
29
29
  <% flash.each do |name, msg| %>
30
30
  <div class="alert alert-<%= name == :notice ? "success" : "error" %>">
@@ -4,5 +4,5 @@
4
4
  <li>links go here</li>
5
5
  </ul>
6
6
 
7
- <p>To override this, run "rails g tkh_admin_panel:install" and customize the new partial to your liking</p>
7
+ <p>To override this, run "rake tkh_admin_panel:setup" and customize the new partial to your liking</p>
8
8
  <% end %>
@@ -1,5 +1,9 @@
1
1
  <% def full_language_name( lang = :en) %>
2
- <% list = {:en => 'English', :fr => 'Français', :es => 'Español'} %>
2
+ <% list = { :en => 'English',
3
+ :fr => 'Français',
4
+ :es => 'Español'
5
+ }
6
+ %>
3
7
  <% list[lang] %>
4
8
  <% end %>
5
9
 
@@ -2,7 +2,7 @@ require 'rails/generators/migration'
2
2
 
3
3
  module TkhAdminPanel
4
4
  module Generators
5
- class FullInstallGenerator < ::Rails::Generators::Base
5
+ class CopyFilesGenerator < ::Rails::Generators::Base
6
6
 
7
7
  source_root File.expand_path('../templates', __FILE__)
8
8
 
@@ -0,0 +1,8 @@
1
+ <% content_for :admin_sidebar do %>
2
+ <h2>Sections</h2>
3
+ <ul>
4
+ <li><%= link_to 'scaffold name', 'path' %></li>
5
+ <li>for example ...</li>
6
+ <li><%= link_to 'pages', pages_path %></li>
7
+ </ul>
8
+ <% end %>
@@ -0,0 +1,16 @@
1
+ require 'rails/generators/migration'
2
+
3
+ module TkhAdminPanel
4
+ module Generators
5
+ class CreateOrUpdateLocalesGenerator < ::Rails::Generators::Base
6
+ source_root File.expand_path('../templates', __FILE__)
7
+ desc "copying latest version of locale files"
8
+ def copy_locales
9
+ puts 'creating locale files'
10
+ I18n.available_locales.each do |l|
11
+ copy_file "#{l.to_s}.yml", "config/locales/tkh_admdn_panel.#{l.to_s}.yml"
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,3 @@
1
+ en:
2
+ language_name: English
3
+
@@ -0,0 +1,3 @@
1
+ es:
2
+ language_name: "Español"
3
+
@@ -0,0 +1,3 @@
1
+ fr:
2
+ language_name: Français
3
+
@@ -0,0 +1,7 @@
1
+ namespace :tkh_admin_panel do
2
+ desc "Create locale and other files"
3
+ task :setup do
4
+ system 'rails g tkh_admin_panel:copy_files'
5
+ system 'rails g tkh_admin_panel:create_or_update_locales'
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module TkhAdminPanel
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
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.7
4
+ version: 0.0.8
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-31 00:00:00.000000000 Z
12
+ date: 2012-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -80,10 +80,13 @@ files:
80
80
  - app/views/layouts/admin.html.erb
81
81
  - app/views/shared/_admin_sidebar.html.erb
82
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
83
+ - lib/generators/tkh_admin_panel/copy_files/copy_files_generator.rb
84
+ - lib/generators/tkh_admin_panel/copy_files/templates/_admin_sidebar.html.erb
85
+ - lib/generators/tkh_admin_panel/create_or_update_locales/create_or_update_locales_generator.rb
86
+ - lib/generators/tkh_admin_panel/create_or_update_locales/templates/en.yml
87
+ - lib/generators/tkh_admin_panel/create_or_update_locales/templates/es.yml
88
+ - lib/generators/tkh_admin_panel/create_or_update_locales/templates/fr.yml
89
+ - lib/tasks/tkh_admin_panel_tasks.rake
87
90
  - lib/tkh_admin_panel.rb
88
91
  - lib/tkh_admin_panel/tkh_admin_panel_action_controller_extension.rb
89
92
  - lib/tkh_admin_panel/version.rb
@@ -1,7 +0,0 @@
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 %>
@@ -1,17 +0,0 @@
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
@@ -1,6 +0,0 @@
1
- <% content_for :admin_sidebar do %>
2
- <h2>Sections</h2>
3
- <ul>
4
- <li><%= link_to 'scaffold name', '#' %></li>
5
- </ul>
6
- <% end %>