bhf 0.7.12 → 0.7.13

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: 7717f7f0c45558fea58b5b3291ad36d6e6bd3859
4
- data.tar.gz: 07ec367b90eeeb5402a83399fc7ae321587ce1d2
3
+ metadata.gz: 58d3c238599cf5b5d56b13769f3fb6ca7bf25485
4
+ data.tar.gz: a53e7eb6589687782d07be6e0b53e5bb5add59a5
5
5
  SHA512:
6
- metadata.gz: da31a849f79f4ccae09235f4accafe382540f97e25239404fcc97f2a7b6e35ee1f4734189cd66ae89bd60717394092f49beecb12d0a30910c88350a91029fd12
7
- data.tar.gz: 010e4e702c586a48d5ccac78cf2c28c654deb3bca945c634936f062c0bb51a8efb5f1d20c9f91cdd0d1043b52ecb93e508404287e9aa598267992b99e069a9b5
6
+ metadata.gz: d04a4904b6d237ce6a5edcb09fe10bc89c142137f0ba00f1e2695959f5aadb5fcdf0c3c3ef9dc7d74c67fa41ab4460d6b2b862ecff486987c05b9d093a390b5c
7
+ data.tar.gz: e7be85db1268a307a1725d9fa0ee92e9c528d9fa17fedc07355b66ba9ff28d7963e5434ecd90f2b3d82b8151de89bbf219c9a005d2b0b0bafb885acc364db1b9
@@ -80,12 +80,10 @@ class Bhf::EntriesController < Bhf::ApplicationController
80
80
  end
81
81
 
82
82
  def sort
83
- sort_attr = (@platform.sortable_property || @platform.sortable).to_sym
84
-
85
83
  params[:order].each do |order|
86
84
  @model.
87
85
  find(order[1].gsub("_#{@platform.name}", '')).
88
- update_attribute(sort_attr, order[0].to_i)
86
+ update_attribute(@platform.sortable_property, order[0].to_i)
89
87
  end
90
88
 
91
89
  head :ok
@@ -20,6 +20,16 @@ module Bhf
20
20
  def delete_t(platform)
21
21
  t("bhf.helpers.entry.models.#{platform.model_name}.delete", platform_name: platform.title_singular, default: t('bhf.helpers.entry.delete')).html_safe
22
22
  end
23
+
24
+ def find_smallest_size_url_for_file(file)
25
+ if file.exists?(:thumb)
26
+ file.url(:thumb)
27
+ elsif file.exists?(:medium)
28
+ file.url(:medium)
29
+ else
30
+ file.url
31
+ end
32
+ end
23
33
 
24
34
  end
25
35
  end
@@ -1,6 +1,6 @@
1
1
  - if @start_time
2
- %p.state= I18n.t('bhf.footer.state', time: (Time.now-@start_time).round(2)).html_safe
2
+ %p.state= t('bhf.footer.state', time: (Time.now-@start_time).round(2)).html_safe
3
3
 
4
- %p.copy= I18n.t('bhf.footer.copy').html_safe
4
+ %p.copy= t('bhf.footer.copy').html_safe
5
5
 
6
- %p.info= I18n.t('bhf.footer.info').html_safe
6
+ %p.info= t('bhf.footer.info').html_safe
@@ -4,7 +4,7 @@
4
4
  - file = f.object.send(field.name)
5
5
  - if file.file?
6
6
  - if ['image/jpeg', 'image/pjpeg', 'image/jpg', 'image/png', 'image/tif', 'image/gif'].include?(f.object.send("#{field.name}_content_type"))
7
- = image_tag file.url, class: 'uploaded_image'
7
+ = image_tag find_smallest_size_url_for_file(file), class: 'uploaded_image'
8
8
  - else
9
9
  = link_to f.object.send("#{field.name}_file_name"), file.url, class: 'uploaded_file'
10
10
 
data/lib/bhf/platform.rb CHANGED
@@ -140,16 +140,16 @@ module Bhf
140
140
  end
141
141
  end
142
142
 
143
- def columns_count
144
- columns.count + (sortable ? 2 : 1)
145
- end
146
-
147
143
  def sortable
148
144
  table_options 'sortable'
149
145
  end
150
146
 
151
147
  def sortable_property
152
- table_options 'sortable_property'
148
+ (@data['sortable_property'] || :position).to_sym
149
+ end
150
+
151
+ def columns_count
152
+ columns.count + (sortable ? 2 : 1)
153
153
  end
154
154
 
155
155
  def hide_edit
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.12
4
+ version: 0.7.13
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-06-04 00:00:00.000000000 Z
11
+ date: 2014-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails