diff options
Diffstat (limited to 'redmine/app/views/projects')
-rw-r--r-- | redmine/app/views/projects/_form.rhtml | 12 | ||||
-rw-r--r-- | redmine/app/views/projects/activity.rhtml | 12 | ||||
-rw-r--r-- | redmine/app/views/projects/add_issue.rhtml | 35 | ||||
-rw-r--r-- | redmine/app/views/projects/calendar.rhtml | 71 | ||||
-rw-r--r-- | redmine/app/views/projects/gantt.rfpdf | 161 | ||||
-rw-r--r-- | redmine/app/views/projects/gantt.rhtml | 241 | ||||
-rw-r--r-- | redmine/app/views/projects/list_issues.rhtml | 2 | ||||
-rw-r--r-- | redmine/app/views/projects/list_news.rhtml | 2 | ||||
-rw-r--r-- | redmine/app/views/projects/settings.rhtml | 133 | ||||
-rw-r--r-- | redmine/app/views/projects/show.rhtml | 2 |
10 files changed, 590 insertions, 81 deletions
diff --git a/redmine/app/views/projects/_form.rhtml b/redmine/app/views/projects/_form.rhtml index 889404bbc..ab0b35fab 100644 --- a/redmine/app/views/projects/_form.rhtml +++ b/redmine/app/views/projects/_form.rhtml @@ -3,7 +3,7 @@ <!--[form:project]--> <p><%= f.text_field :name, :required => true %></p> -<% if admin_loggedin? %> +<% if admin_loggedin? and !@root_projects.empty? %> <p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p> <% end %> @@ -14,11 +14,13 @@ <% for @custom_value in @custom_values %> <p><%= custom_field_tag_with_label @custom_value %></p> <% end %>
-
-<p><label><%=l(:label_custom_field_plural)%></label>
+ +<% unless @custom_fields.empty? %> +<p><label><%=l(:label_custom_field_plural)%></label> <% for custom_field in @custom_fields %> - <%= check_box_tag "custom_field_ids[]", custom_field.id, (@project.custom_fields.include? custom_field) %>
+ <%= check_box_tag "custom_field_ids[]", custom_field.id, ((@project.custom_fields.include? custom_field) or custom_field.is_for_all?), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %>
<%= custom_field.name %>
-<% end %></p>
+<% end %></p> +<% end %>
<!--[eoform:project]-->
</div> diff --git a/redmine/app/views/projects/activity.rhtml b/redmine/app/views/projects/activity.rhtml index 9f5a5d3c9..84275a6e6 100644 --- a/redmine/app/views/projects/activity.rhtml +++ b/redmine/app/views/projects/activity.rhtml @@ -3,8 +3,8 @@ <div>
<div class="rightbox">
<%= start_form_tag %>
- <p>From <%= text_field_tag 'date_from', @date_from, :size => 10, :class => 'button-small' %>
- and <%= text_field_tag 'days_back', @days_back, :size => 2, :class => 'button-small' %> days back</p>
+<p><%= select_month(@month, :prefix => "month", :discard_type => true) %>
+<%= select_year(@year, :prefix => "year", :discard_type => true) %></p>
<%= check_box_tag 'show_issues', 1, @show_issues %><%= hidden_field_tag 'show_issues', 0 %> <%=l(:label_issue_plural)%><br />
<%= check_box_tag 'show_news', 1, @show_news %><%= hidden_field_tag 'show_news', 0 %> <%=l(:label_news_plural)%><br />
<%= check_box_tag 'show_files', 1, @show_files %><%= hidden_field_tag 'show_files', 0 %> <%=l(:label_attachment_plural)%><br />
@@ -15,7 +15,7 @@ <% @events_by_day.keys.sort {|x,y| y <=> x }.each do |day| %>
<h3><%= format_date(day) %></h3>
<ul>
- <% @events_by_day[day].each do |e| %>
+ <% @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") %> <%= e.tracker.name %> <%= link_to e.long_id, :controller => 'issues', :action => 'show', :id => e %> (<%= e.status.name %>): <%= e.subject %><br />
@@ -36,8 +36,6 @@ <% end %>
</ul>
<% end %>
- <br />
-
-
-
+<% if @events_by_day.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
+<br />
</div>
\ No newline at end of file diff --git a/redmine/app/views/projects/add_issue.rhtml b/redmine/app/views/projects/add_issue.rhtml index 3e22940b3..b60f91a2e 100644 --- a/redmine/app/views/projects/add_issue.rhtml +++ b/redmine/app/views/projects/add_issue.rhtml @@ -5,23 +5,46 @@ <div class="box"> <!--[form:issue]--> <%= hidden_field_tag 'tracker_id', @tracker.id %> -
+ +<div class="splitcontentleft"> <p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p>
<p><%= f.select :assigned_to_id, (@issue.project.members.collect {|m| [m.name, m.user_id]}), :include_blank => true %></p>
<p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %></p>
+</div> +<div class="splitcontentright"> +<p><%= f.text_field :start_date, :size => 10 %><%= calendar_for('issue_start_date') %></p> +<p><%= f.text_field :due_date, :size => 10 %><%= calendar_for('issue_due_date') %></p> +<p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %></p> +</div> + +<div class="clear"> <p><%= f.text_field :subject, :size => 80, :required => true %></p> <p><%= f.text_area :description, :cols => 60, :rows => 10, :required => true %></p> -<p><%= f.text_field :due_date, :size => 10 %><%= calendar_for('issue_due_date') %></p> <% for @custom_value in @custom_values %> <p><%= custom_field_tag_with_label @custom_value %></p> <% end %>
-<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%> -<%= link_to_function image_tag('add', :align => "top"), "addFileField()" %></label> +<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%> +<%= link_to_function image_tag('add'), "addFileField()" %></label> <%= file_field_tag 'attachments[]', :size => 30 %></p> -<!--[eoform:issue]-->
-</div> +</div> +<!--[eoform:issue]--> +</div> <%= submit_tag l(:button_create) %>
+<% end %> + +<% unless $RDM_TEXTILE_DISABLED %> +<%= javascript_include_tag 'jstoolbar' %> +<script type="text/javascript"> +//<![CDATA[ +if (document.getElementById) { + if (document.getElementById('issue_description')) { + var commentTb = new jsToolBar(document.getElementById('issue_description')); + commentTb.draw(); + } +} +//]]> +</script> <% end %>
\ No newline at end of file diff --git a/redmine/app/views/projects/calendar.rhtml b/redmine/app/views/projects/calendar.rhtml new file mode 100644 index 000000000..236184fa3 --- /dev/null +++ b/redmine/app/views/projects/calendar.rhtml @@ -0,0 +1,71 @@ +<h2><%= l(:label_calendar) %></h2>
+
+<table width="100%">
+<tr>
+<td align="left">
+<%= start_form_tag :action => 'calendar', :id => @project %>
+<%= select_month(@month, :prefix => "month", :discard_type => true) %>
+<%= select_year(@year, :prefix => "year", :discard_type => true) %>
+<%= submit_tag l(:button_submit), :class => "button-small" %>
+<%= end_form_tag %>
+</td>
+<td align="right">
+<%= image_tag 'gantt' %>
+<%= link_to l(:label_gantt_chart), :action => 'gantt', :id => @project %>
+</td>
+</tr>
+</table>
+<br />
+
+<table class="calenderTable">
+<tr class="ListHead">
+<td></td>
+<% 1.upto(7) do |d| %>
+ <td align="center" width="14%"><%= day_name(d) %></td>
+<% end %>
+</tr>
+<tr height="100">
+<% day = @date_from
+while day <= @date_to
+ if day.cwday == 1 %>
+ <td valign="middle"><%= day.cweek %></td>
+ <% end %>
+ <td valign="top" width="14%" class="<%= day.month==@month ? "even" : "odd" %>">
+ <p align="right"><%= day==Date.today ? "<b>#{day.day}</b>" : day.day %></p>
+ <% day_issues = []
+ @issues.each { |i| day_issues << i if i.start_date == day or i.due_date == day }
+ day_issues.each do |i| %>
+ <%= if day == i.start_date and day == i.due_date
+ image_tag('arrow_bw')
+ elsif day == i.start_date
+ image_tag('arrow_from')
+ elsif day == i.due_date
+ image_tag('arrow_to')
+ end %>
+ <%= i.tracker.name %> <%= link_to i.id, :controller => 'issues', :action => 'show', :id => i %>: <small><%= i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small><br />
+ <% end %>
+ </td>
+ <%= '</tr><tr height="100">' if day.cwday >= 7 and day!=@date_to %>
+ <%
+ day = day + 1
+end %>
+</tr>
+</table>
+
+<table width="100%">
+<tr>
+<td align="left">
+<%= link_to_remote ('« ' + l(:label_previous)),
+ {:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }},
+ {:href => url_for(:action => 'calendar', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))}
+ %>
+</td>
+<td align="right">
+<%= link_to_remote (l(:label_next) + ' »'),
+ {:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }},
+ {:href => url_for(:action => 'calendar', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))}
+ %>
+
+</td>
+</tr>
+</table>
diff --git a/redmine/app/views/projects/gantt.rfpdf b/redmine/app/views/projects/gantt.rfpdf new file mode 100644 index 000000000..0ac0d75ff --- /dev/null +++ b/redmine/app/views/projects/gantt.rfpdf @@ -0,0 +1,161 @@ +<%
+pdf=IfpdfHelper::IFPDF.new
+pdf.AliasNbPages
+pdf.AddPage("L")
+pdf.SetFont('Arial','B',9)
+
+subject_width = 70
+header_heigth = 5
+
+headers_heigth = header_heigth
+show_weeks = false
+show_days = false
+
+if @months < 7
+ show_weeks = true
+ headers_heigth = 2*header_heigth
+ if @months < 3
+ show_days = true
+ headers_heigth = 3*header_heigth
+ end
+end
+
+g_width = 210
+zoom = (g_width) / (@date_to - @date_from + 1)
+g_height = 120
+t_height = g_height + headers_heigth
+
+
+#
+# Months headers
+#
+month_f = @date_from
+left = subject_width
+height = header_heigth
+@months.times do
+ width = ((month_f >> 1) - month_f) * zoom
+ pdf.SetY(20)
+ pdf.SetX(left)
+ pdf.Cell(width, height, "#{month_f.year}-#{month_f.month}", "LTR", 0, "C")
+ left = left + width
+ month_f = month_f >> 1
+end
+
+#
+# Weeks headers
+#
+if show_weeks
+ left = subject_width
+ height = header_heigth
+ if @date_from.cwday == 1
+ # @date_from is monday
+ week_f = @date_from
+ else
+ # find next monday after @date_from
+ week_f = @date_from + (7 - @date_from.cwday + 1)
+ width = (7 - @date_from.cwday + 1) * zoom-1
+ pdf.SetY(25)
+ pdf.SetX(left)
+ pdf.Cell(width + 1, height, "", "LTR")
+ left = left + width+1
+ end
+ while week_f < @date_to
+ width = (week_f + 6 <= @date_to) ? 7 * zoom : (@date_to - week_f + 1) * zoom
+ pdf.SetY(25)
+ pdf.SetX(left)
+ pdf.Cell(width, height, week_f.cweek.to_s, "LTR", 0, "C")
+ left = left + width
+ week_f = week_f+7
+ end
+end
+
+#
+# Days headers
+#
+if show_days
+ left = subject_width
+ height = header_heigth
+ wday = @date_from.cwday
+ pdf.SetFont('Arial','B',7)
+ (@date_to - @date_from + 1).to_i.times do
+ width = zoom
+ pdf.SetY(30)
+ pdf.SetX(left)
+ pdf.Cell(width, height, day_name(wday)[0,1], "LTR", 0, "C")
+ left = left + width
+ wday = wday + 1
+ wday = 1 if wday > 7
+ end
+end
+
+pdf.SetY(20)
+pdf.SetX(15)
+pdf.Cell(subject_width+g_width-15, headers_heigth, "", 1)
+
+
+#
+# Tasks
+#
+top = headers_heigth + 20
+pdf.SetFont('Arial','B',7)
+@issues.each do |i|
+ pdf.SetY(top)
+ pdf.SetX(15)
+ pdf.Cell(subject_width-15, 5, i.id.to_s + " " + i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)'), "LR")
+
+ pdf.SetY(top)
+ pdf.SetX(subject_width)
+ pdf.Cell(g_width, 5, "", "LR")
+
+ i_start_date = (i.start_date >= @date_from ? i.start_date : @date_from )
+ i_end_date = (i.due_date <= @date_to ? i.due_date : @date_to )
+
+ i_done_date = i.start_date + ((i.due_date - i.start_date)*i.done_ratio/100).floor
+ i_done_date = (i_done_date <= @date_from ? @date_from : i_done_date )
+ i_done_date = (i_done_date >= @date_to ? @date_to : i_done_date )
+
+ i_late_date = [i_end_date, Date.today].min if i_start_date < Date.today
+
+ i_left = ((i_start_date - @date_from)*zoom)
+ i_width = ((i_end_date - i_start_date + 1)*zoom)
+ d_width = ((i_done_date - i_start_date)*zoom)
+ l_width = ((i_late_date - i_start_date+1)*zoom) if i_late_date
+ l_width ||= 0
+
+ pdf.SetY(top+1.5)
+ pdf.SetX(subject_width + i_left)
+ pdf.SetFillColor(200,200,200)
+ pdf.Cell(i_width, 2, "", 0, 0, "", 1)
+
+ if l_width > 0
+ pdf.SetY(top+1.5)
+ pdf.SetX(subject_width + i_left)
+ pdf.SetFillColor(255,100,100)
+ pdf.Cell(l_width, 2, "", 0, 0, "", 1)
+ end
+ if d_width > 0
+ pdf.SetY(top+1.5)
+ pdf.SetX(subject_width + i_left)
+ pdf.SetFillColor(100,100,255)
+ pdf.Cell(d_width, 2, "", 0, 0, "", 1)
+ end
+
+ pdf.SetY(top+1.5)
+ pdf.SetX(subject_width + i_left + i_width)
+ pdf.Cell(30, 2, "#{i.status.name} #{i.done_ratio}%")
+
+ top = top + 5
+ pdf.SetDrawColor(200, 200, 200)
+ pdf.Line(15, top, subject_width+g_width, top)
+ if pdf.GetY() > 180
+ pdf.AddPage("L")
+ top = 20
+ pdf.Line(15, top, subject_width+g_width, top)
+ end
+ pdf.SetDrawColor(0, 0, 0)
+end
+
+pdf.Line(15, top, subject_width+g_width, top)
+
+%>
+<%= pdf.Output %>
\ No newline at end of file diff --git a/redmine/app/views/projects/gantt.rhtml b/redmine/app/views/projects/gantt.rhtml new file mode 100644 index 000000000..51334660c --- /dev/null +++ b/redmine/app/views/projects/gantt.rhtml @@ -0,0 +1,241 @@ +<h2><%= l(:label_gantt_chart) %></h2>
+<div class="topright">
+<small>
+<%= link_to 'PDF ', :zoom => @zoom, :year => @year_from, :month => @month_from, :months => @months, :output => 'pdf' %>
+</small>
+</div>
+
+<table width="100%">
+<tr>
+<td align="left">
+<%= start_form_tag %>
+<input type="text" name="months" size="2" value="<%= @months %>">
+<%= l(:label_months_from) %>
+<%= select_month(@month_from, :prefix => "month", :discard_type => true) %>
+<%= select_year(@year_from, :prefix => "year", :discard_type => true) %>
+<%= hidden_field_tag 'zoom', @zoom %>
+<%= submit_tag l(:button_submit), :class => "button-small" %>
+<%= end_form_tag %>
+</td>
+<td align="right">
+<%= if @zoom < 4
+ link_to image_tag('zoom_in'), {:zoom => (@zoom+1), :year => @year_from, :month => @month_from, :months => @months}
+ else
+ image_tag 'zoom_in_g'
+ end %>
+<%= if @zoom > 1
+ link_to image_tag('zoom_out'), :zoom => (@zoom-1), :year => @year_from, :month => @month_from, :months => @months
+ else
+ image_tag 'zoom_out_g'
+ end %>
+</td>
+</tr>
+</table>
+<br />
+
+<style>
+.m_bg {
+ position:absolute;
+ top:0;
+ height:16px;
+ border-top: 1px solid #c0c0c0;
+ border-bottom: 1px solid #c0c0c0;
+ border-right: 1px solid #c0c0c0;
+ text-align: center;
+}
+
+.task {
+ position: absolute;
+ height:8px;
+ font-size:0.8em;
+ color:#888;
+ background:#aaa;
+ padding:0;
+ margin:0;
+ line-height:0.8em;
+}
+
+.task_late {
+ background:#f66;
+}
+
+.task_done {
+ background:#66f;
+}
+</style>
+
+<% zoom = 1
+@zoom.times { zoom = zoom * 2 }
+
+subject_width = 260
+header_heigth = 18
+
+headers_heigth = header_heigth
+show_weeks = false
+show_days = false
+
+if @zoom >1
+ show_weeks = true
+ headers_heigth = 2*header_heigth
+ if @zoom > 2
+ show_days = true
+ headers_heigth = 3*header_heigth
+ end
+end
+
+g_width = (@date_to - @date_from + 1)*zoom
+g_height = [(20 * @issues.length + 6), 206].max
+t_height = g_height + headers_heigth
+%>
+
+<table width="100%" border=0 cellspacing=0 cellpading=0>
+<tr>
+<td width=260>
+
+<div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width + 1 %>px;">
+<div style="right:-2px;width:<%= subject_width %>px;height:<%= headers_heigth %>px;" class="m_bg"></div>
+<div style="right:-2px;width:<%= subject_width %>px;height:<%= t_height %>px;border-left: 1px solid #c0c0c0;" class="m_bg"></div>
+<%
+#
+# Tasks subjects
+#
+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.id, :controller => 'issues', :action => 'show', :id => i %>
+ <%= i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small>
+ </div>
+<% top = top + 20
+end %>
+</div>
+</td>
+<td>
+
+<div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width %>;overflow:auto;">
+<div style="width:<%= g_width-1 %>px;height:<%= headers_heigth %>px;" class="m_bg"> </div>
+<%
+#
+# Months headers
+#
+month_f = @date_from
+left = 0
+height = (show_weeks ? header_heigth : header_heigth + g_height)
+@months.times do
+ width = ((month_f >> 1) - month_f) * zoom - 1
+ %>
+ <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="m_bg">
+ <%= link_to "#{month_f.year}-#{month_f.month}", :year => month_f.year, :month => month_f.month, :zoom => @zoom, :months => @months %>
+ </div>
+ <%
+ left = left + width + 1
+ month_f = month_f >> 1
+end %>
+
+<%
+#
+# Weeks headers
+#
+if show_weeks
+ left = 0
+ height = (show_days ? header_heigth-1 : header_heigth-1 + g_height)
+ if @date_from.cwday == 1
+ # @date_from is monday
+ week_f = @date_from
+ else
+ # find next monday after @date_from
+ week_f = @date_from + (7 - @date_from.cwday + 1)
+ width = (7 - @date_from.cwday + 1) * zoom-1
+ %>
+ <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="m_bg"> </div>
+ <%
+ left = left + width+1
+ end %>
+ <%
+ while week_f < @date_to
+ width = (week_f + 6 <= @date_to) ? 7 * zoom -1 : (@date_to - week_f + 1) * zoom-1
+ %>
+ <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="m_bg">
+ <small><%= week_f.cweek %></small>
+ </div>
+ <%
+ left = left + width+1
+ week_f = week_f+7
+ end
+end %>
+
+<%
+#
+# Days headers
+#
+if show_days
+ left = 0
+ height = g_height + header_heigth - 1
+ wday = @date_from.cwday
+ (@date_to - @date_from + 1).to_i.times do
+ width = zoom - 1
+ %>
+ <div style="left:<%= left %>px;top:37px;width:<%= width %>px;height:<%= height %>px;font-size:0.7em;<%= "background:#f1f1f1;" if wday > 5 %>" class="m_bg">
+ <%= day_name(wday)[0,1] %>
+ </div>
+ <%
+ left = left + width+1
+ wday = wday + 1
+ wday = 1 if wday > 7
+ end
+end %>
+
+<%
+#
+# Today red line
+#
+if Date.today >= @date_from and Date.today <= @date_to %>
+ <div style="position: absolute;height:<%= g_height %>px;top:<%= headers_heigth + 1 %>px;left:<%= ((Date.today-@date_from+1)*zoom).floor()-1 %>px;width:10px;border-left: 1px dashed red;"> </div>
+<% end %>
+
+<%
+#
+# Tasks
+#
+top = headers_heigth + 12
+@issues.each do |i| %>
+ <%
+ i_start_date = (i.start_date >= @date_from ? i.start_date : @date_from )
+ i_end_date = (i.due_date <= @date_to ? i.due_date : @date_to )
+
+ i_done_date = i.start_date + ((i.due_date - i.start_date)*i.done_ratio/100).floor
+ i_done_date = (i_done_date <= @date_from ? @date_from : i_done_date )
+ i_done_date = (i_done_date >= @date_to ? @date_to : i_done_date )
+
+ i_late_date = [i_end_date, Date.today].min if i_start_date < Date.today
+
+ i_left = ((i_start_date - @date_from)*zoom).floor
+ i_width = ((i_end_date - i_start_date + 1)*zoom).floor
+ d_width = ((i_done_date - i_start_date)*zoom).floor
+ l_width = ((i_late_date - i_start_date+1)*zoom).floor if i_late_date
+ l_width ||= 0
+ %>
+ <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;" class="task"> </div>
+ <% if l_width > 0 %>
+ <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= l_width %>px;" class="task task_late"> </div>
+ <% end %>
+ <% if d_width > 0 %>
+ <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= d_width %>px;" class="task task_done"> </div>
+ <% end %>
+ <div style="top:<%= top %>px;left:<%= i_left + i_width + 5 %>px;background:#fff;" class="task">
+ <%= i.status.name %>
+ <%= (i.done_ratio).to_i %>%
+ </div>
+ <% top = top + 20
+end %>
+</div>
+</td>
+</tr>
+</table>
+
+<table width="100%">
+<tr>
+<td align="left"><%= link_to ('« ' + l(:label_previous)), :year => (@date_from << @months).year, :month => (@date_from << @months).month, :zoom => @zoom, :months => @months %></td>
+<td>
+<td align="right"><%= link_to (l(:label_next) + ' »'), :year => (@date_from >> @months).year, :month => (@date_from >> @months).month, :zoom => @zoom, :months => @months %></td>
+</tr>
+</table>
\ No newline at end of file diff --git a/redmine/app/views/projects/list_issues.rhtml b/redmine/app/views/projects/list_issues.rhtml index 3075d077a..ba6f40f86 100644 --- a/redmine/app/views/projects/list_issues.rhtml +++ b/redmine/app/views/projects/list_issues.rhtml @@ -41,7 +41,7 @@ </td>
</tr>
</table>
-<%= start_form_tag ({:controller => 'projects', :action => 'move_issues', :id => @project}, :id => 'issues_form' ) %>
+<%= start_form_tag({:controller => 'projects', :action => 'move_issues', :id => @project}, :id => 'issues_form' ) %>
<table class="listTableContent">
<tr class="ListHead">
diff --git a/redmine/app/views/projects/list_news.rhtml b/redmine/app/views/projects/list_news.rhtml index 31a5f86a4..ae7ae0f86 100644 --- a/redmine/app/views/projects/list_news.rhtml +++ b/redmine/app/views/projects/list_news.rhtml @@ -5,7 +5,7 @@ <% for news in @news %>
<p>
<b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br />
- <%= news.summary %><br />
+ <% unless news.summary.empty? %><%= news.summary %><br /><% end %>
<small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small>
</p>
<% end %> diff --git a/redmine/app/views/projects/settings.rhtml b/redmine/app/views/projects/settings.rhtml index cb6864a23..3f9cba0a0 100644 --- a/redmine/app/views/projects/settings.rhtml +++ b/redmine/app/views/projects/settings.rhtml @@ -1,11 +1,12 @@ <h2><%=l(:label_settings)%></h2> -
-<% labelled_tabular_form_for :project, @project, :url => { :action => "edit", :id => @project } do |f| %> -<%= render :partial => 'form', :locals => { :f => f } %> -<%= submit_tag l(:button_save) %> -<% end %> - +<% if authorize_for('projects', 'edit') %>
+ <% labelled_tabular_form_for :project, @project, :url => { :action => "edit", :id => @project } do |f| %> + <%= render :partial => 'form', :locals => { :f => f } %> + <%= submit_tag l(:button_save) %> + <% end %> + <br /> +<% end %> <div class="box"> <h3><%=l(:label_member_plural)%></h3>
@@ -14,59 +15,67 @@ <% for member in @project.members.find(:all, :include => :user) %>
<% unless member.new_record? %>
<tr>
- <td><%= member.user.display_name %></td>
+ <td><%= member.user.display_name %></td>
<td>
- <%= start_form_tag :controller => 'members', :action => 'edit', :id => member %>
- <select name="member[role_id]">
+ <% if authorize_for('members', 'edit') %> + <%= start_form_tag :controller => 'members', :action => 'edit', :id => member %>
+ <select name="member[role_id]">
<%= options_from_collection_for_select @roles, "id", "name", member.role_id %> - </select>
+ </select>
+ <%= submit_tag l(:button_change), :class => "button-small" %> + <%= end_form_tag %> + <% end %> </td>
- <td>
- <%= submit_tag l(:button_change), :class => "button-small" %>
- <%= end_form_tag %>
+ <td> + <% if authorize_for('members', 'destroy') %>
+ <%= start_form_tag :controller => 'members', :action => 'destroy', :id => member %>
+ <%= submit_tag l(:button_delete), :class => "button-small" %>
+ <%= end_form_tag %> + <% end %>
</td>
- <td>
- <%= start_form_tag :controller => 'members', :action => 'destroy', :id => member %>
- <%= submit_tag l(:button_delete), :class => "button-small" %>
- <%= end_form_tag %>
- </td>
</tr>
<% end %>
<% end %>
-</table>
-<hr />
+</table> +<% if authorize_for('projects', 'add_member') %>
+ <hr />
<label><%=l(:label_member_new)%></label><br/>
- <%= start_form_tag :controller => 'projects', :action => 'add_member', :id => @project %>
- <select name="member[user_id]">
- <%= options_from_collection_for_select @users, "id", "display_name", @member.user_id %> - </select>
- <select name="member[role_id]">
- <%= options_from_collection_for_select @roles, "id", "name", @member.role_id %> - </select>
- <%= submit_tag l(:button_add) %>
- <%= end_form_tag %>
+ <%= start_form_tag :controller => 'projects', :action => 'add_member', :id => @project %>
+ <select name="member[user_id]">
+ <%= options_from_collection_for_select @users, "id", "display_name", @member.user_id %> + </select>
+ <select name="member[role_id]">
+ <%= options_from_collection_for_select @roles, "id", "name", @member.role_id %> + </select>
+ <%= submit_tag l(:button_add) %>
+ <%= end_form_tag %> +<% end %>
</div>
<div class="box">
<h3><%=l(:label_version_plural)%></h3>
-
<table>
<% for version in @project.versions %>
<tr>
- <td><%= link_to version.name, :controller => 'versions', :action => 'edit', :id => version %></td>
- <td><%=h version.description %></td>
- <td>
+ <td width="100"><strong><%=h version.name %></strong></td>
+ <td width="100"><%= format_date(version.effective_date) %></td>
+ <td><%=h version.description %></td> + <td> + <%= link_to_if_authorized l(:button_edit), :controller => 'versions', :action => 'edit', :id => version %> + <% if authorize_for('versions', 'destroy') %> +
<%= start_form_tag :controller => 'versions', :action => 'destroy', :id => version %>
<%= submit_tag l(:button_delete), :class => "button-small" %>
- <%= end_form_tag %>
+ <%= end_form_tag %> + <% end %>
</td>
</tr>
<% end %>
-</table>
-<hr />
- <%= start_form_tag ({ :controller => 'projects', :action => 'add_version', :id => @project }, :method => 'get' ) %>
- <%= submit_tag l(:label_version_new) %>
- <%= end_form_tag %>
+</table> +<% if authorize_for('projects', 'add_version') %>
+ <hr /> + <%= link_to l(:label_version_new), :controller => 'projects', :action => 'add_version', :id => @project %>
+<% end %>
</div>
@@ -76,30 +85,34 @@ <% for @category in @project.issue_categories %>
<% unless @category.new_record? %>
<tr>
- <td>
- <%= start_form_tag :controller => 'issue_categories', :action => 'edit', :id => @category %>
- <%= text_field 'category', 'name', :size => 25 %>
+ <td>
+ <%= start_form_tag :controller => 'issue_categories', :action => 'edit', :id => @category %>
+ <%= text_field 'category', 'name', :size => 25 %>
</td>
- <td>
- <%= submit_tag l(:button_save), :class => "button-small" %>
- <%= end_form_tag %>
+ <td> + <% if authorize_for('issue_categories', 'edit') %>
+ <%= submit_tag l(:button_save), :class => "button-small" %>
+ <%= end_form_tag %> + <% end %>
+ </td>
+ <td> + <% if authorize_for('issue_categories', 'destroy') %>
+ <%= start_form_tag :controller => 'issue_categories', :action => 'destroy', :id => @category %>
+ <%= submit_tag l(:button_delete), :class => "button-small" %>
+ <%= end_form_tag %> + <% end %>
</td>
- <td>
- <%= start_form_tag :controller => 'issue_categories', :action => 'destroy', :id => @category %>
- <%= submit_tag l(:button_delete), :class => "button-small" %>
- <%= end_form_tag %>
- </td>
</tr>
<% end %>
<% end %>
-</table>
-<hr />
-
-<%= start_form_tag :action => 'add_issue_category', :id => @project %> -<label for="issue_category_name"><%=l(:label_issue_category_new)%></label><br/> -<%= error_messages_for 'issue_category' %>
-<%= text_field 'issue_category', 'name', :size => 25 %> -<%= submit_tag l(:button_create) %>
-<%= end_form_tag %>
-
+</table> +<% if authorize_for('projects', 'add_issue_category') %>
+ <hr />
+ <%= start_form_tag :action => 'add_issue_category', :id => @project %> + <label for="issue_category_name"><%=l(:label_issue_category_new)%></label><br/> + <%= error_messages_for 'issue_category' %>
+ <%= text_field 'issue_category', 'name', :size => 25 %> + <%= submit_tag l(:button_create) %>
+ <%= end_form_tag %>
+<% end %>
</div>
diff --git a/redmine/app/views/projects/show.rhtml b/redmine/app/views/projects/show.rhtml index 2cf012390..79e36a586 100644 --- a/redmine/app/views/projects/show.rhtml +++ b/redmine/app/views/projects/show.rhtml @@ -3,7 +3,7 @@ <div class="splitcontentleft">
<%= simple_format(auto_link(@project.description)) %>
<ul>
- <% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= link_to @project.homepage, @project.homepage %></li><% end %>
+ <% 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? %>
|