parlement 0.9 → 0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/CHANGES +20 -1
  2. data/MEMORY +51 -0
  3. data/README +11 -38
  4. data/Rakefile +2 -2
  5. data/app/controllers/account_controller.rb +83 -50
  6. data/app/controllers/application.rb +3 -0
  7. data/app/controllers/elt_controller.rb +14 -3
  8. data/app/controllers/subscriber_controller.rb +25 -9
  9. data/app/helpers/elt_helper.rb +1 -1
  10. data/app/models/elt.rb +23 -13
  11. data/app/models/mail.rb +37 -17
  12. data/app/models/mail_notify.rb +6 -5
  13. data/app/models/person.rb +6 -5
  14. data/app/models/person_mail.rb +4 -0
  15. data/app/models/person_notify.rb +13 -0
  16. data/app/models/subscription.rb +4 -0
  17. data/app/views/account/_login.rhtml +9 -12
  18. data/app/views/account/_show.rhtml +35 -16
  19. data/app/views/elt/_elt.rhtml +8 -20
  20. data/app/views/elt/_listByVote.rhtml +9 -9
  21. data/app/views/elt/show.rhtml +6 -33
  22. data/app/views/layouts/top.rhtml +6 -0
  23. data/app/views/person_notify/setEmail.rhtml +24 -0
  24. data/app/views/subscriber/_list.rhtml +18 -0
  25. data/config/environment.rb +6 -4
  26. data/config/environments/development.rb +2 -0
  27. data/db/ROOT/parlement/{news → News}/Version_01.txt +0 -0
  28. data/db/ROOT/parlement/{news → News}/Version_02.txt +0 -0
  29. data/db/ROOT/parlement/{news → News}/Version_03.txt +0 -0
  30. data/db/ROOT/parlement/{news → News}/Version_04.txt +0 -0
  31. data/db/ROOT/parlement/{news → News}/Version_05.txt +0 -0
  32. data/db/ROOT/parlement/{news → News}/Version_06.txt +0 -0
  33. data/db/ROOT/parlement/{news → News}/Version_07.txt +0 -0
  34. data/db/ROOT/parlement/{news → News}/Version_08.txt +0 -0
  35. data/db/ROOT/parlement/{security → Security}/anonymity.txt +0 -0
  36. data/db/ROOT/parlement.txt +1 -1
  37. data/db/development_structure.sql +49 -34
  38. data/db/migrate/003_elt_children_count.rb +1 -1
  39. data/db/migrate/005_filter_mail.rb +22 -0
  40. data/public/javascripts/mybehaviour.js +10 -2
  41. data/public/stylesheets/default.css +21 -15
  42. data/test/unit/choice_test.rb +1 -1
  43. data/test/unit/elt_test.rb +1 -1
  44. data/test/unit/mail_notify_test.rb +24 -8
  45. data/test/unit/mail_test.rb +61 -6
  46. data/test/unit/{notifier_test.rb → person_notify_test.rb} +2 -2
  47. data/test/unit/person_test.rb +1 -1
  48. data/test/unit/subscriber_test.rb +12 -12
  49. metadata +24 -20
  50. data/app/models/notifier.rb +0 -13
  51. data/app/views/notifier/changeEmail.rhtml +0 -10
  52. data/public/images/comments.gif +0 -0
data/app/models/mail.rb CHANGED
@@ -8,6 +8,8 @@ class Mail < ActiveRecord::Base
8
8
  usesguid
9
9
 
10
10
  belongs_to :elt
11
+ has_many :person_mails, :dependent => :destroy
12
+ has_many :recipients, :through => :person_mails, :source => :person
11
13
 
12
14
  #
13
15
  # Receive this new elt as an email, sent through app/helpers/mailman.rb
@@ -44,6 +46,7 @@ class Mail < ActiveRecord::Base
44
46
  #
45
47
  def receive(mail)
46
48
  logger.info "Receive mail #{mail.message_id}"
49
+ #puts "Receive mail #{mail.message_id}"
47
50
  build_elt :created_on => mail.date,
48
51
  :subject => unquote(mail.subject),
49
52
  :body => '',
@@ -51,7 +54,7 @@ class Mail < ActiveRecord::Base
51
54
 
52
55
  # Try to find its mail parent in the db
53
56
  if mail.in_reply_to and Mail.find_by_message mail.in_reply_to
54
- elt.parent_id = mail.in_reply_to
57
+ elt.parent_id = Mail.find_by_message(mail.in_reply_to).elt.id
55
58
  end
56
59
 
57
60
  # Try to find its mail parent in the db
@@ -85,6 +88,8 @@ class Mail < ActiveRecord::Base
85
88
  end
86
89
 
87
90
  rescue ActiveRecord::RecordNotFound
91
+ logger.info "Creating a parent elt with id #{parentId}"
92
+ #puts "Creating a parent elt with id #{parentId}"
88
93
  elt.build_parent :parent_id => 'mail', :subject => parentId, :body => ''
89
94
  elt.parent.id = parentId
90
95
  elt.parent.publish
@@ -125,10 +130,14 @@ class Mail < ActiveRecord::Base
125
130
  # An elt needs to be published as a mail
126
131
  #
127
132
  def publish
128
- logger.info "Publish mail"
133
+ logger.info "Publish mail for elt #{elt.subject} [#{elt.id}]"
134
+ #puts "Publish mail for elt #{elt.subject} [#{elt.id}]"
129
135
 
130
136
  if message and not message.blank? and file
131
137
  mail = TMail::Mail.parse file
138
+ # Let's reuse an eventual id if it is simply resent (for example after a vote)
139
+ # TODO add a test
140
+ mail.message_id = message
132
141
  else
133
142
  mail = MailNotify.create_publish elt
134
143
  self.mail_parents = mail.references
@@ -140,11 +149,21 @@ class Mail < ActiveRecord::Base
140
149
  mail['List-Archive'] = "http://"+ActionMailer::Base.server_settings[:domain]
141
150
  mail['Errors-To'] = "errors@"+ActionMailer::Base.server_settings[:domain]
142
151
 
143
- mail.bcc = elt.all_recipients \
144
- .select { |i| i.email and not i.email.blank? } \
145
- .collect { |i| i.email } \
146
- .uniq \
147
- .join(', ')
152
+ subscriptions = elt.all_subscriptions \
153
+ .select { |s| s.person.email and not s.person.email.blank? } \
154
+ .select { |s| #puts "Person: #{s.person.name}, elt: #{s.elt.id}, filter: #{s.filter}";
155
+ not s.filter or (elt.result and elt.result >= s.filter) } \
156
+ .reject { |s| recipients.include? s.person } \
157
+ .uniq
158
+
159
+ # Record all people to whom it was sent
160
+ subscriptions.each { |r| person_mails.create :person => r.person }
161
+ # mostly because otherwise the tests don't see it
162
+ person_mails.reload
163
+ recipients.reload
164
+
165
+ mail.bcc = subscriptions.collect { |i| i.person.email }.uniq.join(', ')
166
+ #puts "mail.bcc: #{mail.bcc}"
148
167
 
149
168
  #
150
169
  # Redefine the recipients used when delivering the mail to the local smtp server
@@ -162,21 +181,19 @@ class Mail < ActiveRecord::Base
162
181
  ret.empty? ? default : ret
163
182
  end
164
183
 
184
+ # Added to make sure it is not lost, but not modified if already existant
185
+ mail['X-Message-Id'] = mail.message_id if not mail['X-Message-Id']
186
+
165
187
  if mail.message_id
166
188
  # Let's not change the message id
167
189
  def mail.add_message_id
168
190
  end
169
191
  end
170
192
 
171
- # Added to make sure it is not lost, but not modified if already existant
172
- mail['X-Message-Id'] = mail.message_id if not mail['X-Message-Id']
173
-
174
- MailNotify::deliver(mail) if mail.destinations and not mail.destinations.empty?
193
+ MailNotify::deliver(mail) if mail.bcc and not mail.bcc.empty?
175
194
 
