ksk 0.2.3 → 0.2.4

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: cc9ac631cf12c22eae6531bdcc55539617074b03
4
- data.tar.gz: 1160f1ce2e4bbaba25c7cff140a35d34b72b7845
3
+ metadata.gz: beed8bea3d2c6da7419484a3e223d3086a1e01e5
4
+ data.tar.gz: 15ab6fb83c72558702d4c25069bb9d553a1f8b47
5
5
  SHA512:
6
- metadata.gz: 6c03e3a452b72fef1d213cd2a402e4b0b9073ec03b4efc3681f36df20c0a6bda4cad52af393d01120b85c61e119484c3ecb733f7399a7d22b9a2a4d84d00a529
7
- data.tar.gz: 790fe64dbd2a1b436cd4e3d98437d05a434bb0327cd6144e0f9d7e7df3d5eea47e5e8872e561b1131e0b6860800255da9a34e54ba5307dc98141f603d7356b59
6
+ metadata.gz: b1d4638104813f304cffeac7f22ceb0d73dc6f9b2bd36d9136febe20fd43d3ca5af47b5ad1c050802a7f5bab1723ab1766f7c97eecece42190ada66fb3f661a7
7
+ data.tar.gz: 6fef3149eb48d8d82b5b5b31cc0c55247d217133b4f60493bee20eff7796ecf52c1d80ddf9047512b3f29350c70dc207ae8192e4c5d2ac467e642ccc1b8770e8
@@ -52,10 +52,15 @@ module Ksk
52
52
 
53
53
  def place_data_files(text, data_files)
54
54
  place_content(text, data_files, 'file') do |asset, option|
55
- link_to asset.file.url, class: asset.has_preview? ? :uploaded_file_preview : :uploaded_file do
55
+ link_to asset.file.url, title: asset.file.original_filename, class: asset.has_preview? ? :uploaded_file_preview : :uploaded_file do
56
56
  if asset.has_preview?
57
- image_tag( asset.preview_file.url(:banner) )+
58
- '<span>Hier klicken um die Datei herunter zu laden</span>'.html_safe
57
+ if asset.has_preview_image?
58
+ t_capition = !asset.preview.name.blank? ? asset.preview.name : t('ksk.asset.file_preview.button.download')
59
+ image_tag( asset.preview_file.url(:banner) )+
60
+ "<span>#{t_capition}</span>".html_safe
61
+ else
62
+ asset.preview.name
63
+ end
59
64
  else
60
65
  asset.file_file_name
61
66
  end
@@ -1,17 +1,22 @@
1
1
  - if f.object.assets.any?
2
2
  = node f, field do
3
- %h3 Bilder:
4
- %ol.assets_list{:'data-sort-url' => sort_bhf_entries_path('assets')}
5
- - f.object.assets.only_images.each do |asset|
6
- %li{id: "#{asset.id}_images"}
7
- = render partial: 'bhf/entries/form/has_many/upload', locals: {field: field, f: f, asset: asset, allow_position: true}
3
+ - imgs = f.object.assets.only_images
4
+ - if imgs.any?
5
+ %h3= t('ksk.asset.list.headline.photos')
6
+ %ol.assets_list{:'data-sort-url' => sort_bhf_entries_path('assets')}
7
+ - imgs.each do |asset|
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}
8
10
 
9
- %h3 Dateien:
10
- %ol.assets_list{:'data-sort-url' => sort_bhf_entries_path('assets')}
11
- - f.object.assets.only_data_files.each do |asset|
12
- %li{id: "#{asset.id}_data_files"}
13
- = render partial: 'bhf/entries/form/has_many/upload', locals: {field: field, f: f, asset: asset, allow_position: true}
11
+ - files = f.object.assets.only_data_files
12
+ - if files.any?
13
+ %h3= t('ksk.asset.list.headline.files')
14
+ %ol.assets_list{:'data-sort-url' => sort_bhf_entries_path('assets')}
15
+ - files.each do |asset|
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}
14
18
 
19
+ .clear
15
20
  - unless @quick_edit
16
21
  = node f, field do
17
22
  .array_holder
@@ -1,20 +1,20 @@
1
- = f.fields_for field.name, asset do |a|
2
- - if asset.file.file?
1
+ - if asset.file.file?
2
+ = f.fields_for field.name, asset do |a|
3
3
  - if allow_position
