radiant-reader-extension 1.0.1 → 1.1.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.1.0
@@ -49,7 +49,11 @@ protected
49
49
  unless set_reader # set_reader is in ControllerExtension and sets Reader.current while checking for current_reader
50
50
  store_location
51
51
  respond_to do |format|
52
- format.html { redirect_to reader_login_url }
52
+ format.html {
53
+ flash[:explanation] = t('reader_required')
54
+ flash[:notice] = t('please_log_in')
55
+ redirect_to reader_login_url
56
+ }
53
57
  format.js {
54
58
  @inline = true
55
59
  render :partial => 'reader_sessions/login_form'
@@ -58,11 +62,14 @@ protected
58
62
  false
59
63
  end
60
64
  end
61
-
65
+
62
66
  def require_activated_reader
63
67
  unless current_reader && current_reader.activated?
64
68
  respond_to do |format|
65
- format.html { redirect_to reader_activation_url }
69
+ format.html {
70
+ flash[:explanation] = t('activation_required')
71
+ redirect_to reader_activation_url
72
+ }
66
73
  format.js {
67
74
  @inline = true
68
75
  render :partial => 'reader_activations/activation_required'
@@ -75,10 +82,10 @@ protected
75
82
  def require_no_reader
76
83
  if set_reader
77
84
  store_location
78
- flash[:notice] = 'please_log_out'
85
+ flash[:notice] = t('please_log_out')
79
86
  redirect_back_or_to url_for(current_reader)
80
87
  return false
81
88
  end
82
89
  end
83
-
90
+
84
91
  end
@@ -27,7 +27,7 @@ class ReaderSessionsController < ReaderActionController
27
27
  else
28
28
  respond_to do |format|
29
29
  format.html {
30
- flash[:error] = 'login_unknown'
30
+ flash[:error] = t('login_unknown')
31
31
  render :action => :new
32
32
  }
33
33
  format.js { render :action => :new, :layout => false }
@@ -43,7 +43,7 @@ class ReaderSessionsController < ReaderActionController
43
43
  session['user_id'] = nil
44
44
  current_user = nil
45
45
  end
46
- flash[:notice] = 'logout_message'
46
+ flash[:notice] = t('logout_message')
47
47
  redirect_back_or_to reader_login_url
48
48
  end
49
49
 
@@ -33,7 +33,7 @@ class ReadersController < ReaderActionController
33
33
 
34
34
  def new
35
35
  if current_reader
36
- flash[:error] = "You're already logged in!"
36
+ flash[:error] = t('already_logged_in')
37
37
  redirect_to url_for(current_reader) and return
38
38
  end
39
39
  @reader = Reader.new
@@ -49,7 +49,7 @@ class ReadersController < ReaderActionController
49
49
  @reader.clear_password = params[:reader][:password]
50
50
 
51
51
  unless @reader.email.blank?
52
- flash[:error] = 'please_avoid_spam_trap'
52
+ flash[:error] = t('please_avoid_spam_trap')
53
53
  @reader.email = ''
54
54
  @reader.errors.add(:trap, "must_be_empty")
55
55
  render :action => 'new' and return
@@ -20,7 +20,7 @@
20
20
  - render_region :tbody do |tbody|
21
21
  - tbody.title_cell do
22
22
  %td{:class => reader.activated? ? 'name activated' : 'name inactive'}
23
- = link_to image_tag(gravatar_url(reader.email, :size=>"32px"), :class=>"avatar avatar_32x32", :width=>32, :height=>32, :alt=>""), edit_admin_reader_url(reader)
23
+ = link_to gravatar_for(reader, {:size => 32}, {:class => 'avatar avatar_32x32'}), edit_admin_reader_url(reader)
24
24
  = link_to reader.name, edit_admin_reader_url(reader), :class => reader.trusted? ? '' : 'untrusted'
25
25
  %span.info
26
26
  = "(#{reader.login})"
@@ -1,4 +1,5 @@
1
- = render :partial => 'readers/flasher'
1
+ - content_for :signals do
2
+ = render :partial => 'readers/flasher'
2
3
 
3
4
  - if current_reader
4
5
  %p
@@ -27,7 +28,7 @@
27
28
  - else
28
29
  - if flash[:explanation]
29
30
  %p
30
- = t(flash[:explanation])
31
+ = flash[:explanation]
31
32
 
32
33
  = render :partial => 'login_form', :locals => {:no_title => true}
33
34
 
@@ -37,4 +38,4 @@
37
38
  = t('log_in').titlecase
38
39
 
39
40
  - content_for :title do
40
- = t('log_in')
41
+ = t('please_log_in').titlecase
@@ -1,6 +1,6 @@
1
1
  - if flash[:notice]
2
2
  .notice
3
- %p= t(flash[:notice])
3
+ %p= flash[:notice]
4
4
  - if flash[:error]
5
5
  .error
6
- %p= t(flash[:error])
6
+ %p= flash[:error]
@@ -7,6 +7,7 @@ en:
7
7
  activation_message_sent: "Account activation instructions have been emailed to you."
8
8
  activation_sent: "Activation message sent"
9
9
  already_active: "Your account is already active."
10
+ already_logged_in: "You're already logged in!"
10
11
  already_registered: "If you've already registered, you should only need to"
11
12
  and_try_again: "and try again."
12
13
  bold_required: "Fields with bold headings are required and will cause grumbling if left blank:"
@@ -26,7 +27,7 @@ en:
26
27
  name: "Message sender"
27
28
  address: "Message reply-to"
28
29
  prefix: "Subject prefix"
29
- layout: "Layout for messages"
30
+ layout: "Email layout"
30
31
  confirm_new_password: "Confirm new password"
31
32
  confirm_password: "Confirm password"
32
33
  confirmation_code: "Confirmation code"
@@ -51,11 +52,9 @@ en:
51
52
  invitation_message: "Invitation message"
52
53
  if_cant_find: "If you can't find the message, we can"
53
54
  if_mistake_see_admin: "If this is a mistake, please talk to the site administrator about your account."
54
- if_not_you: "If that's not you, or you want to log in with another account"
55
55
  is_free_and_quick: " is free and only takes a moment"
56
56
  log_in: 'log in'
57
57
  log_out: "log out"
58
- logged_in_as: 'You are currently logged in as'
59
58
  login_name: "Login name"
60
59
  login_notes: "leave blank to use your email address"
61
60
  login_unknown: "Sorry: we don't recognise that combination of username and password."
@@ -144,4 +143,5 @@ en:
144
143
  really_delete_reader: "Are you sure you want to remove the reader %{name}? This cannot be undone."
145
144
  never_sent: 'never sent'
146
145
  for: 'for'
147
- home: 'home'
146
+ home: 'home'
147
+ reader_required: "Sorry: this part of the site requires an account."
data/lib/reader_helper.rb CHANGED
@@ -3,6 +3,12 @@ module ReaderHelper
3
3
  def self.included(base)
4
4
 
5
5
  base.module_eval do
6
+ def gravatar_for(reader, gravatar_options={}, img_options ={})
7
+ size = gravatar_options[:size]
8
+ img_options[:size] = "#{size}x#{size}" if size
9
+ image_tag reader.gravatar_url(gravatar_options), img_options
10
+ end
11
+
6
12
  def clean_textilize(text)
7
13
  Sanitize.clean(textilize(text), Sanitize::Config::RELAXED)
8
14
  end
@@ -0,0 +1,41 @@
1
+ @import compass/css3
2
+
3
+ $red: #b20315
4
+ $darkred: #a80016
5
+ $palered: #db4d5c
6
+ $yellow: #e09a0c
7
+ $darkyellow: #bc7815
8
+ $blue: #004250
9
+
10
+ $coolgrey0: #f1f0ee
11
+ $coolgrey1: #e2e1dd
12
+ $coolgrey2: #d6d6d4
13
+ $coolgrey3: #cacac8
14
+ $coolgrey4: #bdbdbd
15
+ $coolgrey5: #b3b3b3
16
+ $coolgrey6: #afafaf
17
+ $coolgrey7: #9a9b9d
18
+ $coolgrey8: #8c8d8e
19
+ $coolgrey9: #747679
20
+ $coolgrey10: #616265
21
+ $coolgrey11: #4d4e53
22
+
23
+ $dark: $coolgrey11
24
+ $mid: $coolgrey8
25
+ $pale: $coolgrey6
26
+ $paler: $coolgrey4
27
+ $verypale: $coolgrey2
28
+
29
+ $page: white
30
+ $text: $coolgrey11
31
+ $hover: $red
32
+ $tag: $coolgrey8
33
+ $input: $coolgrey11
34
+
35
+ =inputfonts
36
+ font-family: Georgia, serif
37
+ font-size: 1.2em
38
+ line-height: 1.4
39
+
40
+ =functionalfonts
41
+ font-family: helvetica, arial, sans-serif
@@ -0,0 +1,136 @@
1
+ @import reader_constants.sass
2
+
3
+ /*** friendly forms *******
4
+
5
+ form.friendly
6
+ margin: 0 0 60px 0
7
+ p
8
+ margin: 1em 0 0 0
9
+ input.titular
10
+ clear: both
11
+ width: 95%
12
+ font-family: Georgia,Palatino,Sylfaen,"Times New Roman", Times, serif
13
+ font-size: 1.2em
14
+ line-height: 1
15
+ color: #4d4e53
16
+ border-width: 1px
17
+ border-style: solid
18
+ border-color: #cacac8
19
+ padding: 5px
20
+ font-size: 200%
21
+ textarea, select
22
+ width: 95%
23
+ font-family: Georgia,Palatino,Sylfaen,"Times New Roman", Times, serif
24
+ font-size: 1.2em
25
+ line-height: 1
26
+ color: #4d4e53
27
+ border-width: 1px
28
+ border-style: solid
29
+ border-color: #cacac8
30
+ padding: 5px
31
+ input
32
+ &.standard
33
+ width: 95%
34
+ font-family: Georgia,Palatino,Sylfaen,"Times New Roman", Times, serif
35
+ font-size: 1.2em
36
+ line-height: 1
37
+ color: #4d4e53
38
+ border-width: 1px
39
+ border-style: solid
40
+ border-color: #cacac8
41
+ padding: 5px
42
+ &.login
43
+ width: 50%
44
+ font-family: Georgia,Palatino,Sylfaen,"Times New Roman", Times, serif
45
+ font-size: 1.2em
46
+ line-height: 1
47
+ color: #4d4e53
48
+ border-width: 1px
49
+ border-style: solid
50
+ border-color: #cacac8
51
+ padding: 5px
52
+ textarea
53
+ color: #559dc4
54
+ line-height: 1.4
55
+ span.formnote
56
+ font-family: helvetica, arial, sans-serif
57
+ font-size: 0.8em
58
+ line-height: 1.4
59
+ color: #cacac8
60
+ div.error-with-field
61
+ display: inline
62
+ small.error
63
+ display: none
64
+ p.context
65
+ margin: 0
66
+ div.innocuous
67
+ display: none
68
+ label.required
69
+ font-weight: bold
70
+
71
+ /***** input validation and error reporting *******
72
+
73
+ p
74
+ &.errornote
75
+ color: #d1005d
76
+ &.haserror
77
+ border-left-width: 4px
78
+ border-left-style: solid
79
+ border-left-color: #d1005d
80
+ padding-left: 12px
81
+ color: #d1005d
82
+ input, textarea
83
+ border-width: 1px
84
+ border-style: solid
85
+ border-color: #d1005d
86
+ label
87
+ color: #d1005d
88
+
89
+ ul.friendly
90
+ list-style: square
91
+ font-family: helvetica, arial, sans-serif
92
+ font-size: 0.8em
93
+ line-height: 1.4
94
+ color: #4d4e53
95
+ padding-left: 0
96
+ margin-top: 0
97
+
98
+ h2.inviting, a.inviting
99
+ display: block
100
+ font-family: 'HelveticaNeue-Light', helvetica, arial, sans-serif
101
+ font-weight: bold
102
+ font-size: 1.6em
103
+ margin-bottom: 0
104
+ margin-top: 50px
105
+
106
+ /***** gravatars and other useful things *******
107
+
108
+ img.gravatar
109
+ float: left
110
+ margin: 0 10px 3px 0
111
+ +box-shadow
112
+ border: 3px solid white
113
+ &.thumbnail
114
+ margin: 2px 10px 10px 0
115
+ &.big
116
+ margin: 8px 10px 4px 0
117
+
118
+ /*** system messages and controls *******
119
+
120
+ .notice, .error
121
+ position: absolute
122
+ width: 250px
123
+ right: 10px
124
+ +border-radius
125
+ +box-shadow
126
+ color: white
127
+ margin: 0
128
+ padding: 0.75em
129
+
130
+ .notice
131
+ background-color: #00cc33
132
+ border: 3px solid #7fe699
133
+
134
+ .error
135
+ background-color: #cc0000
136
+ border: 3px solid #ff0071
@@ -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.0.1"
8
+ s.version = "1.1.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-20}
12
+ s.date = %q{2010-11-01}
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,7 +108,9 @@ 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/stylesheets/sass/_reader_constants.sass",
111
112
  "public/stylesheets/sass/admin/reader.sass",
113
+ "public/stylesheets/sass/reader.sass",
112
114
  "radiant-reader-extension.gemspec",
113
115
  "reader_extension.rb",
114
116
  "spec/controllers/admin/messages_controller_spec.rb",
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.0.1"
4
+ version "1.1.0"
5
5
  description "Provides reader/member/user registration and management functions"
6
6
  url "http://spanner.org/radiant/reader"
7
7
 
@@ -28,7 +28,7 @@ class ReaderExtension < Radiant::Extension
28
28
  admin.sites.edit.add :form, "admin/sites/choose_reader_layout", :after => "edit_homepage"
29
29
  end
30
30
  end
31
-
31
+
32
32
  if respond_to?(:tab)
33
33
  tab("Readers") do
34
34
  add_item("Readers", "/admin/readers")
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: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 0
9
8
  - 1
10
- version: 1.0.1
9
+ - 0
10
+ version: 1.1.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-20 00:00:00 +01:00
18
+ date: 2010-11-01 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -191,7 +191,9 @@ 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/stylesheets/sass/_reader_constants.sass
194
195
  - public/stylesheets/sass/admin/reader.sass
196
+ - public/stylesheets/sass/reader.sass
195
197
  - radiant-reader-extension.gemspec
196
198
  - reader_extension.rb
197
199
  - spec/controllers/admin/messages_controller_spec.rb