radiant-reader_group-extension 0.9.0 → 1.0.0

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.
Files changed (35) hide show
  1. data/README.markdown +2 -5
  2. data/VERSION +1 -1
  3. data/app/controllers/admin/groups_controller.rb +4 -0
  4. data/app/views/admin/group_invitations/new.html.haml +13 -27
  5. data/app/views/admin/group_invitations/preview.html.haml +52 -57
  6. data/app/views/admin/groups/_form.html.haml +3 -38
  7. data/app/views/admin/groups/edit.html.haml +2 -1
  8. data/app/views/admin/groups/index.html.haml +30 -3
  9. data/app/views/admin/groups/new.html.haml +2 -1
  10. data/app/views/admin/groups/show.html.haml +66 -35
  11. data/app/views/admin/messages/_function.haml +19 -0
  12. data/app/views/admin/messages/_list_function.haml +7 -0
  13. data/app/views/admin/messages/_message_group.html.haml +2 -0
  14. data/app/views/admin/pages/_page_groups.html.haml +9 -15
  15. data/app/views/admin/readers/_reader_groups.html.haml +1 -1
  16. data/app/views/readers/_memberships.html.haml +2 -2
  17. data/app/views/site/not_allowed.html.haml +2 -2
  18. data/config/locales/en.yml +43 -0
  19. data/lib/admin_messages_controller_extensions.rb +2 -1
  20. data/lib/group_ui.rb +11 -4
  21. data/lib/grouped_model.rb +0 -1
  22. data/lib/grouped_page.rb +2 -0
  23. data/lib/grouped_reader.rb +2 -0
  24. data/lib/site_controller_extensions.rb +3 -3
  25. data/public/stylesheets/sass/admin/reader_group.sass +242 -0
  26. data/radiant-reader_group-extension.gemspec +7 -11
  27. data/reader_group_extension.rb +8 -9
  28. metadata +8 -12
  29. data/app/views/admin/groups/_listed.html.haml +0 -25
  30. data/app/views/admin/reader_settings/_group_welcomes.html.haml +0 -11
  31. data/app/views/messages/show.html.haml +0 -11
  32. data/app/views/reader_activations/_on_activation.html.haml +0 -10
  33. data/pkg/radiant-reader_group-extension-0.9.0.gem +0 -0
  34. data/public/stylesheets/sass/admin/group.sass +0 -66
  35. data/spec/controllers/readers_controller_spec.rb +0 -44
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-reader_group-extension}
8
- s.version = "0.9.0"
8
+ s.version = "1.0.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["spanner"]
12
- s.date = %q{2010-10-04}
12
+ s.date = %q{2010-10-19}
13
13
  s.description = %q{Adds group-based page access control to radiant.}
14
14
  s.email = %q{will@spanner.org}
