radiant-downloads-extension 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,7 +9,6 @@ begin
9
9
  gem.authors = ["spanner"]
10
10
  gem.add_dependency "radiant", ">= 0.9.0"
11
11
  gem.add_dependency 'radiant-reader_group-extension'
12
- gem.add_dependency 'paperclip'
13
12
  end
14
13
  rescue LoadError
15
14
  puts "Jeweler (or a dependency) not available. This is only required if you plan to package downloads as a gem."
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.5.2
@@ -1,3 +1,4 @@
1
1
  class Admin::DownloadsController < Admin::ResourceController
2
-
2
+ paginate_models
3
+
3
4
  end
@@ -1,32 +1,31 @@
1
- - include_stylesheet 'admin/downloads'
2
-
3
- %h1 Authorised Downloads
4
-
5
- %table#downloads.index{:cellpadding => "0", :cellspacing => "0", :border => "0"}
6
- %thead
7
- %tr
8
- %th.download Title
9
- %th.file File
10
- %th.groups Visible to groups
11
- %th.actions
12
- %tbody
13
- - if @downloads.empty?
1
+ #downloads_table.outset
2
+ %table#downloads.index{:cellpadding => "0", :cellspacing => "0", :border => "0"}
3
+ %thead
14
4
  %tr
15
- %td.note{:colspan => "4"}
16
- No downloads for you, sonny
17
- - else
18
- - @downloads.each do |dl|
19
- %tr{:class => "node level-1"}
20
- %td.download
21
- = link_to dl.name, edit_admin_download_url(dl)
22
- %td.file
23
- = link_to dl.document_file_name, download_url(dl)
24
- = number_to_human_size(dl.document_file_size)
25
- %td.groups
26
- = dl.groups.map {|g| link_to g.name, admin_group_url(g) }.join(', ')
27
- %td.remove
28
- = link_to( image('remove', :alt => 'Remove Download'), :action => 'destroy', :id => dl, :confirm => "are you sure you want to completely remove #{dl.name}?")
29
-
5
+ %th.download Title
6
+ %th.file File
7
+ %th.groups Visible to groups
8
+ %th.actions
9
+ %tbody
10
+ - if @downloads.empty?
11
+ %tr
12
+ %td.note{:colspan => "4"}
13
+ No downloads for you, sonny
14
+ - else
15
+ - @downloads.each do |dl|
16
+ %tr
17
+ %td.name
18
+ = link_to dl.name, edit_admin_download_url(dl)
19
+ %td.file
20
+ = link_to dl.document_file_name, download_url(dl)
21
+ = number_to_human_size(dl.document_file_size)
22
+ %td.groups
23
+ = dl.groups.map {|g| link_to g.name, admin_group_url(g) }.join(', ')
24
+ %td.actions
25
+ = link_to( image('minus') + ' delete', admin_download_url(dl), :method => :delete, :class => 'action', :confirm => "are you sure you want to completely remove #{dl.name}?")
30
26
 
31
- %p
32
- = link_to(image('new-file', :alt => 'New download'), :action => 'new')
27
+ #actions
28
+ = pagination_for @downloads
29
+ %ul
30
+ %li
31
+ = link_to image('plus') + " " + "new download", new_admin_download_url
@@ -3,7 +3,7 @@
3
3
  require 'paperclip'
4
4
 
5
5
  class DownloadsExtension < Radiant::Extension
6
- version "0.5.1"
6
+ version "0.5.2"
7
7
  description "Controlled file access using nginx's local redirects. Requires reader and reader_group extensions."
8
8
  url "http://www.spanner.org/radiant/downloads"
9
9
 
@@ -12,9 +12,14 @@ class DownloadsExtension < Radiant::Extension
12
12
  Page.send :include, DownloadTags
13
13
  UserActionObserver.instance.send :add_observer!, Download
14
14
 
15
+ unless defined? admin.downloads
16
+ Radiant::AdminUI.send :include, DownloadUI
17
+ Radiant::AdminUI.load_download_extension_regions
18
+ end
19
+
15
20
  if respond_to?(:tab)
