radiant-reader-extension 1.2.2 → 1.2.3

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.2
1
+ 1.2.3
@@ -1,6 +1,6 @@
1
1
  class Message < ActiveRecord::Base
2
2
 
3
- is_site_scoped if defined? ActiveRecord::SiteNotFound
3
+ has_site if respond_to? :has_site
4
4
 
5
5
  belongs_to :layout
6
6
  belongs_to :created_by, :class_name => 'User'
@@ -33,7 +33,7 @@ class Message < ActiveRecord::Base
33
33
  end
34
34
 
35
35
  def undelivered_readers
36
- possible_readers - recipients
36
+ possible_readers.except(recipients)
37
37
  end
38
38
 
39
39
  def inactive_readers
data/app/models/reader.rb CHANGED
@@ -7,7 +7,7 @@ class Reader < ActiveRecord::Base
7
7
  cattr_accessor :current
8
8
  default_scope :order => 'name ASC'
9
9
 
10
- is_site_scoped if respond_to? :is_site_scoped
10
+ has_site if respond_to? :has_site
11
11
 
12
12
  acts_as_authentic do |config|
13
13
  config.validations_scope = :site_id if defined? Site
@@ -39,6 +39,10 @@ class Reader < ActiveRecord::Base
39
39
  named_scope :any
40
40
  named_scope :active, :conditions => "activated_at IS NOT NULL"
41
41
  named_scope :inactive, :conditions => "activated_at IS NULL"
42
+ named_scope :except, lambda { |readers|
43
+ readers = [readers].flatten
44
+ { :conditions => ["NOT readers.id IN (#{readers.map{"?"}.join(',')})", readers.map(&:id)] }
45
+ }
42
46
 
43
47
  def forename
44
48
  read_attribute(:forename) || name.split(/\s/).first
@@ -38,10 +38,7 @@
38
38
  %li
39
39
  = link_to t('edit_message').titlecase, edit_admin_message_url(@message)
40
40
  %li
41
- - if @message.group
42
- = link_to @message.group.name + ' ' + t('group_page'), admin_group_url(@message.group)
43
- - else
44
- = link_to t('reader_configuration_page').titlecase, admin_reader_configuration_url
41
+ = link_to t('reader_configuration_page').titlecase, admin_reader_configuration_url
45
42
 
46
43
  - delivery.options do
47
44
  - unless @message.administrative?
@@ -67,6 +64,6 @@
67
64
  %p.buttons
68
65
  = submit_tag t('send_message')
69
66
  = t('or')
70
- = link_to t('cancel'), @message.group ? admin_group_url(@message.group) : admin_messages_url
67
+ = link_to t('cancel'), admin_messages_url
71
68
 
72
69
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  - if session[:return_to]
8
8
  %p
9
- = link_to (t("return_to_page"), session[:return_to]) + '?'
9
+ = link_to t("return_to_page"), session[:return_to]
10
10
 
11
11
  - content_for :title do
12
12
  = t('hello').titlecase
@@ -20,15 +20,13 @@
20
20
  = text_field_tag @email_field, params[@email_field] || @reader.email, :id => "reader_#{@email_field}", :class => 'standard'
21
21
 
22
22
  .innocuous
23
- - with_error_report(@reader.errors.on(:trap)) do
24
- %label{ :for => 'reader_email', :class => 'required' }
25
- = t("dont_fill")
23
+ %p
24
+ =f.label :email, t("dont_fill"), :class => 'required' }
26
25
  %span.formnote= t('spam_trap')
27
26
  %br
28
- = text_field_tag 'reader_email', '', :name => 'reader[email]', :class => 'standard'
27
+ = f.text_field :email, '', :class => 'standard'
29
28
 
30
29
  - else
31
-
32
30
  %p
33
31
  = f.label :email, t('your_email'), :class => 'required'
34
32
  %span.formnote= t('email_notes')
@@ -58,14 +58,6 @@ module ControllerExtensions # for inclusion into ApplicationController
58
58
  redirect_to address + ".#{format}" # nasty! but necessary for inline login.
59
59
  end
60
60
 
61
- def render_page_or_feed(template_name = action_name)
62
- respond_to do |format|
63
- format.html { render :action => template_name }
64
- format.rss { render :action => template_name, :layout => 'feed' }
65
- format.js { render :action => template_name, :layout => false }
66
- end
67
- end
68
-
69
61
  end
70
62
  end
71
63
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-reader-extension}
8
- s.version = "1.2.2"
8
+ s.version = "1.2.3"
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-12-20}
12
+ s.date = %q{2011-01-13}
13
13
  s.description = %q{Centralises reader/member/user registration and management tasks for the benefit of other extensions}
14
14
  s.email = %q{will@spanner.org}
15
15
  s.extra_rdoc_files = [
data/reader_extension.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require_dependency 'application_controller'
2
2
 
3
3
  class ReaderExtension < Radiant::Extension
4
- version "1.2.2"
4
+ version "1.2.3"
5
5
  description "Provides reader/member/user registration and management functions"
6
6
  url "http://spanner.org/radiant/reader"
7
7
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-reader-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 2
10
- version: 1.2.2
9
+ - 3
10
+ version: 1.2.3
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-12-20 00:00:00 +00:00
18
+ date: 2011-01-13 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency