parlement 0.2 → 0.3

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.
Files changed (125) hide show
  1. data/CHANGES +14 -4
  2. data/README +25 -5
  3. data/Rakefile +21 -21
  4. data/app/controllers/account_controller.rb +5 -1
  5. data/app/controllers/elt_controller.rb +7 -10
  6. data/app/controllers/person_controller.rb +9 -0
  7. data/app/controllers/subscriber_controller.rb +21 -0
  8. data/app/helpers/elt_helper.rb +25 -13
  9. data/app/helpers/mailman.rb +9 -92
  10. data/app/helpers/subscriber_helper.rb +2 -0
  11. data/app/models/attachment.rb +2 -0
  12. data/app/models/elt.rb +64 -2
  13. data/app/models/mail.rb +198 -0
  14. data/app/models/mail_notify.rb +63 -0
  15. data/app/models/person.rb +8 -1
  16. data/app/views/account/_login.rhtml +31 -28
  17. data/app/views/account/_show.rhtml +4 -4
  18. data/app/views/elt/_elt.rhtml +23 -28
  19. data/app/views/elt/_list.rhtml +6 -2
  20. data/app/views/elt/new.rhtml +1 -1
  21. data/app/views/elt/show.rhtml +32 -10
  22. data/app/views/layouts/top.rhtml +16 -10
  23. data/app/views/mail_notify/publish.text.html.rhtml +46 -0
  24. data/app/views/mail_notify/publish.text.plain.rhtml +2 -0
  25. data/app/views/person/_listElts.rhtml +33 -0
  26. data/app/views/person/show.rhtml +21 -19
  27. data/config/boot.rb +2 -0
  28. data/config/environment.rb +19 -13
  29. data/config/environments/development.rb +3 -1
  30. data/config/environments/production.rb +2 -0
  31. data/config/environments/test.rb +2 -0
  32. data/config/routes.rb +5 -2
  33. data/db/ROOT/mail.txt +2 -0
  34. data/db/ROOT/parlement/news/release0.2.txt +8 -0
  35. data/db/ROOT/parlement/news/release0.3.txt +11 -0
  36. data/db/ROOT/parlement/test.txt +6 -1
  37. data/db/ROOT/parlement.txt +23 -30
  38. data/db/ROOT/perso.txt +17 -18
  39. data/db/development_structure.sql +133 -217
  40. data/db/schema.rb +83 -0
  41. data/db/schema.sql +11 -15
  42. data/lib/data_import.rb +3 -1
  43. data/public/attachment/file/architecture.png +0 -0
  44. data/public/attachment/file/architecture.svg +8972 -0
  45. data/public/attachment/file/security.svg +8960 -0
  46. data/public/images/Sleep-Deprivation-5.JPG +0 -0
  47. data/public/images/eltBackground.png +0 -0
  48. data/public/images/eltBackground.svg +89 -0
  49. data/public/images/orange_by_darren_Hester_350o.jpg +0 -0
  50. data/public/images/rails.png +0 -0
  51. data/public/images/smile.png +0 -0
  52. data/public/images/smile.svg +257 -0
  53. data/public/images/world.png +0 -0
  54. data/public/images/world.svg +170 -0
  55. data/public/javascripts/controls.js +30 -1
  56. data/public/javascripts/dragdrop.js +210 -145
  57. data/public/javascripts/effects.js +261 -399
  58. data/public/javascripts/ie7.js +6 -0
  59. data/public/javascripts/prototype.js +131 -72
  60. data/public/oldindex.html +270 -71
  61. data/public/stylesheets/default.css +189 -215
  62. data/script/about +1 -1
  63. data/script/breakpointer +1 -1
  64. data/script/console +1 -1
  65. data/script/destroy +1 -1
  66. data/script/generate +1 -1
  67. data/script/performance/benchmarker +1 -1
  68. data/script/performance/profiler +1 -1
  69. data/script/plugin +1 -1
  70. data/script/process/reaper +1 -1
  71. data/script/process/spawner +1 -1
  72. data/script/process/spinner +1 -1
  73. data/script/runner +1 -1
  74. data/script/server +1 -1
  75. data/test/fixtures/elts.yml +2 -0
  76. data/test/fixtures/mail/mail_ruby +27 -0
  77. data/test/fixtures/mail/mail_rubyChild +28 -0
  78. data/test/fixtures/mail/mail_rubyWithAttachment +7932 -0
  79. data/test/fixtures/mail/mail_rubyWithSubject +27 -0
  80. data/test/fixtures/mails.yml +7 -1
  81. data/test/fixtures/people.yml +5 -0
  82. data/test/fixtures/subscribers.yml +11 -0
  83. data/test/functional/account_controller_test.rb +38 -37
  84. data/test/functional/subscriber_controller_test.rb +128 -0
  85. data/test/test_helper.rb +44 -0
  86. data/test/unit/attachment_test.rb +1 -1
  87. data/test/unit/elt_test.rb +3 -2
  88. data/test/unit/mail_notify_test.rb +37 -0
  89. data/test/unit/mail_test.rb +124 -1
  90. data/test/unit/notifier_test.rb +0 -14
  91. data/test/unit/person_test.rb +2 -1
  92. data/test/unit/subscriber_test.rb +35 -0
  93. data/test/unit/user_test.rb +3 -3
  94. data/vendor/plugins/file_column/CHANGELOG +64 -0
  95. data/vendor/plugins/file_column/README +54 -0
  96. data/vendor/plugins/file_column/Rakefile +36 -0
  97. data/vendor/plugins/file_column/TODO +6 -0
  98. data/vendor/plugins/file_column/init.rb +12 -0
  99. data/vendor/plugins/file_column/lib/file_column.rb +719 -0
  100. data/vendor/plugins/file_column/lib/file_column_helper.rb +145 -0
  101. data/vendor/plugins/file_column/lib/file_compat.rb +28 -0
  102. data/vendor/plugins/file_column/lib/magick_file_column.rb +188 -0
  103. data/vendor/plugins/file_column/lib/validations.rb +112 -0
  104. data/vendor/plugins/file_column/test/abstract_unit.rb +90 -0
  105. data/vendor/plugins/file_column/test/connection.rb +17 -0
  106. data/vendor/plugins/file_column/test/file_column_helper_test.rb +97 -0
  107. data/vendor/plugins/file_column/test/file_column_test.rb +630 -0
  108. data/vendor/plugins/file_column/test/fixtures/entry.rb +32 -0
  109. data/vendor/plugins/file_column/test/fixtures/invalid-image.jpg +1 -0
  110. data/vendor/plugins/file_column/test/fixtures/kerb.jpg +0 -0
  111. data/vendor/plugins/file_column/test/fixtures/mysql.sql +25 -0
  112. data/vendor/plugins/file_column/test/fixtures/schema.rb +10 -0
  113. data/vendor/plugins/file_column/test/fixtures/skanthak.png +0 -0
  114. data/vendor/plugins/file_column/test/magick_test.rb +251 -0
  115. data/vendor/plugins/file_column/test/magick_view_only_test.rb +21 -0
  116. data/vendor/plugins/guid/README.TXT +19 -0
  117. data/vendor/plugins/guid/init.rb +23 -0
  118. data/vendor/plugins/guid/lib/usesguid.rb +37 -0
  119. data/vendor/plugins/guid/lib/uuid22.rb +43 -0
  120. data/vendor/plugins/guid/lib/uuidtools.rb +565 -0
  121. metadata +83 -15
  122. data/db/ROOT/CV.txt +0 -166
  123. data/lib/file_column.rb +0 -263
  124. data/lib/file_column_helper.rb +0 -45
  125. /data/{lib → vendor/plugins/file_column/lib}/rails_file_column.rb +0 -0
