bhm-admin 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- %h2.title== Editing #{current_resource_name}
1
+ %h2.title Editing #{current_resource_name}
2
2
 
3
3
  = humanized_errors_on resource
4
4
 
@@ -1,5 +1,5 @@
1
1
  #header-logo
2
- %h1== #{BHM::Admin.site_name}
2
+ %h1= BHM::Admin.site_name
3
3
 
4
4
  #header-menu
5
5
  %ul
@@ -1,4 +1,4 @@
1
- %h2.title== Add a new #{current_resource_name}
1
+ %h2.title Add a new #{current_resource_name}
2
2
 
3
3
  = humanized_errors_on resource
4
4
 
@@ -1,29 +1,29 @@
1
1
  !!! 5
2
2
  %html{:lang => "en", :dir => "ltr"}
3
3
  %head
4
- %title== #{BHM::Admin.site_name} - Admin Area
5
-
4
+ %title #{BHM::Admin.site_name} - Admin Area
5
+
6
6
  / Stylesheets
7
7
  = include_stylesheets(:admin, :media => 'screen, projection')
8
-
8
+
9
9
  / Javascripts
10
10
  /[if IE]
11
11
  = javascript_include_tag "http://html5shiv.googlecode.com/svn/trunk/html5.js"
12
12
  = include_javascripts(:admin)
13
13
  = csrf_meta_tag
14
14
  = yield :extra_head
15
-
15
+
16
16
  %body
17
17
  #container
18
18
  %header= render :partial => 'admin/shared/header'
19
19
  = flash_messages :alert, :notice
20
-
20
+
21
21
  %section#content-container
22
22
  %section#content= yield
23
23
  %section#sidebar
24
24
  - sidebar_content = content_for(:sidebar)
25
25
  = sidebar_content.present? ? sidebar_content : render(:partial => 'admin/shared/sidebar')
26
-
26
+
27
27
  %footer
28
28
  = render :partial => 'admin/shared/footer'
29
29
  = yield :page_bottom
data/bhm-admin.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bhm-admin}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Darcy Laycock"]
12
- s.date = %q{2010-12-14}
12
+ s.date = %q{2010-12-18}
13
13
  s.description = %q{Provides a reasonably dynamic and simple to use admin area for Rails 3 application. Built on a bunch of open source libraries.}
14
14
  s.email = %q{sutto@sutto.net}
15
15
  s.extra_rdoc_files = [
data/lib/bhm/admin.rb CHANGED
@@ -3,7 +3,7 @@ require 'active_support'
3
3
  module BHM
4
4
  module Admin
5
5
 
6
- VERSION = "0.3.1".freeze
6
+ VERSION = "0.3.2".freeze
7
7
 
8
8
  # Helpers for use in the admin area.
9
9
  autoload :SidebarHelper, 'bhm/admin/sidebar_helper'
@@ -1,6 +1,7 @@
1
1
  module BhmAdmin
2
2
  module Generators
3
3
  class ResourceGenerator < Rails::Generators::NamedBase
4
+ include Rails::Generators::ResourceHelpers
4
5
 
5
6
  def self.source_root
6
7
  @_bar_source_root ||= File.expand_path("templates", File.dirname(__FILE__))
@@ -9,11 +10,12 @@ module BhmAdmin
9
10
  check_class_collision :suffix => "Controller", :prefix => "Admin::"
10
11
 
11
12
  def create_controller_files
12
- template 'controller.rb', File.join('app/controllers/admin', class_path, "#{file_name}_controller.rb")
13
+ actual_class_path = controller_class_path + ["#{controller_file_path}_controller.rb"]
14
+ template 'controller.rb', File.join('app/controllers/admin', *actual_class_path)
13
15
  end
14
16
 
15
17
  def create_template_files
16
- base_path = File.join("app/views/admin", class_path, file_name)
18
+ base_path = File.join("app/views/admin", *(controller_class_path + [controller_file_path]))
17
19
  empty_directory base_path
18
20
  %w(new edit index show _form).each do |view|
19
21
  sub_path = "#{view}.html.haml"
@@ -1,2 +1,2 @@
1
- class Admin::<%= class_name %>Controller < Admin::BaseController
1
+ class Admin::<%= controller_class_name %>Controller < Admin::BaseController
2
2
  end
@@ -1,4 +1,4 @@
1
- %h2.title== Viewing all #{current_resource_name.pluralize}
1
+ %h2.title Viewing all #{current_resource_name.pluralize}
2
2
 
3
3
  - column_names = default_collection_columns
4
4
 
@@ -17,5 +17,5 @@
17
17
  %td=vwd r.try(column)
18
18
  %td.actions= individual_resource_links r
19
19
  = empty_row_for_collection column_names.size
20
-
20
+
21
21
  = will_paginate collection
@@ -1,4 +1,4 @@
1
- %h2.title== Viewing #{current_resource_name}
1
+ %h2.title Viewing #{current_resource_name}
2
2
 
3
3
  = show_for resource do |r|
4
4
  - (resource_class.column_names - [:created_at, :updated_at]).each do |column|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bhm-admin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Darcy Laycock
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-14 00:00:00 +08:00
18
+ date: 2010-12-18 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency