radiant-reader-extension 3.0.36 → 3.0.37

Sign up to get free protection for your applications and to get access to all the features.
@@ -151,7 +151,7 @@ protected
151
151
  private
152
152
 
153
153
  def get_readers_and_groups
154
- @readers = Reader.visible_to(current_reader)
154
+ @readers = Reader.enabled.visible_to(current_reader)
155
155
  @groups = current_reader.groups
156
156
  @reader = Reader.find(params[:id]) if params[:id]
157
157
  end
data/app/models/reader.rb CHANGED
@@ -47,6 +47,8 @@ class Reader < ActiveRecord::Base
47
47
  named_scope :active, :conditions => "activated_at IS NOT NULL"
48
48
  named_scope :inactive, :conditions => "activated_at IS NULL"
49
49
  named_scope :imported, :conditions => "old_id IS NOT NULL"
50
+ named_scope :disabled, :conditions => "disabled = 1"
51
+ named_scope :enabled, :conditions => "disabled = 0"
50
52
 
51
53
  named_scope :except, lambda { |readers|
52
54
  readers = [readers].flatten.compact
@@ -33,7 +33,7 @@
33
33
  = f.date_select :dob
34
34
  %br
35
35
  = f.check_box :dob_secret
36
- = f.label :dob_secret
36
+ = f.label :dob_secret, nil, :class => 'checkbox'
37
37
 
38
38
  - form.edit_phone do
39
39
  %p
@@ -66,6 +66,9 @@
66
66
  ~ f.text_area "description", :size => "53x8", :class => "textarea"
67
67
 
68
68
  - form.edit_notes do
69
+ %p
70
+ = f.check_box :disabled
71
+ = f.label :disabled, nil, :class => 'checkbox'
69
72
  %p
70
73
  = f.label :notes, t('reader_extension.notes'), :class => "optional"
71
74
  ~ f.text_area "notes", :size => "53x4", :class => "textarea"
@@ -26,7 +26,7 @@
26
26
 
27
27
  %tbody
28
28
  - @readers.each do |reader|
29
- %tr
29
+ %tr{:class => reader.disabled? ? 'disabled' : 'active'}
30
30
  - render_region :tbody do |tbody|
31
31
  - tbody.title_cell do
32
32
  %td{:class => reader.activated? ? 'name activated' : 'name inactive'}
@@ -13,6 +13,7 @@ en:
13
13
  dob: "Date of birth"
14
14
  dob_secret: "Keep secret"
15
15
  description: "A but of text about yourself"
16
+ disabled: "Disable account (hides without deleting)"
16
17
  email: "Email address"
17
18
  forename: "Forename"
18
19
  honorific: "Title or rank"
@@ -0,0 +1,9 @@
1
+ class Deactivation < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :readers, :disabled, :boolean, :default => false
4
+ end
5
+
6
+ def self.down
7
+ remove_column :readers, :disabled
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  module RadiantReaderExtension
2
- VERSION = '3.0.36'
2
+ VERSION = '3.0.37'
3
3
  SUMMARY = %q{Reader/viewer/visitor registration, login and access-control for Radiant CMS}
4
4
  DESCRIPTION = %q{Provides reader/member/user registration and management functions including password-reminder, group-based page access control and administrative email.}
5
5
  URL = "http://radiant.spanner.org/reader"
@@ -13,6 +13,13 @@
13
13
  font-weight: normal
14
14
  a
15
15
  color: #06c
16
+
17
+ #readers_table
18
+ tbody
19
+ tr.disabled
20
+ color: #aaa
21
+ a
22
+ color: #999
16
23
 
17
24
  /* show and send page
18
25
 
@@ -89,3 +96,4 @@ ul.help
89
96
  code
90
97
  color: #c00
91
98
  font-size: 115%
99
+
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: 79
4
+ hash: 77
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 36
10
- version: 3.0.36
9
+ - 37
10
+ version: 3.0.37
11
11
  platform: ruby
12
12
  authors:
13
13
  - William Ross
@@ -305,6 +305,7 @@ files:
305
305
  - db/migrate/20111013134949_sort_out_names.rb
306
306
  - db/migrate/20111013203306_remove_login.rb
307
307
  - db/migrate/20111122115514_date_of_birth.rb
308
+ - db/migrate/20111122173717_deactivation.rb
308
309
  - lib/controller_extensions.rb
309
310
  - lib/group_tags.rb
310
311
  - lib/grouped_model.rb
@@ -337,6 +338,7 @@ files:
337
338
  - public/stylesheets/sass/admin/reader.sass
338
339
  - public/stylesheets/sass/admin/reader_group.sass
339
340
  - public/stylesheets/sass/reader.sass
341
+ - radiant-reader-extension-3.0.37.gem
340
342
  - radiant-reader-extension.gemspec
341
343
  - Rakefile
342
344
  - reader_extension.rb
@@ -365,7 +367,7 @@ files:
365
367
  homepage: http://radiant.spanner.org/reader
366
368
  licenses: []
367
369
 
368
- post_install_message: "\n Add this to your radiant project with a line in your Gemfile:\n\n gem 'radiant-reader-extension', '~> 3.0.36'\n\n and if you haven't already, remember to enable ActionMailer in your\n project's config/environment.rb.\n "
370
+ post_install_message: "\n Add this to your radiant project with a line in your Gemfile:\n\n gem 'radiant-reader-extension', '~> 3.0.37'\n\n and if you haven't already, remember to enable ActionMailer in your\n project's config/environment.rb.\n "
369
371
  rdoc_options: []
370
372
 
371
373
  require_paths: