adminsite 3.2.3 → 3.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf15ecd660a816dfa0edb596afbfa21dcb78c9e9
4
- data.tar.gz: 77d371ea28878b46464ec84370bda25c03a30d09
3
+ metadata.gz: ec1dc6526cbc7a4b7a922dc006ef7734a5c4a70c
4
+ data.tar.gz: 5c2a69196c00a6671a393a933a67cfefc5c3b9e0
5
5
  SHA512:
6
- metadata.gz: 2cb4dcb90da3ab9402ca59e2ac6a55fa482f510a25f3fd1cf3ee897e06d3352da4220aa38926b87d4bdfed9f20346e709dc0be8df156f0bd42b798245b38190c
7
- data.tar.gz: 82f4d6780486145da3496641e360d2c405d71bca52d50bf297f0ec6383a0bcdc25aa5eb0753f4e2410acca4f9a5ba7176eac1a5bbb5d0fc5da6af7fff72496fa
6
+ metadata.gz: 24c934899bfe48ca079c7959256f4d3168bcca77bbca7a0dfb0b302259c5fa9b1a3c0f192df62a957f85f4793348194c1ae9b99b1a86bd0f83aa4ae0a5e0d11d
7
+ data.tar.gz: 1ba60ed0f8ea560901cc4695303b51d588694ccf95a7d63c3d9fcb564bf1cc967dec647d102aa6c0485a431d334dc4b61192337b1ff4d9c3f52a1b0a10797f9a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- adminsite (3.2.3)
4
+ adminsite (3.2.4)
5
5
  actionpack-page_caching
6
6
  cancancan (~> 1.10)
7
7
  codemirror-rails (>= 4.8)
@@ -135,6 +135,9 @@ body.adminsite {
135
135
  li {
136
136
  border-left: 1px solid black;
137
137
  padding: 0 0.3em 0 0.5em;
138
+ &.active a {
139
+ font-weight: bold;
140
+ }
138
141
  &:first-child {
139
142
  border-left: 0;
140
143
  padding-left: 0;
@@ -119,8 +119,10 @@ class Adminsite::Admin::ResourcesController < Adminsite::Admin::CrudController
119
119
  end
120
120
 
121
121
  def filter_scopes
122
- return [] if params[:scope].blank?
123
- resource_admin_config.scopes & params[:scope].split(',').collect{|s| s.to_sym }
122
+ @scopes ||= []
123
+ return @scopes if params[:scope].blank?
124
+ scopes = params[:scope].split(',').collect(&:to_sym)
125
+ @scopes = resource_admin_config.scopes.collect(&:to_sym) & scopes
124
126
  end
125
127
 
126
128
  def order_params
@@ -133,7 +135,6 @@ class Adminsite::Admin::ResourcesController < Adminsite::Admin::CrudController
133
135
  @resource_admin_config
134
136
  end
135
137
 
136
-
137
138
  class << self
138
139
 
139
140
  def content_menu_label
@@ -7,7 +7,12 @@
7
7
  - resource_admin_config.scopes.each do |scope|
8
8
  - scope_label = "#{scope.to_s.titlecase} <span class=\"count\">(#{resource_class.send(scope).ransack(params[:q]).result.count})</span>".html_safe
9
9
  - scope_path = "#{admin_resource_path(nil,nil,@ransack_params )}&scope=#{scope}"
10
- %li #{link_to scope_label, scope_path}
10
+ - if @scopes.try(:include?, scope.to_sym) || scope.to_sym == (params[:scope].try(:to_sym) || :all)
11
+ - li_class = 'active'
12
+ - else
13
+ - li_class = nil
14
+ - @scopes
15
+ %li{class: li_class} #{link_to scope_label, scope_path}
11
16
  - if resource_admin_config.attributes_search.any?
12
17
  #search_filters
13
18
  %label |
@@ -6,7 +6,7 @@
6
6
  = stylesheet_link_tag 'adminsite'
7
7
  = javascript_include_tag 'adminsite'
8
8
  %body.adminsite
9
- %h1
9
+ %h1= Adminsite.config.title
10
10
  = render :partial => 'adminsite/admin/shared/admin_menu' if current_adminsite_admin_user.present?
11
11
  = render :partial => 'adminsite/admin/shared/content_menu' if current_adminsite_admin_user.present?
12
12
 
@@ -4,8 +4,11 @@ module Adminsite
4
4
 
5
5
  attr_accessor :admin_namespace # :admin
6
6
 
7
+ attr_accessor :title
8
+
7
9
  # Configuration defaults
8
10
  def initialize
11
+ @title = Rails.application.class.parent_name.titleize
9
12
  @admin_namespace = :admin
10
13
  end
11
14
 
@@ -1,3 +1,3 @@
1
1
  module Adminsite
2
- VERSION = "3.2.3" unless defined?(Adminsite::VERSION)
2
+ VERSION = "3.2.4" unless defined?(Adminsite::VERSION)
3
3
  end
@@ -15,6 +15,8 @@ module Adminsite
15
15
 
16
16
  template "views/index.html.haml", "app/views/adminsite/admin/dashboard/index.html.haml"
17
17
 
18
+ template "views/index.html.haml", "app/views/adminsite/admin/dashboard/index.html.haml"
19
+
18
20
  # Content-Menu
19
21
  inject_into_file "app/views/adminsite/admin/shared/_admin_menu.html.haml", :after => /\= yield :admin_menu\n/ do\
20
22
  # "\n = menu_item 'IFrameMgt', admin_#Dashboard_index_path, ['#{@file_name}']\n"
@@ -35,6 +35,9 @@ module Adminsite
35
35
  puts "Setting up CanCan"
36
36
  copy_file "#{Adminsite::Engine.root}/app/models/adminsite/ability.rb", 'app/models/adminsite/ability.rb'
37
37
 
38
+ # initializers
39
+ template 'config/initializers/adminsite.rb', 'config/initializers/adminsite.rb'
40
+
38
41
  # Locales
39
42
  copy_file "config/locales/adminsite.da.yml", 'config/locales/adminsite.da.yml'
40
43
  copy_file "config/locales/adminsite.en.yml", 'config/locales/adminsite.en.yml'
@@ -0,0 +1,3 @@
1
+ Adminsite.configure do |config|
2
+ # config.title = Rails.application.class.parent_name.titleize
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adminsite
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.3
4
+ version: 3.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Wunderlin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-09 00:00:00.000000000 Z
11
+ date: 2016-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -362,6 +362,7 @@ files:
362
362
  - lib/generators/adminsite/install/install_generator.rb
363
363
  - lib/generators/adminsite/install/templates/assets/adminsite.js
364
364
  - lib/generators/adminsite/install/templates/assets/adminsite.scss
365
+ - lib/generators/adminsite/install/templates/config/initializers/adminsite.rb
365
366
  - lib/generators/adminsite/install/templates/config/locales/adminsite.da.yml
366
367
  - lib/generators/adminsite/install/templates/config/locales/adminsite.en.yml
367
368
  - lib/generators/adminsite/install/templates/recipes/application.rb