etabliocms_pages 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
+ //= require jquery.zclip
1
2
  //= require jquery.uploadify.v2.1.4
2
3
  //= require swfobject
3
- //= require jquery.zclip
4
4
  //= require pages
@@ -1,13 +1,15 @@
1
1
  var AdminPages = function() {
2
2
 
3
3
  return {
4
- initCopyPaste : function() {
5
- $('.icon-copypaste').zclip({
6
- path:'/uploadify/ZeroClipboard.swf',
7
- copy: $(this).parent().find(".url").text,
8
- clickAfter: false
9
- }
10
- );
4
+ initClipboard : function() {
5
+ $('a.clipboard-link').zclip({
6
+ path:'/zeroclipboard/ZeroClipboard.swf',
7
+ copy: function() {
8
+ return $(this).closest('tr').find('a.url').attr("href");
9
+ },
10
+ setHandCursor: true,
11
+ clickAfter: false
12
+ });
11
13
  }
12
14
  }
13
15
  }();
@@ -1,10 +1,5 @@
1
1
  #data-submit { float: none; margin-top: 15px; }
2
- #attachments { width: 698px; overflow: hidden; margin: 0 0 15px 0;
3
- ul { margin-left: 1em; }
4
- li { padding-bottom: 10px; }
2
+ #attachments-table { width: 650px; overflow: hidden; margin: 0 0 15px 0;
3
+ .clipboard-link { cursor: hand; }
5
4
  }
6
5
 
7
- .attachment { float: left; clear:left;
8
- .icon { float: right; }
9
-
10
- }
@@ -1,19 +1,42 @@
1
- <ul>
2
- <% @page.attachments.each do |attachment| %>
3
- <li class="attachment">
4
-
5
- <%= link_to attachment.data.url(:default, false), attachment.data.url(:original, false), :class => "url" %>
6
- : <%= link_to attachment.data_file_name, attachment.data.url(:original, false) %>
1
+ <table id="attachments-table" class="nested-fields-table">
2
+ <thead>
3
+ <tr>
4
+ <th style="width:15px;"></th>
5
+ <th><%= t('activerecord.attributes.etabliocms_pages/attachment.data_file_name') %></th>
6
+ <th><%= t('activerecord.attributes.etabliocms_pages/attachment.data_file_size') %></th>
7
+ <th style="width:15px;"><%= t('admin.actions') %></th>
8
+ </tr>
9
+ </thead>
7
10
 
8
- <%= link_to t('admin.attachments.copypaste'), "#", :class => "icon icon-copypaste", :title => t('admin.attachments.copypaste') %>
11
+ <tbody>
12
+ <% @page.attachments.each do |attachment| %>
9
13
 
10
- <%= link_to I18n.t('admin.attachments.destroy'),
11
- destroy_attachment_admin_page_path(@page.id, :attachment_id => attachment.id),
12
- {:method => :delete,
13
- :confirm => t("admin.attachments.destroy_confirmation"),
14
- :remote => true,
15
- :class => 'icon icon-destroy', :title => I18n.t('admin.attachments.destroy')} %>
14
+ <tr class="fields">
15
+ <td>
16
+ <span style="position:relative;">
17
+ <%= link_to image_tag("icons/icon-copypaste.png"), "#attachments-table", :class => "clipboard-link", :id => "attachments-#{attachment.id}", :title => t('admin.attachments.copypaste') %>
18
+ </span>
19
+ </td>
20
+ <td>
21
+ <%= link_to attachment.data_file_name, attachment.data.url(:original, false), :"data-popup" => true, :class => 'url' %>
22
+ </td>
23
+ <td class="centered"><%= number_to_human_size(attachment.data_file_size) %></td>
24
+ <td>
25
+ <%= link_to I18n.t('admin.attachments.destroy'),
26
+ destroy_attachment_admin_page_path(@page.id, :attachment_id => attachment.id),
27
+ {:method => :delete,
28
+ :confirm => t("admin.attachments.destroy_confirmation"),
29
+ :remote => true,
30
+ :class => 'icon icon-destroy', :title => I18n.t('admin.attachments.destroy')} %>
31
+ </td>
32
+ </tr>
16
33
 
