summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/helpers/issues_helper.rb6
-rw-r--r--app/models/custom_field.rb1
-rw-r--r--app/models/enumeration.rb5
-rw-r--r--app/models/issue_status.rb1
-rw-r--r--app/models/project.rb1
-rw-r--r--app/models/role.rb1
-rw-r--r--app/models/tracker.rb3
-rw-r--r--app/models/user.rb3
-rw-r--r--app/views/admin/projects.rhtml2
-rw-r--r--app/views/documents/_document.rhtml3
-rw-r--r--app/views/issues/_history.rhtml2
-rw-r--r--app/views/issues/_list_simple.rhtml2
-rw-r--r--app/views/issues/change_status.rhtml2
-rw-r--r--app/views/issues/show.rhtml6
-rw-r--r--app/views/my/blocks/_calendar.rhtml2
-rw-r--r--app/views/my/blocks/_documents.rhtml14
-rw-r--r--app/views/my/blocks/_latest_news.rhtml16
-rw-r--r--app/views/my/page.rhtml8
-rw-r--r--app/views/my/page_layout.rhtml16
-rw-r--r--app/views/news/_news.rhtml4
-rw-r--r--app/views/news/show.rhtml4
-rw-r--r--app/views/projects/activity.rhtml12
-rw-r--r--app/views/projects/calendar.rhtml2
-rw-r--r--app/views/projects/changelog.rhtml2
-rw-r--r--app/views/projects/export_issues_pdf.rfpdf3
-rw-r--r--app/views/projects/gantt.rhtml2
-rw-r--r--app/views/projects/list.rhtml2
-rw-r--r--app/views/projects/list_documents.rhtml14
-rw-r--r--app/views/projects/list_issues.rhtml2
-rw-r--r--app/views/projects/list_news.rhtml13
-rw-r--r--app/views/projects/show.rhtml15
-rw-r--r--app/views/users/_form.rhtml2
-rw-r--r--app/views/welcome/index.rhtml11
-rw-r--r--public/stylesheets/application.css3
34 files changed, 73 insertions, 112 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 93bd6c050..d73258939 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -56,9 +56,9 @@ module IssuesHelper
unless no_html
label = content_tag('strong', label)
- old_value = content_tag("i", old_value) if old_value
- old_value = content_tag("strike", old_value) if old_value and !value
- value = content_tag("i", value) if value
+ old_value = content_tag("i", h(old_value)) if old_value
+ old_value = content_tag("strike", h(old_value)) if old_value and !value
+ value = content_tag("i", h(value)) if value
end
if value
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb
index 924a874a3..2f5f2749f 100644
--- a/app/models/custom_field.rb
+++ b/app/models/custom_field.rb
@@ -28,6 +28,7 @@ class CustomField < ActiveRecord::Base
validates_presence_of :name, :field_format
validates_uniqueness_of :name
+ validates_format_of :name, :with => /^[\w\s\'\-]*$/i
validates_inclusion_of :field_format, :in => FIELD_FORMATS.keys
validates_presence_of :possible_values, :if => Proc.new { |field| field.field_format == "list" }
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb
index b5c8ed6e7..0d6554f82 100644
--- a/app/models/enumeration.rb
+++ b/app/models/enumeration.rb
@@ -18,8 +18,9 @@
class Enumeration < ActiveRecord::Base
before_destroy :check_integrity
- validates_presence_of :opt, :name
- validates_uniqueness_of :name, :scope => [:opt]
+ validates_presence_of :opt, :name
+ validates_uniqueness_of :name, :scope => [:opt]
+ validates_format_of :name, :with => /^[\w\s\'\-]*$/i
OPTIONS = {
"IPRI" => :enumeration_issue_priorities,
diff --git a/app/models/issue_status.rb b/app/models/issue_status.rb
index c8a40d330..b821df258 100644
--- a/app/models/issue_status.rb
+++ b/app/models/issue_status.rb
@@ -21,6 +21,7 @@ class IssueStatus < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
+ validates_format_of :name, :with => /^[\w\s\'\-]*$/i
validates_length_of :html_color, :is => 6
validates_format_of :html_color, :with => /^[a-f0-9]*$/i
diff --git a/app/models/project.rb b/app/models/project.rb
index 83197dfde..e8493cb3b 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -31,6 +31,7 @@ class Project < ActiveRecord::Base
validates_presence_of :name, :description
validates_uniqueness_of :name
validates_associated :custom_values, :on => :update
+ validates_format_of :name, :with => /^[\w\s\'\-]*$/i
# returns 5 last created projects
def self.latest
diff --git a/app/models/role.rb b/app/models/role.rb
index 6908095e9..4761b75ad 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -23,6 +23,7 @@ class Role < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
+ validates_format_of :name, :with => /^[\w\s\'\-]*$/i
private
def check_integrity
diff --git a/app/models/tracker.rb b/app/models/tracker.rb
index a4376a351..041525f0f 100644
--- a/app/models/tracker.rb
+++ b/app/models/tracker.rb
@@ -23,7 +23,8 @@ class Tracker < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
-
+ validates_format_of :name, :with => /^[\w\s\'\-]*$/i
+
private
def check_integrity
raise "Can't delete tracker" if Issue.find(:first, :conditions => ["tracker_id=?", self.id])
diff --git a/app/models/user.rb b/app/models/user.rb
index a82c98a88..0287006c6 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -32,7 +32,8 @@ class User < ActiveRecord::Base
validates_presence_of :login, :firstname, :lastname, :mail
validates_uniqueness_of :login, :mail
# Login must contain lettres, numbers, underscores only
- validates_format_of :login, :with => /^[a-z0-9_]+$/i
+ validates_format_of :firstname, :lastname, :with => /^[\w\s\'\-]*$/i
+ validates_format_of :login, :with => /^[a-z0-9_\-@\.]+$/i
validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
# Password length between 4 and 12
validates_length_of :password, :in => 4..12, :allow_nil => true
diff --git a/app/views/admin/projects.rhtml b/app/views/admin/projects.rhtml
index 0772c4e8b..bcf7cba43 100644
--- a/app/views/admin/projects.rhtml
+++ b/app/views/admin/projects.rhtml
@@ -17,7 +17,7 @@
<% for project in @projects %>
<tr class="<%= cycle("odd", "even") %>">
<td><%= link_to project.name, :controller => 'projects', :action => 'settings', :id => project %>
- <td><%= project.description %>
+ <td><%=h project.description %>
<td align="center"><%= image_tag 'true' if project.is_public? %>
<td align="center"><%= project.projects_count %>
<td align="center"><%= format_date(project.created_on) %>
diff --git a/app/views/documents/_document.rhtml b/app/views/documents/_document.rhtml
new file mode 100644
index 000000000..55864ee82
--- /dev/null
+++ b/app/views/documents/_document.rhtml
@@ -0,0 +1,3 @@
+<p><%= link_to h(document.title), :controller => 'documents', :action => 'show', :id => document %><br />
+<% unless document.description.empty? %><%=h truncate document.description, 250 %><br /><% end %>
+<em><%= format_time(document.created_on) %></em></p> \ No newline at end of file
diff --git a/app/views/issues/_history.rhtml b/app/views/issues/_history.rhtml
index 6dc2a84be..da58b7d6c 100644
--- a/app/views/issues/_history.rhtml
+++ b/app/views/issues/_history.rhtml
@@ -6,6 +6,6 @@
<% end %>
</ul>
<% if journal.notes? %>
- <%= simple_format auto_link journal.notes %>
+ <%= simple_format auto_link h(journal.notes) %>
<% end %>
<% end %>
diff --git a/app/views/issues/_list_simple.rhtml b/app/views/issues/_list_simple.rhtml
index 94b63d613..cd2355376 100644
--- a/app/views/issues/_list_simple.rhtml
+++ b/app/views/issues/_list_simple.rhtml
@@ -15,7 +15,7 @@
<td><p class="small"><%= issue.project.name %> - <%= issue.tracker.name %><br />
<%= issue.status.name %> - <%= format_time(issue.updated_on) %></p></td>
<td>
- <p class="small"><%= link_to issue.subject, :controller => 'issues', :action => 'show', :id => issue %></p>
+ <p class="small"><%= link_to h(issue.subject), :controller => 'issues', :action => 'show', :id => issue %></p>
</td>
</tr>
<% end %>
diff --git a/app/views/issues/change_status.rhtml b/app/views/issues/change_status.rhtml
index 2ef87183d..38ca82ea2 100644
--- a/app/views/issues/change_status.rhtml
+++ b/app/views/issues/change_status.rhtml
@@ -1,4 +1,4 @@
-<h2><%=l(:label_issue)%> #<%= @issue.id %>: <%= @issue.subject %></h2>
+<h2><%=l(:label_issue)%> #<%= @issue.id %>: <%=h @issue.subject %></h2>
<%= error_messages_for 'issue' %>
<%= start_form_tag({:action => 'change_status', :id => @issue}, :class => "tabular") %>
diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml
index f01612aec..93b8cd008 100644
--- a/app/views/issues/show.rhtml
+++ b/app/views/issues/show.rhtml
@@ -2,7 +2,7 @@
<%= l(:label_export_to) %><%= link_to 'PDF', {:action => 'export_pdf', :id => @issue}, :class => 'pic picPdf' %>
</div>
-<h2><%= @issue.tracker.name %> #<%= @issue.id %> - <%= @issue.subject %></h2>
+<h2><%= @issue.tracker.name %> #<%= @issue.id %> - <%=h @issue.subject %></h2>
<div class="box">
<table width="100%">
@@ -12,7 +12,7 @@
</tr>
<tr>
<td><b><%=l(:field_assigned_to)%> :</b></td><td><%= @issue.assigned_to ? @issue.assigned_to.name : "-" %></td>
- <td><b><%=l(:field_category)%> :</b></td><td><%= @issue.category ? @issue.category.name : "-" %></td>
+ <td><b><%=l(:field_category)%> :</b></td><td><%=h @issue.category ? @issue.category.name : "-" %></td>
</tr>
<tr>
<td><b><%=l(:field_author)%> :</b></td><td><%= link_to_user @issue.author %></td>
@@ -29,7 +29,7 @@
<tr>
<% n = 0
for custom_value in @custom_values %>
- <td><b><%= custom_value.custom_field.name %> :</b></td><td><%= show_value custom_value %></td>
+ <td><b><%= custom_value.custom_field.name %> :</b></td><td><%=h show_value custom_value %></td>
<% n = n + 1
if (n > 1)
n = 0 %>
diff --git a/app/views/my/blocks/_calendar.rhtml b/app/views/my/blocks/_calendar.rhtml
index 2d7930f52..fd221bcb4 100644
--- a/app/views/my/blocks/_calendar.rhtml
+++ b/app/views/my/blocks/_calendar.rhtml
@@ -34,7 +34,7 @@ while day <= @date_to
elsif day == i.due_date
image_tag('arrow_to')
end %>
- <small><%= link_to "#{i.tracker.name} ##{i.id}", :controller => 'issues', :action => 'show', :id => i %>: <%= i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small><br />
+ <small><%= link_to "#{i.tracker.name} ##{i.id}", :controller => 'issues', :action => 'show', :id => i %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small><br />
<% end %>
</td>
<%= '</tr><tr height="100">' if day.cwday >= 7 and day!=@date_to %>
diff --git a/app/views/my/blocks/_documents.rhtml b/app/views/my/blocks/_documents.rhtml
index 5fa8c7980..8e7f6bc50 100644
--- a/app/views/my/blocks/_documents.rhtml
+++ b/app/views/my/blocks/_documents.rhtml
@@ -1,15 +1,7 @@
<h3><%=l(:label_document_plural)%></h3>
-<ul>
-<% for document in Document.find :all,
+<%= render(:partial => 'documents/document',
+ :collection => Document.find(:all,
:limit => 10,
:conditions => "documents.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})",
- :include => [:project] %>
- <li>
- <b><%= link_to document.title, :controller => 'documents', :action => 'show', :id => document %></b>
- <br />
- <%= truncate document.description, 150 %><br />
- <em><%= format_time(document.created_on) %></em><br />&nbsp;
- </li>
-<% end unless @user.projects.empty? %>
-</ul> \ No newline at end of file
+ :include => [:project])) unless @user.projects.empty? %> \ No newline at end of file
diff --git a/app/views/my/blocks/_latest_news.rhtml b/app/views/my/blocks/_latest_news.rhtml
index 85430ef54..625603ac0 100644
--- a/app/views/my/blocks/_latest_news.rhtml
+++ b/app/views/my/blocks/_latest_news.rhtml
@@ -1,13 +1,7 @@
<h3><%=l(:label_news_latest)%></h3>
-<ul>
-<% for news in News.find :all,
- :limit => 10,
- :conditions => "news.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})",
- :include => [:project, :author] %>
- <li><%= link_to news.title, :controller => 'news', :action => 'show', :id => news %><br />
- <% unless news.summary.empty? %><%= news.summary %><br /><% end %>
- <em><%= news.author.name %>, <%= format_time(news.created_on) %></em><br />&nbsp;
- </li>
-<% end unless @user.projects.empty? %>
-</ul> \ No newline at end of file
+<%= render (:partial => 'news/news',
+ :collection => News.find(:all,
+ :limit => 10,
+ :conditions => "news.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})",
+ :include => [:project, :author])) unless @user.projects.empty? %> \ No newline at end of file
diff --git a/app/views/my/page.rhtml b/app/views/my/page.rhtml
index 121d48ca9..989d01397 100644
--- a/app/views/my/page.rhtml
+++ b/app/views/my/page.rhtml
@@ -1,9 +1,9 @@
-<h2><%=l(:label_my_page)%></h2>
-
-<div class="topright">
- <small><%= link_to l(:label_personalize_page), :action => 'page_layout' %></small>
+<div class="contextual">
+ <%= link_to l(:label_personalize_page), :action => 'page_layout' %>
</div>
+<h2><%=l(:label_my_page)%></h2>
+
<div id="list-top">
<% @blocks['top'].each do |b| %>
<div class="mypage-box">
diff --git a/app/views/my/page_layout.rhtml b/app/views/my/page_layout.rhtml
index 59a38567d..d3346bd7d 100644
--- a/app/views/my/page_layout.rhtml
+++ b/app/views/my/page_layout.rhtml
@@ -34,11 +34,10 @@ function removeBlock(block) {
</script>
-<div style="float:right;">
+<div class="contextual">
+<span id="indicator" style="display:none"><%= image_tag "loading.gif", :align => "absmiddle" %></span>
<%= start_form_tag({:action => "add_block"}, :id => "block-form") %>
-
-<%= select_tag 'block', "<option></option>" + options_for_select(@block_options), :id => "block-select", :class => "select-small" %>
-<small>
+<%= select_tag 'block', "<option></option>" + options_for_select(@block_options), :id => "block-select" %>
<%= link_to_remote l(:button_add),
:url => { :action => "add_block" },
:with => "Form.serialize('block-form')",
@@ -48,16 +47,9 @@ function removeBlock(block) {
:loading => "Element.show('indicator')",
:loaded => "Element.hide('indicator')"
%>
-</small>
-<%= end_form_tag %>
-<small>|
+<%= end_form_tag %> |
<%= link_to l(:button_save), :action => 'page_layout_save' %> |
<%= link_to l(:button_cancel), :action => 'page' %>
-</small>
-</div>
-
-<div style="float:right;margin-right:20px;">
-<span id="indicator" style="display:none"><%= image_tag "loading.gif" %></span>
</div>
<h2><%=l(:label_my_page)%></h2>
diff --git a/app/views/news/_news.rhtml b/app/views/news/_news.rhtml
new file mode 100644
index 000000000..75a80d634
--- /dev/null
+++ b/app/views/news/_news.rhtml
@@ -0,0 +1,4 @@
+<p><%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %><br />
+<% unless news.summary.empty? %><%=h news.summary %><br /><% end %>
+<em><%= news.author.name %>, <%= format_time(news.created_on) %></em><br />
+<%= news.comments_count %> <%= lwr(:label_comment, news.comments_count).downcase %><br /></p>
diff --git a/app/views/news/show.rhtml b/app/views/news/show.rhtml
index e5f199fa2..374bf72af 100644
--- a/app/views/news/show.rhtml
+++ b/app/views/news/show.rhtml
@@ -3,9 +3,9 @@
<%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy', :id => @news}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
</div>
-<h2><%= @news.title %></h2>
+<h2><%=h @news.title %></h2>
-<p><em><%= @news.summary %><br />
+<p><em><%=h @news.summary %><br />
<%= @news.author.display_name %>, <%= format_time(@news.created_on) %></em></p>
<br />
<%= textilizable auto_link @news.description %>
diff --git a/app/views/projects/activity.rhtml b/app/views/projects/activity.rhtml
index 9afe8ff25..9a4a07aff 100644
--- a/app/views/projects/activity.rhtml
+++ b/app/views/projects/activity.rhtml
@@ -18,20 +18,20 @@
<% @events_by_day[day].sort {|x,y| y.created_on <=> x.created_on }.each do |e| %>
<li><p>
<% if e.is_a? Issue %>
- <%= e.created_on.strftime("%H:%M") %> <%= link_to "#{e.tracker.name} ##{e.id}", :controller => 'issues', :action => 'show', :id => e %> (<%= e.status.name %>): <%= e.subject %><br />
+ <%= e.created_on.strftime("%H:%M") %> <%= link_to "#{e.tracker.name} ##{e.id}", :controller => 'issues', :action => 'show', :id => e %> (<%= e.status.name %>): <%=h e.subject %><br />
<i><%= e.author.name %></i>
<% elsif e.is_a? News %>
- <%= e.created_on.strftime("%H:%M") %> <%=l(:label_news)%>: <%= link_to e.title, :controller => 'news', :action => 'show', :id => e %><br />
- <% unless e.summary.empty? %><%= e.summary %><br /><% end %>
+ <%= e.created_on.strftime("%H:%M") %> <%=l(:label_news)%>: <%= link_to h(e.title), :controller => 'news', :action => 'show', :id => e %><br />
+ <% unless e.summary.empty? %><%=h e.summary %><br /><% end %>
<i><%= e.author.name %></i>
<% elsif (e.is_a? Attachment) and (e.container.is_a? Version) %>
- <%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%> (<%= e.container.name %>): <%= link_to e.filename, :controller => 'projects', :action => 'list_files', :id => @project %><br />
+ <%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%> (<%=h e.container.name %>): <%= link_to e.filename, :controller => 'projects', :action => 'list_files', :id => @project %><br />
<i><%= e.author.name %></i>
<% elsif (e.is_a? Attachment) and (e.container.is_a? Document) %>
- <%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%>: <%= e.filename %> (<%= link_to e.container.title, :controller => 'documents', :action => 'show', :id => e.container %>)<br />
+ <%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%>: <%= e.filename %> (<%= link_to h(e.container.title), :controller => 'documents', :action => 'show', :id => e.container %>)<br />
<i><%= e.author.name %></i>
<% elsif e.is_a? Document %>
- <%= e.created_on.strftime("%H:%M") %> <%=l(:label_document)%>: <%= link_to e.title, :controller => 'documents', :action => 'show', :id => e %><br />
+ <%= e.created_on.strftime("%H:%M") %> <%=l(:label_document)%>: <%= link_to h(e.title), :controller => 'documents', :action => 'show', :id => e %><br />
<% end %>
</p></li>
diff --git a/app/views/projects/calendar.rhtml b/app/views/projects/calendar.rhtml
index 2781f98c9..9b0c26ed4 100644
--- a/app/views/projects/calendar.rhtml
+++ b/app/views/projects/calendar.rhtml
@@ -50,7 +50,7 @@ while day <= @date_to
elsif day == i.due_date
image_tag('arrow_to')
end %>
- <small><%= link_to "#{i.tracker.name} ##{i.id}", :controller => 'issues', :action => 'show', :id => i %>: <%= i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small><br />
+ <small><%= link_to "#{i.tracker.name} ##{i.id}", :controller => 'issues', :action => 'show', :id => i %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small><br />
<% end %>
</td>
<%= '</tr><tr height="100">' if day.cwday >= 7 and day!=@date_to %>
diff --git a/app/views/projects/changelog.rhtml b/app/views/projects/changelog.rhtml
index 081456413..e59df059d 100644
--- a/app/views/projects/changelog.rhtml
+++ b/app/views/projects/changelog.rhtml
@@ -23,6 +23,6 @@
<ul>
<% ver_id = issue.fixed_version_id
end %>
- <li><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %> [<%= issue.tracker.name %>]: <%= issue.subject %></li>
+ <li><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %> [<%= issue.tracker.name %>]: <%=h issue.subject %></li>
<% end %>
</div> \ No newline at end of file
diff --git a/app/views/projects/export_issues_pdf.rfpdf b/app/views/projects/export_issues_pdf.rfpdf
index 2e0acf54b..09592d391 100644
--- a/app/views/projects/export_issues_pdf.rfpdf
+++ b/app/views/projects/export_issues_pdf.rfpdf
@@ -1,10 +1,9 @@
<% pdf=IfpdfHelper::IFPDF.new
pdf.AliasNbPages
pdf.footer_date = format_date(Date.today)
- pdf.AddPage
@issues.each {|i|
- render :partial => 'issues/pdf', :locals => { :pdf => pdf, :issue => i }
pdf.AddPage
+ render :partial => 'issues/pdf', :locals => { :pdf => pdf, :issue => i }
}
%>
diff --git a/app/views/projects/gantt.rhtml b/app/views/projects/gantt.rhtml
index 206186f08..7fbe02757 100644
--- a/app/views/projects/gantt.rhtml
+++ b/app/views/projects/gantt.rhtml
@@ -103,7 +103,7 @@ top = headers_heigth + 8
@issues.each do |i| %>
<div style="position: absolute;line-height:1em;height:16px;top:<%= top %>px;left:4px;width:<%= subject_width - 5 %>px;overflow:hidden;">
<small><%= link_to "#{i.tracker.name} ##{i.id}", :controller => 'issues', :action => 'show', :id => i %>:
- <%= i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small>
+ <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small>
</div>
<% top = top + 20
end %>
diff --git a/app/views/projects/list.rhtml b/app/views/projects/list.rhtml
index 0137086d9..69e2c064f 100644
--- a/app/views/projects/list.rhtml
+++ b/app/views/projects/list.rhtml
@@ -10,7 +10,7 @@
<% for project in @projects %>
<tr class="<%= cycle("odd", "even") %>">
<td><%= link_to project.name, :action => 'show', :id => project %>
- <td><%= project.description %>
+ <td><%=h project.description %>
<td align="center"><%= format_date(project.created_on) %>
</tr>
<% end %>
diff --git a/app/views/projects/list_documents.rhtml b/app/views/projects/list_documents.rhtml
index 0b630e922..c24785f69 100644
--- a/app/views/projects/list_documents.rhtml
+++ b/app/views/projects/list_documents.rhtml
@@ -8,16 +8,6 @@
<% documents = @documents.group_by {|d| d.category } %>
<% documents.each do |category, docs| %>
-<h3><%= category.name %></h3>
-<ul>
-<% docs.each do |d| %>
- <li>
- <b><%= link_to d.title, :controller => 'documents', :action => 'show', :id => d %></b>
- <br />
- <%= truncate d.description, 250 %><br />
- <em><%= format_time(d.created_on) %></em><br />&nbsp;
- </li>
-
-<% end %>
-</ul>
+ <h3><%= category.name %></h3>
+ <%= render :partial => 'documents/document', :collection => docs %>
<% end %> \ No newline at end of file
diff --git a/app/views/projects/list_issues.rhtml b/app/views/projects/list_issues.rhtml
index 5f0d0282a..190aab838 100644
--- a/app/views/projects/list_issues.rhtml
+++ b/app/views/projects/list_issues.rhtml
@@ -69,7 +69,7 @@
<td align="center"><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %></td>
<td align="center" style="font-weight:bold;color:#<%= issue.status.html_color %>;"><%= issue.status.name %></font></td>
<td align="center"><%= issue.tracker.name %></td>
- <td><%= link_to issue.subject, :controller => 'issues', :action => 'show', :id => issue %></td>
+ <td><%= link_to h(issue.subject), :controller => 'issues', :action => 'show', :id => issue %></td>
<td align="center"><%= issue.author.display_name %></td>
<td align="center"><%= format_time(issue.created_on) %></td>
<td align="center"><%= format_time(issue.updated_on) %></td>
diff --git a/app/views/projects/list_news.rhtml b/app/views/projects/list_news.rhtml
index 1427c07be..8d8f99668 100644
--- a/app/views/projects/list_news.rhtml
+++ b/app/views/projects/list_news.rhtml
@@ -5,16 +5,5 @@
<h2><%=l(:label_news_plural)%></h2>
<% if @news.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
-
-<ul>
-<% for news in @news %>
- <li><%= link_to news.title, :controller => 'news', :action => 'show', :id => news %><br />
- <% unless news.summary.empty? %><%= news.summary %><br /><% end %>
- <em><%= news.author.name %>, <%= format_time(news.created_on) %></em><br />
- <%= news.comments_count %> <%= lwr(:label_comment, news.comments_count).downcase %><br />&nbsp;
- </li>
-<% end %>
-</ul>
-
-
+<%= render :partial => 'news/news', :collection => @news %>
<%= pagination_links_full @news_pages %>
diff --git a/app/views/projects/show.rhtml b/app/views/projects/show.rhtml
index 79e36a586..46f17d9b9 100644
--- a/app/views/projects/show.rhtml
+++ b/app/views/projects/show.rhtml
@@ -1,13 +1,13 @@
<h2><%=l(:label_overview)%></h2>
<div class="splitcontentleft">
- <%= simple_format(auto_link(@project.description)) %>
+ <%= simple_format(auto_link(h @project.description)) %>
<ul>
<% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %>
<li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li>
<% for custom_value in @custom_values %>
<% if !custom_value.value.empty? %>
- <li><%= custom_value.custom_field.name%>: <%= show_value(custom_value) %></li>
+ <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>
<% end %>
<% end %>
</ul>
@@ -32,7 +32,7 @@
<% end %>
</ul>
<% end %>
- <center><small>[ <%= link_to l(:label_issue_view_all), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %> ]</small></center>
+ <center><small><%= link_to l(:label_issue_view_all), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %></small></center>
</div>
</div>
@@ -55,13 +55,8 @@
<div class="box">
<h3><%=l(:label_news_latest)%></h3>
- <% for news in @news %>
- <p><b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br />
- <%= news.summary %>
- <small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small></p>
- <hr />
- <% end %>
- <center><small>[ <%= link_to l(:label_news_view_all), :controller => 'projects', :action => 'list_news', :id => @project %> ]</small></center>
+ <%= render :partial => 'news/news', :collection => @news %>
+ <center><small><%= link_to l(:label_news_view_all), :controller => 'projects', :action => 'list_news', :id => @project %></small></center>
</div>
</div>
diff --git a/app/views/users/_form.rhtml b/app/views/users/_form.rhtml
index 089d4d23c..989cb7559 100644
--- a/app/views/users/_form.rhtml
+++ b/app/views/users/_form.rhtml
@@ -11,7 +11,7 @@
<% for @custom_value in @custom_values %>
<p><%= custom_field_tag_with_label @custom_value %></p>
-<% end %>
+<% end if @custom_values%>
<p><%= f.check_box :admin %></p>
<p><%= f.check_box :mail_notification %></p>
diff --git a/app/views/welcome/index.rhtml b/app/views/welcome/index.rhtml
index abee85691..24c969e6f 100644
--- a/app/views/welcome/index.rhtml
+++ b/app/views/welcome/index.rhtml
@@ -4,14 +4,7 @@
<% if $RDM_WELCOME_TEXT %><p><%= $RDM_WELCOME_TEXT %></p><br /><% end %>
<div class="box">
<h3><%=l(:label_news_latest)%></h3>
- <% for news in @news %>
- <p>
- <b><%= news.title %></b> (<%= link_to_user news.author %> <%= format_time(news.created_on) %> - <%= news.project.name %>)<br />
- <% unless news.summary.empty? %><%= news.summary %><br /><% end %>
- [<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]
- </p>
- <hr />
- <% end %>
+ <%= render :partial => 'news/news', :collection => @news %>
</div>
</div>
@@ -22,7 +15,7 @@
<% for project in @projects %>
<li>
<%= link_to project.name, :controller => 'projects', :action => 'show', :id => project %> (<%= format_time(project.created_on) %>)<br />
- <%= project.description %>
+ <%=h project.description %>
</li>
<% end %>
</ul>
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index f00ffc62a..d85b025fe 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -473,6 +473,9 @@ float: right;
font-size: 0.8em;
}
+.contextual select {
+font-size: 1em;
+}
/***** CSS FORM ******/