data/db/schema.sql CHANGED
@@ -19,16 +19,15 @@ CREATE DATABASE parlement_development
19
19
  \connect parlement_development manu
20
20
 
21
21
 
22
- CREATE SEQUENCE people_id_seq;
23
22
  CREATE TABLE people (
24
- id text PRIMARY KEY default nextval('public.people_id_seq'),
23
+ id text PRIMARY KEY,
25
24
  created_on timestamp with time zone NOT NULL DEFAULT now(),
26
25
  name TEXT UNIQUE,
27
26
  email text
28
27
  );
29
28
 
30
29
  INSERT INTO people (id, name, email)
31
- VALUES ('echarp', 'echarp', 'manu@noos.fr');
30
+ VALUES ('echarp', 'echarp', 'manu@localhost');
32
31
 
33
32
  --CREATE TABLE "users" (
34
33
  -- id SERIAL PRIMARY KEY,
@@ -69,9 +68,8 @@ CREATE TABLE "users" (
69
68
  --VALUES (0, 'echarp', 'manu@echarp.org', '5640f07556079f0f2259f9ad12c6758515dedf94');
70
69
 
71
70
 
72
- CREATE SEQUENCE elts_id_seq;
73
71
  CREATE TABLE elts (
74
- id text PRIMARY KEY default nextval('public.elts_id_seq'),
72
+ id text PRIMARY KEY,
75
73
  parent_id text REFERENCES elts,
76
74
  position float,
77
75
  created_on timestamp with time zone NOT NULL DEFAULT now(),
@@ -82,44 +80,42 @@ CREATE TABLE elts (
82
80
 
83
81
  INSERT INTO elts (id, subject) VALUES ('ROOT', '');
84
82
 
85
- CREATE SEQUENCE mails_id_seq;
86
83
  CREATE TABLE mails (
87
- id text PRIMARY KEY default nextval('public.mails_id_seq'),
84
+ id text PRIMARY KEY,
88
85
  elt_id text NOT NULL REFERENCES elts,
89
86
  message text,
90
87
  mail_parents text,
91
88
  file text
92
89
  );
93
90
 
94
- CREATE SEQUENCE attachments_id_seq;
95
91
  CREATE TABLE attachments (
96
- id text PRIMARY KEY default nextval('attachments_id_seq'),
92
+ id text PRIMARY KEY,
97
93
  elt_id text NOT NULL REFERENCES elts,
98
94
  created_on timestamp with time zone NOT NULL DEFAULT now(),
99
95
  content_type text,
100
96
  file text
101
97
  );
102
98
 
103
- CREATE SEQUENCE subscribers_id_seq;
99
+ -- The people_elts relationship
104
100
  CREATE TABLE subscribers (
105
- id text PRIMARY KEY default nextval('public.subscribers_id_seq'),
106
101
  elt_id text NOT NULL REFERENCES elts,
107
- email text,
108
- confirmed boolean NOT NULL default false
102
+ person_id text NOT NULL REFERENCES people
109
103
  );
110
104
 
111
- INSERT INTO subscribers(elt_id, email, confirmed)
112
- VALUES ('ROOT', 'manu', true);
105
+ INSERT INTO subscribers(elt_id, person_id)
106
+ VALUES ('ROOT', 'echarp');
113
107
 
114
108
  CREATE TABLE choices (
115
109
  elt_id text NOT NULL REFERENCES elts,
116
110
  person_id text NOT NULL REFERENCES people,
111
+ created_on timestamp with time zone NOT NULL DEFAULT now(),
117
112
  PRIMARY KEY (elt_id, person_id)
118
113
  );
119
114
 
120
115
  CREATE TABLE delegations (
121
116
  elt_id text NOT NULL REFERENCES elts,
122
117
  person_id text NOT NULL REFERENCES people,
118
+ created_on timestamp with time zone NOT NULL DEFAULT now(),
123
119
  temporary boolean NOT NULL DEFAULT false,
124
120
  delegate_to text NOT NULL REFERENCES people,
125
121
  PRIMARY KEY (elt_id, person_id)
data/lib/data_import.rb CHANGED
@@ -14,7 +14,7 @@ def inputDir(directory)
14
14
  end
15
15
 
16
16
  Dir.foreach(directory) do |d|
17
- if (d != '.' and d != '..')
17
+ if (d != '.' and d != '..' and d != '.svn')
18
18
  dir = directory+'/'+d
19
19
  if (File.directory?(dir) or File.symlink?(dir))
20
20
  #puts 'dir: '+dir
@@ -38,6 +38,8 @@ def inputFile(d, fileName)
38
38
  end
39
39
 
40
40
  if elt.created_on == nil or elt.created_on < file.mtime
41
+ elt.mail = nil
42
+
41
43
  elt.parent_id = d
42
44
  elt.created_on = file.mtime
43
45
  puts elt.created_on.class