4
- .position_handle.float_left
5
- - if asset.is_image?
6
- = image_tag asset.file.url(:medium), class: 'uploaded_image float_left'
7
- - else
8
- = link_to asset.file_file_name, asset.file.url, class: 'uploaded_image float_left'
9
- - if asset.has_preview?
10
- = link_to edit_bhf_entry_path('previews', asset.preview), class: 'float_left' do
11
- = image_tag asset.preview_file.url(:thumb), class: 'uploaded_image'
12
- - else
13
- = link_to 'Vorschaubild hochladen', new_bhf_entry_path('previews', asset_id: asset.id), class: 'float_left'
4
+ .handle.icon.float_left
14
5
 
15
6
  .file_delete.float_right
16
7
  = a.check_box :_destroy
17
8
  = a.label :_destroy, t('bhf.helpers.file.delete')
18
9
 
19
- - if allow_position
20
- %hr
10
+ - if asset.is_image?
11
+ = image_tag(asset.file.url(:medium), class: 'uploaded_image float_left')
12
+ = link_to t('ksk.asset.photo_preview.button.edit'), edit_bhf_entry_path('assets', asset.id), class: 'alt_button float_right'
13
+ - else
14
+ = link_to asset.file_file_name, asset.file.url, class: 'uploaded_image float_right'
15
+ - if asset.has_preview?
16
+ = link_to t('ksk.asset.file_preview.button.edit'), edit_bhf_entry_path('previews', asset.preview), class: 'alt_button float_right'
17
+ - else
18
+ = link_to t('ksk.asset.file_preview.button.create'), new_bhf_entry_path('previews', asset_id: asset.id), class: 'alt_button float_right'
19
+
20
+ .clear
@@ -2,8 +2,8 @@
2
2
  def p_recursive_navi(navis, current_level = 0, max_level = 99, ul = 'ul', first_wrap = '')
3
3
  a = "\n <#{ul}#{first_wrap}>\n"
4
4
  navis.each do |navi|
5
- x = link_to 'edit', edit_bhf_entry_path('navigation', navi)
6
- y = link_to 'delete', bhf_entry_path('navigation', navi), :method => :delete, :confirm => t('bhf.helpers.promts.confirm')
5
+ x = link_to 'edit', edit_bhf_entry_path('navigation', navi), class: 'edit icon'
6
+ y = link_to 'delete', bhf_entry_path('navigation', navi), :method => :delete, :confirm => t('bhf.helpers.promts.confirm'), class: 'delete icon'
7
7
  a += " <li id='navigation_#{navi.id}'><div><span class='title'>#{navi.title}</span> <span class='links'>#{x} #{y}</span></div>"
8
8
  if current_level <= max_level and navi.children.any?
9
9
  a += p_recursive_navi(navi.children, current_level+1, max_level, ul)
@@ -14,10 +14,19 @@
14
14
  end
15
15
 
16
16
 
17
- #content.navi.js_tree_holder{data: {:'update-url' => sort_ksk_navigations_path}}
18
- = p_recursive_navi(Navigation.top_level, 0, 99, 'ol', ' class="multi_grid js_tree_list"').html_safe
19
-
17
+ %table.navigation_capiton.data_table{id: "#{platform.name}_platform", class: (platform.custom_columns? ? :custom_columns : :default_columns)}
18
+ %caption
19
+ %h4= platform.title
20
+ %p.info= t('ksk.navigation_sort.info')
21
+ - unless platform.hide_create
22
+ %p.create= link_to new_t(platform), new_bhf_entry_path(platform.name), class: :alt_button
23
+ - unless platform.custom_partial
24
+ = render partial: 'search', locals: {platform: platform} if platform.search?
25
+
26
+ .content_box
27
+ .navi.js_tree_holder{data: {:'update-url' => sort_ksk_navigations_path}}
28
+ = p_recursive_navi(Navigation.top_level, 0, 99, 'ol', ' class="multi_grid js_tree_list"').html_safe
29
+
20
30
  .template_data.hide{data: {:'update-path' => ksk_navigations_path, :'prompt-question' => I18n.t('ksk.navigation_sort.prompt_question')}}
21
- = link_to 'edit', edit_bhf_entry_path('navigation', 'NAVIID')
22
- = link_to 'delete', bhf_entry_path('navigation', 'NAVIID'), method: :delete, data: {confirm: t('bhf.helpers.promts.confirm')}
23
-
31
+ = link_to 'edit', edit_bhf_entry_path('navigation', 'NAVIID'), class: 'edit icon'
32
+ = link_to 'delete', bhf_entry_path('navigation', 'NAVIID'), method: :delete, data: {confirm: t('bhf.helpers.promts.confirm')}, class: 'delete icon'
@@ -1,4 +1,18 @@
1
1
  de:
