radiant-reader-extension 1.3.7 → 1.3.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.7
1
+ 1.3.8
@@ -30,13 +30,13 @@ class Admin::MessagesController < Admin::ResourceController
30
30
  failures = @message.deliver(@readers) || []
31
31
  if failures.any?
32
32
  if failures.length == @readers.length
33
- flash[:error] = "all_deliveries_failed"
33
+ flash[:error] = t("all_deliveries_failed")
34
34
  else
35
35
  addresses = failures.map(&:email).to_sentence
36
- flash[:notice] = "some_deliveries_failed"
36
+ flash[:notice] = t("some_deliveries_failed")
37
37
  end
38
38
  else
39
- flash[:notice] = "message_delivered"
39
+ flash[:notice] = t("message_delivered")
40
40
  end
41
41
  redirect_to admin_message_url(@message)
42
42
  end
data/app/models/reader.rb CHANGED
@@ -50,6 +50,10 @@ class Reader < ActiveRecord::Base
50
50
  end
51
51
  }
52
52
 
53
+ def self.find_by_login_or_email(login_or_email)
54
+ reader = find(:first, :conditions => ["login = ? OR email = ?", login_or_email, login_or_email])
55
+ end
56
+
53
57
  def forename
54
58
  read_attribute(:forename) || name.split(/\s/).first
55
59
  end
@@ -1,3 +1,3 @@
1
1
  class ReaderSession < Authlogic::Session::Base
2
-
2
+ find_by_login_method :find_by_login_or_email
3
3
  end
@@ -50,16 +50,16 @@
50
50
  %label.checkbox{:for => 'delivery_to_all', :class => @message.possible_readers.empty? ? 'disabled' : ''}
51
51
  = t('everyone')
52
52
  = t('count_people', :count => @message.possible_readers.count)
53
- %p
54
- = radio_button_tag 'delivery', 'inactive', false, :id => 'delivery_to_inactive', :disabled => @message.inactive_readers.empty?
55
- %label.checkbox{:for => 'delivery_to_inactive', :class => @message.inactive_readers.empty? ? 'disabled' : ''}
56
- = t('everyone_inactive')
57
- = t('count_people', :count => @message.inactive_readers.count)
58
53
  %p
59
54
  = radio_button_tag 'delivery', 'unsent', false, :id => 'delivery_to_unsent', :disabled => @message.undelivered_readers.empty?
60
55
  %label.checkbox{:for => 'delivery_to_unsent', :class => @message.undelivered_readers.empty? ? 'disabled' : ''}
61
56
  = t('everyone_unsent')
62
57
  = t('count_people', :count => @message.undelivered_readers.count)
58
+ %p
59
+ = radio_button_tag 'delivery', 'inactive', false, :id => 'delivery_to_inactive', :disabled => @message.inactive_readers.empty?
60
+ %label.checkbox{:for => 'delivery_to_inactive', :class => @message.inactive_readers.empty? ? 'disabled' : ''}
61
+ = t('everyone_inactive')
62
+ = t('count_people', :count => @message.inactive_readers.count)
63
63
 
64
64
  %p.buttons
65
65
  = submit_tag t('send_message')
@@ -27,7 +27,7 @@
27
27
 
28
28
  %p{ :class => @reader_session.errors.on(:login) ? 'haserror' : '' }
29
29
  %label{:for => "reader_session_login"}
30
- = t('username').titlecase
30
+ = t('login_or_email')
31
31
  %br
32
32
  = f.text_field :login, :class => 'login'
33
33
 
@@ -45,12 +45,13 @@ en:
45
45
  enter_code: "Please enter confirmation code"
46
46
  enter_email_for_reminder: "enter your email address and we will send the message again"
47
47
  enter_own_password: "First, just to make sure you're you, please enter your current password:"
48
+ everyone_in_group: "Everyone in the group"
48
49
  forgotten_password: "Forgotten your password?"
49
50
  form_notes:
50
51
  description: "you can fill this in later. Textile formatting is allowed."
51
52
  email: "we will send activation instructions to this address"
52
53
  existing_password: "leave blank to keep present password. If changing, at least four characters."
53
- login: "leave blank to use your email address"
54
+ login: "you can always use your email address instead"
54
55
  name: "this is how you will be credited on the site"
55
56
  new_password: "at least four characters, please"
56
57
  honorific: "this is prepended to your name when you are credited"
@@ -78,6 +79,7 @@ en:
78
79
  log_in_or_register: "To use this part of the site you need to be logged in. It's easy to get an account: if you have received an invitation, please follow the instructions in that message. Otherwise, please <a href='/register'>register here</a>. It only takes a moment."
79
80
  log_out: "log out"
80
81
  login_name: "Login name"
82
+ login_or_email: "Login name or email address"
81
83
  login_unknown: "Sorry: we don't recognise that combination of username and password."
82
84
  logout_message: "You are logged out. Bye!"
83
85
  must_be_empty: "must be empty"
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-reader-extension}
8
- s.version = "1.3.7"
8
+ s.version = "1.3.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["spanner"]
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.3.7"
4
+ version "1.3.8"
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: 21
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 7
10
- version: 1.3.7
9
+ - 8
10
+ version: 1.3.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - spanner