17
- </li>
18
34
  <% end %>
19
- </ul>
35
+ </tbody>
36
+ </table>
37
+
38
+ <script>
39
+ $(function() {
40
+ AdminPages.initClipboard();
41
+ });
42
+ </script>
@@ -73,7 +73,7 @@
73
73
  <script>
74
74
  $(function() {
75
75
  $("#contents").tabs();
76
- AdminPages.initCopyPaste();
76
+ //AdminPages.initCopyPaste();
77
77
 
78
78
  $('#etabliocms_pages_page_attachment_data').click(function(event) {
79
79
  event.preventDefault();
@@ -91,7 +91,7 @@
91
91
  'attachable_id' : '<%= @page.id %>'},
92
92
  onComplete: function(event, queueID, fileObj, response, data) {
93
93
  $('#attachments').html(response);
94
- AdminPages.initCopyPaste();
94
+ //AdminPages.initCopyPaste();
95
95
  }
96
96
 
97
97
  });
@@ -1,2 +1 @@
1
1
  $("#attachments").html("<%= escape_javascript(render("attachments")) %>");
2
- console.log("fasfds");
@@ -8,6 +8,7 @@ cs:
8
8
  copypaste: Zkopírovat do schránky
9
9
  destroy: Odstranit
10
10
  destroy_confirmation: Skutečně chcete smazat tuto přílohu?
11
+ clipboard: Schránka
11
12
  page:
12
13
  pages: Stránky
13
14
  pages_count: "Stránky (%{count})"
@@ -49,3 +50,6 @@ cs:
49
50
  locale: Jazyk
50
51
  page_title: Meta title
51
52
  page_description: Meta description
53
+ "etabliocms_pages/attachment":
54
+ data_file_name: Soubor
55
+ data_file_size: Velikost
@@ -1,3 +1,3 @@
1
1
  module EtabliocmsPages
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etabliocms_pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-16 00:00:00.000000000 Z
12
+ date: 2012-03-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &19165520 !ruby/object:Gem::Requirement
16
+ requirement: &20330440 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *19165520
24
+ version_requirements: *20330440
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: etabliocms_core
27
- requirement: &19165080 !ruby/object:Gem::Requirement
27
+ requirement: &20329880 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *19165080
35
+ version_requirements: *20329880
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: awesome_nested_set
38
- requirement: &19164460 !ruby/object:Gem::Requirement
38
+ requirement: &20328220 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - =
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.1.2
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *19164460
46
+ version_requirements: *20328220
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: paperclip
49
- requirement: &19163860 !ruby/object:Gem::Requirement
49
+ requirement: &20326940 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *19163860
57
+ version_requirements: *20326940
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: sqlite3
60
- requirement: &19163220 !ruby/object:Gem::Requirement
60
+ requirement: &20325920 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *19163220
68
+ version_requirements: *20325920
69
69
  description: Small CMS - module for pages
70
70
  email:
71
71
  - patrikjira@gmail.com
@@ -101,8 +101,9 @@ files:
101
101
  - lib/etabliocms_pages/version.rb
102
102
  - lib/etabliocms_pages/engine.rb
103
103
  - lib/etabliocms_pages.rb
104
+ - public/zeroclipboard/ZeroClipboard.swf
105
+ - public/zeroclipboard/ZeroClipboard10.swf
104
106
  - public/uploadify/uploadify.swf
105
- - public/uploadify/ZeroClipboard.swf
106
107
  - public/uploadify/cancel.png
107
108
  - vendor/assets/javascripts/jquery.uploadify.v2.1.4.js
108
109
  - vendor/assets/javascripts/jquery.zclip.js