2
2
  ksk:
3
3
  navigation_sort:
4
- prompt_question: Name eintragen
4
+ prompt_question: Name eintragen
5
+ info: können neu angelegt und verschoben werden
6
+ asset:
7
+ list:
8
+ headline:
9
+ photos: 'Pictures:'
10
+ files: 'Files:'
11
+ photo_preview:
12
+ button:
13
+ edit: Bild bearbeiten
14
+ file_preview:
15
+ button:
16
+ edit: Vorschau einstellen
17
+ create: Vorschau erstellen
18
+ download: Hier klicken um die Datei herunter zu laden
@@ -1,4 +1,18 @@
1
- de:
1
+ en:
2
2
  ksk:
3
3
  navigation_sort:
4
- prompt_question: Enter the name
4
+ prompt_question: Enter the name
5
+ info: can be created and moved
6
+ asset:
7
+ list:
8
+ headline:
9
+ photos: 'Bilder:'
10
+ files: 'Dateien:'
11
+ photo_preview:
12
+ button:
13
+ edit: Bild bearbeiten
14
+ file_preview:
15
+ button:
16
+ edit: Edit preview
17
+ create: Add preview
18
+ download: Click here to download the file
data/lib/actives/asset.rb CHANGED
@@ -38,7 +38,11 @@ module Ksk
38
38
  end
39
39
 
40
40
  def has_preview?
41
- preview && preview.assets.any?
41
+ preview && (preview.assets.any? || !preview.name.blank?)
42
+ end
43
+
44
+ def has_preview_image?
45
+ preview.assets.any? and preview.assets.first.file
42
46
  end
43
47
 
44
48
  def preview_file
@@ -17,9 +17,10 @@ var kskInit = function(){
17
17
  }).post(queryParams);
18
18
  }
19
19
  });
