Changeset 1137
- Timestamp:
- 08/22/07 10:29:55 (1 year ago)
- Files:
-
- trunk/app/controllers/documents_controller.rb (modified) (2 diffs)
- trunk/app/views/documents/share.rhtml (modified) (2 diffs)
- trunk/app/views/users/_people.rhtml (modified) (2 diffs)
- trunk/db/schema.rb (modified) (6 diffs)
- trunk/public/stylesheets/screen.css (modified) (5 diffs)
- trunk/test/fixtures/groups.yml (modified) (1 diff)
- trunk/test/fixtures/reviews.yml (modified) (1 diff)
- trunk/test/fixtures/subscriptions.yml (modified) (3 diffs)
- trunk/test/fixtures/users.yml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/controllers/documents_controller.rb
r1130 r1137 127 127 end 128 128 129 130 129 def search_nonsubscribers 131 130 input = params[:input].nil? ? "" : params[:input].downcase … … 135 134 not (user.name.downcase.include?(input) or (not user.username.nil? and user.username.downcase.include?(input))) 136 135 end 137 render :partial => "users/people", :object => @people, 138 :locals => { :empty => "Aucun utilisateur ne correspond", :draggable => true } 136 render :partial => "users/people", :object => @people, :locals => { :empty => "Aucun utilisateur ne correspond", :draggable => true } 139 137 end 140 138 end trunk/app/views/documents/share.rhtml
r1130 r1137 1 1 <h2>Publier votre document</h2> 2 <% if @document.casts.empty? %> 3 <p> 4 Le contenu publiable sera disponible dans quelques minutes 5 </p> 2 <% if @document.uploaded? %> 3 <% if @document.casts.empty? %> 4 <p>Le contenu publiable sera disponible dans quelques minutes.</p> 5 <% else %> 6 <p> 7 Pour publier votre document dans un site internet, utilisez l'adresse suivante: <%= link_to(url_for(:controller => 'casts', :action => 'play', :name => @document.casts.first.name, :only_path => false), :controller => 'casts', :action => 'play', :name => @document.casts.first.name) %> 8 </p> 9 <% end %> 6 10 <% else %> 7 <p> 8 Pour publier votre document dans un site internet, utilisez l'adresse suivante: <%= link_to(url_for(:controller => 'casts', :action => 'play', :name => @document.casts.first.name, :only_path => false), :controller => 'casts', :action => 'play', :name => @document.casts.first.name) %> 9 </p> 11 <p>Le contenu publiable sera disponible dÚs que vous aurez <%= link_to("déposé votre fichier ›", {:action => "upload", :id => @document }) %></p> 10 12 <% end %> 11 12 13 <hr/> 13 14 14 <h2>Partager votre document</h2> 15 15 <ul> 16 16 <%= render :partial => "documents/documents", :object => @document.to_a, :locals => { :linked => true, :empty => "Aucun document ne correspond ...", :actions => false, :tags => false } %> 17 17 </ul> 18 19 18 <hr/> 20 21 <h4>N'ont pas accÚs à ce document :</h4> 22 19 <h4 class="left">N'ont pas accÚs à ce document :</h4> 20 <% form_tag({ :controller => "documents", :action => "search_nonsubscribers" }, { :method => :post, :id => :filter }) do %> 21 <p> 22 <%= text_field_tag("input", "rechercher") %> 23 <%= hidden_field_tag("id", @document.id ) %> 24 </p> 25 <% end %> 26 <%= observe_form(:filter, { :url => { :controller => "documents", :action => "search_nonsubscribers" }, :update => :users, :frequency => 3 }) %> 23 27 <ul id="users"> 24 28 <%= render :partial => "users/people", :object => @document.nonsubscribers, :locals => { :empty => "Reposer ici les utilisateurs qui ne doivent pas avoir accÚs à ce document" } %> 25 29 </ul> 26 30 <%= drop_receiving_element("users", :url => { :controller => "subscriptions", :action => "remove", :document => @document }) %> 27 28 <% form_remote_tag :update => "users", :url => { :controller => "documents", :action => "search_nonsubscribers" } do %>29 <p>30 <label>Sélection: </label><%= text_field_tag("input") %>31 <%= hidden_field_tag("id", @document.id ) %>32 </p>33 <% end %>34 35 31 <hr/> 36 32 <h4>Ont accÚs à ce document :</h4> … … 39 35 </ul> 40 36 <%= drop_receiving_element("subscribers", :url => { :controller => "subscriptions", :action => "add", :document => @document }) %> 41 trunk/app/views/users/_people.rhtml
r1130 r1137 10 10 11 11 <li id="<%= "#{entry_type}_#{entry.id}" %>" class="vcard"> 12 13 12 <% case entry_type 14 13 when "user" %> … … 17 16 <span class="org"><%= entry.organization %></span> 18 17 <% when "group" %> 19 <%= image_tag(" avatar-group.png", :class => "photo") %>18 <%= image_tag("group.png", :class => "photo") %> 20 19 <span class="fn"><%= entry.name %></span> 21 20 <% end %> trunk/db/schema.rb
r1129 r1137 6 6 7 7 create_table "casts", :force => true do |t| 8 t.column "document_id", :integer, :null => false9 t.column "name", :string, : default => "", :null => false8 t.column "document_id", :integer, :null => false 9 t.column "name", :string, :null => false 10 10 end 11 11 … … 15 15 16 16 create_table "documents", :force => true do |t| 17 t.column "title", :string, :default => "",:null => false18 t.column "description", :string, :default => "",:null => false17 t.column "title", :string, :null => false 18 t.column "description", :string, :null => false 19 19 t.column "author_id", :integer, :null => false 20 20 t.column "length", :integer, :default => 0, :null => false 21 21 t.column "size", :integer, :default => 0, :null => false 22 22 t.column "format", :string, :default => "application/octet-stream", :null => false 23 t.column "type", :string, :default => "",:null => false23 t.column "type", :string, :null => false 24 24 t.column "uploaded", :boolean, :default => false 25 25 t.column "updated_at", :datetime … … 32 32 33 33 create_table "groups", :force => true do |t| 34 t.column "name", :string, : default => "", :null => false34 t.column "name", :string, :null => false 35 35 t.column "description", :string 36 t.column "owner_id", :integer, :null => false36 t.column "owner_id", :integer, :null => false 37 37 end 38 38 … … 74 74 75 75 create_table "reviews", :force => true do |t| 76 t.column "document_id", :integer, :null => false77 t.column "user_id", :integer, :null => false78 t.column "rating", :integer, :null => false79 t.column "description", :string, : default => "", :null => false80 t.column "created_at", :datetime, :null => false76 t.column "document_id", :integer, :null => false 77 t.column "user_id", :integer, :null => false 78 t.column "rating", :integer, :null => false 79 t.column "description", :string, :null => false 80 t.column "created_at", :datetime, :null => false 81 81 end 82 82 … … 90 90 91 91 create_table "subscriptions", :force => true do |t| 92 t.column "document_id", :integer, :null => false93 t.column "author_id", :integer, :null => false94 t.column "subscriber_id", :integer, :null => false92 t.column "document_id", :integer, :null => false 93 t.column "author_id", :integer, :null => false 94 t.column "subscriber_id", :integer, :null => false 95 95 t.column "download_count", :integer, :default => 0 96 96 t.column "created_at", :datetime 97 t.column "subscriber_type", :string, :default => "",:null => false97 t.column "subscriber_type", :string, :null => false 98 98 end 99 99 … … 103 103 104 104 create_table "uploads", :force => true do |t| 105 t.column "document_id", :integer, :null => false106 t.column "key", :string, : default => "", :null => false105 t.column "document_id", :integer, :null => false 106 t.column "key", :string, :null => false 107 107 end 108 108 109 109 create_table "users", :force => true do |t| 110 t.column "username", :string, :default => ""111 t.column "password", :string, :default => ""112 t.column "name", :string, :default => "",:null => false113 t.column "email", :string, :default => "",:null => false110 t.column "username", :string, :null => false 111 t.column "password", :string, :null => false 112 t.column "name", :string, :null => false 113 t.column "email", :string, :null => false 114 114 t.column "organization", :string 115 115 t.column "confirmed", :boolean, :default => false trunk/public/stylesheets/screen.css
r1108 r1137 1 body { 2 margin: 0; 3 padding: 0; 4 font: 14px Trebuchet MS, Verdana, sans-serif; 5 } 6 h1, h2, h3, h4, h5, div, ul, p { 7 margin: 0; 8 padding: 0; 9 list-style-type: square; 10 } 1 body { margin: 0; padding: 0; font: 14px Trebuchet MS, Verdana, sans-serif; } 2 h1, h2, h3, h4, h5, div, ul, p, ul { margin: 0; padding: 0; } 3 ul { list-style-type: square; } 11 4 a { color: #5884a6; text-decoration: none; } 12 5 a:hover { text-decoration: underline; } 13 6 form { margin: 12px; } 14 input, textarea { padding: 4px; font-weight: normal; font-size: 120%;}7 input, textarea { font-family: Trebuchet MS, Verdana, sans-serif; padding: 4px; font-weight: normal; font-size: 100%; } 15 8 input.openid { padding-left: 24px; background: url("../images/openid.png") no-repeat 4px; } 16 9 hr { display: none; clear: both; } … … 24 17 #access { display: none; } 25 18 26 #header { 27 border-bottom: 4px solid #ccc; 28 background: #333; 29 } 30 #header div { 31 height: 100px; 32 width: 750px; 33 margin: 0 auto; 34 background: url("../images/audiobank.png") no-repeat 0px 10px; 35 } 19 #header { border-bottom: 4px solid #ccc; background: #333; } 20 #header div { position: relative; height: 100px; width: 750px; margin: 0 auto; background: url("../images/audiobank.png") no-repeat 0px 10px; } 36 21 #header h1 { display: none; } 37 22 #header a { font-size: 90%; color: #fff; } 38 #header div ul { 39 float: right; 40 margin-top: 70px; 41 padding: 0; 42 font-size: 90%; 43 list-style: none; 44 } 45 #header ul li { 46 float: left; 47 margin: 0 0 0 8px; 48 padding: 0; 49 background: #66af16 url("../images/corner.png") no-repeat top right; 50 } 51 #header ul li a { 52 float: left; 53 display: block; 54 padding: 6px 10px; 55 text-decoration: none; 56 color: #fff; 57 font: normal 115% "Trebuchet MS", sans-serif; 58 } 59 #header ul li a:hover { 60 color: #333; 61 background: #a3de5b url("../images/corner-over.png") no-repeat top right; 62 } 23 #header div ul { position: absolute; bottom: 0; right: 0; padding: 0; font-size: 90%; list-style: none; } 24 #header ul li { float: left; margin: 0 0 0 8px; padding: 0; background: #66af16 url("../images/corner.png") no-repeat top right; } 25 #header ul li a { float: left; display: block; padding: 6px 10px; text-decoration: none; color: #fff; font: normal 115% "Trebuchet MS", sans-serif; } 26 #header ul li a:hover { color: #333; background: #a3de5b url("../images/corner-over.png") no-repeat top right; } 63 27 64 #frame { 65 margin: 0; 66 padding: 18px 0; 67 clear: both; 68 } 69 #wrap { 70 width: 750px; 71 margin: 0 auto; 72 background: #fff url("../images/frame-bg.png") repeat-y top left; 73 } 28 #frame { margin: 0; padding: 18px 0; clear: both; } 29 #wrap { width: 750px; margin: 0 auto; background: #fff url("../images/frame-bg.png") repeat-y top left; } 74 30 #frame ul { margin: 4px 0; list-style-type: none; } 75 #frame h1 { 76 font: normal 145% "Georgia", serif; 77 color: #66af16; 78 margin: 6px 0; 79 } 80 #frame h2 { 81 font: normal 120% "Georgia", serif; 82 margin: 6px 0; 83 color: #7dacd1; 84 clear: both; 85 border-bottom: 1px solid #7dacd1; 86 } 87 #frame .actions, #frame .tags { 88 clear: both; 89 margin: 0 0 6px; 90 padding: 4px 0; 91 font-size: 90%; 92 text-align: right; 93 border-top: 1px solid #ccc; 94 } 95 #frame .details { 96 position: absolute; 97 top: 10px; 98 right: 0; 99 font-size: 90%; 100 } 101 #frame .tags { 102 margin: 6px 0 0; 103 padding: 6px 20px; 104 text-align: left; 105 background: url("../images/tags.png") no-repeat 0px 6px; 106 } 31 #frame h1 { font: normal 145% "Georgia", serif; color: #66af16; margin: 6px 0; } 32 #frame h2 { font: normal 120% "Georgia", serif; margin: 6px 0; color: #7dacd1; clear: both; border-bottom: 1px solid #7dacd1; } 33 #frame .actions, #frame .tags { clear: both; margin: 0 0 6px; padding: 4px 0; font-size: 90%; text-align: right; border-top: 1px solid #ccc; } 34 #frame .details { position: absolute; top: 10px; right: 0; font-size: 90%; } 35 #frame .tags { margin: 6px 0 0; padding: 6px 20px; text-align: left; background: url("../images/tags.png") no-repeat 0px 6px; } 107 36 #frame .details span, #frame .actions span, #frame .icon { margin: 0; padding: 0 4px 0 20px; } 108 37 #frame .actions a, #frame .details a { color: #000; padding: 2px 2px 2px 20px; margin-left: 6px; } … … 124 53 #frame .author { float: left; background: url("../images/author.png") no-repeat; } 125 54 126 #content { 127 float: right; 128 width: 510px; 129 margin: 0 0 0 40px; 130 } 55 #content { float: right; width: 510px; margin: 0 0 0 40px; } 131 56 #content h3, #content h3 a { text-decoration: none; color: #6b2; margin-bottom: 6px; } 132 57 #content h4 { margin: 12px 0 0; color: #5884a6; } … … 135 60 #content li p, #content form p { margin: 0; } 136 61 #content li.vcard { float: left; width: 45%; padding: 10px 0; } 137 #content li.vcard img.photo { 138 float: left; 139 margin: 0 10px 0 0; 140 text-align: center; 141 padding: 2px; 142 border: 1px solid #ccc; 143 background: #fff; 144 } 145 #content li.vcard span.fn { 146 display: block; 147 margin-bottom: 5px; 148 } 149 #content li.hreview { 150 position: relative; 151 padding: 15px; 152 border-bottom: 1px solid #E5DFC7; 153 border-right: 1px solid #E5DFC7; 154 background: #f2f2f2; 155 } 156 #content li.hreview img.photo { 157 float: left; 158 margin: 0 10px 4px 0; 159 padding: 2px; 160 border: 1px solid #ccc; 161 } 162 #content li.hreview span.reviewer { 163 padding: 0; 164 margin: 0 0 6px 0; 165 font-weight: bold; 166 font-size: 100%; 167 border: none; 168 } 169 #content li.hreview abbr.rating { 170 float: right; 171 margin: 0; 172 border: none; 173 } 174 #content li.hreview blockquote.description { 175 margin: 2px 0 6px 56px; 176 padding: 0; 177 line-height: 1.5em; 178 } 179 180 #content a.rel-tag { 181 line-height: 2em; 182 margin: 0 2px 0 0; 183 padding: 3px 5px; 184 border-right: 1px solid #ccc; 185 border-bottom: 1px solid #ccc; 186 background: #f2f2f2; 187 } 62 #content li.vcard img.photo { float: left; margin: 0 10px 0 0; text-align: center; padding: 2px; border: 1px solid #ccc; background: #fff; } 63 #content li.vcard span.fn { display: block; margin-bottom: 5px; } 64 #content li.hreview { position: relative; padding: 15px; border-bottom: 1px solid #e5dfc7; border-right: 1px solid #e5dfc7; background: #f2f2f2; } 65 #content li.hreview img.photo { float: left; margin: 0 10px 4px 0; padding: 2px; border: 1px solid #ccc; } 66 #content li.hreview span.reviewer { padding: 0; margin: 0 0 6px 0; font-weight: bold; font-size: 100%; border: none; } 67 #content li.hreview abbr.rating { float: right; margin: 0; border: none; } 68 #content li.hreview blockquote.description { margin: 2px 0 6px 56px; padding: 0; line-height: 1.5em; } 69 #content #filter { float: right; margin: 0; } 70 #content #filter p { margin: 0; } 71 #content #filter input { padding: 1px 4px; font-size: 90%; color: #333; margin-top: 9px; } 72 #content a.rel-tag { line-height: 2em; margin: 0 2px 0 0; padding: 3px 5px; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; background: #f2f2f2; } 188 73 #content a:hover.rel-tag { text-decoration: none; background: #efefef; } 189 74 ul#welcome { margin: 16px 100px 16px 14px; } 190 #welcome li {191 margin: 6px;192 color: #000;193 padding: 4px 4px 4px 28px;194 background: #fff url("../images/tick.png") no-repeat 4px 4px;195 }196 75 197 #subscribers, #users, #members { 198 clear: both; 199 border: 1px solid #5884a6; 200 } 201 #subscribers li, #users li, #members li { 202 padding: 12px; 203 margin: 2px 12px; 204 cursor: pointer; 205 } 76 #welcome li { margin: 6px; color: #000; padding: 4px 4px 4px 28px; background: #fff url("../images/tick.png") no-repeat 4px 4px; } 206 77 207 #sidebar { 208 float: left; 209 width: 200px; 210 margin: 0 0 20px 0; 211 } 212 #sidebar ul { 213 margin: 0 0 12px 22px; 214 padding: 0; 215 list-style-type: square; 216 } 217 #sidebar li { 218 margin: 3px 0; 219 padding: 6px 0 0 0; 220 font-size: 100%; 221 } 78 #subscribers, #users, #members { clear: both; border: 1px solid #5884a6; } 79 #subscribers li, #users li, #members li { padding: 12px; margin: 2px 12px; cursor: pointer; } 80 81 #sidebar { float: left; width: 200px; margin: 0 0 20px 0; } 82 #sidebar ul { margin: 0 0 12px 22px; padding: 0; list-style-type: square; } 83 #sidebar li { margin: 3px 0; padding: 6px 0 0 0; font-size: 100%; } 222 84 #sidebar li a { color : #000; } 223 #sidebar sup { 224 font-size: 70%; 225 } 226 #sidebar p { 227 text-indent: 4px; 228 font-size: 90%; 229 margin: 4px; 230 } 231 #search { 232 margin: 0.2em 0 1em; 233 } 234 #search input { 235 float: left; 236 padding: 0; 237 width: 174px; 238 } 239 #search input.image { 240 float: right; 241 width: 20px; 242 height: 20px; 243 border: none; 244 } 85 #sidebar sup { font-size: 70%; } 86 #sidebar p { text-indent: 4px; font-size: 90%; margin: 4px; } 87 #search { margin: 0.2em 0 1em; } 88 #search input { float: left; padding: 0; width: 174px; } 89 #search input.image { float: right; width: 20px; height: 20px; border: none; } 245 90 246 91 #status { margin: 1em 0; } … … 249 94 250 95 #messages { padding: 0 0 12px; background: #fff; } 251 #flash { 252 margin: 6px 0; 253 padding: 12px 0; 254 font-size: 115%; 255 font-weight: bold; 256 text-indent: 54px; 257 border-top: 1px solid #979797; 258 border-bottom: 1px solid #979797; 259 background: #e7e7e7 url("../images/notice.png") no-repeat 28px; 260 } 261 #messages .success { 262 color: #1e7a1b; 263 border-color: #4bb426; 264 background: #b7e1af url("../images/success.png") no-repeat 28px; 265 } 266 #messages .failure { 267 color: #c01100; 268 border-color: #ca4f35;; 269 background: #ffbdbd url("../images/failure.png") no-repeat 28px; 270 } 271 #messages .warning { 272 color: #c67109; 273 border-color: #c67109; 274 background: #f8e694 url("../images/warning.png") no-repeat 28px; 275 } 96 #flash { margin: 6px 0; padding: 12px 0; font-size: 115%; font-weight: bold; text-indent: 54px; border-top: 1px solid #979797; border-bottom: 1px solid #979797; background: #e7e7e7 url("../images/notice.png") no-repeat 28px; } 97 #messages .success { color: #1e7a1b; border-color: #4bb426; background: #b7e1af url("../images/success.png") no-repeat 28px; } 98 #messages .failure { color: #c01100; border-color: #ca4f35; background: #ffbdbd url("../images/failure.png") no-repeat 28px; } 99 #messages .warning { color: #c67109; border-color: #c67109; background: #f8e694 url("../images/warning.png") no-repeat 28px; } 276 100 277 #errors ul { 278 margin: 0 12px 14px 14px; 279 list-style-type: square; 280 } 101 #errors ul { margin: 0 12px 14px 14px; list-style-type: square; } 281 102 #errors li { margin: 6px; } 282 103 283 104 p#cloud { margin-bottom: 8px; } 284 #labels_auto_complete ul { 285 margin: 0; 286 padding: 0; 287 list-style-type: none; 288 border: 1px solid #ccc; 289 background: #fff; 290 } 291 #labels_auto_complete li { 292 cursor: default; 293 margin: 0; 294 padding: 7px 5px; 295 border-top: 1px solid #ccc; 296 background: #fff; 297 } 105 #labels_auto_complete ul { margin: 0; padding: 0; list-style-type: none; border: 1px solid #ccc; background: #fff; } 106 #labels_auto_complete li { cursor: default; margin: 0; padding: 7px 5px; border-top: 1px solid #ccc; background: #fff; } 298 107 #labels_auto_complete li.selected { background: #c9e9b3; } 299 108 300 #footer { 301 display: none; 302 clear: both; 303 color: #333; 304 line-height: 18px; 305 margin: 0; 306 padding: 24px 0; 307 background: #e7db9f; 308 } 309 #footer div { 310 width: 760px; 311 margin: 0 auto; 312 text-align: left; 313 } 314 315 #wrap:after, #content .vcard:after, #subscribers:after, #users:after, #members:after, #content .hreview:after, #search:after { 316 content: "."; 317 display: block; 318 height: 0; 319 clear: both; 320 visibility: hidden; 321 } 109 #footer { display: none; clear: both; color: #333; line-height: 18px; margin: 0; padding: 24px 0; background: #e7db9f; } 110 #footer div { width: 760px; margin: 0 auto; text-align: left; } 111 #wrap:after, #content .vcard:after, #subscribers:after, #users:after, #members:after, #content .hreview:after, #search:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 322 112 * html #wrap, * html #content .vcard, * html #subscribers, * html #users, * html #members, * html #search { height: 1%; } trunk/test/fixtures/groups.yml
r1108 r1137 2 2 one: 3 3 id: 1 4 name: Sesame Street 5 owner_id: 3 4 6 two: 5 7 id: 2 8 name: Jump Street 9 owner_id: 3 trunk/test/fixtures/reviews.yml
r738 r1137 1 1 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 first:2 kermit: 3 3 id: 1 4 another: 4 document_id: 4 5 user_id: 2 6 rating: 0 7 description: I've got the exact same one ! Goddamn Elmo! 8 created_at: <%= DateTime.now %> 9 elmo: 5 10 id: 2 11 document_id: 4 12 user_id: 3 13 rating: 0 14 description: Hihi, hihi ... 15 created_at: <%= DateTime.now %> trunk/test/fixtures/subscriptions.yml
r562 r1137 5 5 author_id: 1 6 6 subscriber_id: 2 7 subscriber_type: User 7 8 second: 8 9 id: 2 … … 10 11 author_id: 2 11 12 subscriber_id: 1 13 subscriber_type: User 12 14 third: 13 15 id: 3 … … 15 17 author_id: 2 16 18 subscriber_id: 3 19 subscriber_type: User trunk/test/fixtures/users.yml
r1125 r1137 6 6 password: <%= User.digest_password("bert") %> 7 7 email: ernie@sesamestreet.com 8 confirmed: true 8 9 ernie: 9 10 id: 2 … … 12 13 password: <%= User.digest_password("ernie") %> 13 14 email: bert@sesamestreet.com 15 confirmed: true 14 16 elmo: 15 17 id: 3
