parlement 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +16 -0
- data/README +36 -3
- data/Rakefile +8 -12
- data/app/controllers/account_controller.rb +2 -0
- data/app/controllers/elt_controller.rb +1 -5
- data/app/controllers/subscriber_controller.rb +1 -1
- data/app/helpers/elt_helper.rb +30 -10
- data/app/models/elt.rb +2 -1
- data/app/models/mail.rb +41 -41
- data/app/models/mail_notify.rb +27 -10
- data/app/views/account/_login.rhtml +9 -7
- data/app/views/account/_show.rhtml +4 -4
- data/app/views/elt/_elt.rhtml +52 -51
- data/app/views/elt/_list.rhtml +22 -14
- data/app/views/elt/new.rhtml +1 -1
- data/app/views/elt/show.rhtml +15 -16
- data/app/views/layouts/top.rhtml +13 -1
- data/app/views/person/show.rhtml +1 -7
- data/config/boot.rb +32 -7
- data/config/database.yml +3 -0
- data/config/environment.rb +3 -1
- data/config/environments/development.rb +1 -1
- data/db/ROOT/parlement/ddRing.txt +14 -0
- data/db/ROOT/parlement/top-politics.txt +12 -0
- data/db/ROOT/perso.txt +1 -1
- data/db/development_structure.sql +30 -16
- data/db/schema.rb +18 -10
- data/db/schema.sql +34 -34
- data/public/javascripts/application.js +2 -0
- data/public/javascripts/blank.gif +0 -0
- data/public/javascripts/borders.js +687 -0
- data/public/javascripts/controls.js +95 -30
- data/public/javascripts/dragdrop.js +161 -21
- data/public/javascripts/effects.js +310 -211
- data/public/javascripts/ie7-load.htc +1 -0
- data/public/javascripts/prototype.js +228 -28
- data/test/fixtures/attachments.yml +3 -0
- data/test/fixtures/mail/mail_ruby +1 -0
- data/test/fixtures/people.yml +14 -0
- data/test/functional/account_controller_test.rb +3 -2
- data/test/unit/mail_notify_test.rb +2 -0
- data/test/unit/mail_test.rb +59 -6
- data/test/unit/person_test.rb +1 -1
- data/vendor/plugins/engines/CHANGELOG +92 -0
- data/vendor/plugins/engines/MIT-LICENSE +21 -0
- data/vendor/plugins/engines/README +325 -39
- data/vendor/plugins/engines/generators/engine/USAGE +26 -0
- data/vendor/plugins/engines/generators/engine/engine_generator.rb +199 -0
- data/vendor/plugins/engines/generators/engine/templates/README +85 -0
- data/vendor/plugins/engines/generators/engine/templates/init_engine.erb +13 -0
- data/vendor/plugins/engines/generators/engine/templates/install.erb +4 -0
- data/vendor/plugins/engines/generators/engine/templates/lib/engine.erb +6 -0
- data/vendor/plugins/engines/generators/engine/templates/licenses/GPL +18 -0
- data/vendor/plugins/engines/generators/engine/templates/licenses/LGPL +19 -0
- data/vendor/plugins/engines/generators/engine/templates/licenses/MIT +22 -0
- data/vendor/plugins/engines/generators/engine/templates/licenses/None +1 -0
- data/vendor/plugins/engines/generators/engine/templates/public/javascripts/engine.js +0 -0
- data/vendor/plugins/engines/generators/engine/templates/public/stylesheets/engine.css +0 -0
- data/vendor/plugins/engines/generators/engine/templates/tasks/engine.rake +0 -0
- data/vendor/plugins/engines/generators/engine/templates/test/test_helper.erb +13 -0
- data/vendor/plugins/engines/init.rb +18 -3
- data/vendor/plugins/engines/lib/bundles/require_resource.rb +124 -0
- data/vendor/plugins/engines/lib/bundles.rb +77 -0
- data/vendor/plugins/engines/lib/{action_mailer_extensions.rb → engines/action_mailer_extensions.rb} +15 -36
- data/vendor/plugins/engines/lib/{action_view_extensions.rb → engines/action_view_extensions.rb} +40 -33
- data/vendor/plugins/engines/lib/engines/active_record_extensions.rb +19 -0
- data/vendor/plugins/engines/lib/engines/dependencies_extensions.rb +118 -0
- data/vendor/plugins/engines/lib/engines/migration_extensions.rb +53 -0
- data/vendor/plugins/engines/lib/{ruby_extensions.rb → engines/ruby_extensions.rb} +14 -28
- data/vendor/plugins/engines/lib/engines/testing_extensions.rb +323 -0
- data/vendor/plugins/engines/lib/engines.rb +258 -148
- data/vendor/plugins/engines/tasks/engines.rake +161 -0
- data/vendor/plugins/engines/test/action_view_extensions_test.rb +9 -0
- data/vendor/plugins/engines/test/ruby_extensions_test.rb +24 -3
- data/vendor/plugins/guid/README.TXT +14 -4
- data/vendor/plugins/guid/init.rb +9 -2
- data/vendor/plugins/guid/lib/uuidtools.rb +22 -15
- data/vendor/plugins/login_engine/CHANGELOG +14 -0
- data/vendor/plugins/login_engine/README +93 -7
- data/vendor/plugins/login_engine/app/controllers/user_controller.rb +30 -20
- data/vendor/plugins/login_engine/app/helpers/user_helper.rb +1 -1
- data/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml +2 -2
- data/vendor/plugins/login_engine/db/migrate/001_initial_schema.rb +25 -0
- data/vendor/plugins/login_engine/install.rb +4 -0
- data/vendor/plugins/login_engine/lib/login_engine/authenticated_system.rb +11 -5
- data/vendor/plugins/login_engine/lib/login_engine/authenticated_user.rb +15 -9
- data/vendor/plugins/login_engine/lib/login_engine.rb +7 -3
- data/vendor/plugins/login_engine/test/functional/user_controller_test.rb +22 -19
- data/vendor/plugins/login_engine/test/test_helper.rb +4 -8
- data/vendor/plugins/login_engine/test/unit/user_test.rb +31 -11
- metadata +60 -57
- data/app/models/attachment.rb +0 -6
- data/public/attachment/file/architecture.png +0 -0
- data/public/attachment/file/architecture.svg +0 -8972
- data/public/attachment/file/security.svg +0 -8960
- data/public/engine_files/login_engine/stylesheets/login_engine.css +0 -81
- data/public/oldREADME +0 -190
- data/public/stylesheets/default.css +0 -235
- data/public/stylesheets/live_tree.css +0 -62
- data/public/stylesheets/scaffold.css +0 -74
- data/script/about +0 -3
- data/script/benchmarker +0 -19
- data/script/breakpointer +0 -3
- data/script/console +0 -3
- data/script/create_db +0 -7
- data/script/destroy +0 -3
- data/script/generate +0 -3
- data/script/performance/benchmarker +0 -3
- data/script/performance/profiler +0 -3
- data/script/plugin +0 -3
- data/script/process/reaper +0 -3
- data/script/process/spawner +0 -3
- data/script/process/spinner +0 -3
- data/script/profiler +0 -34
- data/script/runner +0 -3
- data/script/server +0 -3
- data/test/unit/user_test.rb +0 -94
- data/vendor/plugins/engines/lib/dependencies_extensions.rb +0 -56
- data/vendor/plugins/engines/lib/testing_extensions.rb +0 -33
- data/vendor/plugins/login_engine/db/schema.rb +0 -25
- data/vendor/plugins/login_engine/test/fixtures/templates/users.yml +0 -41
- /data/public/images/{eltBackground.png → eltBackground.jng} +0 -0
data/app/views/elt/_list.rhtml
CHANGED
@@ -10,23 +10,31 @@ e = Elt.find_all("parent_id = '#{elt.id}'",
|
|
10
10
|
# TODO There seems to be a problem with firefox when trying to use a visual_effect
|
11
11
|
%>
|
12
12
|
|
13
|
-
<%= link_to_remote('< Previous',
|
14
|
-
|
13
|
+
<%= link_to_remote('< Previous page',
|
14
|
+
{ :update => 'eltSubs_'+elt.id.to_s,
|
15
15
|
:url => { :action => 'list', :id => elt, :page => e_pages.current.next },
|
16
|
-
:loading => visual_effect(:
|
17
|
-
:complete => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s)
|
16
|
+
:loading => visual_effect(:BlindUp, 'eltSubs_'+elt.id.to_s),
|
17
|
+
:complete => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s)+
|
18
|
+
visual_effect(:BlindDown, 'eltSubsClose_'+elt.id.to_s) },
|
19
|
+
{ :href => url_for(:controller => 'elt', :action => 'show', :id => @elt,
|
20
|
+
:page => (@params['page'] ? @params['page'].to_i+1 : 2))}) if e_pages.current.next %>
|
18
21
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
+
<% if e_pages.length > 1 %>
|
23
|
+
<span class="pageCount">
|
24
|
+
(<%= e_pages.length-e_pages.current.to_i+1 %>/<%= e_pages.length %>)
|
25
|
+
</span>
|
26
|
+
<% end %>
|
22
27
|
|
23
|
-
<%= link_to_remote('Next >',
|
24
|
-
|
28
|
+
<%= link_to_remote('Next page >',
|
29
|
+
{ :update => 'eltSubs_'+elt.id.to_s,
|
25
30
|
:url => { :action => 'list', :id => elt, :page => e_pages.current.previous },
|
26
|
-
:loading => visual_effect(:
|
27
|
-
:complete => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s)
|
31
|
+
:loading => visual_effect(:BlindUp, 'eltSubs_'+elt.id.to_s),
|
32
|
+
:complete => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s)+
|
33
|
+
visual_effect(:BlindDown, 'eltSubsClose_'+elt.id.to_s) },
|
34
|
+
{ :href => url_for(:controller => 'elt', :action => 'show', :id => @elt,
|
35
|
+
:page => (@params['page'] ? @params['page'].to_i-1 : e_pages.length-1))}) if e_pages.current.previous %>
|
28
36
|
|
29
|
-
|
30
|
-
:collection => e.reverse,
|
31
|
-
|
37
|
+
<ul class="eltSubs" style="padding: 0; margin: 0;">
|
38
|
+
<%= render :partial => '/elt/elt', :collection => e.reverse, :locals => { :eltTop => false } %>
|
39
|
+
</ul>
|
32
40
|
|
data/app/views/elt/new.rhtml
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
<%= hidden_field 'elt', 'parent_id' %></p>
|
23
23
|
|
24
24
|
<h2>
|
25
|
-
<%= text_field 'elt', 'subject'
|
25
|
+
<%= text_field 'elt', 'subject' %>
|
26
26
|
|
27
27
|
<%= render :partial => '/help',
|
28
28
|
:locals => { :divId => 'title'+@elt.parent_id, :content => '
|
data/app/views/elt/show.rhtml
CHANGED
@@ -1,25 +1,22 @@
|
|
1
1
|
<div class="sidebar">
|
2
2
|
<% if @elt.children.count > 0 %>
|
3
|
-
<
|
3
|
+
<h3 class="boxTitle">Titres</h3>
|
4
4
|
<% end %>
|
5
5
|
|
6
6
|
<div class="box">
|
7
|
-
|
8
|
-
|
9
|
-
<
|
10
|
-
<%= elt.
|
11
|
-
</
|
12
|
-
|
13
|
-
|
14
|
-
<% end %>
|
15
|
-
|
16
|
-
<br/>
|
7
|
+
<ul>
|
8
|
+
<% for elt in @elt.children.reverse[0...PAGE_ELT_LENGTH] %>
|
9
|
+
<li class="boxLine" title="<%= elt.created_on.strftime('%d/%m') %>">
|
10
|
+
<%= link_to elt.subject, :id => elt %>
|
11
|
+
</li>
|
12
|
+
<% end %>
|
13
|
+
</ul>
|
17
14
|
|
18
15
|
<%= link_to image_tag("/images/webfeed.gif"),
|
19
16
|
:action => 'rss', :id => @elt %>
|
20
17
|
</div>
|
21
18
|
|
22
|
-
<
|
19
|
+
<h3 class="boxTitle">Subscribe</h3>
|
23
20
|
<div class="box">
|
24
21
|
<div id="author_<%= @elt.id %>">
|
25
22
|
<%= render :partial => 'account/show',
|
@@ -47,12 +44,14 @@
|
|
47
44
|
<% end %>
|
48
45
|
|
49
46
|
<% if @elt.parent and @elt.parent.subject != '' %>
|
50
|
-
<
|
47
|
+
<h3 class="parent">
|
51
48
|
<%= link_to(textilize_without_paragraph(@elt.parent.subject),
|
52
49
|
:id => @elt.parent) %>
|
53
|
-
</
|
50
|
+
</h3>
|
54
51
|
<% end %>
|
55
52
|
|
56
|
-
|
57
|
-
|
53
|
+
<ul>
|
54
|
+
<%= render :partial => 'elt', :layout => 'top',
|
55
|
+
:locals => { :elt => @elt, :eltTop => true } %>
|
56
|
+
</ul>
|
58
57
|
|
data/app/views/layouts/top.rhtml
CHANGED
@@ -7,6 +7,16 @@
|
|
7
7
|
<%= stylesheet_link_tag 'default.css' %>
|
8
8
|
<%= javascript_include_tag "/javascripts/prototype" %>
|
9
9
|
<%= javascript_include_tag "/javascripts/scriptaculous" %>
|
10
|
+
<!--
|
11
|
+
<%= javascript_include_tag "/javascripts/borders" %>
|
12
|
+
-->
|
13
|
+
|
14
|
+
<!-- compliance patch for microsoft browsers -->
|
15
|
+
<!--[if lt IE 7]>
|
16
|
+
<script type="text/javascript">IE7_PNG_SUFFIX = ".png";</script>
|
17
|
+
<%= javascript_include_tag "/javascripts/ie7.js" %>
|
18
|
+
<![endif]-->
|
19
|
+
|
10
20
|
|
11
21
|
<link rel="shortcut icon" href="/images/world.png" type="image/png"/>
|
12
22
|
|
@@ -35,11 +45,13 @@
|
|
35
45
|
<p class="version">
|
36
46
|
<a href="<%= url_for :controller => 'elt', :action => 'show', :id => '' %>">
|
37
47
|
v<%= PARLEMENT_VERSION %></a>
|
48
|
+
<a href="http://www.pagerank.net/" title="Search Engine Optimization" target="_blank">
|
49
|
+
<img src="http://www.pagerank.net/pagerank.gif" alt="Search Engine Optimization">
|
50
|
+
</a>
|
38
51
|
<a href="http://validator.w3.org/check?uri=referer">
|
39
52
|
<img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict"/>
|
40
53
|
</a>
|
41
54
|
</p>
|
42
|
-
|
43
55
|
</body>
|
44
56
|
</html>
|
45
57
|
|
data/app/views/person/show.rhtml
CHANGED
@@ -20,13 +20,7 @@
|
|
20
20
|
|
21
21
|
<p>Created on <%= @person.created_on %></p>
|
22
22
|
|
23
|
-
|
24
|
-
<p>Posts made by <%= @person.name %>
|
25
|
-
<%= render :partial => '/help',
|
26
|
-
:locals => { :divId => 'body'+@person.id, :content => '
|
27
|
-
posts can be displayed more than once depending on their occurence in sub
|
28
|
-
threads
|
29
|
-
' } %></p>
|
23
|
+
<p>Posts made by <%= @person.name %></p>
|
30
24
|
|
31
25
|
<%
|
32
26
|
# TODO get the count from the parent element call
|
data/config/boot.rb
CHANGED
@@ -2,18 +2,43 @@
|
|
2
2
|
|
3
3
|
unless defined?(RAILS_ROOT)
|
4
4
|
root_path = File.join(File.dirname(__FILE__), '..')
|
5
|
+
|
5
6
|
unless RUBY_PLATFORM =~ /mswin32/
|
6
7
|
require 'pathname'
|
7
8
|
root_path = Pathname.new(root_path).cleanpath(true).to_s
|
8
9
|
end
|
10
|
+
|
9
11
|
RAILS_ROOT = root_path
|
10
12
|
end
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
unless defined?(Rails::Initializer)
|
15
|
+
if File.directory?("#{RAILS_ROOT}/vendor/rails")
|
16
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
17
|
+
else
|
18
|
+
require 'rubygems'
|
19
|
+
|
20
|
+
environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
|
21
|
+
environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
|
22
|
+
rails_gem_version = $1
|
23
|
+
|
24
|
+
if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
|
25
|
+
rails_gem = Gem.cache.search('rails', "=#{version}").first
|
26
|
+
|
27
|
+
if rails_gem
|
28
|
+
require_gem "rails", "=#{version}"
|
29
|
+
require rails_gem.full_gem_path + '/lib/initializer'
|
30
|
+
else
|
31
|
+
STDERR.puts %(Cannot find gem for Rails =#{version}:
|
32
|
+
Install the missing gem with 'gem install -v=#{version} rails', or
|
33
|
+
change environment.rb to define RAILS_GEM_VERSION with your desired version.
|
34
|
+
)
|
35
|
+
exit 1
|
36
|
+
end
|
37
|
+
else
|
38
|
+
require_gem "rails"
|
39
|
+
require 'initializer'
|
40
|
+
end
|
41
|
+
end
|
18
42
|
|
19
|
-
Rails::Initializer.run(:set_load_path)
|
43
|
+
Rails::Initializer.run(:set_load_path)
|
44
|
+
end
|
data/config/database.yml
CHANGED
@@ -10,6 +10,7 @@ development:
|
|
10
10
|
database: parlement_development
|
11
11
|
username: manu
|
12
12
|
password: manu
|
13
|
+
#encoding: unicode
|
13
14
|
|
14
15
|
# Connect on a TCP socket. If omitted, the adapter will connect on the
|
15
16
|
# domain socket given by socket instead.
|
@@ -24,12 +25,14 @@ test:
|
|
24
25
|
database: parlement_test
|
25
26
|
username: manu
|
26
27
|
password:
|
28
|
+
#encoding: unicode
|
27
29
|
|
28
30
|
production:
|
29
31
|
adapter: postgresql
|
30
32
|
database: parlement_production
|
31
33
|
username: manu
|
32
34
|
password: manu
|
35
|
+
#encoding: unicode
|
33
36
|
|
34
37
|
|
35
38
|
# PostgreSQL versions 7.4 - 8.1
|
data/config/environment.rb
CHANGED
@@ -39,6 +39,8 @@ Rails::Initializer.run do |config|
|
|
39
39
|
# Use Active Record's schema dumper instead of SQL when creating the test database
|
40
40
|
# (enables use of different database adapters for development and test environments)
|
41
41
|
# config.active_record.schema_format = :ruby
|
42
|
+
# echarp
|
43
|
+
config.active_record.schema_format = :sql
|
42
44
|
|
43
45
|
# See Rails::Configuration for more options
|
44
46
|
end
|
@@ -62,7 +64,7 @@ require 'rails_file_column'
|
|
62
64
|
require 'jcode'
|
63
65
|
$KCODE = 'u'
|
64
66
|
|
65
|
-
PARLEMENT_VERSION='0.
|
67
|
+
PARLEMENT_VERSION='0.4'
|
66
68
|
|
67
69
|
# How many elements are displayed at once
|
68
70
|
PAGE_ELT_LENGTH = 10
|
@@ -0,0 +1,14 @@
|
|
1
|
+
DIRECT DEMOCRACY
|
2
|
+
|
3
|
+
<img style="float: left; padding-bottom: 1em" src="http://www.acthum.net/directdemocracy/images/dd-sml.gif"/>
|
4
|
+
|
5
|
+
<a href="http://www.acthum.net/directdemocracy/">Web Ring</a>
|
6
|
+
<br/>
|
7
|
+
<a href="http://www.software-zone.com/cgi-bin/ringlink/prev5.pl?ringid=common1;siteid=parlement">|<</a>
|
8
|
+
<a href="http://www.software-zone.com/cgi-bin/ringlink/prev.pl?ringid=common1;siteid=parlement"><</a>
|
9
|
+
<a href="http://www.software-zone.com/cgi-bin/ringlink/list.pl?ringid=common1;siteid=parlement">Site List</a>
|
10
|
+
<a href="http://www.software-zone.com/cgi-bin/ringlink/next.pl?ringid=common1;siteid=parlement">></a>
|
11
|
+
<a href="http://www.software-zone.com/cgi-bin/ringlink/next5.pl?ringid=common1;siteid=parlement">>|</a>
|
12
|
+
<br/>
|
13
|
+
<a href="http://www.software-zone.com/cgi-bin/ringlink/rand.pl?ringid=common1;siteid=parlement">Random Site</a>
|
14
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
top-politics
|
2
|
+
|
3
|
+
This group was started with the goal of creating a network of different
|
4
|
+
initiatives which reside on the TOP (Transparent Open Public) principles of
|
5
|
+
political activities. We hope that we will soon be able to share concepts,
|
6
|
+
ideas and suggestions about the Internet as a media, OpenSource as a paradigm
|
7
|
+
and Democracy as the ultimate goal.
|
8
|
+
|
9
|
+
http://groups.google.com/group/top-politics
|
10
|
+
|
11
|
+
(historically here: http://groups.yahoo.com/group/top-politics)
|
12
|
+
|
data/db/ROOT/perso.txt
CHANGED
@@ -12,7 +12,7 @@ echarp
|
|
12
12
|
<a href="http://www.motorun.net">motos!</a>
|
13
13
|
</div>
|
14
14
|
<div class="boxLine">
|
15
|
-
<a href="http://www.copinedegeek.
|
15
|
+
<a href="http://www.copinedegeek.com">Copine De Geek</a>
|
16
16
|
</div>
|
17
17
|
<div class="boxLine"><a href="http://www.paulhac.org">Coralie</a></div>
|
18
18
|
<div class="boxLine">
|
@@ -2,7 +2,7 @@
|
|
2
2
|
-- PostgreSQL database dump
|
3
3
|
--
|
4
4
|
|
5
|
-
SET client_encoding = '
|
5
|
+
SET client_encoding = 'LATIN9';
|
6
6
|
SET check_function_bodies = false;
|
7
7
|
SET client_min_messages = warning;
|
8
8
|
|
@@ -71,6 +71,16 @@ CREATE TABLE elts (
|
|
71
71
|
);
|
72
72
|
|
73
73
|
|
74
|
+
--
|
75
|
+
-- Name: engine_schema_info; Type: TABLE; Schema: public; Owner: manu; Tablespace:
|
76
|
+
--
|
77
|
+
|
78
|
+
CREATE TABLE engine_schema_info (
|
79
|
+
engine_name character varying(255),
|
80
|
+
version integer
|
81
|
+
);
|
82
|
+
|
83
|
+
|
74
84
|
--
|
75
85
|
-- Name: mails; Type: TABLE; Schema: public; Owner: manu; Tablespace:
|
76
86
|
--
|
@@ -96,6 +106,15 @@ CREATE TABLE people (
|
|
96
106
|
);
|
97
107
|
|
98
108
|
|
109
|
+
--
|
110
|
+
-- Name: schema_info; Type: TABLE; Schema: public; Owner: manu; Tablespace:
|
111
|
+
--
|
112
|
+
|
113
|
+
CREATE TABLE schema_info (
|
114
|
+
version integer
|
115
|
+
);
|
116
|
+
|
117
|
+
|
99
118
|
--
|
100
119
|
-- Name: subscribers; Type: TABLE; Schema: public; Owner: manu; Tablespace:
|
101
120
|
--
|
@@ -106,29 +125,32 @@ CREATE TABLE subscribers (
|
|
106
125
|
);
|
107
126
|
|
108
127
|
|
109
|
-
SET default_with_oids = true;
|
110
|
-
|
111
128
|
--
|
112
129
|
-- Name: users; Type: TABLE; Schema: public; Owner: manu; Tablespace:
|
113
130
|
--
|
114
131
|
|
115
132
|
CREATE TABLE users (
|
116
133
|
id serial NOT NULL,
|
117
|
-
"login"
|
118
|
-
salted_password character varying(40) NOT NULL,
|
119
|
-
email character varying(60),
|
134
|
+
"login" character varying(80) DEFAULT ''::character varying NOT NULL,
|
135
|
+
salted_password character varying(40) DEFAULT ''::character varying NOT NULL,
|
136
|
+
email character varying(60) DEFAULT ''::character varying NOT NULL,
|
120
137
|
firstname character varying(40),
|
121
138
|
lastname character varying(40),
|
122
|
-
salt character(40) NOT NULL,
|
139
|
+
salt character varying(40) DEFAULT ''::character varying NOT NULL,
|
123
140
|
verified integer DEFAULT 0,
|
124
141
|
"role" character varying(40),
|
125
|
-
security_token character(40),
|
142
|
+
security_token character varying(40),
|
126
143
|
token_expiry timestamp without time zone,
|
144
|
+
created_at timestamp without time zone,
|
145
|
+
updated_at timestamp without time zone,
|
146
|
+
logged_in_at timestamp without time zone,
|
127
147
|
deleted integer DEFAULT 0,
|
128
148
|
delete_after timestamp without time zone
|
129
149
|
);
|
130
150
|
|
131
151
|
|
152
|
+
SET default_with_oids = true;
|
153
|
+
|
132
154
|
--
|
133
155
|
-- Name: usersold; Type: TABLE; Schema: public; Owner: manu; Tablespace:
|
134
156
|
--
|
@@ -312,14 +334,6 @@ ALTER TABLE ONLY subscribers
|
|
312
334
|
ADD CONSTRAINT subscribers_person_id_fkey FOREIGN KEY (person_id) REFERENCES people(id);
|
313
335
|
|
314
336
|
|
315
|
-
--
|
316
|
-
-- Name: users_login_fkey; Type: FK CONSTRAINT; Schema: public; Owner: manu
|
317
|
-
--
|
318
|
-
|
319
|
-
ALTER TABLE ONLY users
|
320
|
-
ADD CONSTRAINT users_login_fkey FOREIGN KEY ("login") REFERENCES people(name);
|
321
|
-
|
322
|
-
|
323
337
|
--
|
324
338
|
-- Name: usersold_person_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: manu
|
325
339
|
--
|
data/db/schema.rb
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# migrations feature of ActiveRecord to incrementally modify your database, and
|
3
3
|
# then regenerate this schema definition.
|
4
4
|
|
5
|
-
ActiveRecord::Schema.define() do
|
5
|
+
ActiveRecord::Schema.define(:version => 0) do
|
6
6
|
|
7
7
|
create_table "attachments", :force => true do |t|
|
8
8
|
t.column "elt_id", :text, :null => false
|
9
|
-
t.column "created_on", :datetime, :
|
9
|
+
t.column "created_on", :datetime, :null => false
|
10
10
|
t.column "content_type", :text
|
11
11
|
t.column "file", :text
|
12
12
|
end
|
@@ -14,13 +14,13 @@ ActiveRecord::Schema.define() do
|
|
14
14
|
create_table "choices", :id => false, :force => true do |t|
|
15
15
|
t.column "elt_id", :text, :null => false
|
16
16
|
t.column "person_id", :text, :null => false
|
17
|
-
t.column "created_on", :datetime, :
|
17
|
+
t.column "created_on", :datetime, :null => false
|
18
18
|
end
|
19
19
|
|
20
20
|
create_table "delegations", :id => false, :force => true do |t|
|
21
21
|
t.column "elt_id", :text, :null => false
|
22
22
|
t.column "person_id", :text, :null => false
|
23
|
-
t.column "created_on", :datetime, :
|
23
|
+
t.column "created_on", :datetime, :null => false
|
24
24
|
t.column "temporary", :boolean, :default => false, :null => false
|
25
25
|
t.column "delegate_to", :text, :null => false
|
26
26
|
end
|
@@ -28,12 +28,17 @@ ActiveRecord::Schema.define() do
|
|
28
28
|
create_table "elts", :force => true do |t|
|
29
29
|
t.column "parent_id", :text
|
30
30
|
t.column "position", :float
|
31
|
-
t.column "created_on", :datetime, :
|
31
|
+
t.column "created_on", :datetime, :null => false
|
32
32
|
t.column "person_id", :text
|
33
33
|
t.column "subject", :text
|
34
34
|
t.column "body", :text
|
35
35
|
end
|
36
36
|
|
37
|
+
create_table "engine_schema_info", :id => false, :force => true do |t|
|
38
|
+
t.column "engine_name", :string
|
39
|
+
t.column "version", :integer
|
40
|
+
end
|
41
|
+
|
37
42
|
create_table "mails", :force => true do |t|
|
38
43
|
t.column "elt_id", :text, :null => false
|
39
44
|
t.column "message", :text
|
@@ -42,7 +47,7 @@ ActiveRecord::Schema.define() do
|
|
42
47
|
end
|
43
48
|
|
44
49
|
create_table "people", :force => true do |t|
|
45
|
-
t.column "created_on", :datetime, :
|
50
|
+
t.column "created_on", :datetime, :null => false
|
46
51
|
t.column "name", :text
|
47
52
|
t.column "email", :text
|
48
53
|
end
|
@@ -55,16 +60,19 @@ ActiveRecord::Schema.define() do
|
|
55
60
|
end
|
56
61
|
|
57
62
|
create_table "users", :force => true do |t|
|
58
|
-
t.column "login", :
|
59
|
-
t.column "salted_password", :string, :limit => 40, :null => false
|
60
|
-
t.column "email", :string, :limit => 60
|
63
|
+
t.column "login", :string, :limit => 80, :default => "", :null => false
|
64
|
+
t.column "salted_password", :string, :limit => 40, :default => "", :null => false
|
65
|
+
t.column "email", :string, :limit => 60, :default => "", :null => false
|
61
66
|
t.column "firstname", :string, :limit => 40
|
62
67
|
t.column "lastname", :string, :limit => 40
|
63
|
-
t.column "salt", :string, :limit => 40, :null => false
|
68
|
+
t.column "salt", :string, :limit => 40, :default => "", :null => false
|
64
69
|
t.column "verified", :integer, :default => 0
|
65
70
|
t.column "role", :string, :limit => 40
|
66
71
|
t.column "security_token", :string, :limit => 40
|
67
72
|
t.column "token_expiry", :datetime
|
73
|
+
t.column "created_at", :datetime
|
74
|
+
t.column "updated_at", :datetime
|
75
|
+
t.column "logged_in_at", :datetime
|
68
76
|
t.column "deleted", :integer, :default => 0
|
69
77
|
t.column "delete_after", :datetime
|
70
78
|
end
|
data/db/schema.sql
CHANGED
@@ -13,17 +13,17 @@ DROP DATABASE parlement_development;
|
|
13
13
|
-- Name: parlement_development; Type: DATABASE; Schema: -; Owner: manu
|
14
14
|
--
|
15
15
|
CREATE DATABASE parlement_development
|
16
|
-
|
16
|
+
WITH TEMPLATE = template0 ENCODING = 'UNICODE';
|
17
17
|
-- WITH TEMPLATE = template0 ENCODING = 'LATIN9';
|
18
18
|
|
19
19
|
\connect parlement_development manu
|
20
20
|
|
21
21
|
|
22
22
|
CREATE TABLE people (
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
id text PRIMARY KEY,
|
24
|
+
created_on timestamp with time zone NOT NULL DEFAULT now(),
|
25
|
+
name TEXT UNIQUE,
|
26
|
+
email text
|
27
27
|
);
|
28
28
|
|
29
29
|
INSERT INTO people (id, name, email)
|
@@ -69,55 +69,55 @@ CREATE TABLE "users" (
|
|
69
69
|
|
70
70
|
|
71
71
|
CREATE TABLE elts (
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
72
|
+
id text PRIMARY KEY,
|
73
|
+
parent_id text REFERENCES elts,
|
74
|
+
position float,
|
75
|
+
created_on timestamp with time zone NOT NULL DEFAULT now(),
|
76
|
+
person_id text REFERENCES people,
|
77
|
+
subject text,
|
78
|
+
body text
|
79
79
|
);
|
80
80
|
|
81
81
|
INSERT INTO elts (id, subject) VALUES ('ROOT', '');
|
82
82
|
|
83
83
|
CREATE TABLE mails (
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
84
|
+
id text PRIMARY KEY,
|
85
|
+
elt_id text NOT NULL REFERENCES elts,
|
86
|
+
message text,
|
87
|
+
mail_parents text,
|
88
|
+
file text
|
89
89
|
);
|
90
90
|
|
91
91
|
CREATE TABLE attachments (
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
92
|
+
id text PRIMARY KEY,
|
93
|
+
elt_id text NOT NULL REFERENCES elts,
|
94
|
+
created_on timestamp with time zone NOT NULL DEFAULT now(),
|
95
|
+
content_type text,
|
96
|
+
file text
|
97
97
|
);
|
98
98
|
|
99
99
|
-- The people_elts relationship
|
100
100
|
CREATE TABLE subscribers (
|
101
|
-
|
102
|
-
|
101
|
+
elt_id text NOT NULL REFERENCES elts,
|
102
|
+
person_id text NOT NULL REFERENCES people
|
103
103
|
);
|
104
104
|
|
105
105
|
INSERT INTO subscribers(elt_id, person_id)
|
106
106
|
VALUES ('ROOT', 'echarp');
|
107
107
|
|
108
108
|
CREATE TABLE choices (
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
109
|
+
elt_id text NOT NULL REFERENCES elts,
|
110
|
+
person_id text NOT NULL REFERENCES people,
|
111
|
+
created_on timestamp with time zone NOT NULL DEFAULT now(),
|
112
|
+
PRIMARY KEY (elt_id, person_id)
|
113
113
|
);
|
114
114
|
|
115
115
|
CREATE TABLE delegations (
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
116
|
+
elt_id text NOT NULL REFERENCES elts,
|
117
|
+
person_id text NOT NULL REFERENCES people,
|
118
|
+
created_on timestamp with time zone NOT NULL DEFAULT now(),
|
119
|
+
temporary boolean NOT NULL DEFAULT false,
|
120
|
+
delegate_to text NOT NULL REFERENCES people,
|
121
|
+
PRIMARY KEY (elt_id, person_id)
|
122
122
|
);
|
123
123
|
|
Binary file
|