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.
- data/CHANGES +16 -0
- data/MEMORY +4 -0
- data/README +1 -0
- data/app/controllers/account_controller.rb +3 -0
- data/app/controllers/application.rb +15 -0
- data/app/controllers/elt_controller.rb +64 -2
- data/app/controllers/subscriber_controller.rb +0 -6
- data/app/helpers/elt_helper.rb +28 -18
- data/app/models/elt.rb +8 -3
- data/app/models/old_visit.rb +4 -0
- data/app/models/person.rb +4 -0
- data/app/models/visit.rb +4 -0
- data/app/views/account/_show.rhtml +11 -3
- data/app/views/elt/_listByDate.rhtml +74 -58
- data/app/views/elt/_listByVote.rhtml +70 -65
- data/app/views/elt/_listVisitors.rhtml +20 -0
- data/app/views/elt/new.rhtml +36 -23
- data/app/views/elt/show.rhtml +30 -15
- data/app/views/subscriber/_list.rhtml +24 -15
- data/config/database.yml +3 -3
- data/config/environment.rb +1 -1
- data/db/ROOT/Titemagli.txt +3 -0
- data/db/ROOT/titemagli.txt +9 -0
- data/db/development_structure.sql +343 -53
- data/db/migrate/007_create_visits.rb +19 -0
- data/db/migrate/008_create_old_visits.rb +18 -0
- data/db/migrate/009_add_person_last_login.rb +9 -0
- data/db/schema.rb +22 -1
- data/public/images/feed-icon-14x14.png +0 -0
- data/public/images/feed-icon-28x28.png +0 -0
- data/public/javascripts/mybehaviour.js +13 -4
- data/public/stylesheets/default.css +46 -42
- data/test/unit/visit_test.rb +10 -0
- metadata +226 -216
- data/public/images/webfeed.gif +0 -0
@@ -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
|
+
|
data/app/views/elt/new.rhtml
CHANGED
@@ -8,33 +8,46 @@
|
|
8
8
|
:update => 'eltSubs_'+@elt.parent_id,
|
9
9
|
:url => { :action => 'create', :id => @elt.parent },
|
10
10
|
:position => 'top',
|
11
|
-
|
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
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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 => </div><blockquote>blockquote</blockquote> "Google":http://google.com => <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"><<</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
|
-
|
data/app/views/elt/show.rhtml
CHANGED
@@ -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
|
-
<
|
4
|
-
|
11
|
+
<div class="box identity" id="identity">
|
12
|
+
<%= render :partial => 'account/show', :locals => { :elt => @elt.parent } %>
|
13
|
+
</div>
|
5
14
|
|
6
|
-
|
7
|
-
|
8
|
-
|
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="<"><</a>
|
11
19
|
<select id="filter" name="filter"
|
12
|
-
|
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
|
-
<
|
23
|
-
|
30
|
+
<div class="box" id="listVisitors">
|
31
|
+
<%= render :partial => '/elt/listVisitors' %>
|
32
|
+
</div>
|
24
33
|
|
25
|
-
<
|
26
|
-
|
34
|
+
<div class="box" id="listSubscribers">
|
35
|
+
<%= render :partial => '/subscriber/list' %>
|
36
|
+
</div>
|
27
37
|
|
28
|
-
<
|
29
|
-
|
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’ 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
|
-
<
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
35
|
+
#encoding: unicode
|
36
36
|
|
37
37
|
|
38
38
|
# PostgreSQL versions 7.4 - 8.1
|
data/config/environment.rb
CHANGED