ksk 0.3.0 → 0.3.2

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: 6b804e03da8cfde0ad5b09746538107c5e333d4f
4
- data.tar.gz: 9c0787bb75383e9e48c172a6ec17535e6bf2ca88
3
+ metadata.gz: 3c4d598578b73bdcfb5dcbfdaef592c31c541af9
4
+ data.tar.gz: a69d61eb6855cf795d67afb31dd53436cd2079fb
5
5
  SHA512:
6
- metadata.gz: f58b9c31d819b4beef4692476235c459831fdd1764c309a710f4c87a6490480dbb1a804d3659bb14315a84f37060a82daa165b7ec46d8d4cd7bec805bc7b8a60
7
- data.tar.gz: 0e7d6232bbb39d8a120baa9a4e5cdd4d85fa8dee85e80c7d3e04c4f2d64dd542edc8563f25b7a748ab1f6bc123457a37c59b4fa50333c46b23566d91a8863fa1
6
+ metadata.gz: 8dd2524833aac95cafc845239bab5ea7f6f0f800f07de8246d4209177d0887be79a418b9d1d7bd1839142af3fd8b428d10fdabf0eee5cbe5cb4255e367f84427
7
+ data.tar.gz: 0d2ba23d5e1b59cf027caba237713cab29be1599b95455b44c0a86f39b3ef0223eaaac6f7d097ca5547bfdcbed5fd53f3b31f11968686e17746217d48745c92c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.2
@@ -41,24 +41,7 @@ initHelper(function(scope){
41
41
  }
42
42
  }).post(queryParams);
43
43
  });
44
- });
45
-
46
- scope.getElements('.assets_list').each(function(elem){
47
- new Sortables(elem, {
48
- handle: '.handle',
49
- onStart: function(element, clone){
50
- element.addClass('dragged');
51
- },
52
- onComplete: function(element){
53
- element.removeClass('dragged');
54
- new Request({
55
- method: 'put',
56
- url: this.element.getParent('ol').get('data-sort-url')
57
- }).send({data: {order: this.serialize()}});
58
- }
59
- });
60
- });
61
-
44
+ });
62
45
 
63
46
  cropImages = scope.getElements('.js_crop_image');
