bhf 0.6.21 → 0.6.22

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: ea3828bf228388314f66419153703d30d693255f
4
- data.tar.gz: c8391df2548607b8a27363b550b73edaa0610b3e
3
+ metadata.gz: d655617e2044bd17eed546420dbb327be3a5249c
4
+ data.tar.gz: a469136f9ff5e25146665d49ba4de00ce72fa09e
5
5
  SHA512:
6
- metadata.gz: 95313defc1225ba4e8b4965a4a799136a0060edb80facee19a279a9e370411bb1631d7ec2739d2e5cc3d4b4b6c778e0c0ecda133e6eb467af862b7423ffa8754
7
- data.tar.gz: 1fd7e80f81ca5f5fe5ee4b9a6b55e4edd7ac5090f118496e291a9d112bac2af369940b7a8da6023a89c988446ca921fd9d26536cd4ada92c3b35b78d27e0caec
6
+ metadata.gz: bad7751589cf51c48fa5ccba35fd4d4b99ec73a345f1436bbf3592bdeafb01f2225020504913459d7c4e7288594de89ca032ebc727ee0c3d4ca89fbfe5ea8af2
7
+ data.tar.gz: fec1926b811562320c7bdc0d3c09ed947e9493ccd0bb31e1ab8b8eb6bc6f9f38f36df4ab0a1b31387a28a6bf262bec4dafc2274e9ce0ce5be57ec944e2a3a756
@@ -207,7 +207,7 @@ var initHelper = function(callback){
207
207
  e.target.getParent('li').dispose();
208
208
  },
209
209
  'ajax:failure': function(html){
210
- alert(Locale.get('Messages.warning'));
210
+ alert(Locale.get('Notifications.failure'));
211
211
  }
212
212
  });
213
213
  });
@@ -10,28 +10,8 @@ var AjaxEdit = new Class({
10
10
 
11
11
  initialize: function(_options){
12
12
  this.setOptions(_options);
13
- this.holder = new Element('div.quick_edit_holder').addEvents({
14
- 'click:relay(.open)': function(e){
15
- e.preventDefault();
16
- Turbolinks.visit((this.wrapElement.getElement('a') || this.wrapElement).get('href'));
17
- }.bind(this),
18
- 'click:relay(.cancel)': function(e){
19
- e.preventDefault();
20
- this.close();
21
- }.bind(this),
22
- 'click:relay(.save_and_next)': function(e){
23
- e.preventDefault();
24
- this.submit(this.newEntry ? ['successAndAdd'] : ['successAndChange', 'successAndNext']);
25
- }.bind(this),
26
- 'click:relay(.save)': function(e){
27
- e.preventDefault();
28
- this.submit(this.newEntry ? ['successAndAdd'] : ['successAndChange']);
29
- }.bind(this),
30
- 'submit:relay(form)': function(e){
31
- e.preventDefault();
32
- this.submit(this.newEntry ? ['successAndAdd'] : ['successAndChange']);
33
- }.bind(this)
34
- });
13
+ this.holder = new Element('div.quick_edit_holder');
14
+
35
15
  },
36
16
 
37
17
  startEdit: function(element, wrapElement){
@@ -106,9 +86,31 @@ var AjaxEdit = new Class({
106
86
 
107
87
  injectForm: function(form){
108
88
  this.holder.innerHTML = form;
89
+
90
+ this.holder.getElements('.open').addEvent('click', function(e){
91
+ e.preventDefault();
92
+ Turbolinks.visit((this.wrapElement.getElement('a') || this.wrapElement).get('href'));
93
+ }.bind(this));
94
+ this.holder.getElements('.cancel').addEvent('click', function(e){
95
+ e.preventDefault();
96
+ this.close();
97
+ }.bind(this));
98
+ this.holder.getElements('.save_and_next').addEvent('click', function(e){
99
+ e.preventDefault();
100
+ this.submit(this.newEntry ? ['successAndAdd'] : ['successAndChange', 'successAndNext']);
101
+ }.bind(this));
102
+ this.holder.getElements('.save').addEvent('click', function(e){
103
+ e.preventDefault();
104
+ this.submit(this.newEntry ? ['successAndAdd'] : ['successAndChange']);
105
+ }.bind(this));
106
+ this.holder.getElements('form').addEvent('submit', function(e){
107
+ e.preventDefault();
108
+ this.submit(this.newEntry ? ['successAndAdd'] : ['successAndChange']);
109
+ }.bind(this));
110
+
109
111
  this.holder.inject($(this.options.holderParent));
110
112
 
111
- this.fireEvent('formInjected', [this.holder]);
113
+ this.fireEvent('formInjected', [this.holder]);
112
114
  },
113
115
 
114
116
  hide: function(){
@@ -51,7 +51,7 @@ var PlatformHelper = new Class({
51
51
  this.getParent('tr').dispose();
52
52
  },
53
53
  'ajax:failure': function(html){
54
- alert(Locale.get('Messages.warning'));
54
+ alert(Locale.get('Notifications.failure'));
55
55
  }
56
56
  });
57
57
  });
@@ -24,7 +24,7 @@ window.addEvent('domready', function(){
24
24
  param: rails.getCsrf('param')
25
25
  };
26
26
 
27
- rails.applyEvents();
27
+ // rails.applyEvents();
28
28
  });
29
29
 
30
30
  (function($){
@@ -6,6 +6,7 @@ $w1: #fff
6
6
  $w2: #F1F1F1
7
7
  $k1: #000
8
8
  $b1: #38A5E9
9
+ $r1: #E93838
9
10
  $b2: #0F8FDD
10
11
  $g1: #7F7F7F
11
12
  $g2: #ccc
@@ -50,6 +51,12 @@ header
50
51
  height: 50px
51
52
  nav
52
53
  padding-top: 25px
54
+ .shrink_space
55
+ li
56
+ margin-right: 5px
57
+ a
58
+ padding-left: 19px
59
+ padding-right: 19px
53
60
  li
54
61
  float: left
55
62
  font-weight: bold
@@ -60,10 +67,10 @@ header
60
67
  +text-shadow(#fff)
61
68
  +bg-gradient(#eaeaea, #D5D5D5)
62
69
  +box-shadow(0, 1, 4)
63
- color: #414756
70
+ color: #3e3e3e
64
71
  &:hover
65
- +bg-gradient(#D5D5D5, #FFFFFF)
66
- color: #414756
72
+ +bg-gradient(#FFFFFF, #FFFFFF)
73
+ color: $b2
67
74
  border-color: #FFFFFF
68
75
  +text-shadow(#fff)
69
76
  a
@@ -242,7 +249,7 @@ table.data_table
242
249
  color: #3E3E3E
243
250
  .info
244
251
  margin: 0 20px 0 10px
245
- width: 290px
252
+ min-width: 290px
246
253
  text-transform: uppercase
247
254
  font-size: 12px
248
255
  color: $g1
@@ -458,7 +465,7 @@ form
458
465
  color: $g3
459
466
  +text-shadow(#fff)
460
467
  .field_with_errors
461
- color: red
468
+ color: $r1
462
469
  .input
463
470
  input[type="password"],
464
471
  input[type="text"],
@@ -510,18 +517,6 @@ form
510
517
  .multiple_field,
511
518
  .array_fields
512
519
  display: block
513
- .add_field
514
- display: block
515
- font-size: 20px
516
- font-weight: bold
517
- width: 30px
518
- margin-left: -8px
519
- cursor: pointer
520
- text-align: center
521
- color: $k1 !important
522
- text-decoration: none !important
523
- &:hover
524
- color: $b1 !important
525
520
  .uploaded_file,
526
521
  .uploaded_image
527
522
  padding: 2px
@@ -540,19 +535,44 @@ form
540
535
  color: $b1
541
536
  .warning
542
537
  font-weight: bold
543
- .quick_edit
544
- text-decoration: underline
545
- color: $b2
546
- .relation
547
- li
548
- &:hover
549
- .delete
550
- opacity: 1
551
- +transition-duration(0.5)
538
+ .add_field,
539
+ .relation .quick_edit
540
+ color: $b1
541
+ text-decoration: none
542
+ border: 2px solid $b1
543
+ background: white
544
+ padding: 3px 6px
545
+ border-radius: 4px
546
+ margin-left: -6px
547
+ display: inline-block
548
+ margin-bottom: 8px
549
+ &:hover
550
+ color: white
551
+ background-color: $b1
552
+ &.live_edit
553
+ color: white
554
+ background-color: $b2
555
+ border-color: $b2
556
+ .add_field
557
+ font-size: 20px
558
+ font-weight: bold
559
+ padding: 0 8px 6px 8px
560
+ line-height: 20px
561
+ cursor: pointer
562
+ .relation
563
+ li
564
+ &:hover
552
565
  .delete
553
- opacity: 0
554
- &:hover
555
- color: $b1
566
+ opacity: 1
567
+ +transition-duration(0.5)
568
+ .delete
569
+ opacity: 0
570
+ font-size: 20px
571
+ font-weight: bold
572
+ padding: 0 8px 6px 8px
573
+ line-height: 20px
574
+ &:hover
575
+ color: $r1
556
576
 
557
577
  .cancel
558
578
  margin-left: 20px
@@ -71,8 +71,8 @@ class Bhf::ApplicationController < ActionController::Base
71
71
 
72
72
 
73
73
  def set_title
74
- @title = Bhf::Engine.config.page_title ||
75
- (Rails.application.class.to_s.split('::').first+' &ndash; Admin').html_safe
74
+ @app_title = Rails.application.class.to_s.split('::').first
75
+ @title = Bhf::Engine.config.page_title || ("#{@app_title} &ndash; Admin").html_safe
76
76
  end
77
77
 
78
78
  def set_message(type, model = nil)
@@ -3,7 +3,7 @@
3
3
  %head
4
4
  %meta{charset: 'utf-8'}
5
5
  %title= @title
6
- %link{href: '/favicon.ico', rel: 'icon', type: 'image/x-icon'}
6
+ %link{href: "/favicon.ico?#{@app_title.downcase}", rel: 'icon', type: 'image/x-icon'}
7
7
  - (['bhf/application'] + Bhf::Engine.config.css.to_a).each do |css|
8
8
  = stylesheet_link_tag css
9
9
  %body
@@ -13,7 +13,7 @@
13
13
  = link_to image_tag(asset_path(logo)), main_app.root_url, :'data-no-turbolink' => true
14
14
  - if @config && @config.pages.any?
15
15
  %nav
16
- %ul
16
+ %ul{class: ('shrink_space' if @config.pages.count > 7)}
17
17
  - @config.pages.each do |page|
18
18
  %li{class: ('active' if @page == page)}
19
19
  = link_to t("bhf.pages.navigation.#{page}", default: page.capitalize), page_path(page)
data/config/routes.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  Bhf::Engine.routes.draw do
2
+
2
3
  root to: 'application#index'
3
4
 
4
5
  get 'page/:page', to: 'pages#show', as: :page
@@ -6,11 +7,10 @@ Bhf::Engine.routes.draw do
6
7
  scope ':platform' do
7
8
  resources :entries, except: [:index] do
8
9
  put :sort, on: :collection
10
+ post :duplicate, on: :member
9
11
 
10
12
  resources :embed_entries, except: [:index, :show], as: :embed
11
- post :duplicate, on: :member
12
13
  end
13
14
  end
14
15
 
15
- #()((.+)_?(path|url))
16
16
  end
data/lib/bhf/platform.rb CHANGED
@@ -161,7 +161,7 @@ module Bhf
161
161
  end
162
162
 
163
163
  def hide_create
164
- table_options 'hide_create'
164
+ table_options('hide_create') || table_options('hide_new')
165
165
  end
166
166
 
167
167
  def show_duplicate
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.6.21
4
+ version: 0.6.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Pawlik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-18 00:00:00.000000000 Z
11
+ date: 2013-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails