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,19 @@
|
|
1
|
+
class CreateVisits < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :visits do |t|
|
4
|
+
t.column :person_id, :string
|
5
|
+
t.column :elt_id, :string, :null => false
|
6
|
+
t.column :created_on, :datetime, :null => false
|
7
|
+
t.column :updated_on, :datetime
|
8
|
+
t.column :filter, :integer, :default => 0
|
9
|
+
end
|
10
|
+
|
11
|
+
execute 'ALTER TABLE visits ADD CONSTRAINT visits_elt_person_key UNIQUE ( elt_id, person_id ) '
|
12
|
+
execute 'ALTER TABLE visits ADD CONSTRAINT visits_elt_id FOREIGN KEY ( elt_id ) REFERENCES elts( id ) ON UPDATE CASCADE ON DELETE CASCADE'
|
13
|
+
execute 'ALTER TABLE visits ADD CONSTRAINT visits_person_id FOREIGN KEY ( person_id ) REFERENCES people( id ) ON UPDATE CASCADE ON DELETE CASCADE '
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.down
|
17
|
+
drop_table :visits
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateOldVisits < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :old_visits do |t|
|
4
|
+
t.column :person_id, :string
|
5
|
+
t.column :elt_id, :string, :null => false
|
6
|
+
t.column :created_on, :datetime, :null => false
|
7
|
+
t.column :updated_on, :datetime
|
8
|
+
t.column :filter, :integer, :default => 0
|
9
|
+
end
|
10
|
+
|
11
|
+
execute 'ALTER TABLE old_visits ADD CONSTRAINT old_visits_elt_person_key UNIQUE ( elt_id, person_id ) '
|
12
|
+
execute 'ALTER TABLE old_visits ADD CONSTRAINT old_visits_elt_id FOREIGN KEY ( elt_id ) REFERENCES elts( id ) ON UPDATE CASCADE ON DELETE CASCADE'
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.down
|
16
|
+
drop_table :old_visits
|
17
|
+
end
|
18
|
+
end
|
data/db/schema.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
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(:version =>
|
5
|
+
ActiveRecord::Schema.define(:version => 9) do
|
6
6
|
|
7
7
|
create_table "attachments", :force => true do |t|
|
8
8
|
t.column "elt_id", :text, :null => false
|
@@ -58,11 +58,22 @@ ActiveRecord::Schema.define(:version => 6) do
|
|
58
58
|
t.column "file", :text
|
59
59
|
end
|
60
60
|
|
61
|
+
create_table "old_visits", :force => true do |t|
|
62
|
+
t.column "person_id", :string
|
63
|
+
t.column "elt_id", :string, :null => false
|
64
|
+
t.column "created_on", :datetime, :null => false
|
65
|
+
t.column "updated_on", :datetime
|
66
|
+
t.column "filter", :integer, :default => 0
|
67
|
+
end
|
68
|
+
|
69
|
+
add_index "old_visits", ["person_id", "elt_id"], :name => "old_visits_elt_person_key", :unique => true
|
70
|
+
|
61
71
|
create_table "people", :force => true do |t|
|
62
72
|
t.column "created_on", :datetime, :null => false
|
63
73
|
t.column "name", :text
|
64
74
|
t.column "email", :text
|
65
75
|
t.column "image", :text
|
76
|
+
t.column "last_login", :datetime
|
66
77
|
end
|
67
78
|
|
68
79
|
add_index "people", ["name"], :name => "people_name_key", :unique => true
|
@@ -106,4 +117,14 @@ ActiveRecord::Schema.define(:version => 6) do
|
|
106
117
|
|
107
118
|
add_index "usersold", ["person_id"], :name => "usersold_person_id_key", :unique => true
|
108
119
|
|
120
|
+
create_table "visits", :force => true do |t|
|
121
|
+
t.column "person_id", :string
|
122
|
+
t.column "elt_id", :string, :null => false
|
123
|
+
t.column "created_on", :datetime, :null => false
|
124
|
+
t.column "updated_on", :datetime
|
125
|
+
t.column "filter", :integer, :default => 0
|
126
|
+
end
|
127
|
+
|
128
|
+
add_index "visits", ["person_id", "elt_id"], :name => "visits_elt_person_key", :unique => true
|
129
|
+
|
109
130
|
end
|
Binary file
|
Binary file
|
@@ -15,6 +15,9 @@ var myrules = {
|
|
15
15
|
|
16
16
|
/* Called for each element to set its knobs */
|
17
17
|
function setKnobs(elt) {
|
18
|
+
// To not filter out the top element
|
19
|
+
if (elt.parentNode.getAttribute('class') == 'top') return;
|
20
|
+
|
18
21
|
var knobOpened = document.createElement("a");
|
19
22
|
Element.addClassName(knobOpened, "knobOpened");
|
20
23
|
knobOpened.href = "#";
|
@@ -37,10 +40,12 @@ function setKnobs(elt) {
|
|
37
40
|
* the filter
|
38
41
|
*/
|
39
42
|
function setKnob(elt, result) {
|
43
|
+
// To not filter out the top element
|
44
|
+
if (elt.parentNode.getAttribute('class') == 'top') return;
|
45
|
+
|
40
46
|
var f = document.filterForm.filter;
|
41
47
|
var filter = parseInt(f.options[f.selectedIndex].value);
|
42
48
|
|
43
|
-
Element.removeClassName(elt, 'opened');
|
44
49
|
if (filter == 'null' || result >= filter) {
|
45
50
|
Element.removeClassName(elt, 'closed');
|
46
51
|
} else if (result < filter) {
|
@@ -114,9 +119,14 @@ function setCookie(name, value) {
|
|
114
119
|
|
115
120
|
|
116
121
|
/*
|
117
|
-
*
|
122
|
+
* The parameter 'filter' is not the value itself, but an index!
|
118
123
|
*/
|
119
|
-
function setFilter(filter) {
|
124
|
+
function setFilter(filter, elt) {
|
125
|
+
setCookie('filter', document.filterForm.filter.selectedIndex);
|
126
|
+
|
127
|
+
new Ajax.Updater('listByVote', '/elt/listByVote/'+elt, { asynchronous:true, evalScripts:true });
|
128
|
+
new Ajax.Updater('listByDate', '/elt/listByDate/'+elt, { asynchronous:true, evalScripts:true });
|
129
|
+
|
120
130
|
document.getElementsByClassName('result').each( function(result) {
|
121
131
|
//alert(parseInt(result.innerHTML)+', '+filter);
|
122
132
|
Element.removeClassName(result.parentNode.parentNode.parentNode, 'opened');
|
@@ -126,7 +136,6 @@ function setFilter(filter) {
|
|
126
136
|
Element.addClassName(result.parentNode.parentNode.parentNode, 'closed');
|
127
137
|
}
|
128
138
|
});
|
129
|
-
setCookie('filter', document.filterForm.filter.selectedIndex);
|
130
139
|
}
|
131
140
|
|
132
141
|
function setFilterFromCookie() {
|
@@ -67,8 +67,7 @@ h1 input {
|
|
67
67
|
|
68
68
|
#elt_parlement > form > .created_on, #elt_parlement > .knobOpened,
|
69
69
|
#elt_parlement > * > h1 a, #elt_fr > form > .created_on, #elt_fr > .knobOpened,
|
70
|
-
#elt_fr > * > h1 a {
|
71
|
-
display: none; }
|
70
|
+
#elt_fr > * > h1 a { display: none; }
|
72
71
|
|
73
72
|
legend, a:link, select, input[type='Button'], input[type='submit'] { color: #3b76ae; }
|
74
73
|
a:visited { color: #1b568e; }
|
@@ -136,6 +135,10 @@ h1 .help {
|
|
136
135
|
/ __| |/ _` |/ _ \ '_ \ / _` | '__|
|
137
136
|
\__ \ | (_| | __/ |_) | (_| | |
|
138
137
|
|___/_|\__,_|\___|_.__/ \__,_|_| */
|
138
|
+
#spinner img {
|
139
|
+
position: absolute;
|
140
|
+
right: 4.5%;
|
141
|
+
top: 3em; }
|
139
142
|
.sidebar, .links {
|
140
143
|
text-align: center;
|
141
144
|
background: white;
|
@@ -168,22 +171,26 @@ h1 .help {
|
|
168
171
|
letter-spacing: 0.5em; }
|
169
172
|
.signets { font-size: smaller; }
|
170
173
|
|
171
|
-
.boxTitle {
|
172
|
-
color: #ff4;
|
173
|
-
text-align: left;
|
174
|
-
font-size: medium;
|
175
|
-
font-weight: bolder;
|
176
|
-
padding: 0.3em 0.6em;
|
177
|
-
border: outset thin #3b76ae;
|
178
|
-
background: #3b76ae url(/images/Sleep-Deprivation-5.JPG); }
|
179
174
|
.box {
|
180
|
-
padding: 1px;
|
181
175
|
background: #ccc;
|
182
176
|
font-size: smaller;
|
183
177
|
margin-bottom: 1em;
|
184
178
|
padding-bottom: 0.5em;
|
185
179
|
border: outset thin #ccc;
|
186
180
|
border-top: none; }
|
181
|
+
.boxTitle {
|
182
|
+
color: #ff4;
|
183
|
+
text-align: left;
|
184
|
+
font-size: medium;
|
185
|
+
font-weight: bolder;
|
186
|
+
padding: 0.3em 0.6em;
|
187
|
+
background: #3b76ae url(/images/Sleep-Deprivation-5.JPG); }
|
188
|
+
.feed {
|
189
|
+
width: 28px;
|
190
|
+
height: 28px;
|
191
|
+
float: right;
|
192
|
+
margin: 1px 5px 0 0; }
|
193
|
+
.feed img { max-width: 100%; }
|
187
194
|
.boxLine {
|
188
195
|
text-align: left;
|
189
196
|
margin-left: 1em; }
|
@@ -193,30 +200,33 @@ h1 .help {
|
|
193
200
|
.boxMore {
|
194
201
|
text-align: right;
|
195
202
|
font-weight: bolder; }
|
203
|
+
.box .filter { display: none; }
|
204
|
+
.box:hover .filter { display: inline; }
|
196
205
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
206
|
+
.identity form { display: block; }
|
207
|
+
.identity #edit, .identity iframe { display: none; }
|
208
|
+
.identity:hover #edit { display: block; }
|
209
|
+
.identity fieldset#edit {
|
201
210
|
border: solid thin yellow;
|
202
211
|
padding: 0.5em 0;
|
203
212
|
margin: 0.5em 0; }
|
204
|
-
|
213
|
+
.identity fieldset#edit label { color: #3b76ae; }
|
205
214
|
img.avatar {
|
206
215
|
float: left;
|
207
216
|
width: auto;
|
208
217
|
max-width: 30%;
|
209
218
|
_max-width: none;
|
210
219
|
margin-right: 1em; }
|
211
|
-
|
220
|
+
.identity img.avatar {
|
212
221
|
float: none;
|
213
222
|
margin: 0 auto;
|
214
223
|
display: block;
|
215
224
|
max-width: 90%;
|
216
225
|
_max-width: none;
|
217
226
|
width: expression((offsetWidth > document.body.offsetWidth*0.3) ? "100%" : offsetWidth); }
|
227
|
+
.elt .identity img.avatar { float: left; }
|
218
228
|
|
219
|
-
#filter {
|
229
|
+
#filter select {
|
220
230
|
border: none;
|
221
231
|
text-align: center; }
|
222
232
|
form#filterForm a {
|
@@ -224,20 +234,20 @@ form#filterForm a {
|
|
224
234
|
font-weight: bolder; }
|
225
235
|
form#filterForm input[type='submit'] { display: none; }
|
226
236
|
|
227
|
-
|
237
|
+
#listByDate ul, #listByVote ul {
|
228
238
|
margin: 0 3px;
|
229
239
|
padding: 0; }
|
230
|
-
|
240
|
+
#listByDate ul li.boxLine, #listByVote ul li.boxLine {
|
231
241
|
background: none;
|
232
242
|
border-bottom: solid 1px #fd8; }
|
233
|
-
|
234
|
-
|
235
|
-
|
243
|
+
#listByDate .created_on, #listByVote .created_on { display: none; }
|
244
|
+
#listByDate .author, #listByVote .author { font-size: smaller; }
|
245
|
+
#listByDate .result, #listByVote .result {
|
236
246
|
font-weight: bolder;
|
237
247
|
float: right;
|
238
248
|
color: blue; }
|
239
249
|
|
240
|
-
div#
|
250
|
+
div#listSubscribers .boxLineR { font-size: smaller; }
|
241
251
|
|
242
252
|
.box h4 {
|
243
253
|
margin: 0;
|
@@ -417,27 +427,21 @@ li.pager {
|
|
417
427
|
border: solid 1px #fd8;
|
418
428
|
text-decoration: none;
|
419
429
|
font-weight: bolder;
|
420
|
-
|
421
|
-
|
422
|
-
margin-left: -
|
430
|
+
background: white; }
|
431
|
+
.knobOpened {;
|
432
|
+
margin-left: -16px;
|
433
|
+
position: absolute; }
|
423
434
|
.knobOpened:link, .knobOpened:visited, .knobClosed:link, .knobClosed:visited {
|
424
435
|
color: orange; }
|
425
436
|
|
426
|
-
.closed
|
427
|
-
|
428
|
-
|
429
|
-
.closed
|
430
|
-
|
431
|
-
|
432
|
-
display:
|
433
|
-
|
434
|
-
.opened blockquote, .opened ol, .opened hr, .opened ul, .opened img, .opened div.tooLarge,
|
435
|
-
.opened .eltQuickAdd {
|
436
|
-
display: block; }
|
437
|
-
.opened label, .opened .result, .opened .author { display: inline; }
|
438
|
-
|
439
|
-
.closed { color: #ddd; }
|
440
|
-
.closed .opened { color: black; }
|
437
|
+
.closed .knobOpened, .elt .knobClosed,
|
438
|
+
.closed form, .closed ul.eltSub, .closed ul.eltNew, .closed .eltSubsClose { display: none; }
|
439
|
+
|
440
|
+
.closed, .closed .knobClosed {
|
441
|
+
position: relative;
|
442
|
+
background: white;
|
443
|
+
display: inline;
|
444
|
+
right: 8px; }
|
441
445
|
|
442
446
|
/* _ _
|
443
447
|
_ __ ___ ___ ____ | |__ ___ _ __ __| | ___ _ __
|