forgeos_core 1.9.2 → 1.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +1 -23
- data/app/assets/javascripts/forgeos/admin/customselects.js +2 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_core/overlay.js +22 -3
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_core/tinyMCE.js +1 -1
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_core/uploads.js +55 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_core/visual.js +3 -3
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_core/overlays.js +4 -46
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_core/visual.js +17 -57
- data/app/assets/stylesheets/forgeos/960.css.sass +1 -125
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_attachments.css.sass +13 -4
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_content.css.sass +7 -2
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_customer.css.sass +18 -5
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_dashboard.css.sass +38 -16
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_datatable.css.sass +32 -13
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_generals.css.sass +75 -39
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_icons.css.sass +130 -16
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_lightbox.css.sass +21 -18
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_notifications.css.sass +0 -1
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_payment.css.sass +1 -1
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_rightSidebar.css.sass +14 -14
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_roles.css.sass +1 -1
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_search.css.sass +6 -5
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_settings.css.sass +1 -3
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_sidebar.css.sass +11 -3
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_uploadify.css.sass +10 -8
- data/app/assets/stylesheets/forgeos/admin/forgeos_core/_visuals.css.sass +12 -12
- data/app/assets/stylesheets/forgeos/admin/login.css.sass +30 -14
- data/app/assets/stylesheets/forgeos/jquery-ui/themes/forgeos.css.sass +96 -733
- data/app/assets/stylesheets/forgeos/jstree/themes/categories/style.css.sass +12 -18
- data/app/controllers/admin/administrators_controller.rb +2 -2
- data/app/controllers/admin/attachments_controller.rb +3 -3
- data/app/controllers/admin/categories_controller.rb +1 -1
- data/app/controllers/admin/person_sessions_controller.rb +1 -1
- data/app/controllers/admin/rights_controller.rb +2 -2
- data/app/controllers/admin/roles_controller.rb +3 -3
- data/app/controllers/admin/users_controller.rb +2 -2
- data/app/controllers/forgeos/application_controller.rb +1 -1
- data/app/models/category.rb +7 -3
- data/app/models/right.rb +1 -1
- data/app/models/role.rb +1 -1
- data/app/models/user.rb +6 -3
- data/app/views/admin/administrators/index.json.erb +3 -1
- data/app/views/admin/attachments/_attachments_popup.html.haml +4 -4
- data/app/views/admin/attachments/_form.html.haml +1 -1
- data/app/views/admin/attachments/_tabs.html.haml +1 -1
- data/app/views/admin/attachments/index.json.erb +4 -2
- data/app/views/admin/attachments/show.html.haml +1 -1
- data/app/views/admin/cachings/index.html.haml +2 -2
- data/app/views/admin/categories/index.json.erb +3 -1
- data/app/views/admin/import/_tabs.html.haml +1 -0
- data/app/views/admin/import/index.html.haml +1 -1
- data/app/views/admin/rights/_tabs.html.haml +1 -0
- data/app/views/admin/rights/index.json.erb +7 -5
- data/app/views/admin/roles/_tabs.html.haml +1 -0
- data/app/views/admin/roles/index.json.erb +5 -3
- data/app/views/admin/sidebars/_attachments_popups.html.haml +7 -76
- data/app/views/admin/users/index.json.erb +3 -1
- data/app/views/admin/visual/_visual_popup.html.haml +18 -107
- data/app/views/admin/visual/_visuals_popup.html.haml +7 -47
- data/app/views/layouts/admin.html.haml +2 -2
- data/app/views/layouts/admin_login.html.haml +2 -2
- data/config/locales/common/en.yml +1 -0
- data/config/locales/common/fr.yml +1 -0
- data/config/routes.rb +12 -1
- data/lib/forgeos/urlified.rb +16 -0
- data/lib/tasks/install.rake +3 -3
- data/lib/technoweenie/attachment_fu/backends/ftp_backend.rb +8 -12
- data/recipes/db.rb +1 -1
- metadata +52 -57
- data/app/controllers/admin/base_controller.rbc +0 -1305
- data/app/controllers/admin/dashboard_controller.rbc +0 -361
- data/app/controllers/admin/person_sessions_controller.rbc +0 -1248
- data/app/controllers/forgeos/application_controller.rbc +0 -2027
- data/app/helpers/admin/attachment_helper.rbc +0 -2340
- data/app/helpers/admin/base_helper.rbc +0 -2522
- data/app/helpers/forgeos/application_helper.rbc +0 -3152
- data/app/models/administrator.rbc +0 -415
- data/app/models/person.rbc +0 -1498
- data/app/models/person_session.rbc +0 -142
- data/app/models/right.rbc +0 -432
- data/app/models/role.rbc +0 -469
- data/app/models/setting.rbc +0 -699
- data/config/initializers/load_settings.rbc +0 -330
- data/config/routes.rbc +0 -2203
- data/lib/extensions.rbc +0 -126
- data/lib/extensions/form_helper_extensions.rbc +0 -295
- data/lib/extensions/i18n_fallbacks_config.rbc +0 -246
- data/lib/forgeos.rbc +0 -1942
- data/lib/forgeos/core.rbc +0 -325
- data/lib/forgeos/core/engine.rbc +0 -316
- data/lib/forgeos_core.rbc +0 -53
- data/lib/map_fields.rbc +0 -4437
- data/lib/sortable_attachments.rbc +0 -1399
- data/lib/sphinx_globalize.rbc +0 -785
@@ -1,11 +1,11 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
#imageLeftSidebarUploadDialog.upload-lightbox-container.white
|
2
|
+
#imageLeftSidebarUpload
|
3
3
|
%span= I18n.t('or')
|
4
|
-
= link_to_function I18n.t('media.
|
4
|
+
= link_to_function I18n.t('media.add_from_library'), "$('#imageLeftSidebarSelectDialog').dialog('open');"
|
5
5
|
|
6
|
-
#
|
6
|
+
#imageLeftSidebarSelectDialog.media-hoverlay
|
7
7
|
.media-hoverlay-header
|
8
|
-
= link_to_function content_tag(:span, I18n.t('media.picture.upload.action').capitalize, :class=>'big-icons add-picture'), "$(\'#
|
8
|
+
= link_to_function content_tag(:span, I18n.t('media.picture.upload.action').capitalize, :class=>'big-icons add-picture'), "$(\'#imageLeftSidebarUploadDialog\').dialog(\'open\'); $(\'#imageLeftSidebarSelectDialog\').dialog(\'close\')", :class=>'backgrounds button'
|
9
9
|
.display-mode
|
10
10
|
.heading-separator
|
11
11
|
.display-thumbnails
|
@@ -27,75 +27,6 @@
|
|
27
27
|
%tr
|
28
28
|
%td
|
29
29
|
|
30
|
-
= dataSlides_tag :url => forgeos_core.
|
30
|
+
= dataSlides_tag :url => forgeos_core.admin_pictures_path(:format => :json, :skin => 'thumbnail', :mode => 'selection'), :columns => [ '{ "bSortable": true, "bSearchable": true, "sType": "string", "bUseRendered": true, "fnRender": null, "iDataSort": 0, "nTf": null, "nTh": function(){$(".thead").find(".th");}, "sWidth": "0px"}','{"bVisible": false}', '{ "bVisible": false }', '{ "bVisible": false}' ], :id => 'thumbnail-table', :autostart => false
|
31
31
|
|
32
|
-
= dataTables_tag :id => 'image-table', :url => forgeos_core.
|
33
|
-
|
34
|
-
|
35
|
-
-# TODO move to base.js
|
36
|
-
:javascript
|
37
|
-
function initImageUploadLeftSidebar(link){
|
38
|
-
$('#imageUploadDialogLeftSidebar').dialog('open');
|
39
|
-
$('#imageUploadDialogLeftSidebar').html('<div id="imageUploadLeftSidebar"></div><div class="library-add"><span>#{t(:or)}</span><a href="#" onclick="$(\'#imageUploadDialogLeftSidebar\').dialog(\'close\'); $(\'#imageSelectDialogLeftSidebar\').dialog(\'open\'); return false;">#{t('media.add_from_library')}</a></div>');
|
40
|
-
var uploadify_datas = { "format": "json" };
|
41
|
-
uploadify_datas[window._forgeos_js_vars.session_key] = window._forgeos_js_vars.session;
|
42
|
-
|
43
|
-
$('#imageUploadLeftSidebar').uploadify({
|
44
|
-
"uploader": "/assets/forgeos/uploadify/uploadify.swf",
|
45
|
-
"cancelImg": "/assets/forgeos/admin/big-icons/delete-icon.png",
|
46
|
-
"script": "#{forgeos_core.admin_attachments_path(:file_type => "picture")}",
|
47
|
-
"buttonImg": "#{image_path("forgeos/uploadify/upload-picture_#{I18n.locale}.png")}",
|
48
|
-
"width" :"154",
|
49
|
-
"height" :"24",
|
50
|
-
"scriptData": uploadify_datas,
|
51
|
-
"ScriptAccess": "always",
|
52
|
-
"multi": "true",
|
53
|
-
"displayData": "speed",
|
54
|
-
"onComplete": function(e,queueID,fileObj,response,data){
|
55
|
-
if(typeof JSON=="object" && typeof JSON.parse=="function") {
|
56
|
-
result = JSON.parse(response);
|
57
|
-
} else {
|
58
|
-
result = eval('(' + response + ')');
|
59
|
-
}
|
60
|
-
if (result.result == 'success'){
|
61
|
-
$.ajax({
|
62
|
-
"success": function(result){
|
63
|
-
jQuery.tree.focused().refresh();
|
64
|
-
},
|
65
|
-
"error": function(){},
|
66
|
-
"data": {
|
67
|
-
'category[attachment_ids]': [result.id],
|
68
|
-
authenticity_token: window._forgeos_js_vars.token
|
69
|
-
},
|
70
|
-
"dataType": 'json',
|
71
|
-
"type": 'put',
|
72
|
-
"url": '/admin/categories/'+ link +'.json',
|
73
|
-
});
|
74
|
-
} else {
|
75
|
-
display_notification_message('error',result.error)
|
76
|
-
}
|
77
|
-
},
|
78
|
-
"onAllComplete": function(){
|
79
|
-
$('#imageUploadDialogLeftSidebar').dialog('close');
|
80
|
-
}
|
81
|
-
});
|
82
|
-
}
|
83
|
-
|
84
|
-
function add_picture_to_category(){
|
85
|
-
var image_id = get_rails_element_id($('.row_selected')[0]);
|
86
|
-
var cat_id = get_rails_element_id($('.tree-li-selected-to-add-image'));
|
87
|
-
$.ajax({
|
88
|
-
"success": function(result){
|
89
|
-
jQuery.tree.focused().refresh();
|
90
|
-
jQuery('#imageSelectDialogLeftSidebar').dialog('close');
|
91
|
-
},
|
92
|
-
"error": function(){},
|
93
|
-
"data": {
|
94
|
-
'category[attachment_ids]': [image_id],
|
95
|
-
authenticity_token: window._forgeos_js_vars.token
|
96
|
-
},
|
97
|
-
"dataType": 'json',
|
98
|
-
"type": 'put',
|
99
|
-
"url": '/admin/categories/'+ cat_id +'.json',
|
100
|
-
});
|
101
|
-
}
|
32
|
+
= dataTables_tag :id => 'image-table', :url => forgeos_core.admin_pictures_path(:format => :json, :mode => 'selection'), :columns => ["{'sClass':'th-checkbox-container', 'bSortable': false }", "{ 'sTitle': '#{I18n.t('media.filename')}'}", "{ 'sTitle': '#{I18n.t('media.content_type')}'}", "{ 'sTitle': '#{I18n.t('media.updated_at')}'}", "{ 'sTitle': '#{I18n.t('media.size')}'}", '{"bVisible": false}', '{ "bVisible": false }', '{ "bVisible": false}','{ "bVisible": false}', '{ "bVisible": false}'], :autostart => false
|
@@ -1,6 +1,8 @@
|
|
1
1
|
<%
|
2
2
|
output = {
|
3
|
-
:
|
3
|
+
:sEcho => params[:sEcho],
|
4
|
+
:iTotalRecords => @users.total_entries || 0,
|
5
|
+
:iTotalDisplayRecords => @users.size,
|
4
6
|
:aaData => @users.collect do |user|
|
5
7
|
link_id = "user_#{user.id}"
|
6
8
|
klass = user.active? ? 'see-on' : 'see-off'
|
@@ -1,12 +1,7 @@
|
|
1
1
|
#imagepictureUploadDialog.upload-lightbox-container.white
|
2
2
|
#imagepictureUpload
|
3
|
-
/= form.file_field :uploaded_data
|
4
|
-
/= hidden_field_tag :target, params[:target]
|
5
|
-
/= hidden_field_tag :target_id, params[:target_id]
|
6
|
-
/= form.submit t('save').capitalize
|
7
|
-
|
8
3
|
%span= t('or')
|
9
|
-
= link_to_function t('media.
|
4
|
+
= link_to_function t('media.add_from_library'), "$('#imagepictureSelectDialog').dialog('open');"
|
10
5
|
|
11
6
|
#imagepictureSelectDialog.media-hoverlay.project
|
12
7
|
.media-hoverlay-header
|
@@ -32,67 +27,10 @@
|
|
32
27
|
%tr
|
33
28
|
%td
|
34
29
|
|
35
|
-
= dataSlides_tag :url => forgeos_core.admin_attachments_path(:format => :json, :skin => 'thumbnail', :file_type => 'picture', :mode => 'selection'), :columns => [ '{ "bSortable": true, "bSearchable": true, "sType": "string", "bUseRendered": true, "fnRender": null, "iDataSort": 0, "nTf": null, "nTh": function(){$(".thead").find(".th");}, "sWidth": "0px"}','{"bVisible": false}', '{ "bVisible": false }', '{ "bVisible": false}' ], :id => 'thumbnail-table-picture', :autostart => false
|
36
|
-
|
37
|
-
= dataTables_tag :id => 'image-table-picture', :url => forgeos_core.admin_attachments_path(:format => :json, :file_type => 'picture',:mode => 'selection'),:columns => ["{'sClass':'th-checkbox-container', 'bSortable': false }", "{ 'sTitle': '#{t('media.filename')}'}", "{ 'sTitle': '#{t('media.content_type')}'}", "{ 'sTitle': '#{t('media.updated_at')}'}", "{ 'sTitle': '#{t('media.size')}'}", '{"bVisible": false}', '{ "bVisible": false }', '{ "bVisible": false}','{ "bVisible": false}', '{ "bVisible": false}'], :autostart => false
|
38
|
-
|
39
|
-
-# TODO move to base.js
|
40
|
-
- session_key = ActionController::Base.session_options[:key]
|
41
|
-
- javascript_tag do
|
42
|
-
function initpictureImageUpload(){
|
43
|
-
|
44
|
-
$('#imagepictureUploadDialog').html('<div id="imagepictureUpload"></div><div class="library-add"><span>or</span><a href="#" onclick="$(\'#imagepictureUploadDialog\').dialog(\'close\'); $(\'#imagepictureSelectDialog\').dialog(\'open\'); return false;">add from library</a></div>');
|
45
|
-
|
46
|
-
$('#imagepictureUpload').uploadify({
|
47
|
-
uploader: '/assets/forgeos/uploadify/uploadify.swf',
|
48
|
-
cancelImg: '/assets/forgeos/big-icons/delete-icon.png',
|
49
|
-
= "script: '#{forgeos_core.admin_attachments_path(:file_type => 'picture')}',"
|
50
|
-
= "buttonImg:'#{image_path("uploadify/choose-picture_#{I18n.locale}.png")}',"
|
51
|
-
width: 154,
|
52
|
-
height:24,
|
53
|
-
scriptData: {
|
54
|
-
format: 'json',
|
55
|
-
= "'authenticity_token': encodeURIComponent('#{u form_authenticity_token}')," if protect_against_forgery?
|
56
|
-
= "'#{session_key}': encodeURIComponent('#{cookies[session_key]}')"
|
57
|
-
},
|
58
|
-
ScriptAccess: 'always',
|
59
|
-
multi: 'true',
|
60
|
-
displayData: 'speed',
|
61
|
-
onComplete: function(e,queueID,fileObj,response,data){
|
62
|
-
if(typeof JSON=="object" && typeof JSON.parse=="function")
|
63
|
-
{
|
64
|
-
result = JSON.parse(response);
|
65
|
-
}
|
66
|
-
else{
|
67
|
-
result = eval('(' + response + ')');
|
68
|
-
}
|
69
|
-
if (result.result == 'success'){
|
70
|
-
add_picture_picture_to_element(result.path,result.id,fileObj.name);
|
71
|
-
} else {
|
72
|
-
display_notification_message('error',result.error)
|
73
|
-
}
|
74
|
-
},
|
75
|
-
onAllComplete: function(){
|
76
|
-
$('#imagepictureUploadDialog').dialog('close');
|
77
|
-
}
|
78
|
-
});
|
79
|
-
}
|
80
|
-
|
81
|
-
function add_picture_picture_to_element(path,id,name){
|
82
|
-
= "object_name='#{form.object_name}';"
|
83
|
-
$('#picture-picture ul.sortable').html('<li><img src="'+path+'" alt="'+name+'"/><a href="#" onclick="$(this).parents(\'li\').remove(); $(\'#picture\').val(\'null\'); return false;" class="big-icons delete"></a></li>');
|
84
|
-
$("#picture").val(id);
|
85
|
-
}
|
86
|
-
|
87
30
|
#imageimageUploadDialog.upload-lightbox-container.white
|
88
31
|
#imageimageUpload
|
89
|
-
/= form.file_field :uploaded_data
|
90
|
-
/= hidden_field_tag :target, params[:target]
|
91
|
-
/= hidden_field_tag :target_id, params[:target_id]
|
92
|
-
/= form.submit t('save').capitalize
|
93
|
-
|
94
32
|
%span= t('or')
|
95
|
-
= link_to_function t('media.
|
33
|
+
= link_to_function t('media.add_from_library'), "$('#imageimageSelectDialog').dialog('open');"
|
96
34
|
|
97
35
|
#imageimageSelectDialog.media-hoverlay.project
|
98
36
|
.media-hoverlay-header
|
@@ -118,53 +56,26 @@
|
|
118
56
|
%tr
|
119
57
|
%td
|
120
58
|
|
121
|
-
= dataSlides_tag :url => forgeos_core.
|
122
|
-
= dataTables_tag :id => 'image-table-image', :url => forgeos_core.admin_attachments_path(:format => :json, :file_type => 'picture',:mode => 'selection'),:columns => ["{'sClass':'th-checkbox-container', 'bSortable': false }", "{ 'sTitle': '#{t('media.filename')}'}", "{ 'sTitle': '#{t('media.content_type')}'}", "{ 'sTitle': '#{t('media.updated_at')}'}", "{ 'sTitle': '#{t('media.size')}'}", '{"bVisible": false}', '{ "bVisible": false }', '{ "bVisible": false}','{ "bVisible": false}', '{ "bVisible": false}']
|
59
|
+
= dataSlides_tag :url => forgeos_core.admin_pictures_path(:format => :json, :skin => 'thumbnail', :mode => 'selection'), :columns => [ '{ "bSortable": true, "bSearchable": true, "sType": "string", "bUseRendered": true, "fnRender": null, "iDataSort": 0, "nTf": null, "nTh": function(){$(".thead").find(".th");}, "sWidth": "0px"}','{"bVisible": false}', '{ "bVisible": false }', '{ "bVisible": false}' ], :id => 'thumbnail-table-image'
|
123
60
|
|
124
|
-
|
125
|
-
- session_key = ActionController::Base.session_options[:key]
|
126
|
-
- javascript_tag do
|
127
|
-
function initimageImageUpload(){
|
61
|
+
= dataTables_tag :id => 'image-table-image', :url => forgeos_core.admin_pictures_path(:format => :json, :mode => 'selection'),:columns => ["{'sClass':'th-checkbox-container', 'bSortable': false }", "{ 'sTitle': '#{t('media.filename')}'}", "{ 'sTitle': '#{t('media.content_type')}'}", "{ 'sTitle': '#{t('media.updated_at')}'}", "{ 'sTitle': '#{t('media.size')}'}", '{"bVisible": false}', '{ "bVisible": false }', '{ "bVisible": false}','{ "bVisible": false}', '{ "bVisible": false}']
|
128
62
|
|
129
|
-
|
63
|
+
= dataSlides_tag :url => forgeos_core.admin_pictures_path(:format => :json, :skin => 'thumbnail', :mode => 'selection'), :columns => [ '{ "bSortable": true, "bSearchable": true, "sType": "string", "bUseRendered": true, "fnRender": null, "iDataSort": 0, "nTf": null, "nTh": function(){$(".thead").find(".th");}, "sWidth": "0px"}','{"bVisible": false}', '{ "bVisible": false }', '{ "bVisible": false}' ], :id => 'thumbnail-table-picture', :autostart => false
|
130
64
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
height:24,
|
138
|
-
scriptData: {
|
139
|
-
format: 'json',
|
140
|
-
= "'authenticity_token': encodeURIComponent('#{u form_authenticity_token}')," if protect_against_forgery?
|
141
|
-
= "'#{session_key}': encodeURIComponent('#{cookies[session_key]}')"
|
142
|
-
},
|
143
|
-
ScriptAccess: 'always',
|
144
|
-
multi: 'true',
|
145
|
-
displayData: 'speed',
|
146
|
-
onComplete: function(e,queueID,fileObj,response,data){
|
147
|
-
if(typeof JSON=="object" && typeof JSON.parse=="function")
|
148
|
-
{
|
149
|
-
result = JSON.parse(response);
|
150
|
-
}
|
151
|
-
else{
|
152
|
-
result = eval('(' + response + ')');
|
153
|
-
}
|
154
|
-
if (result.result == 'success'){
|
155
|
-
add_image_picture_to_element(result.path,result.id,fileObj.name);
|
156
|
-
} else {
|
157
|
-
display_notification_message('error',result.error)
|
158
|
-
}
|
159
|
-
},
|
160
|
-
onAllComplete: function(){
|
161
|
-
$('#imageimageUploadDialog').dialog('close');
|
162
|
-
}
|
163
|
-
});
|
65
|
+
= dataTables_tag :id => 'image-table-picture', :url => forgeos_core.admin_pictures_path(:format => :json, :mode => 'selection'),:columns => ["{'sClass':'th-checkbox-container', 'bSortable': false }", "{ 'sTitle': '#{t('media.filename')}'}", "{ 'sTitle': '#{t('media.content_type')}'}", "{ 'sTitle': '#{t('media.updated_at')}'}", "{ 'sTitle': '#{t('media.size')}'}", '{"bVisible": false}', '{ "bVisible": false }', '{ "bVisible": false}','{ "bVisible": false}', '{ "bVisible": false}'], :autostart => false
|
66
|
+
|
67
|
+
:javascript
|
68
|
+
function add_image_to_element(path,id,name,object_name,input) {
|
69
|
+
jQuery(input + '-picture ul.sortable').html('<li><img src="'+path+'" alt="'+name+'"/><a href="#" onclick="$(this).parents(\'li\').remove(); $("'+input+'").val(\'null\'); return false;" class="big-icons delete"></a></li>');
|
70
|
+
jQuery(input).val(id);
|
164
71
|
}
|
165
72
|
|
166
73
|
function add_image_picture_to_element(path,id,name){
|
167
|
-
|
168
|
-
|
169
|
-
|
74
|
+
var object_name='#{form.object_name}';
|
75
|
+
add_image_to_element(path,id,name,object_name, '#image');
|
76
|
+
}
|
77
|
+
|
78
|
+
function add_picture_picture_to_element(path,id,name){
|
79
|
+
var object_name='#{form.object_name}';
|
80
|
+
add_image_to_element(path,id,name,object_name, '#picture');
|
170
81
|
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
/= form.submit I18n.t('save').capitalize
|
7
7
|
|
8
8
|
%span= I18n.t('or')
|
9
|
-
= link_to_function I18n.t('media.
|
9
|
+
= link_to_function I18n.t('media.add_from_library'), "$('#imagevisualsSelectDialog').dialog('open');"
|
10
10
|
|
11
11
|
#imagevisualsSelectDialog.media-hoverlay.project
|
12
12
|
.media-hoverlay-header
|
@@ -32,52 +32,12 @@
|
|
32
32
|
%tr
|
33
33
|
%td
|
34
34
|
|
35
|
-
= dataSlides_tag :url => forgeos_core.
|
35
|
+
= dataSlides_tag :url => forgeos_core.admin_pictures_path(:format => :json, :skin => 'thumbnail', :mode => 'selection'), :columns => [ '{ "bSortable": true, "bSearchable": true, "sType": "string", "bUseRendered": true, "fnRender": null, "iDataSort": 0, "nTf": null, "nTh": function(){$(".thead").find(".th");}, "sWidth": "0px"}','{"bVisible": false}', '{ "bVisible": false }', '{ "bVisible": false}' ], :id => 'thumbnail-table-visuals', :autostart => false
|
36
36
|
|
37
|
-
= dataTables_tag :id => 'image-table-visuals', :url => forgeos_core.
|
37
|
+
= dataTables_tag :id => 'image-table-visuals', :url => forgeos_core.admin_pictures_path(:format => :json, :mode => 'selection'),:columns => ["{'sClass':'th-checkbox-container', 'bSortable': false }", "{ 'sTitle': '#{I18n.t('media.filename')}'}", "{ 'sTitle': '#{I18n.t('media.content_type')}'}", "{ 'sTitle': '#{I18n.t('media.updated_at')}'}", "{ 'sTitle': '#{I18n.t('media.size')}'}", '{"bVisible": false}', '{ "bVisible": false }', '{ "bVisible": false}','{ "bVisible": false}', '{ "bVisible": false}'], :autostart => false
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
$('#imagevisualsUploadDialog').html('<div id="imagevisualsUpload"></div><div class="library-add"><span>or</span><a href="#" onclick="$(\'#imagevisualsUploadDialog\').dialog(\'close\'); $(\'#imagevisualsSelectDialog\').dialog(\'open\'); return false;">add from library</a></div>');
|
45
|
-
|
46
|
-
$('#imagevisualsUpload').uploadify({
|
47
|
-
uploader: '/assets/forgeos/uploadify/uploadify.swf',
|
48
|
-
cancelImg: '/assets/forgeos/min/big-icons/delete-icon.png',
|
49
|
-
= "script: '#{forgeos_core.admin_attachments_path(:file_type => 'picture')}',"
|
50
|
-
= "buttonImg:'#{image_path("uploadify/choose-picture_#{I18n.locale}.png")}',"
|
51
|
-
width: 154,
|
52
|
-
height:24,
|
53
|
-
scriptData: {
|
54
|
-
format: 'json',
|
55
|
-
= "authenticity_token: encodeURIComponent('#{u form_authenticity_token}')," if protect_against_forgery?
|
56
|
-
= "#{session_key}: encodeURIComponent('#{cookies[session_key]}')"
|
57
|
-
},
|
58
|
-
ScriptAccess: 'always',
|
59
|
-
multi: 'true',
|
60
|
-
displayData: 'speed',
|
61
|
-
onComplete: function(e,queueID,fileObj,response,data){
|
62
|
-
if(typeof JSON=="object" && typeof JSON.parse=="function")
|
63
|
-
{
|
64
|
-
result = JSON.parse(response);
|
65
|
-
}
|
66
|
-
else{
|
67
|
-
result = eval('(' + response + ')');
|
68
|
-
}
|
69
|
-
if (result.result == 'success'){
|
70
|
-
add_picture_to_element(result.path,result.id,fileObj.name);
|
71
|
-
} else {
|
72
|
-
display_notification_message('error',result.error)
|
39
|
+
:javascript
|
40
|
+
function add_picture_to_visuals(path,id,name){
|
41
|
+
var object_name='#{form.object_name}';
|
42
|
+
jQuery('#visuals-picture ul.sortable').before('<li><a href="#" onclick="jQuery(this).parents(\'li\').remove(); return false;" class="big-icons trash"></a><input type="hidden" name="'+object_name+'[attachment_ids][]" value="'+id+'"/><img src="'+path+'" alt="'+name+'"/><div class="handler"><div class="inner"></div></div></li>');
|
73
43
|
}
|
74
|
-
},
|
75
|
-
onAllComplete: function(){
|
76
|
-
$('#imagevisualsUploadDialog').dialog('close');
|
77
|
-
}
|
78
|
-
});
|
79
|
-
}
|
80
|
-
|
81
|
-
function add_picture_to_element(path,id,name){
|
82
|
-
= "object_name='#{form.object_name}';"
|
83
|
-
$('#visuals-picture ul.sortable').before('<li><a href="#" onclick="$(this).parents(\'li\').remove(); return false;" class="big-icons trash"></a><input type="hidden" name="'+object_name+'[attachment_ids][]" value="'+id+'"/><img src="'+path+'" alt="'+name+'"/><div class="handler"><div class="inner"></div></div></li>'); }
|
data/config/routes.rb
CHANGED
@@ -59,8 +59,19 @@ Forgeos::Core::Engine.routes.draw do
|
|
59
59
|
end
|
60
60
|
|
61
61
|
match '/library' => 'attachments#index', :as => :library, :file_type => 'picture'
|
62
|
+
|
63
|
+
resources :attachments, :except => [:new] do
|
64
|
+
collection do
|
65
|
+
get :manage
|
66
|
+
end
|
67
|
+
member do
|
68
|
+
get :download
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
|
62
73
|
%w(media picture doc pdf audio video attachment).each do |attachment|
|
63
|
-
resources attachment.pluralize.to_sym, :except => [:new] do
|
74
|
+
resources attachment.pluralize.to_sym, :controller => 'attachments', :file_type => attachment, :except => [:new] do
|
64
75
|
collection do
|
65
76
|
get :manage
|
66
77
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Forgeos
|
2
|
+
module Urlified
|
3
|
+
def self.included(base)
|
4
|
+
base.before_validation :force_url_format, :generate_url
|
5
|
+
end
|
6
|
+
|
7
|
+
def force_url_format
|
8
|
+
self.url= Forgeos::url_generator(self.url)
|
9
|
+
end
|
10
|
+
|
11
|
+
def generate_url
|
12
|
+
return true if self.url.present?
|
13
|
+
self.url = self.name.parameterize if self.name.present?
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/tasks/install.rake
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
namespace :forgeos do
|
2
2
|
namespace :core do
|
3
3
|
desc "load fixtures and generate forgeos_core controllers ACLs"
|
4
|
-
task :install
|
5
|
-
|
6
|
-
|
4
|
+
task :install do
|
5
|
+
Rake::Task['forgeos:core:fixtures:load'].invoke('forgeos_core','people geo_zones settings')
|
6
|
+
Rake::Task['forgeos:core:generate:acl'].invoke(Gem.loaded_specs['forgeos_core'].full_gem_path)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -152,18 +152,12 @@ module Technoweenie # :nodoc:
|
|
152
152
|
end
|
153
153
|
|
154
154
|
def current_data
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
ftp.getbinaryfile(dest_path, f.path)
|
162
|
-
ftp.close
|
163
|
-
f.open
|
164
|
-
v = f.read()
|
165
|
-
f.delete
|
166
|
-
v
|
155
|
+
Net::FTP.open(ftp_config[:server]) do |ftp|
|
156
|
+
ftp.login(ftp_config[:login], ftp_config[:password])
|
157
|
+
ftp.getbinaryfile(File.join(ftp_config[:base_upload_path], full_filename)) do |data|
|
158
|
+
return data
|
159
|
+
end
|
160
|
+
end
|
167
161
|
end
|
168
162
|
|
169
163
|
# Partitions the given path into an array of path components.
|
@@ -201,6 +195,7 @@ module Technoweenie # :nodoc:
|
|
201
195
|
protected
|
202
196
|
# Called in the after_destroy callback
|
203
197
|
def destroy_file
|
198
|
+
return true if ftp_config[:read_only]
|
204
199
|
ftp = Net::FTP.new(ftp_config[:server])
|
205
200
|
ftp.login(ftp_config[:login], ftp_config[:password])
|
206
201
|
dest_path = File.join(ftp_config[:base_upload_path], full_filename)
|
@@ -208,6 +203,7 @@ module Technoweenie # :nodoc:
|
|
208
203
|
end
|
209
204
|
|
210
205
|
def rename_file
|
206
|
+
return true if ftp_config[:read_only]
|
211
207
|
return unless @old_filename && @old_filename != filename
|
212
208
|
old_full_filename = File.join(base_path, @old_filename)
|
213
209
|
|