radiant-reader-extension 1.3.1 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -1
- data/VERSION +1 -1
- data/app/controllers/reader_sessions_controller.rb +12 -1
- data/app/controllers/readers_controller.rb +1 -0
- data/app/helpers/reader_helper.rb +4 -3
- data/app/models/reader_notifier.rb +3 -3
- data/app/views/reader_sessions/_login_form.html.haml +2 -2
- data/app/views/reader_sessions/new.html.haml +6 -28
- data/app/views/readers/_standard_parts.html.haml +1 -14
- data/config/locales/en.yml +5 -3
- data/public/images/furniture/no_gravatar.png +0 -0
- data/public/stylesheets/sass/reader.sass +25 -2
- data/radiant-reader-extension.gemspec +3 -2
- data/reader_extension.rb +3 -1
- metadata +5 -4
data/README.md
CHANGED
@@ -10,7 +10,10 @@ The purpose of this extension is to provide a common core that supports other vi
|
|
10
10
|
|
11
11
|
## Latest
|
12
12
|
|
13
|
-
|
13
|
+
This version requires edge radiant, or radiant 0.9.2 when it becomes available. We are using a lot of the new configuration and sheets code.
|
14
|
+
|
15
|
+
Right now we are **not compatible with multi_site or the sites extension**: that's mostly because neither is radiant edge: it will all be sorted out in time for the release of 0.9.2, which isn't far away.
|
16
|
+
|
14
17
|
* public interface internationalized;
|
15
18
|
* Uses the new configuration interface;
|
16
19
|
* Messaging much simplified and now intended to be purely administrative.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.3
|
@@ -5,7 +5,18 @@ class ReaderSessionsController < ReaderActionController
|
|
5
5
|
radiant_layout { |controller| Radiant::Config['reader.layout'] }
|
6
6
|
|
7
7
|
def new
|
8
|
-
|
8
|
+
if current_reader
|
9
|
+
if current_reader.activated?
|
10
|
+
cookies[:error] = t('already_logged_in')
|
11
|
+
redirect_to reader_url(current_reader)
|
12
|
+
else
|
13
|
+
cookies[:error] = t('account_requires_activation')
|
14
|
+
redirect_to reader_activation_url
|
15
|
+
end
|
16
|
+
else
|
17
|
+
@reader_session = ReaderSession.new
|
18
|
+
expires_now
|
19
|
+
end
|
9
20
|
end
|
10
21
|
|
11
22
|
def create
|
@@ -4,13 +4,14 @@ module ReaderHelper
|
|
4
4
|
def standard_gravatar_for(reader=nil, url=nil)
|
5
5
|
size = Radiant::Config['forum.gravatar_size'] || 40
|
6
6
|
url ||= reader_url(reader)
|
7
|
-
gravatar = gravatar_for(reader, {:size => size
|
7
|
+
gravatar = gravatar_for(reader, {:size => size}, {:class => 'gravatar offset', :width => size, :height => size})
|
8
8
|
link_to gravatar, url
|
9
9
|
end
|
10
10
|
|
11
11
|
def gravatar_for(reader=nil, gravatar_options={}, img_options ={})
|
12
|
-
size = gravatar_options[:size]
|
13
|
-
img_options[:size] ||= "#{size}x#{size}"
|
12
|
+
size = gravatar_options[:size] || 40
|
13
|
+
img_options[:size] ||= "#{size}x#{size}"
|
14
|
+
gravatar_options[:default] ||= "#{request.protocol}#{request.host_with_port}/images/furniture/no_gravatar.png"
|
14
15
|
img_options[:alt] ||= reader.name if reader
|
15
16
|
if reader.nil? || reader.email.blank?
|
16
17
|
image_tag gravatar_options[:default], img_options
|
@@ -5,7 +5,7 @@ class ReaderNotifier < ActionMailer::Base
|
|
5
5
|
def message(reader, message, sender=nil)
|
6
6
|
site = reader.site if reader.respond_to?(:site)
|
7
7
|
prefix = site ? site.abbreviation : Radiant::Config['email.prefix']
|
8
|
-
host = site ? site.base_domain : Radiant::Config['site.
|
8
|
+
host = site ? site.base_domain : Radiant::Config['site.host'] || 'www.example.com'
|
9
9
|
default_url_options[:host] = host
|
10
10
|
sender = Radiant::Config['email.name'] || "sender_not_configured"
|
11
11
|
sender_address = Radiant::Config['email.address'] || "admin@#{host}"
|
@@ -27,8 +27,8 @@ class ReaderNotifier < ActionMailer::Base
|
|
27
27
|
:reply_to => sender_address,
|
28
28
|
:reader => reader,
|
29
29
|
:site => site || {
|
30
|
-
:name => Radiant::Config['site.
|
31
|
-
:url => Radiant::Config['site.
|
30
|
+
:name => Radiant::Config['site.name'],
|
31
|
+
:url => Radiant::Config['site.host']
|
32
32
|
}
|
33
33
|
})
|
34
34
|
end
|
@@ -43,11 +43,11 @@
|
|
43
43
|
%label.paranthetical{:for => "reader_session_remember_me"}
|
44
44
|
= t('remember_me')
|
45
45
|
|
46
|
-
%ul
|
46
|
+
%ul
|
47
47
|
- if Radiant::Config['reader.allow_registration?']
|
48
48
|
%li
|
49
49
|
= link_to "registration".titlecase, new_reader_url
|
50
50
|
= t('is_free_and_quick')
|
51
51
|
%li
|
52
|
-
= link_to t("forgotten_password")
|
52
|
+
= link_to t("forgotten_password"), new_password_reset_url
|
53
53
|
|
@@ -1,36 +1,14 @@
|
|
1
1
|
= render :partial => 'readers/standard_parts'
|
2
2
|
|
3
3
|
- content_for :login do
|
4
|
-
- if
|
4
|
+
- if @message
|
5
5
|
%p
|
6
|
-
=
|
7
|
-
%strong
|
8
|
-
= current_reader.name
|
9
|
-
- unless current_reader.activated?
|
10
|
-
= t('but_not_active')
|
11
|
-
|
12
|
-
- if current_reader.activated?
|
13
|
-
%p
|
14
|
-
=t('if_not_you')
|
15
|
-
= link_to t("log_out"), reader_logout_url
|
16
|
-
- else
|
17
|
-
%p
|
18
|
-
=t('if_cant_find')
|
19
|
-
= link_to(t("send_it_again"), new_reader_activation_url) + '.'
|
20
|
-
%p
|
21
|
-
=t('if_not_you')
|
22
|
-
=t('or')
|
23
|
-
=t('wrong_email')
|
24
|
-
=t('please')
|
25
|
-
= link_to "log out", reader_logout_url
|
26
|
-
=t('and_try_again')
|
27
|
-
|
6
|
+
= @message
|
28
7
|
- else
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
= render :partial => 'login_form', :locals => {:no_title => true}
|
8
|
+
%p
|
9
|
+
= t('log_in_or_register')
|
10
|
+
|
11
|
+
= render :partial => 'login_form', :locals => {:no_title => true}
|
34
12
|
|
35
13
|
- content_for :breadcrumbs do
|
36
14
|
= link_to t('home').titlecase, '/'
|
@@ -3,23 +3,10 @@
|
|
3
3
|
|
4
4
|
- content_for :section_navigation do
|
5
5
|
= link_to t('navigation.readers'), readers_url, :class => 'section'
|
6
|
-
|
7
|
-
= link_to t('navigation.profile'), reader_profile_url
|
8
|
-
= link_to t('navigation.preferences'), reader_account_url
|
9
|
-
- unless current_reader.activated?
|
10
|
-
= link_to t('navigation.activate'), new_reader_activation_url
|
11
|
-
= link_to t('navigation.logout'), reader_logout_url
|
12
|
-
- else
|
13
|
-
= link_to t('log_in'), reader_login_url
|
6
|
+
= link_to t('navigation.preferences'), reader_account_url
|
14
7
|
- if Radiant::Config['reader.help_url']
|
15
8
|
= link_to t('navigation.reader_help'), Radiant::Config['reader.help_url']
|
16
9
|
|
17
|
-
- content_for :controls do
|
18
|
-
= render :partial => 'readers/controls'
|
19
|
-
|
20
|
-
- content_for :signals do
|
21
|
-
= render :partial => 'readers/flasher'
|
22
|
-
|
23
10
|
- content_for :reader_css do
|
24
11
|
- reader_css_paths.each do |path|
|
25
12
|
%link{:rel => 'stylesheet', :href => path, :type => 'text/css'}
|
data/config/locales/en.yml
CHANGED
@@ -42,7 +42,7 @@ en:
|
|
42
42
|
enter_code: "Please enter confirmation code"
|
43
43
|
enter_email_for_reminder: "enter your email address and we will send the message again"
|
44
44
|
enter_own_password: "First, just to make sure you're you, please enter your current password:"
|
45
|
-
forgotten_password: "
|
45
|
+
forgotten_password: "Forgotten your password?"
|
46
46
|
form_notes:
|
47
47
|
description: "you can fill this in later. Textile formatting is allowed."
|
48
48
|
email: "we will send activation instructions to this address"
|
@@ -59,6 +59,7 @@ en:
|
|
59
59
|
invite_description: '<a href="%{url}">Edit your preferences to put some text about yourself here.'
|
60
60
|
if_cant_find: "If you can't find the message, we can"
|
61
61
|
if_mistake_see_admin: "If this is a mistake, please talk to the site administrator about your account."
|
62
|
+
if_not_you: "If that's not you, please"
|
62
63
|
is_free_and_quick: " is free and only takes a moment"
|
63
64
|
joined_on: "Joined on"
|
64
65
|
label:
|
@@ -71,6 +72,7 @@ en:
|
|
71
72
|
repeat_password: "Confirm password"
|
72
73
|
current_password: "Current password"
|
73
74
|
log_in: 'log in'
|
75
|
+
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."
|
74
76
|
log_out: "log out"
|
75
77
|
login_name: "Login name"
|
76
78
|
login_unknown: "Sorry: we don't recognise that combination of username and password."
|
@@ -81,8 +83,8 @@ en:
|
|
81
83
|
readers: "People"
|
82
84
|
preferences: "Preferences"
|
83
85
|
profile: "Your profile"
|
84
|
-
|
85
|
-
|
86
|
+
log_in: "Log in"
|
87
|
+
log_out: "Log out"
|
86
88
|
new_account: "Register"
|
87
89
|
new_password: "New password"
|
88
90
|
new_password_instructions: "Please enter and confirm the new password you would like to use. It must be at least four characters long, nothing obvious or typical and ideally a mixture of numbers and letters."
|
Binary file
|
@@ -17,6 +17,28 @@ $accent = #d1005d / rubine red
|
|
17
17
|
+functional
|
18
18
|
font-size: 80%
|
19
19
|
|
20
|
+
.error, .notice
|
21
|
+
position: absolute
|
22
|
+
width: 300px
|
23
|
+
top: 50px
|
24
|
+
right: 50px
|
25
|
+
+border-radius
|
26
|
+
+box-shadow
|
27
|
+
color: white
|
28
|
+
padding: 1px 1em
|
29
|
+
a.closer
|
30
|
+
display: block
|
31
|
+
position: absolute
|
32
|
+
top: 5px
|
33
|
+
right: 5px
|
34
|
+
color: white
|
35
|
+
font-weight: bold
|
36
|
+
.notice
|
37
|
+
background-color: #b2e5b2
|
38
|
+
color: #060
|
39
|
+
.error
|
40
|
+
background-color: #f3c2c2
|
41
|
+
color: #770000
|
20
42
|
|
21
43
|
div#readers
|
22
44
|
.reader
|
@@ -47,6 +69,9 @@ form.friendly
|
|
47
69
|
margin: 0 0 60px 0
|
48
70
|
p
|
49
71
|
margin: 1em 0 0 0
|
72
|
+
input.login
|
73
|
+
width: 95%
|
74
|
+
font-size: 140%
|
50
75
|
input.titular
|
51
76
|
width: 95%
|
52
77
|
font-size: 200%
|
@@ -56,8 +81,6 @@ form.friendly
|
|
56
81
|
height: 400px
|
57
82
|
input.standard
|
58
83
|
width: 95%
|
59
|
-
input.login
|
60
|
-
width: 50%
|
61
84
|
span.formnote
|
62
85
|
color: $mid
|
63
86
|
label
|
@@ -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.3.
|
8
|
+
s.version = "1.3.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{2011-
|
12
|
+
s.date = %q{2011-02-07}
|
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 = [
|
@@ -108,6 +108,7 @@ Gem::Specification.new do |s|
|
|
108
108
|
"public/images/admin/chk_off.png",
|
109
109
|
"public/images/admin/chk_on.png",
|
110
110
|
"public/images/admin/delta.png",
|
111
|
+
"public/images/furniture/no_gravatar.png",
|
111
112
|
"public/javascripts/reader.js",
|
112
113
|
"public/stylesheets/sass/admin/reader.sass",
|
113
114
|
"public/stylesheets/sass/reader.sass",
|
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.
|
4
|
+
version "1.3.3"
|
5
5
|
description "Provides reader/member/user registration and management functions"
|
6
6
|
url "http://spanner.org/radiant/reader"
|
7
7
|
|
@@ -18,6 +18,8 @@ class ReaderExtension < Radiant::Extension
|
|
18
18
|
UserActionObserver.instance.send :add_observer!, Reader
|
19
19
|
UserActionObserver.instance.send :add_observer!, Message
|
20
20
|
|
21
|
+
|
22
|
+
|
21
23
|
unless defined? admin.reader
|
22
24
|
Radiant::AdminUI.send :include, ReaderAdminUI
|
23
25
|
Radiant::AdminUI.load_reader_extension_regions
|
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:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 1.3.
|
9
|
+
- 3
|
10
|
+
version: 1.3.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: 2011-
|
18
|
+
date: 2011-02-07 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -191,6 +191,7 @@ files:
|
|
191
191
|
- public/images/admin/chk_off.png
|
192
192
|
- public/images/admin/chk_on.png
|
193
193
|
- public/images/admin/delta.png
|
194
|
+
- public/images/furniture/no_gravatar.png
|
194
195
|
- public/javascripts/reader.js
|
195
196
|
- public/stylesheets/sass/admin/reader.sass
|
196
197
|
- public/stylesheets/sass/reader.sass
|