bhf 0.6.24 → 0.6.25
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 +4 -4
- data/app/assets/javascripts/bhf/application.js +9 -0
- data/app/assets/javascripts/bhf/classes/AjaxEdit.js +5 -2
- data/app/assets/javascripts/bhf/classes/FormHelper.js +1 -1
- data/app/assets/stylesheets/bhf/application.css.sass +4 -4
- data/app/controllers/bhf/application_controller.rb +1 -1
- data/app/controllers/bhf/entries_controller.rb +8 -13
- data/app/views/bhf/helper/_flash.haml +4 -3
- data/app/views/bhf/pages/_platform.haml +5 -1
- data/app/views/layouts/bhf/application.haml +0 -1
- data/config/locales/de.yml +1 -1
- data/config/locales/en.yml +1 -1
- data/lib/bhf/pagination.rb +8 -24
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f826ec1cab0c75468cbe892bb70cc694a2cb9622
|
4
|
+
data.tar.gz: dd15052e8817004eca77a99a373b9981a95eed6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9d417a62b0f4a47d97e3c306d7c51f3b53eaf1178f0e24075831996c3ce60678714e07d604a6bb54f0a824623e3b871ccab4d623fac705f9efee0a8a2bcbc20
|
7
|
+
data.tar.gz: ebcba5e793e609b52b51b1b53a96849180d6e594c554eec566bc5a4cdc126c662753cb86f7d7936a8ed5c728a27c25409f6f678904534af1582097bf613cb67c
|
@@ -278,6 +278,15 @@ var initHelper = function(callback){
|
|
278
278
|
fm.removeClass.delay(10000, fm, 'show');
|
279
279
|
}
|
280
280
|
|
281
|
+
mainScope.getElements('.initial_referral').each(function(elem){
|
282
|
+
setTimeout(function(){
|
283
|
+
elem.removeClass('live_edit');
|
284
|
+
setTimeout(function(){
|
285
|
+
elem.removeClass('animate');
|
286
|
+
}, 600);
|
287
|
+
}, 500);
|
288
|
+
});
|
289
|
+
|
281
290
|
ajaxNote.success();
|
282
291
|
});
|
283
292
|
})();
|
@@ -19,7 +19,7 @@ var AjaxEdit = new Class({
|
|
19
19
|
this.newEntry = this.wrapElement.hasClass('add_field');
|
20
20
|
|
21
21
|
this.fireEvent('startRequest');
|
22
|
-
new Request.HTML({
|
22
|
+
this.currentRequest = new Request.HTML({
|
23
23
|
method: 'get',
|
24
24
|
evalScripts: false,
|
25
25
|
url: element.get('href'),
|
@@ -73,8 +73,11 @@ var AjaxEdit = new Class({
|
|
73
73
|
},
|
74
74
|
|
75
75
|
close: function(){
|
76
|
+
if (this.currentRequest) {
|
77
|
+
this.currentRequest.cancel();
|
78
|
+
}
|
76
79
|
this.holder.dispose();
|
77
|
-
this.fireEvent('closed')
|
80
|
+
this.fireEvent('closed');
|
78
81
|
},
|
79
82
|
|
80
83
|
injectForm: function(form){
|
@@ -84,7 +84,7 @@ var FormHelper = new Class({
|
|
84
84
|
button_bar: new Element('div').inject(mdTa, 'before'),
|
85
85
|
preview: livePreview,
|
86
86
|
output: htmlPreview,
|
87
|
-
buttons: 'bold italic link image ol ul heading hr undo redo
|
87
|
+
buttons: 'bold italic link image ol ul heading hr undo redo',
|
88
88
|
modifierKeys: false,
|
89
89
|
autoFormatting: false
|
90
90
|
});
|
@@ -493,10 +493,10 @@ form
|
|
493
493
|
&.wysiwyg
|
494
494
|
height: 400px
|
495
495
|
.errors
|
496
|
-
color:
|
496
|
+
color: $r1
|
497
497
|
.field_with_errors
|
498
498
|
input
|
499
|
-
border-color:
|
499
|
+
border-color: $r1
|
500
500
|
[disabled]
|
501
501
|
background: $g2 !important
|
502
502
|
input[type="submit"],
|
@@ -597,7 +597,7 @@ form
|
|
597
597
|
.error_explanation
|
598
598
|
margin-left: 20px
|
599
599
|
label
|
600
|
-
color:
|
600
|
+
color: $r1
|
601
601
|
cursor: pointer
|
602
602
|
display: block
|
603
603
|
&:hover
|
@@ -1124,7 +1124,7 @@ input[type="submit"].alt_button,
|
|
1124
1124
|
|
1125
1125
|
|
1126
1126
|
.translation_missing
|
1127
|
-
color:
|
1127
|
+
color: $r1 !important
|
1128
1128
|
|
1129
1129
|
|
1130
1130
|
@media screen and (-webkit-min-device-pixel-ratio: 1.5), screen and (min--moz-device-pixel-ratio: 1.5), screen and (min-device-pixel-ratio: 1.5)
|
@@ -103,7 +103,7 @@ class Bhf::ApplicationController < ActionController::Base
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def redirect_back_or_default(default, msg)
|
106
|
-
redirect_to(session[:return_to] || default, msg)
|
106
|
+
redirect_to(session[:return_to] || default, flash: msg)
|
107
107
|
session[:return_to] = nil
|
108
108
|
end
|
109
109
|
|
@@ -30,7 +30,7 @@ class Bhf::EntriesController < Bhf::ApplicationController
|
|
30
30
|
if @quick_edit
|
31
31
|
render json: object_to_bhf_display_hash, status: :ok
|
32
32
|
else
|
33
|
-
redirect_back_or_default(page_url(@platform.page_name, anchor: "#{@platform.name}_platform"), notice: set_message('create.success', @model))
|
33
|
+
redirect_back_or_default(page_url(@platform.page_name, anchor: "#{@platform.name}_platform"), {notice: set_message('create.success', @model), referral_entry: {id: @object.id, platform: @platform.name}})
|
34
34
|
end
|
35
35
|
else
|
36
36
|
@form_url = entries_path(@platform.name)
|
@@ -52,7 +52,7 @@ class Bhf::EntriesController < Bhf::ApplicationController
|
|
52
52
|
if @quick_edit
|
53
53
|
render json: object_to_bhf_display_hash, status: :ok
|
54
54
|
else
|
55
|
-
redirect_back_or_default(page_url(@platform.page_name, anchor: "#{@platform.name}_platform"), notice: set_message('update.success', @model))
|
55
|
+
redirect_back_or_default(page_url(@platform.page_name, anchor: "#{@platform.name}_platform"), {notice: set_message('update.success', @model), referral_entry: {id: @object.id, platform: @platform.name}})
|
56
56
|
end
|
57
57
|
else
|
58
58
|
@form_url = entry_path(@platform.name, @object)
|
@@ -128,20 +128,15 @@ class Bhf::EntriesController < Bhf::ApplicationController
|
|
128
128
|
|
129
129
|
def manage_many_to_many
|
130
130
|
return unless params[:has_and_belongs_to_many]
|
131
|
-
params[:has_and_belongs_to_many].each_pair do |relation,
|
131
|
+
params[:has_and_belongs_to_many].each_pair do |relation, ids|
|
132
132
|
reflection = @model.reflections[relation.to_sym]
|
133
133
|
|
134
|
-
|
135
|
-
|
136
|
-
|
134
|
+
next unless ids.any?
|
135
|
+
reflection.klass.unscoped.find(ids.keys).each do |relation_obj|
|
136
|
+
if ids[relation_obj.id.to_s].blank?
|
137
137
|
@object.send(relation).delete(relation_obj)
|
138
|
-
|
139
|
-
|
140
|
-
ids = all_ids.values.reject(&:blank?)
|
141
|
-
if ids.any?
|
142
|
-
reflection.klass.unscoped.find(ids).each do |relation_obj|
|
143
|
-
@object.send(relation) << relation_obj
|
144
|
-
end
|
138
|
+
else
|
139
|
+
@object.send(relation) << relation_obj
|
145
140
|
end
|
146
141
|
end
|
147
142
|
end
|
@@ -1,4 +1,5 @@
|
|
1
|
-
-
|
1
|
+
- f = {notice: (flash[:notice] if flash[:notice]), error: (flash[:error] if flash[:error])}.reject {|k, v| v.blank?}
|
2
|
+
- unless f.blank?
|
2
3
|
%ul#flash_massages.show
|
3
|
-
-
|
4
|
-
%li{class: type}= msg.html_safe
|
4
|
+
- f.each do |type, msg|
|
5
|
+
%li{class: type}= msg.to_s.html_safe
|
@@ -1,4 +1,8 @@
|
|
1
1
|
- platform.pagination.template = self
|
2
|
+
- referral_id = nil
|
3
|
+
- if flash[:referral_entry]
|
4
|
+
- referral_id = flash[:referral_entry][:platform] == platform.name && flash[:referral_entry][:id]
|
5
|
+
|
2
6
|
- if platform.custom_partial
|
3
7
|
= render partial: "bhf/pages/#{platform.custom_partial}", locals: {platform: platform}
|
4
8
|
- else
|
@@ -33,7 +37,7 @@
|
|
33
37
|
- platform.objects.each do |object|
|
34
38
|
- edit_link = edit_entry_path(platform.name, object)
|
35
39
|
- custom_link = send(platform.custom_link, platform.name, object) if platform.custom_link
|
36
|
-
%tr{id: "#{object.id}_#{platform.name}"}
|
40
|
+
%tr{id: "#{object.id}_#{platform.name}", class: ('animate live_edit initial_referral' if referral_id == object.id)}
|
37
41
|
- if platform.sortable
|
38
42
|
%td.drag
|
39
43
|
%span.handle.icon
|
data/config/locales/de.yml
CHANGED
@@ -28,7 +28,7 @@ de:
|
|
28
28
|
success: "%{model} wurde erfolgreich aktiviert"
|
29
29
|
error: "%{model} Fehler"
|
30
30
|
validation:
|
31
|
-
header:
|
31
|
+
header: 'Durch diese Fehler konnte "%{name}" nicht gespeichert werden:'
|
32
32
|
error: Fehler
|
33
33
|
file:
|
34
34
|
delete: Datei löschen
|
data/config/locales/en.yml
CHANGED
@@ -28,7 +28,7 @@ en:
|
|
28
28
|
success: "%{model} was activated successfuly"
|
29
29
|
error: "%{model} error"
|
30
30
|
validation:
|
31
|
-
header:
|
31
|
+
header: '%{error} prohibited this "%{name}" from being saved:'
|
32
32
|
error: error
|
33
33
|
file:
|
34
34
|
delete: Delete file
|
data/lib/bhf/pagination.rb
CHANGED
@@ -1,30 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
@param_name = @options.delete(:param_name) || Kaminari.config.param_name
|
7
|
-
@theme = @options[:theme] ? "#{@options.delete(:theme)}/" : ''
|
8
|
-
@params = @options[:params] ? template.params.merge(@options.delete :params) : template.params
|
9
|
-
end
|
10
|
-
|
11
|
-
def to_s(locals = {}) #:nodoc:
|
12
|
-
@template.render :partial => "kaminari/#{@theme}#{self.class.name.demodulize.underscore}", :locals => @options.merge(locals), :formats => [:html]
|
13
|
-
end
|
14
|
-
|
15
|
-
def page_url_for(page)
|
16
|
-
if @param_name.is_a?(Array)
|
17
|
-
@params[@param_name[0]] = (@params[@param_name[0]] || {}).merge(@param_name[1] => (page <= 1 ? nil : page))
|
18
|
-
return @template.url_for @params
|
19
|
-
end
|
20
|
-
|
21
|
-
@template.url_for @params.merge(@param_name => (page <= 1 ? nil : page))
|
22
|
-
end
|
1
|
+
Kaminari::Helpers::Tag.class_eval do
|
2
|
+
def page_url_for(page)
|
3
|
+
if @param_name.is_a?(Array)
|
4
|
+
@params[@param_name[0]] = (@params[@param_name[0]] || {}).merge(@param_name[1] => (page <= 1 ? nil : page))
|
5
|
+
return @template.url_for @params
|
23
6
|
end
|
7
|
+
|
8
|
+
@template.url_for @params.merge(@param_name => (page <= 1 ? nil : page))
|
24
9
|
end
|
25
10
|
end
|
26
|
-
# TODO: check for support here
|
27
|
-
# https://github.com/amatsuda/kaminari/pull/491
|
11
|
+
# TODO: check for support here https://github.com/amatsuda/kaminari/pull/491
|
28
12
|
|
29
13
|
|
30
14
|
module Bhf
|
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.
|
4
|
+
version: 0.6.25
|
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-
|
11
|
+
date: 2013-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|