16
- tab("Content") do
17
- add_item("Downloads", "/admin/readers/downloads")
21
+ tab("Readers") do
22
+ add_item("Downloads", "/admin/readers/downloads", :before => 'Settings')
18
23
  end
19
24
  else
20
25
  admin.tabs.add "Downloads", "/admin/readers/downloads", :visibility => [:all]
data/lib/download_ui.rb CHANGED
@@ -8,10 +8,13 @@ module DownloadUI
8
8
 
9
9
  def load_default_regions_with_download
10
10
  load_default_regions_without_download
11
- @download = load_default_download_regions
11
+ load_download_extension_regions
12
12
  end
13
-
14
13
  alias_method_chain :load_default_regions, :download
14
+
15
+ def load_download_extension_regions
16
+ @download = load_default_download_regions
17
+ end
15
18
 
16
19
  protected
17
20
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-downloads-extension}
8
- s.version = "0.5.1"
8
+ s.version = "0.5.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["spanner"]
@@ -34,7 +34,6 @@ Gem::Specification.new do |s|
34
34
  "lib/download_tags.rb",
35
35
  "lib/download_ui.rb",
36
36
  "lib/tasks/downloads_extension_tasks.rake",
37
- "public/stylesheets/admin/downloads.css",
38
37
  "radiant-downloads-extension.gemspec",
39
38
  "spec/controllers/downloads_controller_spec.rb",
40
39
  "spec/datasets/download_groups_dataset.rb",
@@ -71,16 +70,13 @@ Gem::Specification.new do |s|
71
70
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
72
71
  s.add_runtime_dependency(%q<radiant>, [">= 0.9.0"])
73
72
  s.add_runtime_dependency(%q<radiant-reader_group-extension>, [">= 0"])
74
- s.add_runtime_dependency(%q<paperclip>, [">= 0"])
75
73
  else
76
74
  s.add_dependency(%q<radiant>, [">= 0.9.0"])
77
75
  s.add_dependency(%q<radiant-reader_group-extension>, [">= 0"])
78
- s.add_dependency(%q<paperclip>, [">= 0"])
79
76
  end
80
77
  else
81
78
  s.add_dependency(%q<radiant>, [">= 0.9.0"])
82
79
  s.add_dependency(%q<radiant-reader_group-extension>, [">= 0"])
83
- s.add_dependency(%q<paperclip>, [">= 0"])
84
80
  end
85
81
  end
86
82
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-downloads-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 1
10
- version: 0.5.1
9
+ - 2
10
+ version: 0.5.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - spanner
@@ -48,20 +48,6 @@ dependencies:
48
48
  version: "0"
49
49
  type: :runtime
50
50
  version_requirements: *id002
51
- - !ruby/object:Gem::Dependency
52
- name: paperclip
53
- prerelease: false
54
- requirement: &id003 !ruby/object:Gem::Requirement
55
- none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
- version: "0"
63
- type: :runtime
64
- version_requirements: *id003
65
51
  description: Controlled, secure file access with group-based access control.
66
52
  email: will@spanner.org
67
53
  executables: []
@@ -89,7 +75,6 @@ files:
89
75
  - lib/download_tags.rb
90
76
  - lib/download_ui.rb
91
77
  - lib/tasks/downloads_extension_tasks.rake
92
- - public/stylesheets/admin/downloads.css
93
78
  - radiant-downloads-extension.gemspec
94
79
  - spec/controllers/downloads_controller_spec.rb
95
80
  - spec/datasets/download_groups_dataset.rb
@@ -1,25 +0,0 @@
1
- /* submenu admin */
2
-
3
- #content table.index .node .download {
4
- font-size:115%;
5
- font-weight:bold;
6
- }
7
-
8
- #content table.index .node .download a {
9
- color: black;
10
- }
11
-
12
- #content .form-area .user select {
13
- font-family:Georgia,Palatino,"Times New Roman",Times,serif;
14
- font-size:150%;
15
- width:60%;
16
- }
17
-
18
- #content .form-area p.description {
19
- margin-top: 10px;
20
- }
21
-
22
- #content .form-area span.formnote {
23
- color: #7d796c;
24
- font-size: 85%;
25
- }