15
15
  s.extra_rdoc_files = [
@@ -33,25 +33,24 @@ Gem::Specification.new do |s|
33
33
  "app/views/admin/groups/_add_readers.html.haml",
34
34
  "app/views/admin/groups/_form.html.haml",
35
35
  "app/views/admin/groups/_list_head.html.haml",
36
- "app/views/admin/groups/_listed.html.haml",
37
36
  "app/views/admin/groups/edit.html.haml",
38
37
  "app/views/admin/groups/index.html.haml",
39
38
  "app/views/admin/groups/new.html.haml",
40
39
  "app/views/admin/groups/remove.html.haml",
41
40
  "app/views/admin/groups/show.html.haml",
42
41
  "app/views/admin/memberships/_reader.html.haml",
42
+ "app/views/admin/messages/_function.haml",
43
+ "app/views/admin/messages/_list_function.haml",
43
44
  "app/views/admin/messages/_list_notes.html.haml",
44
45
  "app/views/admin/messages/_message_description.html.haml",
45
46
  "app/views/admin/messages/_message_group.html.haml",
46
47
  "app/views/admin/pages/_listed.html.haml",
47
48
  "app/views/admin/pages/_page_groups.html.haml",
48
49
  "app/views/admin/permissions/_page.html.haml",
49
- "app/views/admin/reader_settings/_group_welcomes.html.haml",
50
50
  "app/views/admin/readers/_reader_groups.html.haml",
51
- "app/views/messages/show.html.haml",
52
- "app/views/reader_activations/_on_activation.html.haml",
53
51
  "app/views/readers/_memberships.html.haml",
54
52
  "app/views/site/not_allowed.html.haml",
53
+ "config/locales/en.yml",
55
54
  "config/routes.rb",
56
55
  "db/migrate/001_create_groups.rb",
57
56
  "db/migrate/20090921125654_group_messages.rb",
@@ -69,7 +68,6 @@ Gem::Specification.new do |s|
69
68
  "lib/readers_controller_extensions.rb",
70
69
  "lib/site_controller_extensions.rb",
71
70
  "lib/tasks/reader_group_extension_tasks.rake",
72
- "pkg/radiant-reader_group-extension-0.9.0.gem",
73
71
  "public/images/admin/chk_auto.png",
74
72
  "public/images/admin/chk_off.png",
75
73
  "public/images/admin/chk_on.png",
@@ -80,10 +78,9 @@ Gem::Specification.new do |s|
80
78
  "public/images/admin/populate.png",
81
79
  "public/images/admin/rdo_off.png",
82
80
  "public/images/admin/rdo_on.png",
83
- "public/stylesheets/sass/admin/group.sass",
81
+ "public/stylesheets/sass/admin/reader_group.sass",
84
82
  "radiant-reader_group-extension.gemspec",
85
83
  "reader_group_extension.rb",
86
- "spec/controllers/readers_controller_spec.rb",
87
84
  "spec/controllers/site_controller_spec.rb",
88
85
  "spec/datasets/group_messages_dataset.rb",
89
86
  "spec/datasets/group_readers_dataset.rb",
@@ -102,8 +99,7 @@ Gem::Specification.new do |s|
102
99
  s.rubygems_version = %q{1.3.7}
103
100
  s.summary = %q{Group-based access control for the radiant CMS}
104
101
  s.test_files = [
105
- "spec/controllers/readers_controller_spec.rb",
106
- "spec/controllers/site_controller_spec.rb",
102
+ "spec/controllers/site_controller_spec.rb",
107
103
  "spec/datasets/group_messages_dataset.rb",
108
104
  "spec/datasets/group_readers_dataset.rb",
109
105
  "spec/datasets/group_sites_dataset.rb",
@@ -10,7 +10,7 @@ module ReaderGroup
10
10
  end
11
11
 
12
12
  class ReaderGroupExtension < Radiant::Extension
13
- version "0.9.0"
13
+ version "1.0.0"
14
14
  description "Page (and other) access control for site readers and groups"
15
15
  url "http://spanner.org/radiant/reader_group"
16
16
 
@@ -25,22 +25,21 @@ class ReaderGroupExtension < Radiant::Extension
25
25
  ReaderNotifier.send :include, ReaderNotifierExtensions # a couple of new message types
26
26
  SiteController.send :include, SiteControllerExtensions # access control based on group membership
27
27
  ReadersController.send :include, ReadersControllerExtensions # offer subscription to public groups
28
- Admin::MessagesController.send :include, AdminMessagesControllerExtensions # supports specification of group on newing of message
28
+ Admin::MessagesController.send :include, AdminMessagesControllerExtensions # preview and delivery
29
29
  ReaderSessionsController.send :include, ReaderSessionsControllerExtensions # sends newly logged-in readers to a group home page if one can be found
30
30
  ReaderActivationsController.send :include, ReaderActivationsControllerExtensions # sends newly activated readers to a group home page if one can be found
31
31
  UserActionObserver.instance.send :add_observer!, Group # the usual date-stamping and ownership
32
32
  Page.send :include, GroupMessageTags # extra tags for talking about groups in mailouts
33
33
 
34
-
35
34
  unless defined? admin.group # to avoid duplicate partials
36
35
  Radiant::AdminUI.send :include, GroupUI
37
- admin.group = Radiant::AdminUI.load_default_group_regions
38
- admin.page.edit.add :parts_bottom, "page_groups", :before => "edit_timestamp"
39
- admin.reader.edit.add :form, "reader_groups", :before => "edit_password"
40
- admin.message.edit.add :form, "message_group", :before => "edit_subject"
41
- admin.reader_setting.index.add :messages, "group_welcomes", :after => "administration"
36
+ Radiant::AdminUI.load_reader_group_extension_regions
42
37
  end
43
-
38
+
39
+ admin.page.edit.add :parts_bottom, "page_groups"
40
+ admin.reader.edit.add :form, "reader_groups", :before => :edit_description
41
+ admin.message.edit.add :body_bottom, "message_group"
42
+
44
43
  tab("Readers") do
45
44
  add_item 'Groups', '/admin/readers/groups', :before => 'Settings'
46
45
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-reader_group-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 9
9
9
  - 0
10
- version: 0.9.0
10
+ version: 1.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - spanner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-04 00:00:00 +01:00
18
+ date: 2010-10-19 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -74,25 +74,24 @@ files:
74
74
  - app/views/admin/groups/_add_readers.html.haml
75
75
  - app/views/admin/groups/_form.html.haml
76
76
  - app/views/admin/groups/_list_head.html.haml
77
- - app/views/admin/groups/_listed.html.haml
78
77
  - app/views/admin/groups/edit.html.haml
79
78
  - app/views/admin/groups/index.html.haml
80
79
  - app/views/admin/groups/new.html.haml
81
80
  - app/views/admin/groups/remove.html.haml
82
81
  - app/views/admin/groups/show.html.haml
83
82
  - app/views/admin/memberships/_reader.html.haml
83
+ - app/views/admin/messages/_function.haml
84
+ - app/views/admin/messages/_list_function.haml
84
85
  - app/views/admin/messages/_list_notes.html.haml
85
86
  - app/views/admin/messages/_message_description.html.haml
86
87
  - app/views/admin/messages/_message_group.html.haml
87
88
  - app/views/admin/pages/_listed.html.haml
88
89
  - app/views/admin/pages/_page_groups.html.haml
89
90
  - app/views/admin/permissions/_page.html.haml
90
- - app/views/admin/reader_settings/_group_welcomes.html.haml
91
91
  - app/views/admin/readers/_reader_groups.html.haml
92
- - app/views/messages/show.html.haml
93
- - app/views/reader_activations/_on_activation.html.haml
94
92
  - app/views/readers/_memberships.html.haml
95
93
  - app/views/site/not_allowed.html.haml
94
+ - config/locales/en.yml
96
95
  - config/routes.rb
97
96
  - db/migrate/001_create_groups.rb
98
97
  - db/migrate/20090921125654_group_messages.rb
@@ -110,7 +109,6 @@ files:
110
109
  - lib/readers_controller_extensions.rb
111
110
  - lib/site_controller_extensions.rb
112
111
  - lib/tasks/reader_group_extension_tasks.rake
113
- - pkg/radiant-reader_group-extension-0.9.0.gem
114
112
  - public/images/admin/chk_auto.png
115
113
  - public/images/admin/chk_off.png
116
114
  - public/images/admin/chk_on.png
@@ -121,10 +119,9 @@ files:
121
119
  - public/images/admin/populate.png
122
120
  - public/images/admin/rdo_off.png
123
121
  - public/images/admin/rdo_on.png
124
- - public/stylesheets/sass/admin/group.sass
122
+ - public/stylesheets/sass/admin/reader_group.sass
125
123
  - radiant-reader_group-extension.gemspec
126
124
  - reader_group_extension.rb
127
- - spec/controllers/readers_controller_spec.rb
128
125
  - spec/controllers/site_controller_spec.rb
129
126
  - spec/datasets/group_messages_dataset.rb
130
127
  - spec/datasets/group_readers_dataset.rb
@@ -171,7 +168,6 @@ signing_key:
171
168
  specification_version: 3
172
169
  summary: Group-based access control for the radiant CMS
173
170
  test_files:
174
- - spec/controllers/readers_controller_spec.rb
175
171
  - spec/controllers/site_controller_spec.rb
176
172
  - spec/datasets/group_messages_dataset.rb
177
173
  - spec/datasets/group_readers_dataset.rb
@@ -1,25 +0,0 @@
1
- %tr.node.level-1
2
- - render_region :tbody do |tbody|
3
- - tbody.name_cell do
4
- %td.name
5
- %p
6
- = link_to group.name, admin_group_url(group)
7
- %br
8
- = truncate_words(group.description, 40)
9
- - tbody.home_cell do
10
- %td.home
11
- - if group.homepage
12
- = link_to group.homepage.title, edit_admin_page_url(group.homepage)
13
- - else
14
- none
15
- - tbody.members_cell do
16
- %td.members
17
- = link_to group.readers.count, admin_group_url(group)
18
- - tbody.pages_cell do
19
- %td.pages
20
- = link_to group.pages.count, admin_group_url(group)
21
- - tbody.modify_cell do
22
- %td.actions
23
- = link_to_unless_current image('plus') + ' send invitations', new_admin_group_group_invitation_url(group), :class => 'action'
24
- = link_to_unless_current image('minus') + ' remove group', admin_group_url(group, :method => 'delete', :confirm => "are you sure you want to completely remove the #{group.name} group?"), :class => 'action'
25
-
@@ -1,11 +0,0 @@
1
- - Group.all.each do |group|
2
- - [:invitation, :welcome].each do |func|
3
- - message = Message.functional(:invitation, group)
4
- %p.ruled
5
- %label
6
- = group.name
7
- = func
8
- - if message
9
- = link_to message.subject, edit_admin_message_url(message)
10
- - else
11
- = link_to image('plus') + " create message", new_admin_group_message_url(group, :function => func), :class => 'create'
@@ -1,11 +0,0 @@
1
- .message
2
- %iframe.message_body{:src => preview_group_message_url(@group, @message)}
3
-
4
- - content_for :pagetitle do
5
- = @message.subject
6
-
7
- - content_for :marginalia do
8
- margin?
9
-
10
- - content_for :breadhead do
11
- = link_to @group.name, @group.homepage.url
@@ -1,10 +0,0 @@
1
- - if homepage = current_reader.find_homepage
2
- %p
3
- Would you like to go straight to the
4
- = link_to homepage.title, homepage.url
5
- page?
6
-
7
- - elsif session[:return_to]
8
- %p
9
- Would you like to
10
- = link_to ("return to the page you were looking at before you started registering", session[:return_to]) + '?'
@@ -1,66 +0,0 @@
1
- @import compass
2
-
3
- body.reversed
4
- #content
5
- form
6
- p.homepage
7
- margin: 0
8
- label
9
- display: inline
10
-
11
- #group_pages, #group_people
12
- position: relative
13
- float: left
14
- overflow: hidden
15
- ul
16
- li.fake_checkbox
17
- margin: 10px 0
18
- padding-left: 30px
19
- background:
20
- image: none
21
- repeat: no-repeat
22
- position: 4px center
23
- a
24
- text-decoration: none
25
- &.checked
26
- background-image: url(/images/admin/chk_on.png)
27
- a
28
- color: #5da454
29
- font-weight: bold
30
- &.unchecked
31
- background-image: url(/images/admin/chk_off.png)
32
- a
33
- color: #999
34
- font-weight: normal
35
- &.waiting
36
- background-image: url(/images/admin/spinner.gif)
37
- a
38
- color: #8c8d8e
39
- &.failed
40
- background-image: url(/images/admin/error.png)
41
- a
42
- color: #c00
43
- &.inherited
44
- background-image: url(/images/admin/chk_auto.png)
45
- color: #80aa79
46
- input
47
- position: absolute
48
- left: -999px
49
-
50
- #group_pages
51
- width: 30%
52
- float: left
53
- margin-right: 2%
54
- ul
55
- ul
56
- padding-left: 20px
57
-
58
- #group_people
59
- float: right
60
- width: 62%
61
- ul
62
- float: left
63
- width: 49%
64
-
65
- #footnotes
66
- clear: both
@@ -1,44 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe ReadersController do
4
- dataset :groups
5
- dataset :pages
6
-
7
- before do
8
- controller.stub!(:request).and_return(request)
9
- Page.current_site = sites(:test) if defined? Site
10
- request.env["HTTP_REFERER"] = 'http://test.host/referer!'
11
- end
12
-
13
- # all we're really testing here is the chaining of Reader.homepage
14
- # but from a reader pov it's the login behaviour that matters
15
-
16
- describe "a logged-in reader requesting a login form" do
17
- before do
18
- end
19
-
20
- describe "who has a homed group" do
21
- before do
22
- login_as_reader(:normal)
23
- get :login
24
- end
25
-
26
- it "should be redirected to the group's home page" do
27
- response.should be_redirect
28
- response.should redirect_to(groups(:homed).homepage.url)
29
- end
30
- end
31
-
32
- describe "who doesn't have a homed group" do
33
- before do
34
- login_as_reader(:another)
35
- get :login
36
- end
37
- it "should be redirected to that reader's page" do
38
- response.should be_redirect
39
- response.should redirect_to(reader_url(readers(:another)))
40
- end
41
- end
42
- end
43
-
44
- end