176
195
  # Do it after sending, to get the actual message id as generated by the MTA
177
- # Note that the id of a resent mail is regenerated, but we don't record it,
178
- # we record the initial id
179
- self.message = mail.message_id if not self.message or self.message.blank?
196
+ self.message = mail.message_id if not message or message.blank?
180
197
 
181
198
  logger.info "Published with id \"#{message}\""
182
199
  end
@@ -184,9 +201,10 @@ class Mail < ActiveRecord::Base
184
201
 
185
202
  private
186
203
 
187
- # This is to make sure we only have text, no iso-8859 or utf-8 encoding
204
+ # This is to make sure we only have text, no iso-8859
188
205
  def unquote(text)
189
- text.gsub(/\=\?(.*)\?(Q|q)\?.*?\?\=/) { |m| TMail::Unquoter.unquote_and_convert_to m, Regexp.last_match(1) }
206
+ #text.gsub(/\=\?(.*)\?(Q|q)\?.*?\?\=/) { |m| TMail::Unquoter.unquote_and_convert_to m, Regexp.last_match(1) }
207
+ text.gsub(/\=\?.*?\?.\?.*?\?\=/) { |m| TMail::Unquoter.unquote_and_convert_to m, "utf8" }
190
208
  end
191
209
 
192
210
  # Get and store the attachments
@@ -212,8 +230,10 @@ class Mail < ActiveRecord::Base
212
230
  # It looks like ==0 or ^@ !!!
213
231
  # Otherwise the elt can not be saved in the db :(
214
232
  elt.body += Iconv.new(charset, 'iso-8859-1').iconv(attachment.body).gsub(/\0/, '')
215
- else
233
+ elsif !charset =~ 'uft-8'
216
234
  elt.body += Iconv.new(charset, 'iso-8859-1').iconv(attachment.body)
235
+ else
236
+ elt.body += attachment.body
217
237
  end
218
238
  else
219
239
  # Here too have to remove any eventual null character!
@@ -11,7 +11,7 @@ class MailNotify < ActionMailer::Base
11
11
 
12
12
  ml = mailing_list(elt.parent)
13
13
 
14
- recipients (ml.subject.blank? ? '' : ml.subject ) \
14
+ recipients ml.subject.to_s \
15
15
  + " <#{ml.id}@#{ActionMailer::Base.server_settings[:domain]}>"
16
16
 
17
17
  from ((elt.person and elt.person.name) ? elt.person.name : ANONYMOUS_POSTER) \
@@ -58,6 +58,7 @@ class MailNotify < ActionMailer::Base
58
58
 
59
59
  parentMsg = elt.parent.mail
60
60
  if parentMsg
61
+ parentMsg.reload # Mostly necessary for tests
61
62
  @headers['references'] = ''
62
63
  @headers['references'] << parentMsg.mail_parents if parentMsg.mail_parents
63
64
  @headers['references'] << parentMsg.message if parentMsg.message
@@ -71,13 +72,13 @@ class MailNotify < ActionMailer::Base
71
72
  private
72
73
 
73
74
  #
74
- # Try to fine, define, the mailing list id this elt is part of
75
+ # Try to find, define, the mailing list id this elt is part of
75
76
  #
76
- # The algo used is simple: find a parent id smaller than the usually auto
77
- # generated ids
77
+ # The algo used is simple: find a small parent id which does not correspond
78
+ # to an answer
78
79
  #
79
80
  def mailing_list(elt)
80
- if (elt.id.size > 21 and elt.parent_id != 'ROOT' and !elt.subject.match 'Re: ') then
81
+ if (elt and elt.parent_id and elt.parent_id != 'ROOT' and (elt.id.size > 21 or elt.subject =~ /Re:\s/)) then
81
82
  mailing_list elt.parent
82
83
  else
83
84
  elt
data/app/models/person.rb CHANGED
@@ -2,8 +2,13 @@ class Person < ActiveRecord::Base
2
2
  usesguid
3
3
 
4
4
  has_many :elts
5
- has_many :choices
5
+
6
+ has_many :choices, :dependent => :destroy
6
7
  has_many :issues, :through => :choices, :source => :elt
8
+ has_many :subscriptions, :dependent => :destroy
9
+ has_many :subscribed_elts, :through => :subscriptions, :source => :elt
10
+ has_many :person_mails, :dependent => :destroy
11
+ has_many :mails, :through => :person_mails, :source => :mail
7
12
 
8
13
  validates_presence_of :name, :on => :create
9
14
  validates_length_of :name, :within => 3..80, :on => :create
@@ -11,10 +16,6 @@ class Person < ActiveRecord::Base
11
16
  validates_uniqueness_of :email, :on => :create,
12
17
  :if => Proc.new { |p| p.email and p.email.length > 0 }
13
18
 
14
- has_and_belongs_to_many :subscribed_elts,
15
- :class_name => "Elt",
16
- :join_table => "subscribers"
17
-
18
19
  # Convenience method, because User is as it was from the salted login plugin
19
20
  def user
20
21
  return User.find_by_login(name)
@@ -0,0 +1,4 @@
1
+ class PersonMail < ActiveRecord::Base
2
+ belongs_to :person
3
+ belongs_to :mail
4
+ end
@@ -0,0 +1,13 @@
1
+ class PersonNotify < ActionMailer::Base
2
+ def setEmail(person, url=nil)
3
+ # Email header info MUST be added here
4
+ @recipients = person.user.email
5
+ @subject = "[parlement] email verification"
6
+ @from = LoginEngine.config(:email_from).to_s
7
+
8
+ # Email body substitutions go here
9
+ @body["name"] = person.name
10
+ @body["url"] = url
11
+ @body["app_name"] = LoginEngine.config(:app_name).to_s
12
+ end
13
+ end
@@ -0,0 +1,4 @@
1
+ class Subscription < ActiveRecord::Base
2
+ belongs_to :person
3
+ belongs_to :elt
4
+ end
@@ -1,11 +1,8 @@
1
1
  <%= form_remote_tag(
2
- :update => divId,
3
- :url => { :controller => 'account', :action => 'login', :divId => divId },
4
- :before => visual_effect(:SwitchOff, divId)+";resetChoices();",
5
- :loaded => visual_effect(:BlindDown, divId)) %>
6
-
7
- <%= hidden_field 'elt', 'id' if @elt %>
8
- <input type="hidden" id="divId" name="divId" value="<%= divId %>"/>
2
+ :update => 'identity',
3
+ :url => { :controller => 'account', :action => 'login', :elt => @elt },
4
+ :before => visual_effect(:BlindUp, 'identity')+";resetChoices();",
5
+ :loaded => visual_effect(:BlindDown, 'identity')) %>
9
6
 
10
7
  <div class="login">Please, choose a pseudo</div>
11
8
 
@@ -16,10 +13,10 @@
16
13
 
17
14
  <%= link_to_function('<span class="icon">&gt;&gt;</span>',
18
15
  "Element.toggle(this);" \
19
- +visual_effect(:Grow, 'user_password_'+divId.to_s) \
16
+ +visual_effect(:Grow, 'user_password_identity') \
20
17
  +"Form.focusFirstElement(document.forms[0])") %>
21
18
 
22
- <span style="display: none;" id="user_password_<%= divId %>">
19
+ <span style="display: none;" id="user_password_identity">
23
20
  <br/>
24
21
  <label for="user_password">Password:
25
22
  <%= password_field "user", "password", :size => 10 %>
@@ -27,11 +24,11 @@
27
24
 
28
25
  <%= link_to_function('<span class="icon">&gt;&gt;</span>',
29
26
  "Element.toggle(this);" \
30
- +visual_effect(:Grow, 'person_email_'+divId.to_s) \
27
+ +visual_effect(:Grow, 'person_email_identity') \
31
28
  +"Form.focusFirstElement(document.forms[0])") %>
32
29
  </span>
33
30
 
34
- <span style="display: none;" id="person_email_<%= divId %>">
31
+ <span style="display: none;" id="person_email_identity">
35
32
  <br/>
36
33
  <label for="person_email">Email (or check key):</label>
37
34
  <%= text_field "person", "email", :size => 20 %>
@@ -40,7 +37,7 @@
40
37
  <%= submit_tag 'OK' %>
41
38
 
42
39
  <%= render :partial => '/help',
43
- :locals => { :divId => 'login'+divId.to_s, :content => '
40
+ :locals => { :divId => 'login', :content => '
44
41
  <p>You can participate with:</p>
45
42
  <ul>
46
43
  <li>no pseudo</li>
@@ -21,13 +21,12 @@
21
21
  <% if @person = session[:person] %>
22
22
  <span class="logout">
23
23
  <%= link_to_remote('[X]',
24
- { :update => divId,
25
- :url => { :controller => 'account', :action => 'logout', :divId => divId },
26
- :before => visual_effect(:SwitchOff, divId)+";resetChoices();",
27
- :complete => visual_effect(:BlindDown, divId) },
24
+ { :update => 'identity',
25
+ :url => { :controller => 'account', :action => 'logout', :elt => @elt },
26
+ :before => visual_effect(:BlindUp, 'identity')+";resetChoices();",
27
+ :loaded => visual_effect(:BlindDown, 'identity') },
28
28
  { :href => url_for(:controller => 'account', :action => 'logout') }) %>
29
29
  </span>
30
-
31
30
  <span class="author">
32
31
  &lt;<%= link_to session[:person].name,
33
32
  :controller => 'person',
@@ -40,21 +39,41 @@
40
39
  :id => "person_avatar", :class => "avatar" %>
41
40
  </div>
42
41
 
43
- <%= form_tag( { :controller => "account", :action => "setAvatar"},
44
- :multipart => true, :target => "avatar", :class => "setAvatar") %>
45
- <label>
46
- Avatar:
47
- <%= file_field "person", "image", :onchange => "submit()", :size => "18" %>
48
- </label>
49
- <%= submit_tag 'Ok' %>
50
- <%= end_form_tag %>
42
+ <fieldset id="edit"><legend>Edit</legend>
43
+ <%= form_remote_tag(
44
+ :update => 'identity',
45
+ :url => { :controller => 'account', :action => 'setPassword' },
46
+ :before => visual_effect(:BlindUp, 'identity'),
47
+ :loaded => visual_effect(:BlindDown, 'identity')) %>
48
+ <label for="user_password">Password:</label>
49
+ <%= password_field "user", "password", :size => 12 %>
50
+ <%= submit_tag 'OK' %>
51
+ <%= end_form_tag %>
52
+
53
+ <%= form_remote_tag(
54
+ :update => 'identity',
55
+ :url => { :controller => 'account', :action => 'setEmail' },
56
+ :before => visual_effect(:BlindUp, 'identity'),
57
+ :loaded => visual_effect(:BlindDown, 'identity')) %>
58
+ <label for="person_email">Email:</label>
59
+ <%= text_field "person", "email", :size => 16 %>
60
+ <%= submit_tag 'OK' %>
61
+ <%= end_form_tag %>
62
+
63
+ <%= form_tag( { :controller => "account", :action => "setAvatar"},
64
+ :multipart => true, :target => "avatar", :class => "setAvatar") %>
65
+ <label>Avatar:</label>
66
+ <%= file_field "person", "image", :onchange => "submit()", :size => 3 %>
67
+ <%= submit_tag 'OK' %>
68
+ <%= end_form_tag %>
69
+ </fieldset>
51
70
 
52
71
  <iframe id="avatar" name="avatar" style="display: none"></iframe>
53
72
 
54
- <script language="JavaScript">Element.show($('subscription'));</script>
73
+ <script language="JavaScript">Element.show($('subscriptionLink'));</script>
55
74
  <% else %>
56
75
 
57
- <%= render :partial => '/account/login', :locals => { :divId => divId } %>
58
- <script language="JavaScript">Element.hide($('subscription'));</script>
76
+ <%= render :partial => '/account/login' %>
77
+ <script language="JavaScript">Element.hide($('subscriptionLink'));</script>
59
78
  <% end %>
60
79
 
@@ -57,38 +57,26 @@
57
57
  <% end %>
58
58
 
59
59
  <span class="eltMore" id="eltMore_<%= elt.id %>"
60
- <%= 'style="display: none"' if (eltTop or elt.elts_count < 2) %>>
61
- <%= link_to_remote(elt.elts_count.to_s+' more',
60
+ <%= 'style="display: none"' if (eltTop or elt.elts_count < SUB_THREAD_LENGTH) %>>
61
+ <%= link_to_remote(elt.elts_count.to_s+' more...',
62
62
  { :update => 'eltSubs_'+elt.id.to_s,
63
63
  :url => { :controller => 'elt', :action => 'list', :id => elt },
64
- :loading => visual_effect(:SwitchOff, "eltMore_#{elt.id.to_s}")+
65
- visual_effect(:BlindDown, "eltSubs_#{elt.id.to_s}")+
66
- visual_effect(:BlindDown, "eltSubsClose_#{elt.id.to_s}") },
64
+ :before => visual_effect(:BlindUp, "eltMore_#{elt.id.to_s}")+
65
+ visual_effect(:BlindDown, "eltSubsClose_#{elt.id.to_s}"),
66
+ :loading => visual_effect(:BlindDown, "eltSubs_#{elt.id.to_s}") },
67
67
  { :href => url_for(:controller => 'elt', :action => 'show', :id => elt) }) %>
68
- <!--
69
- -
70
- <%= link_to_remote('Write <span class="icon">&gt;&gt;</span>',
71
- { :update => "eltNew_#{elt.id.to_s}",
72
- :url => { :controller => 'elt', :action => 'new', :id => elt },
73
- :loaded => visual_effect(:BlindDown, "eltNew_#{elt.id.to_s}")+
74
- visual_effect(:BlindDown, "eltSubsClose_#{elt.id.to_s}")},
75
- { :href => url_for(:controller => 'elt', :action => 'new', :id => elt)}) %>
76
- -->
77
68
  </span>
78
69
  <!-- The choice end form, here to make sure it looks nice in text browsers -->
79
70
  <%= end_form_tag %>
80
71
 
81
72
  <ul class="eltNew" id="eltNew_<%= elt.id %>"></ul>
82
73
 
83
- <!-- Display automatically one element threads -->
84
- <ul <%= 'style="display: none"' unless (eltTop or elt.elts_count == 1) %>
74
+ <ul <%= 'style="display: none"' unless (eltTop or elt.elts_count < SUB_THREAD_LENGTH) %>
85
75
  id="eltSubs_<%= elt.id %>" class="eltSub">
86
- <% if eltTop or elt.elts_count == 1 %>
87
- <%= render :partial => '/elt/list', :locals => { :elt => elt } %>
88
- <% end %>
76
+ <%= render :partial => '/elt/list', :locals => { :elt => elt } if (eltTop or elt.elts_count < SUB_THREAD_LENGTH) %>
89
77
  </ul>
90
78
 
91
- <span <%= 'style="display: none"' unless ((eltTop and elt.elts_count > 0) or elt.elts_count == 1) %>
79
+ <span <%= 'style="display: none"' unless (elt.elts_count > 0 and (eltTop or elt.elts_count < SUB_THREAD_LENGTH)) %>
92
80
  id="eltSubsClose_<%= elt.id %>" title="<%= elt.created_on %>"
93
81
  class="eltSubsClose">
94
82
  <%= link_to_function('<span class="icon">&lt;&lt;</span> Close',
@@ -45,15 +45,15 @@
45
45
  <ul>
46
46
  <% elts.each do |elt| %>
47
47
  <li class="boxLine elt" title="<%= elt.created_on.strftime('%d/%m %H:%M') %>">
48
- <span>
49
- <%= link_to_remote("%+d" % elt.resultlocal,
50
- { :update => 'resultList_'+elt.id,
51
- :position => :top,
52
- :url => { :action => 'choices', :id => elt } },
53
- { :class => 'result', :id => "resultList_#{ elt.id}",
54
- :href => url_for(:controller => 'elt', :action => 'choices', :id => elt) }
55
- ) if elt.resultlocal %>
56
- </span>
48
+ <span>
49
+ <%= link_to_remote("%+d" % elt.resultlocal,
50
+ { :update => 'resultList_'+elt.id,
51
+ :position => :top,
52
+ :url => { :action => 'choices', :id => elt } },
53
+ { :class => 'result', :id => "resultList_#{ elt.id}",
54
+ :href => url_for(:controller => 'elt', :action => 'choices', :id => elt) }
55
+ ) if elt.resultlocal %>
56
+ </span>
57
57
 
58
58
  <% if elt.person %>
59
59
  <span class="author">
@@ -1,11 +1,7 @@
1
1
  <% voters = Choice.count :select => 'person_id', :distinct => true %>
2
2
  <div class="sidebar">
3
3
  <h3 class="boxTitle">Identity</h3>
4
- <div class="box" id="identity">
5
- <div id="author_<%= @elt.id %>">
6
- <%= render :partial => 'account/show', :locals => { :divId => 'author_'+@elt.id } %>
7
- </div>
8
- </div>
4
+ <div class="box" id="identity"><%= render :partial => 'account/show' %></div>
9
5
 
10
6
  <h3 class="boxTitle">Filter</h3>
11
7
  <div class="box">
@@ -23,37 +19,14 @@
23
19
  <script>setFilterFromCookie();</script>
24
20
  </div>
25
21
 
26
- <h3 class="boxTitle">Highest posts</h3>
27
- <div class="box listByVote">
28
- <%= render :partial => '/elt/listByVote' %>
29
- </div>
30
-
31
- <h3 class="boxTitle">Latest posts</h3>
32
- <div class="box listByDate">
33
- <%= render :partial => '/elt/listByDate' %>
34
- </div>
35
-
36
22
  <h3 class="boxTitle">Subscribers</h3>
37
- <div class="box">
38
- <div id="subscription" <%= "style='display: none'" unless session[:person] %> >
39
- <%= link_to_remote(((@session[:person] and @elt.subscribers.include?(@session[:person])) ? 'Unsubscribe!' : 'Subscribe!'),
40
- :update => 'subscription',
41
- :url => { :controller => 'subscriber', :action => 'subscribe', :id => @elt },
42
- :loaded => visual_effect(:BlindDown, 'subscription')) %>
43
- </div>
23
+ <div class="box"><%= render :partial => '/subscriber/list' %></div>
44
24
 
45
- <div class="boxLine">
46
- <% @elt.subscribers.each do |i| %>
47
- <%= link_to(i.name, :controller => 'person', :action => 'show', :id => i) %>
48
- <% end %>
49
- </div>
25
+ <h3 class="boxTitle">Highest posts</h3>
26
+ <div class="box listByVote"><%= render :partial => '/elt/listByVote' %></div>
50
27
 
51
- <div class="boxLineR">
52
- <% @elt.parent.all_recipients.each do |i| %>
53
- <%= link_to(i.name, :controller => 'person', :action => 'show', :id => i) %>
54
- <% end %>
55
- </div>
56
- </div>
28
+ <h3 class="boxTitle">Latest posts</h3>
29
+ <div class="box listByDate"><%= render :partial => '/elt/listByDate' %></div>
57
30
 
58
31
  <h3 class="boxTitle">Search</h3>
59
32
  <div class="box">
@@ -4,6 +4,12 @@
4
4
  <html>
5
5
  <head>
6
6
  <title><%= @title %></title>
7
+
8
+ <link rel="alternate" type="application/rss+xml" title="Latest Posts - <%= @title %>"
9
+ href="<%= url_for :action => 'rss', :id => @elt %>"/>
10
+ <link rel="alternate" type="application/rss+xml" title="Highest posts - <%= @title %>"
11
+ href="<%= url_for :action => 'vote_rss', :id => @elt %>"/>
12
+
7
13
  <%= stylesheet_link_tag 'default.css' %>
8
14
  <%= javascript_include_tag "/javascripts/prototype" %>
9
15
  <%= javascript_include_tag "/javascripts/scriptaculous" %>
@@ -0,0 +1,24 @@
1
+ Welcome to <%= @app_name %>, <%= @name %>.
2
+
3
+ Please click on the following link to confirm your email:
4
+ <a href="<%= @url%>">Click me!</a>
5
+
6
+ <%= @url %>
7
+
8
+ If you received this email by mistake, just ignore it.
9
+
10
+ Thank you
11
+
12
+ ====================================================================
13
+
14
+ Bienvenue à <%= @app_name %>, <%= @name %>.
15
+
16
+ Veuillez cliquer sur le lien ci dessous pour confirmer votre email:
17
+ <a href="<%= @url%>">cliquez moi</a>
18
+
19
+ <%= @url %>
20
+
21
+ Si vous avez reçu ce mail par erreur, ignorez le tout simplement.
22
+
23
+ Merci
24
+
@@ -0,0 +1,18 @@
1
+ <div id="subscription">
2
+ <div class="boxLine">
3
+ <% @elt.all_subscriptions.each do |p| %>
4
+ <%= link_to p.person.name, :controller => 'person', :action => 'show', :id => p.person %>
5
+ <%= "(#{ p.filter })" if p.filter %>
6
+ <% end %>
7
+ </div>
8
+
9
+ <div id="subscriptionLink" class="boxLineR"
10
+ <%= "style='display: none'" unless session[:person] %> >
11
+ <%= link_to_remote 'Add/remove me!',
12
+ :update => 'subscription',
13
+ :url => { :controller => 'subscriber', :action => 'subscribe', :id => @elt },
14
+ :before => visual_effect(:BlindUp, 'subscription'),
15
+ :loaded => visual_effect(:BlindDown, 'subscription') %>
16
+ </div>
17
+ </div>
18
+
@@ -64,14 +64,16 @@ require 'rails_file_column'
64
64
  require 'jcode'
65
65
  $KCODE = 'u'
66
66
 
67
+ # What is the name of a quick anonymous poster
68
+ ANONYMOUS_POSTER = 'anon'
69
+
67
70
  # How many elements are displayed at once in a page
68
71
  PAGE_LENGTH = 20
72
+ # How many elements are displayed at once in a sub thread
73
+ SUB_THREAD_LENGTH = 5
69
74
  # How many elements are displayed at once in a sidebar list
70
75
  LIST_LENGTH = 10
71
76
 
72
- # What is the name of a quick anonymous poster
73
- ANONYMOUS_POSTER = 'anon'
74
-
75
77
  # Number of elt's paragraphs to show initially
76
78
  NB_PARAGRAPH_TO_DISPLAY = 4
77
79
 
@@ -106,5 +108,5 @@ Engines.start :login
106
108
 
107
109
  Rubaidh::GoogleAnalytics.tracker_id = 'UA-317241-1'
108
110
 
109
- PARLEMENT_VERSION='0.9'
111
+ PARLEMENT_VERSION='0.10'
110
112
 
@@ -17,3 +17,5 @@ config.action_controller.perform_caching = true
17
17
 
18
18
  # Don't care if the mailer can't send
19
19
  config.action_mailer.raise_delivery_errors = false
20
+
21
+ config.action_mailer.delivery_method = :test
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- Parlement
1
+ parlement
2
2
 
3
3
  !/images/ParlementLogo.png!
4
4