20
- elem.getParent('.platform').getElements('.create a').addEvent('click', function(e){
20
+ var platform = elem.getParent('.platform');
21
+ platform.getElements('.create a').addEvent('click', function(e){
21
22
  e.preventDefault();
22
- var tmpl = elem.getElement('.template_data');
23
+ var tmpl = platform.getElement('.template_data');
23
24
  var name = prompt(tmpl.get('data-prompt-question'), '');
24
25
  if ( ! name) { return; }
25
26
 
@@ -29,13 +30,13 @@ var kskInit = function(){
29
30
  title: name
30
31
  };
31
32
  new Request({
32
- url: elem.getElement('.template_data').get('data-update-path'),
33
+ url: platform.getElement('.template_data').get('data-update-path'),
33
34
  onSuccess: function(responseText){
34
35
  new Element('li', {
35
36
  'id': naviName+'_'+responseText,
36
37
  'html': '<div> <span class="title">'+name+'</span> <span class="links">'+tmpl.get('html')+'</span></div>'.replace(/NAVIID/g, responseText)
37
38
  })
38
- .inject(elem.getElement('.js_tree_list li'), 'before');
39
+ .inject(platform.getElement('.js_tree_list li'), 'before');
39
40
  naviA.reInit();
40
41
  }
41
42
  }).post(queryParams);
@@ -22,7 +22,7 @@ var NaviAdmin = new Class({
22
22
  options: {/*
23
23
  onItemDropped: $empty(item, parent, itemId, parentId),*/
24
24
  elemTree: null,
25
- dragSpan: new Element('span', {'class': 'drag'}),
25
+ dragSpan: new Element('span', {'class': 'icon handle drag'}),
26
26
  pos_helper: new Element('li', {'class': 'pos_helper'})
27
27
  },
28
28
 
@@ -1,60 +1,52 @@
1
+ $w1: #fff
2
+ $w2: #F1F1F1
3
+ $k1: #000
4
+ $b1: #38A5E9
5
+ $b2: #0F8FDD
6
+ $g1: #7F7F7F
7
+ $g2: #ccc
8
+ $g3: #424242
9
+
10
+ table.navigation_capiton
11
+ margin-bottom: 20px
1
12
  .navi
2
13
  /* STYLING */
3
14
  .multi_grid
4
- border: 1px solid #CDD0D3
5
- border-bottom: 0
6
- border: 1px solid #CDD0D3
7
-
15
+ ol
16
+ padding-top: 10px
8
17
  li
9
18
  margin: 0
10
19
  display: block
11
- padding: 5px 0 5px 10px
12
- border-bottom: 1px solid #CDD0D3
13
-
14
-
15
-
16
- li div
17
- border-bottom: 1px solid #CDD0D3
18
- padding-bottom: 5px
19
- clear: both
20
- overflow: hidden
21
-
22
- li .title
23
- float: left
24
-
25
- li .links
26
- float: right
27
-
28
- li
29
- padding-left: 30px
20
+ padding: 0 0 10px 10px
21
+ border-bottom: 1px solid #E0E0E0
30
22
  border-bottom: 0
31
-
23
+ li
24
+ padding-left: 30px
25
+ div
26
+ border-bottom: 1px solid #E0E0E0
27
+ padding-bottom: 10px
28
+ clear: both
29
+ overflow: hidden
30
+ .links
31
+ float: right
32
32
  .moved
33
33
  background-color: rgba(255, 255, 255, 0.6)
34
34
  padding-right: 20px
35
35
  min-width: 400px
36
+ .title
37
+ float: left
38
+ .handle
39
+ padding-right: 20px
40
+ float: left
36
41
 
37
- .drag
38
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAOCAYAAADwikbvAAAAGXRFWHRTb2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4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PlrgasEAAAA7SURBVHjaYvz//z8DuYCJgQKAUzOLSOV/ZJpUmy3RaJI0H0ej6WQzMBYGyGaYjUguGC6hzThgaRsgwABmFBehNiE89QAAAABJRU5ErkJggg==) no-repeat 0px 2px
39
-
40
42
  /* ESSENTIAL */
41
- .drag
42
- display: block
43
- float: left
44
- height: 20px
45
- width: 18px
46
- cursor: move
47
- background: gray
48
-
49
43
  .multi_grid,
50
44
  .multi_grid ol
51
45
  list-style: none
52
-
53
46
  .multi_grid
54
47
  li div
55
48
  clear: both
56
49
  overflow: hidden
57
-
58
50
  .pos_helper
59
51
  padding: 0
60
52
  margin: 0
@@ -62,33 +54,49 @@
62
54
  transition-duration: 0.3s
63
55
  -moz-transition-duration: 0.3s
64
56
  -webkit-transition-duration: 0.3s
65
-
66
57
  &.drag_active .pos_helper
67
58
  height: 6px
68
-
69
59
  .pos_helper.hover
70
60
  height: 20px
71
-
72
61
  .hover
73
- background-color: rgba(255, 0, 0, 0.1)
62
+ background-color: rgba($b1, 0.3)
74
63
  transition-duration: 0.3s
75
64
  -moz-transition-duration: 0.3s
76
65
  -webkit-transition-duration: 0.3s
66
+ li
67
+ border-color: $b2
77
68
 
78
69
  .moved
79
70
  z-index: 3000
80
71
 
81
72
 
82
- .float_left
83
- float: left
84
- margin-right: 100px !important
85
- .float_right
86
- float: right
87
-
88
- .position_handle
89
- background: image-url('bhf/pictos.png') no-repeat -94px 0
90
- cursor: move
91
- display: block
92
- text-indent: -9999px
93
- height: 30px
94
- width: 30px
73
+ .assets_list
74
+ clear: both
75
+ list-style: none
76
+ counter-reset: asset-counter
77
+ .handle
78
+ margin-top: 5px
79
+ margin-right: 30px
80
+ .alt_button
81
+ margin-right: 15px
82
+ .uploaded_image
83
+ margin: 0 !important
84
+ li
85
+ position: relative
86
+ padding: 10px 0
87
+ border-bottom: 1px solid #e0e0e0
88
+ &:before
89
+ content: counter(asset-counter)
90
+ counter-increment: asset-counter
91
+ position: absolute
92
+ background: #999
93
+ color: #fff
94
+ left: -26px
95
+ font-size: 12px
96
+ top: 15px
97
+ display: block
98
+ min-width: 18px
99
+ text-align: center
100
+ border-radius: 20px
101
+
102
+
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.2.3
4
+ version: 0.2.4
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-11-20 00:00:00.000000000 Z
11
+ date: 2013-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bhf
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.0
19
+ version: 0.6.13
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.5.0
26
+ version: 0.6.13
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: stringex
29
29
  requirement: !ruby/object:Gem::Requirement