bhf 0.7.8 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a11ce825c2b389e3240cb1cde9da695a23e4fb2b
4
- data.tar.gz: ad5abf46d9afd087f7ad23ed74536da517f29d95
3
+ metadata.gz: 6258a93fccb709c75facbf4c58f86773f25c8d45
4
+ data.tar.gz: bf9b39ef971a4c9107135615df4debda7db5d616
5
5
  SHA512:
6
- metadata.gz: 35d7ad8fe8327650d80c02c023f96db907f63a498e78c5817c02c07c520686adef905086288673bbf4082a476301d179f6dfd51548a36080cce97c85c7a32d97
7
- data.tar.gz: 3ca16947d38d86c37f979adf6e502fe598202783dc2aa99ffdab5e757b4bfb49b410f3d5e5271220363f52ee7e00c4b987a58c4b3690e564ce6543594813ca47
6
+ metadata.gz: 3dce6785d36d190332c0eaea91c33e7d482df8075ade512648dce0decb4ddc072e68184f925dd0171d5d8e35f3f638b24b5e97ef67f79757d60eca0354a67988
7
+ data.tar.gz: 03e40f0335a6097dfa8fb9cec8150c98b7014827dfbfced2211bc2f5c6306daee6fbca117bf4db54b0f42c02b10067bebaa50c911f4cb93d5861d514904149a1
@@ -4,11 +4,11 @@
4
4
  %meta{charset: 'utf-8'}
5
5
  %title= @title
6
6
  %link{href: "/favicon.ico?#{@app_title.to_s.downcase}", rel: 'icon', type: 'image/x-icon'}
7
- - (['bhf/application'] + Bhf::Engine.config.bhf.css.to_a).each do |css|
7
+ - Bhf::Engine.config.bhf.css.each do |css|
8
8
  = stylesheet_link_tag css
9
9
  %body
10
+
10
11
  %header
11
-
12
12
  %h1
13
13
  - logo = if params[:bhf_area] && Rails.application.assets.find_asset("logo_#{params[:bhf_area]}_bhf.svg")
14
14
  - "logo_#{params[:bhf_area]}_bhf.svg"
@@ -17,7 +17,7 @@
17
17
 
18
18
  = link_to image_tag(logo), @root_link ? @root_link : main_app.root_url, :'data-no-turbolink' => true
19
19
 
20
- - if @areas and @areas.length > 1
20
+ - if @areas && @areas.length > 1
21
21
  = select_tag :area_select, options_from_collection_for_select(@areas, 'path', 'name', main_app.bhf_path(params[:bhf_area])), class: 'icon'
22
22
 
23
23
  - if @config && @config.pages.any?
@@ -36,5 +36,5 @@
36
36
  = render 'bhf/user'
37
37
  = render 'bhf/footer'
38
38
 
39
- - (['bhf/application'] + Bhf::Engine.config.bhf.js.to_a).each do |js|
39
+ - Bhf::Engine.config.bhf.js.each do |js|
40
40
  = javascript_include_tag js, {:'data-turbolinks-eval' => false}
@@ -1,4 +1,4 @@
1
- en:
1
+ en:
2
2
  bhf:
3
3
  page_title: "%{title} – Admin"
4
4
  areas:
@@ -41,10 +41,9 @@ en:
41
41
  input:
42
42
  date_format:
43
43
  timestamp: '%Y-%m-%d %H:%M'
44
- datetime: '%Y-%m-%d %H:%M'
44
+ datetime: '%Y-%m-%d %H:%M'
45
45
  date: '%Y-%m-%d'
46
46
  time: '%H:%M'
47
-
48
47
  quick_edit:
49
48
  buttons:
50
49
  cancel: Cancel
data/lib/bhf.rb CHANGED
@@ -1,46 +1,39 @@
1
- def d(var)
2
- raise var.inspect.split(', ').join(",\n")
3
- end
4
- require 'haml'
5
- require 'kaminari'
6
-
7
1
  module Bhf
8
2
  class Engine < Rails::Engine
9
3
 
10
4
  isolate_namespace Bhf
11
5
 
12
- # config.bhf defaults
13
- config.bhf = OpenStruct.new
14
- config.bhf.page_title = nil
15
- config.bhf.on_login_fail = :root_url
16
- config.bhf.logout_path = :logout_path
17
- config.bhf.session_auth_name = :is_admin
18
- config.bhf.session_account_id = :admin_account_id
19
- config.bhf.account_model = 'User'
20
- config.bhf.account_model_find_method = 'find'
21
- config.bhf.css = []
22
- config.bhf.js = []
23
- config.bhf.abstract_config = []
24
-
25
- # config.bhf.bhf_logic = YAML::load(IO.read('config/bhf.yml'))
6
+ config.bhf = OpenStruct.new(
7
+ on_login_fail: :root_url,
8
+ logout_path: :logout_path,
9
+ session_auth_name: :is_admin,
10
+ session_account_id: :admin_account_id,
11
+ account_model: 'User',
12
+ account_model_find_method: 'find',
13
+ css: ['bhf/application'],
14
+ js: ['bhf/application'],
15
+ abstract_config: []
16
+ )
26
17
 
27
- initializer 'bhf.action_controller' do |app|
18
+ initializer 'bhf.helper' do |app|
28
19
  ActiveSupport.on_load :action_controller do
29
20
  helper Bhf::FrontendHelper
30
21
  end
31
22
  end
32
23
 
33
- initializer 'bhf.hooks' do
34
- if defined?(::ActiveRecord)
35
- ::ActiveRecord::Base.send :include, Bhf::ActiveRecord::Object
24
+ initializer 'bhf.model_hooks' do
25
+ ActiveSupport.on_load :active_record do
26
+ include Bhf::ActiveRecord::Object
36
27
  end
37
- if defined?(::Mongoid)
38
- ::Mongoid::Document.send :include, Bhf::Mongoid::Document
28
+ ActiveSupport.on_load :mongoid do
29
+ include Bhf::Mongoid::Document
39
30
  end
40
31
  end
41
32
  end
42
33
  end
43
34
 
35
+ require 'haml'
36
+ require 'kaminari'
44
37
  require 'bhf/active_record/active_record'
45
38
  require 'bhf/mongoid/document'
46
39
  require 'bhf/data'
@@ -49,5 +42,3 @@ require 'bhf/config_parser'
49
42
  require 'bhf/settings'
50
43
  require 'bhf/pagination'
51
44
  require 'bhf/form'
52
-
53
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bhf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.8
4
+ version: 0.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Pawlik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-26 00:00:00.000000000 Z
11
+ date: 2014-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails