parlement 0.12 → 0.13

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.
@@ -0,0 +1,20 @@
1
+ <h3 class="boxTitle"><%= _('Visitors') %></h3>
2
+
3
+ <%visitors = Person.find :all,
4
+ :select => 'people.id, people.name, MAX(updated_on) AS updated_on, MAX(filter) AS filter',
5
+ :joins => "JOIN visits ON people.id = visits.person_id \
6
+ JOIN elts elts ON visits.elt_id = elts.id
7
+ AND ((#{@elt.lft} <= elts.lft AND elts.rgt <= #{@elt.rgt}) \
8
+ OR (elts.lft < #{@elt.lft} AND #{@elt.rgt} < elts.rgt))",
9
+ :group => [ 'people.id, ', 'people.name' ],
10
+ :order => 'MAX(visits.updated_on) DESC' %>
11
+
12
+ <% visitors.each do |visitor| %>
13
+ <span class="person">
14
+ <span class="author" title="<%= visitor.updated_on %>">
15
+ <%= link_to visitor.name, :controller => 'person', :action => 'show', :id => visitor.id %>
16
+ </span>
17
+ <span class="filter"><%= "(#{ visitor.filter })" if visitor.filter %></span>
18
+ </span>
19
+ <% end %>
20
+
@@ -8,33 +8,46 @@
8
8
  :update => 'eltSubs_'+@elt.parent_id,
9
9
  :url => { :action => 'create', :id => @elt.parent },
10
10
  :position => 'top',
11
- :before => visual_effect(:BlindUp, 'eltNew_'+@elt.parent_id),
11
+ :before => visual_effect(:BlindUp, "eltNew_#{@elt.parent_id}"),
12
12
  :loading => "Element.show('eltSubs_#{@elt.parent_id}');
13
13
  Element.show('eltSubsClose_#{@elt.parent_id}')") do %>
14
14
 
15
15
  <%= hidden_field 'elt', 'parent_id' %>
16
16
 
17
- <h2>
18
- <%= text_field 'elt', 'subject' %>
19
-
20
- <%= render :partial => '/help',
21
- :locals => { :divId => 'title'+@elt.parent_id, :content => _('This is the title of your proposition.<br/>If you leave it as it is then it won\'t be displayed (recommanded if your text is short, like in a conversation).') } %>
22
- </h2>
23
-
24
- <%= text_area 'elt', 'body' %>
25
-
26
- <div class="eltNewButtons">
27
- <%= submit_to_remote(_('Preview'), _('Preview'),
28
- :update => "eltNewPreview_"+@elt.parent_id,
29
- :url => { :action => "create", :id => @elt.parent, :submit => "preview" },
30
- :loading => visual_effect(:BlindDown, 'eltNewPreview_'+@elt.parent_id)) %>
31
-
32
- <%= submit_tag _('Propose!') %>
33
-
34
- <%= render :partial => '/help',
35
- :locals => { :divId => 'body'+@elt.parent_id, :content => _('_<em>emphasis</em>_ *<strong>strong</strong>* -<span style="text-decoration: line-through;">strike-through</span>- +added+^<sup>sup</sup>^ ~<sub>sub</sub>~<div>bg. blockquote =&gt; </div><blockquote>blockquote</blockquote> "Google":http://google.com =&gt; <a href="http://google.com">Google</a><br/><pre>@code@</pre><div style="float:left">ordered list<br/># first item<br/># second item<br/># third item</div><div style="margin-left:10em"><ol>ordered list<li>first item</li><li>second item</li><li>third item</li></ol></div><div style="float:left">unordered list<br/>* item<br/>* item<br/>* item</div><div style="margin-left:10em"><ul>unordered list<li>item</li><li>item</li><li>item</li></ul></div><a href="http://hobix.com/textile/quick.html">Textile Reference</a>') } %>
36
- </div>
17
+ <span id="eltNewWrite_<%= @elt.parent_id %>">
18
+ <h2>
19
+ <%= text_field 'elt', 'subject' %>
20
+
21
+ <%= render :partial => '/help',
22
+ :locals => { :divId => 'title'+@elt.parent_id,
23
+ :content => _('This is the title of your proposition.<br/>If you leave it as it is then it won\'t be displayed (recommanded if your text is short, like in a conversation).') } %>
24
+ </h2>
25
+
26
+ <%= text_area 'elt', 'body' %>
27
+
28
+ <div class="eltNewButtons">
29
+ <%= submit_to_remote(_('Preview'), _('Preview'),
30
+ :update => "eltNewPreview_"+@elt.parent_id,
31
+ :url => { :action => "create", :id => @elt.parent, :submit => "preview" },
32
+ :before => visual_effect(:BlindUp, 'eltNewWrite_'+@elt.parent_id),
33
+ :loading => visual_effect(:BlindDown, 'eltNewPropose_'+@elt.parent_id)) %>
34
+
35
+ <%= render :partial => '/help',
36
+ :locals => { :divId => 'body'+@elt.parent_id,
37
+ :content => _('_<em>emphasis</em>_ *<strong>strong</strong>* -<span style="text-decoration: line-through;">strike-through</span>- +added+^<sup>sup</sup>^ ~<sub>sub</sub>~<div>bg. blockquote =&gt; </div><blockquote>blockquote</blockquote> "Google":http://google.com =&gt; <a href="http://google.com">Google</a><br/><pre>@code@</pre><div style="float:left">ordered list<br/># first item<br/># second item<br/># third item</div><div style="margin-left:10em"><ol>ordered list<li>first item</li><li>second item</li><li>third item</li></ol></div><div style="float:left">unordered list<br/>* item<br/>* item<br/>* item</div><div style="margin-left:10em"><ul>unordered list<li>item</li><li>item</li><li>item</li></ul></div><a href="http://hobix.com/textile/quick.html">Textile Reference</a>') } %>
38
+ </div>
39
+ </span>
40
+
41
+ <span id="eltNewPropose_<%= @elt.parent_id %>" style="display: none">
42
+ <span class="elt" id="eltNewPreview_<%= @elt.parent_id %>"></span>
43
+
44
+ <div class="eltNewButtons">
45
+ <%= link_to_function('<span class="icon">&lt;&lt;</span> '+_('Modify'),
46
+ visual_effect(:BlindDown, 'eltNewWrite_'+@elt.parent_id) \
47
+ +visual_effect(:BlindUp, 'eltNewPropose_'+@elt.parent_id)) %>
48
+
49
+ <%= submit_tag _('Propose!') %>
50
+ </div>
51
+ </span>
37
52
  <% end %>
38
53
 
39
- <span class="elt" id="eltNewPreview_<%= @elt.parent_id %>"/>
40
-
@@ -1,15 +1,23 @@
1
1
  <% voters = Choice.count :select => 'person_id', :distinct => true %>
2
+
3
+ <%= periodically_call_remote(:update => 'spinner', :url => { :action => 'updateView', :id => @elt })%>
4
+ <span id="spinner">
5
+ <!--
6
+ <%= image_tag "/images/live_tree_loading_spinner.gif" %>
7
+ -->
8
+ </span>
9
+
2
10
  <div class="sidebar">
3
- <h3 class="boxTitle"><%= _('Identity')%></h3>
4
- <div class="box" id="identity"><%= render :partial => 'account/show' %></div>
11
+ <div class="box identity" id="identity">
12
+ <%= render :partial => 'account/show', :locals => { :elt => @elt.parent } %>
13
+ </div>
5
14
 
6
- <h3 class="boxTitle"><%= _('Filter') %></h3>
7
- <div class="box">
8
- <div><%= _('All voters:') %> <span class="result"><%= voters %></span></div>
9
- <form id="filterForm" name="filterForm">
15
+ <div class="box" id="filter">
16
+ <h3 class="boxTitle"><%= _('Filter') %></h3>
17
+ <form id="filterForm" name="filterForm">
10
18
  <a onclick="return decrementFilter()" href="#" accesskey="<">&lt;</a>
11
19
  <select id="filter" name="filter"
12
- onchange="setFilter(this.options[this.selectedIndex].value)">
20
+ onchange="setFilter(this.options[this.selectedIndex].value, '<%= @elt.id %>')">
13
21
  <%= options_for_select [["", -voters]] %>
14
22
  <%= options_for_select (0..(voters)), 0 %>
15
23
  </select>
@@ -19,17 +27,24 @@
19
27
  <script>setFilterFromCookie();</script>
20
28
  </div>
21
29
 
22
- <h3 class="boxTitle"><%= _('Subscribers') %></h3>
23
- <div class="box"><%= render :partial => '/subscriber/list' %></div>
30
+ <div class="box" id="listVisitors">
31
+ <%= render :partial => '/elt/listVisitors' %>
32
+ </div>
24
33
 
25
- <h3 class="boxTitle"><%= _('Highest posts') %></h3>
26
- <div class="box listByVote"><%= render :partial => '/elt/listByVote' %></div>
34
+ <div class="box" id="listSubscribers">
35
+ <%= render :partial => '/subscriber/list' %>
36
+ </div>
27
37
 
28
- <h3 class="boxTitle"><%= _('Latest posts') %></h3>
29
- <div class="box listByDate"><%= render :partial => '/elt/listByDate' %></div>
38
+ <div class="box" id="listByVote">
39
+ <%= render :partial => '/elt/listByVote' %>
40
+ </div>
41
+
42
+ <div class="box" id="listByDate">
43
+ <%= render :partial => '/elt/listByDate' %>
44
+ </div>
30
45
 
31
- <h3 class="boxTitle"><%= _('Links') %></h3>
32
46
  <div class="box">
47
+ <h3 class="boxTitle"><%= _('Links') %></h3>
33
48
  <h4><%= _('Personal') %></h4>
34
49
  <div class="boxLine"><a href="http://www.alivrouvert.com">
35
50
  À Livr&#8217; Ouvert</a></div>
@@ -58,8 +73,8 @@
58
73
  Worldwide Direct Democracy Movement</a></div>
59
74
  </div>
60
75
 
61
- <h3 class="boxTitle"><%= _('Search') %></h3>
62
76
  <div class="box">
77
+ <h3 class="boxTitle"><%= _('Search') %></h3>
63
78
  <form action="http://google.com/search">
64
79
  <input type="hidden" name="q"
65
80
  value="site:<%= ActionMailer::Base.smtp_settings[:domain] %>"/>
@@ -1,18 +1,27 @@
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>
1
+ <h3 class="boxTitle"><%= _('Subscribers') %></h3>
8
2
 
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', { :queue => 'end' }),
15
- :loaded => visual_effect(:BlindDown, 'subscription', { :queue => 'end' }) %>
16
- </div>
3
+ <% subscribers = Person.find :all,
4
+ :select => 'people.id, people.name, MIN(subscriptions.created_on) AS created_on, MAX(filter) AS filter',
5
+ :joins => "JOIN subscriptions ON people.id = subscriptions.person_id \
6
+ JOIN elts elts ON subscriptions.elt_id = elts.id
7
+ AND ((#{@elt.lft} <= elts.lft AND elts.rgt <= #{@elt.rgt}) \
8
+ OR (elts.lft < #{@elt.lft} AND #{@elt.rgt} < elts.rgt))",
9
+ :group => [ 'people.id, ', 'people.name' ],
10
+ :order => 'MIN(subscriptions.created_on) DESC' %>
11
+
12
+ <% subscribers.each do |s| %>
13
+ <span class="author">
14
+ <%= link_to s.name, :controller => 'person', :action => 'show', :id => s.id %>
15
+ </span>
16
+ <span class="filter"><%= "(#{ s.filter })" if s.filter %></span>
17
+ <% end %>
18
+
19
+ <div id="subscriptionLink" class="boxLineR"
20
+ <%= "style='display: none'" unless session[:person] %> >
21
+ <%= link_to_remote _('Add/remove me!'),
22
+ :update => 'listSubscribers',
23
+ :url => { :controller => 'subscriber', :action => 'subscribe', :id => @elt },
24
+ :before => visual_effect(:BlindUp, 'listSubscribers', { :queue => 'end' }),
25
+ :loaded => visual_effect(:BlindDown, 'listSubscribers', { :queue => 'end' }) %>
17
26
  </div>
18
27
 
data/config/database.yml CHANGED
@@ -10,7 +10,7 @@ development:
10
10
  database: parlement_development
11
11
  username: manu
12
12
  password: manu
13
- #encoding: unicode
13
+ #encoding: unicode
14
14
 
15
15
  # Connect on a TCP socket. If omitted, the adapter will connect on the
16
16
  # domain socket given by socket instead.
@@ -25,14 +25,14 @@ test:
25
25
  database: parlement_test
26
26
  username: manu
27
27
  password:
28
- #encoding: unicode
28
+ #encoding: unicode
29
29
 
30
30
  production:
31
31
  adapter: postgresql
32
32
  database: parlement_production
33
33
  username: manu
34
34
  password: manu
35
- #encoding: unicode
35
+ #encoding: unicode
36
36
 
37
37
 
38
38
  # PostgreSQL versions 7.4 - 8.1
@@ -112,5 +112,5 @@ end
112
112
 
113
113
  Rubaidh::GoogleAnalytics.tracker_id = 'UA-317241-1'
114
114
 
115
- PARLEMENT_VERSION='0.12'
115
+ PARLEMENT_VERSION='0.13'
116
116
 
@@ -0,0 +1,3 @@
1
+ Titemagli
2
+
3
+
@@ -0,0 +1,9 @@
1
+ Titemagli
2
+
3
+ Bonjour, c'est moi
4
+
5
+ <style>
6
+ .links, #identity, #filter, .choice label, div#listByVote { display: none; }
7
+ .sidebar { margin-top: 1.5em; }
8
+ </style>
9
+