64
47
  if (cropImages.length) {
@@ -67,7 +50,9 @@ initHelper(function(scope){
67
50
  jQuery('.js_crop_image').each(function(){
68
51
  var $cropImg = jQuery(this);
69
52
  $cropImg.Jcrop({
70
- onSelect: function(c){
53
+ boxWidth: 800,
54
+ boxHeight: 800,
55
+ onSelect: function(c){
71
56
  $cropImg.parent().find('.js_cords_x').val(c.x);
72
57
  $cropImg.parent().find('.js_cords_y').val(c.y);
73
58
  $cropImg.parent().find('.js_cords_w').val(c.w);
@@ -14,11 +14,11 @@ module Ksk::Asset
14
14
 
15
15
  do_not_validate_attachment_file_type :file
16
16
 
17
- scope :only_images, -> {where(file_content_type: Bhf::PAPERCLIP_IMAGE_TYPES)}
17
+ scope :only_images, -> {where(file_content_type: Bhf.configuration.paperclip_image_types)}
18
18
  scope :first_image, -> {only_images.limit(1)}
19
19
  scope :other_images, -> {only_images.offset(1)}
20
20
 
21
- scope :only_data_files, -> {where('file_content_type not in (?)', Bhf::PAPERCLIP_IMAGE_TYPES)}
21
+ scope :only_data_files, -> {where('file_content_type not in (?)', Bhf.configuration.paperclip_image_types)}
22
22
  scope :first_data_files, -> {only_data_files.limit(1)}
23
23
 
24
24
  before_file_post_process :is_image?
@@ -66,7 +66,7 @@ module Ksk::Asset
66
66
  end
67
67
 
68
68
  def is_image?
69
- Bhf::PAPERCLIP_IMAGE_TYPES.include?(file.content_type)
69
+ Bhf.configuration.paperclip_image_types.include?(file.content_type)
70
70
  end
71
71
 
72
72
  def has_preview?
@@ -1,5 +1,4 @@
1
1
  - return if @quick_edit
2
- - style = :banner
3
2
  - f.object.file.styles.each_pair do |style, meta|
4
3
  .node{class: field.form_type}
5
4
  .label= f.label "crop_#{style}", f.object.class.human_attribute_name("crop_#{style}")
@@ -3,18 +3,18 @@
3
3
  - imgs = f.object.assets.only_images
4
4
  - if imgs.any?
5
5
  %h4= t('ksk.asset.list.headline.photos')
6
- %ol.assets_list{:'data-sort-url' => sort_entries_path('assets')}
6
+ %ol.assets_list.js_sortable{data: {sort_url: sort_entries_path('assets')}}
7
7
  - imgs.each do |asset|
8
8
  %li{id: "#{asset.id}_images"}
9
- = render partial: 'bhf/entries/form/has_many/upload', locals: {field: field, f: f, asset: asset, allow_position: !@quick_edit}
9
+ = render partial: 'bhf/form/has_many/upload', locals: {field: field, f: f, asset: asset, allow_position: !@quick_edit}
10
10
 
11
11
  - files = f.object.assets.only_data_files
12
12
  - if files.any?
13
13
  %h4= t('ksk.asset.list.headline.files')
14
- %ol.assets_list{:'data-sort-url' => sort_entries_path('assets')}
14
+ %ol.assets_list.js_sortable{data: {sort_url: sort_entries_path('assets')}}
15
15
  - files.each do |asset|
16
16
  %li{id: "#{asset.id}_data_files"}
17
- = render partial: 'bhf/entries/form/has_many/upload', locals: {field: field, f: f, asset: asset, allow_position: !@quick_edit}
17
+ = render partial: 'bhf/form/has_many/upload', locals: {field: field, f: f, asset: asset, allow_position: !@quick_edit}
18
18
 
19
19
  .clear
20
20
  - unless @quick_edit
@@ -7,9 +7,10 @@
7
7
  = a.check_box :_destroy
8
8
  = a.label :_destroy, t(asset.is_image? ? 'bhf.helpers.image.delete' : 'bhf.helpers.file.delete')
9
9
 
10
- - return_to = {return_to: (edit_entry_path(@platform.name, f.object) unless @platform.return_to == false)}
10
+ - return_to = {return_to: edit_entry_path(@platform.name, f.object)}
11
11
  - if asset.is_image?
12
- = image_tag(find_smallest_size_url_for_file(asset.file), class: 'uploaded_image float_left')
12
+ = link_to asset.file.url, target: :blank do
13
+ = image_tag(find_smallest_size_url_for_file(asset.file), class: 'uploaded_image float_left')
13
14
  = link_to t('ksk.asset.image_preview.button.edit'), edit_entry_path('assets', asset.id, return_to), class: 'alt_button float_right'
14
15
  - else
15
16
  = link_to asset.file_file_name, asset.file.url, class: 'uploaded_file float_left'
@@ -2,7 +2,7 @@
2
2
  = node f, field do
3
3
  = f.fields_for field.name, Asset.new do |a|
4
4
  - if ! f.object.send(field.name).nil?
5
- = render partial: 'bhf/entries/form/has_many/upload', locals: {field: field, f: f, asset: f.object.send(field.name), allow_position: false}
5
+ = render partial: 'bhf/form/has_many/upload', locals: {field: field, f: f, asset: f.object.send(field.name), allow_position: false}
6
6
  %div
7
7
  = a.file_field :file
8
8
  %hr
data/ksk.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: ksk 0.3.0 ruby lib
5
+ # stub: ksk 0.3.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "ksk"
9
- s.version = "0.3.0"
9
+ s.version = "0.3.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Anton Pawlik"]
14
- s.date = "2014-06-11"
14
+ s.date = "2014-07-02"
15
15
  s.description = "Fast and friendly"
16
16
  s.email = "anton.pawlik@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -38,14 +38,14 @@ Gem::Specification.new do |s|
38
38
  "app/models/concerns/ksk/post.rb",
39
39
  "app/models/concerns/ksk/preview.rb",
40
40
  "app/models/concerns/ksk/static.rb",
41
- "app/views/bhf/entries/form/column/_crop_thumbs.html.haml",
42
- "app/views/bhf/entries/form/column/_file.html.haml",
43
- "app/views/bhf/entries/form/column/_select_file_assets.html.haml",
44
- "app/views/bhf/entries/form/has_many/_assets.html.haml",
45
- "app/views/bhf/entries/form/has_many/_upload.html.haml",
46
- "app/views/bhf/entries/form/has_one/_asset.html.haml",
47
- "app/views/bhf/pages/_navi.html.haml",
48
- "app/views/bhf/pages/macro/column/_extern_link.haml",
41
+ "app/views/bhf/form/column/_crop_thumbs.html.haml",
42
+ "app/views/bhf/form/column/_file.html.haml",
43
+ "app/views/bhf/form/column/_select_file_assets.html.haml",
44
+ "app/views/bhf/form/has_many/_assets.html.haml",
45
+ "app/views/bhf/form/has_many/_upload.html.haml",
46
+ "app/views/bhf/form/has_one/_asset.html.haml",
47
+ "app/views/bhf/platform/_navi.html.haml",
48
+ "app/views/bhf/table/column/_extern_link.haml",
49
49
  "config/locales/de.yml",
50
50
  "config/locales/en.yml",
51
51
  "config/routes.rb",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ksk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
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-11 00:00:00.000000000 Z
11
+ date: 2014-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bhf
@@ -149,14 +149,14 @@ files:
149
149
  - app/models/concerns/ksk/post.rb
150
150
  - app/models/concerns/ksk/preview.rb
151
151
  - app/models/concerns/ksk/static.rb
152
- - app/views/bhf/entries/form/column/_crop_thumbs.html.haml
153
- - app/views/bhf/entries/form/column/_file.html.haml
154
- - app/views/bhf/entries/form/column/_select_file_assets.html.haml
155
- - app/views/bhf/entries/form/has_many/_assets.html.haml
156
- - app/views/bhf/entries/form/has_many/_upload.html.haml
157
- - app/views/bhf/entries/form/has_one/_asset.html.haml
158
- - app/views/bhf/pages/_navi.html.haml
159
- - app/views/bhf/pages/macro/column/_extern_link.haml
152
+ - app/views/bhf/form/column/_crop_thumbs.html.haml
153
+ - app/views/bhf/form/column/_file.html.haml
154
+ - app/views/bhf/form/column/_select_file_assets.html.haml
155
+ - app/views/bhf/form/has_many/_assets.html.haml
156
+ - app/views/bhf/form/has_many/_upload.html.haml
157
+ - app/views/bhf/form/has_one/_asset.html.haml
158
+ - app/views/bhf/platform/_navi.html.haml
159
+ - app/views/bhf/table/column/_extern_link.haml
160
160
  - config/locales/de.yml
161
161
  - config/locales/en.yml
162
162
  - config/routes.rb
File without changes