comparison app/helpers/projects_helper.rb @ 159:4e485928a26b cannam-pre-20110113-merge

* Simplify table construction, with name and description in the same cell and some layout tidying. Eliminates minor bug that made name and description highlight separately on mouseover.
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 28 Jan 2011 11:01:43 +0000
parents 4272e09f4b5f
children 05f9a2a9c753
comparison
equal deleted inserted replaced
149:e7c03e1738fb 159:4e485928a26b
193 end 193 end
194 194
195 classes = (ancestors.empty? ? 'root' : 'child') 195 classes = (ancestors.empty? ? 'root' : 'child')
196 196
197 s << "<tr class='#{oddeven} #{classes} level#{level}'>" 197 s << "<tr class='#{oddeven} #{classes} level#{level}'>"
198 s << "<td class='firstcol name hosted_here'>" << link_to_project(project, {}, :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}") << "</td>" 198 s << "<td class='firstcol' align=top><div class='name hosted_here"
199 s << "<td class='managers' rowspan=2 align=top>" 199 s << " no_description" if project.description.blank?
200 s << "'>" << link_to_project(project, {}, :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}");
201 s << "</div>"
202 unless project.description.blank?
203 s << "<div class='wiki description'>"
204 s << textilizable(project.short_description, :project => project)
205 s << "</div>"
206 end
207
208 s << "<td class='managers' align=top>"
200 209
201 u = project.users_by_role 210 u = project.users_by_role
202 if u 211 if u
203 u.keys.each do |r| 212 u.keys.each do |r|
204 if r.allowed_to?(:edit_project) 213 if r.allowed_to?(:edit_project)
214 end 223 end
215 end 224 end
216 end 225 end
217 226
218 s << "</td>" 227 s << "</td>"
219 s << "<td class='created_on' rowspan=2 align=top>" << format_date(project.created_on) << "</td>" 228 s << "<td class='created_on' align=top>" << format_date(project.created_on) << "</td>"
220 s << "<td class='updated_on' rowspan=2 align=top>" << format_date(project.updated_on) << "</td>" 229 s << "<td class='updated_on' align=top>" << format_date(project.updated_on) << "</td>"
221 230
222 s << "</tr>"
223 s << "<tr class='#{oddeven} #{classes}'>"
224 s << "<td class='firstcol wiki description'>"
225 s << textilizable(project.short_description, :project => project) unless project.description.blank?
226 s << "</td>"
227 s << "</tr>" 231 s << "</tr>"
228 232
229 ancestors << project 233 ancestors << project
230 end 234 end
231 235