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 +4 -4
- data/app/helpers/ksk/application_helper.rb +8 -3
- data/app/views/bhf/entries/form/has_many/_assets.html.haml +15 -10
- data/app/views/bhf/entries/form/has_many/_upload.html.haml +14 -14
- data/app/views/bhf/pages/_navi.html.haml +17 -8
- data/config/locales/de.yml +15 -1
- data/config/locales/en.yml +16 -2
- data/lib/actives/asset.rb +5 -1
- data/vendor/assets/javascripts/ksk/application.js +5 -4
- data/vendor/assets/javascripts/ksk/classes/NaviAdmin.js +1 -1
- data/vendor/assets/stylesheets/ksk/application.css.sass +62 -54
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beed8bea3d2c6da7419484a3e223d3086a1e01e5
|
4
|
+
data.tar.gz: 15ab6fb83c72558702d4c25069bb9d553a1f8b47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
58
|
-
|
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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
2
|
-
|
1
|
+
- if asset.file.file?
|
2
|
+
= f.fields_for field.name, asset do |a|
|
3
3
|
- if allow_position
|
4
|
-
.
|
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
|
20
|
-
|
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
|
-
|
18
|
-
|
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'
|
data/config/locales/de.yml
CHANGED
@@ -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
|
data/config/locales/en.yml
CHANGED
@@ -1,4 +1,18 @@
|
|
1
|
-
|
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')
|
20
|
+
var platform = elem.getParent('.platform');
|
21
|
+
platform.getElements('.create a').addEvent('click', function(e){
|
21
22
|
e.preventDefault();
|
22
|
-
var tmpl =
|
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:
|
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(
|
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
|
-
|
5
|
-
|
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:
|
12
|
-
border-bottom: 1px solid #
|
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,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAOCAYAAADwikbvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTgxODI2NTlBNUY5MTFERkJEQTY5NjM0QTI0OTkzQ0MiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTgxODI2NUFBNUY5MTFERkJEQTY5NjM0QTI0OTkzQ0MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBODE4MjY1N0E1RjkxMURGQkRBNjk2MzRBMjQ5OTNDQyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBODE4MjY1OEE1RjkxMURGQkRBNjk2MzRBMjQ5OTNDQyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/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(
|
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
|
-
.
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
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.
|
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
|
+
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.
|
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.
|
26
|
+
version: 0.6.13
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: stringex
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|