Added branch for sys controller refactoring.
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1006 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<% 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 %>
|
||||
@@ -0,0 +1,52 @@
|
||||
<%= error_messages_for 'project' %>
|
||||
|
||||
<div class="box">
|
||||
<!--[form:project]-->
|
||||
<p><%= f.text_field :name, :required => true %><br /><em><%= l(:text_caracters_maximum, 30) %></em></p>
|
||||
|
||||
<% if User.current.admin? and !@root_projects.empty? %>
|
||||
<p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p>
|
||||
<% end %>
|
||||
|
||||
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 5 %><em><%= l(:text_caracters_maximum, 255) %></em></p>
|
||||
<p><%= f.text_field :identifier, :required => true, :disabled => @project.identifier_frozen? %><br /><em><%= l(:text_length_between, 3, 20) %> <%= l(:text_project_identifier_info) unless @project.identifier_frozen? %></em></p>
|
||||
<p><%= f.text_field :homepage, :size => 40 %></p>
|
||||
<p><%= f.check_box :is_public %></p>
|
||||
<%= wikitoolbar_for 'project_description' %>
|
||||
|
||||
<% for @custom_value in @custom_values %>
|
||||
<p><%= custom_field_tag_with_label @custom_value %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% unless @trackers.empty? %>
|
||||
<fieldset class="box"><legend><%=l(:label_tracker_plural)%></legend>
|
||||
<% @trackers.each do |tracker| %>
|
||||
<label class="floating">
|
||||
<%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.include?(tracker) %>
|
||||
<%= tracker %>
|
||||
</label>
|
||||
<% end %>
|
||||
<%= hidden_field_tag 'project[tracker_ids][]', '' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
<% unless @custom_fields.empty? %>
|
||||
<fieldset class="box"><legend><%=l(:label_custom_field_plural)%></legend>
|
||||
<% for custom_field in @custom_fields %>
|
||||
<label class="floating">
|
||||
<%= 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 %>
|
||||
</label>
|
||||
<% end %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
<!--[eoform:project]-->
|
||||
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'calendar/calendar' %>
|
||||
<%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
|
||||
<%= javascript_include_tag 'calendar/calendar-setup' %>
|
||||
<%= stylesheet_link_tag 'calendar' %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,43 @@
|
||||
<h2><%=l(:label_activity)%>: <%= "#{month_name(@month).downcase} #{@year}" %></h2>
|
||||
|
||||
<% @events_by_day.keys.sort {|x,y| y <=> x }.each do |day| %>
|
||||
<h3><%= day_name(day.cwday) %> <%= day.day %></h3>
|
||||
<ul>
|
||||
<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| %>
|
||||
<li><p><%= format_time(e.event_datetime, false) %> <%= link_to truncate(e.event_title, 100), e.event_url %><br />
|
||||
<% unless e.event_description.blank? %><em><%= truncate(e.event_description, 500) %></em><br /><% end %>
|
||||
<span class="author"><%= e.event_author if e.respond_to?(:event_author) %></span></p></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% if @events_by_day.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %>
|
||||
|
||||
<div style="float:left;">
|
||||
<% prev_params = params.clone.update :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) %>
|
||||
<%= link_to_remote ('« ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
|
||||
{:update => "content", :url => prev_params}, {:href => url_for(prev_params)} %>
|
||||
</div>
|
||||
<div style="float:right;">
|
||||
<% next_params = params.clone.update :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) %>
|
||||
<%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' »'),
|
||||
{:update => "content", :url => next_params}, {:href => url_for(next_params)} %>
|
||||
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :year => nil, :month => nil, :key => User.current.rss_key})) %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<% form_tag do %>
|
||||
<h3><%= l(:label_activity) %></h3>
|
||||
<p><% @event_types.each do |t| %>
|
||||
<label><%= check_box_tag "show_#{t}", 1, @scope.include?(t) %> <%= l("label_#{t.singularize}_plural")%></label><br />
|
||||
<% end %></p>
|
||||
<p><%= submit_tag l(:button_apply), :class => 'button-small' %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% set_html_title l(:label_activity) -%>
|
||||
@@ -0,0 +1,15 @@
|
||||
<h2><%=l(:label_project_new)%></h2>
|
||||
|
||||
<% labelled_tabular_form_for :project, @project, :url => { :action => "add" } do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
|
||||
<fieldset class="box"><legend><%= l(:label_module_plural) %></legend>
|
||||
<% Redmine::AccessControl.available_project_modules.each do |m| %>
|
||||
<label class="floating">
|
||||
<%= check_box_tag 'enabled_modules[]', m, @project.module_enabled?(m) %> <%= m.to_s.humanize %>
|
||||
</label>
|
||||
<% end %>
|
||||
</fieldset>
|
||||
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,13 @@
|
||||
<h2><%=l(:label_document_new)%></h2>
|
||||
|
||||
<% form_tag( { :action => 'add_document', :id => @project }, :class => "tabular", :multipart => true) do %>
|
||||
<%= render :partial => 'documents/form' %>
|
||||
|
||||
<div class="box">
|
||||
<%= render :partial => 'common/attachments_form'%>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<h2><%=l(:label_attachment_new)%></h2>
|
||||
|
||||
<%= error_messages_for 'attachment' %>
|
||||
<div class="box">
|
||||
<% form_tag({ :action => 'add_file', :id => @project }, :multipart => true, :class => "tabular") do %>
|
||||
|
||||
<p><label for="version_id"><%=l(:field_version)%> <span class="required">*</span></label>
|
||||
<%= select_tag "version_id", options_from_collection_for_select(@versions, "id", "name") %></p>
|
||||
|
||||
<%= render :partial => 'attachments/form' %>
|
||||
</div>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,19 @@
|
||||
<h2><%=l(:label_issue_new)%>: <%= @issue.tracker %></h2>
|
||||
|
||||
<% labelled_tabular_form_for :issue, @issue,
|
||||
:url => {:action => 'add_issue'},
|
||||
:html => {:multipart => true, :id => 'issue-form'} do |f| %>
|
||||
<%= f.hidden_field :tracker_id %>
|
||||
<%= render :partial => 'issues/form', :locals => {:f => f} %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= link_to_remote l(:label_preview),
|
||||
{ :url => { :controller => 'issues', :action => 'preview', :id => @issue },
|
||||
:method => 'post',
|
||||
:update => 'preview',
|
||||
:with => "Form.serialize('issue-form')",
|
||||
:complete => "location.href='#preview-top'"
|
||||
}, :accesskey => accesskey(:preview) %>
|
||||
<% end %>
|
||||
|
||||
<a name="preview-top"></a>
|
||||
<div id="preview" class="wiki"></div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<h2><%=l(:label_issue_category_new)%></h2>
|
||||
|
||||
<% labelled_tabular_form_for :category, @category, :url => { :action => 'add_issue_category' } do |f| %>
|
||||
<%= render :partial => 'issue_categories/form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,6 @@
|
||||
<h2><%=l(:label_news_new)%></h2>
|
||||
|
||||
<% labelled_tabular_form_for :news, @news, :url => { :action => "add_news" } do |f| %>
|
||||
<%= render :partial => 'news/form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,6 @@
|
||||
<h2><%=l(:label_version_new)%></h2>
|
||||
|
||||
<% labelled_tabular_form_for :version, @version, :url => { :action => 'add_version' } do |f| %>
|
||||
<%= render :partial => 'versions/form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,42 @@
|
||||
<% cache(:year => @year, :month => @month, :tracker_ids => @selected_tracker_ids, :subprojects => params[:with_subprojects], :lang => current_language) do %>
|
||||
<h2><%= l(:label_calendar) %>: <%= "#{month_name(@month).downcase} #{@year}" %></h2>
|
||||
|
||||
<table width="100%">
|
||||
<tr><td align="left">
|
||||
<%= link_to_remote ('« ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
|
||||
{:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1), :tracker_ids => @selected_tracker_ids, :with_subprojects => params[:with_subprojects] }},
|
||||
{:href => url_for(:action => 'calendar', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1), :tracker_ids => @selected_tracker_ids, :with_subprojects => params[:with_subprojects])}
|
||||
%>
|
||||
</td><td align="right">
|
||||
<%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' »'),
|
||||
{:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1), :tracker_ids => @selected_tracker_ids, :with_subprojects => params[:with_subprojects] }},
|
||||
{:href => url_for(:action => 'calendar', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1), :tracker_ids => @selected_tracker_ids, :with_subprojects => params[:with_subprojects])}
|
||||
%>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
<%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %>
|
||||
|
||||
<%= image_tag 'arrow_from.png' %> <%= l(:text_tip_task_begin_day) %><br />
|
||||
<%= image_tag 'arrow_to.png' %> <%= l(:text_tip_task_end_day) %><br />
|
||||
<%= image_tag 'arrow_bw.png' %> <%= l(:text_tip_task_begin_end_day) %><br />
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<h3><%= l(:label_calendar) %></h3>
|
||||
|
||||
<% form_tag() do %>
|
||||
<p><%= select_month(@month, :prefix => "month", :discard_type => true) %>
|
||||
<%= select_year(@year, :prefix => "year", :discard_type => true) %></p>
|
||||
|
||||
<% @trackers.each do |tracker| %>
|
||||
<label><%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %> <%= tracker.name %></label><br />
|
||||
<% end %>
|
||||
<% if @project.active_children.any? %>
|
||||
<br /><label><%= check_box_tag "with_subprojects", 1, params[:with_subprojects] %> <%=l(:label_subproject_plural)%></label>
|
||||
<% end %>
|
||||
<p><%= submit_tag l(:button_apply), :class => 'button-small' %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% set_html_title l(:label_calendar) -%>
|
||||
@@ -0,0 +1,42 @@
|
||||
<h2><%=l(:label_change_log)%></h2>
|
||||
|
||||
<% if @versions.empty? %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
<% @versions.each do |version| %>
|
||||
<a name="<%= version.name %>"><h3 class="icon22 icon22-package"><%= version.name %></h3></a>
|
||||
<% if version.effective_date %>
|
||||
<p><%= format_date(version.effective_date) %></p>
|
||||
<% end %>
|
||||
<p><%=h version.description %></p>
|
||||
<% issues = version.fixed_issues.find(:all,
|
||||
:include => [:status, :tracker],
|
||||
:conditions => ["#{IssueStatus.table_name}.is_closed=? AND #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')})", true],
|
||||
:order => "#{Tracker.table_name}.position") unless @selected_tracker_ids.empty?
|
||||
issues ||= []
|
||||
%>
|
||||
<% if !issues.empty? %>
|
||||
<ul>
|
||||
<% issues.each do |issue| %>
|
||||
<li><%= link_to_issue(issue) %>: <%=h issue.subject %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<% form_tag do %>
|
||||
<h3><%= l(:label_change_log) %></h3>
|
||||
<% @trackers.each do |tracker| %>
|
||||
<label><%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %>
|
||||
<%= tracker.name %></label><br />
|
||||
<% end %>
|
||||
<p><%= submit_tag l(:button_apply), :class => 'button-small' %></p>
|
||||
<% end %>
|
||||
|
||||
<h3><%= l(:label_version_plural) %></h3>
|
||||
<% @versions.each do |version| %>
|
||||
<%= link_to version.name, :anchor => version.name %><br />
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,14 @@
|
||||
<h2><%=l(:label_confirmation)%></h2>
|
||||
<div class="box">
|
||||
<center>
|
||||
<p><strong><%=h @project_to_destroy.name %></strong><br />
|
||||
<%=l(:text_project_destroy_confirmation)%></p>
|
||||
|
||||
<p>
|
||||
<% form_tag({:controller => 'projects', :action => 'destroy', :id => @project_to_destroy}) do %>
|
||||
<%= hidden_field_tag "confirm", 1 %>
|
||||
<%= submit_tag l(:button_delete) %>
|
||||
<% end %>
|
||||
</p>
|
||||
</center>
|
||||
</div>
|
||||
@@ -0,0 +1,188 @@
|
||||
<%
|
||||
pdf=IfpdfHelper::IFPDF.new(current_language)
|
||||
pdf.SetTitle("#{@project.name} - #{l(:label_gantt)}")
|
||||
pdf.AliasNbPages
|
||||
pdf.footer_date = format_date(Date.today)
|
||||
pdf.AddPage("L")
|
||||
pdf.SetFontStyle('B',12)
|
||||
pdf.SetX(15)
|
||||
pdf.Cell(70, 20, @project.name)
|
||||
pdf.Ln
|
||||
pdf.SetFontStyle('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
|
||||
|
||||
y_start = pdf.GetY
|
||||
|
||||
|
||||
#
|
||||
# Months headers
|
||||
#
|
||||
month_f = @date_from
|
||||
left = subject_width
|
||||
height = header_heigth
|
||||
@months.times do
|
||||
width = ((month_f >> 1) - month_f) * zoom
|
||||
pdf.SetY(y_start)
|
||||
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(y_start + header_heigth)
|
||||
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(y_start + header_heigth)
|
||||
pdf.SetX(left)
|
||||
pdf.Cell(width, height, (width >= 5 ? 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.SetFontStyle('B',7)
|
||||
(@date_to - @date_from + 1).to_i.times do
|
||||
width = zoom
|
||||
pdf.SetY(y_start + 2 * header_heigth)
|
||||
pdf.SetX(left)
|
||||
pdf.Cell(width, height, day_name(wday).first, "LTR", 0, "C")
|
||||
left = left + width
|
||||
wday = wday + 1
|
||||
wday = 1 if wday > 7
|
||||
end
|
||||
end
|
||||
|
||||
pdf.SetY(y_start)
|
||||
pdf.SetX(15)
|
||||
pdf.Cell(subject_width+g_width-15, headers_heigth, "", 1)
|
||||
|
||||
|
||||
#
|
||||
# Tasks
|
||||
#
|
||||
top = headers_heigth + y_start
|
||||
pdf.SetFontStyle('B',7)
|
||||
@events.each do |i|
|
||||
pdf.SetY(top)
|
||||
pdf.SetX(15)
|
||||
|
||||
if i.is_a? Issue
|
||||
pdf.Cell(subject_width-15, 5, "#{i.tracker.name} #{i.id}: #{i.subject}".sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)'), "LR")
|
||||
else
|
||||
pdf.Cell(subject_width-15, 5, "#{l(:label_version)}: #{i.name}", "LR")
|
||||
end
|
||||
|
||||
pdf.SetY(top)
|
||||
pdf.SetX(subject_width)
|
||||
pdf.Cell(g_width, 5, "", "LR")
|
||||
|
||||
pdf.SetY(top+1.5)
|
||||
|
||||
if i.is_a? Issue
|
||||
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+1)*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.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}%")
|
||||
else
|
||||
i_left = ((i.start_date - @date_from)*zoom)
|
||||
|
||||
pdf.SetX(subject_width + i_left)
|
||||
pdf.SetFillColor(50,200,50)
|
||||
pdf.Cell(2, 2, "", 0, 0, "", 1)
|
||||
|
||||
pdf.SetY(top+1.5)
|
||||
pdf.SetX(subject_width + i_left + 3)
|
||||
pdf.Cell(30, 2, "#{i.name}")
|
||||
end
|
||||
|
||||
|
||||
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 %>
|
||||
@@ -0,0 +1,249 @@
|
||||
<% zoom = 1
|
||||
@zoom.times { zoom = zoom * 2 }
|
||||
|
||||
subject_width = 330
|
||||
header_heigth = 18
|
||||
|
||||
headers_height = header_heigth
|
||||
show_weeks = false
|
||||
show_days = false
|
||||
|
||||
if @zoom >1
|
||||
show_weeks = true
|
||||
headers_height = 2*header_heigth
|
||||
if @zoom > 2
|
||||
show_days = true
|
||||
headers_height = 3*header_heigth
|
||||
end
|
||||
end
|
||||
|
||||
g_width = (@date_to - @date_from + 1)*zoom
|
||||
g_height = [(20 * @events.length + 6)+150, 206].max
|
||||
t_height = g_height + headers_height
|
||||
%>
|
||||
|
||||
<div class="contextual">
|
||||
</div>
|
||||
|
||||
<h2><%= l(:label_gantt) %></h2>
|
||||
|
||||
<% form_tag(params.merge(:month => nil, :year => nil, :months => nil)) do %>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<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" %>
|
||||
</td>
|
||||
|
||||
<td align="right">
|
||||
<%= if @zoom < 4
|
||||
link_to image_tag('zoom_in.png'), {:zoom => (@zoom+1), :year => @year_from, :month => @month_from, :months => @months, :tracker_ids => @selected_tracker_ids, :with_subprojects => params[:with_subprojects]}
|
||||
else
|
||||
image_tag 'zoom_in_g.png'
|
||||
end %>
|
||||
<%= if @zoom > 1
|
||||
link_to image_tag('zoom_out.png'),{:zoom => (@zoom-1), :year => @year_from, :month => @month_from, :months => @months, :tracker_ids => @selected_tracker_ids, :with_subprojects => params[:with_subprojects]}
|
||||
else
|
||||
image_tag 'zoom_out_g.png'
|
||||
end %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
<% cache(:year => @year_from, :month => @month_from, :months => @months, :zoom => @zoom, :tracker_ids => @selected_tracker_ids, :subprojects => params[:with_subprojects], :lang => current_language) do %>
|
||||
|
||||
<table width="100%" style="border:0; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="width:<%= subject_width %>px;">
|
||||
|
||||
<div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width + 1 %>px;">
|
||||
<div style="right:-2px;width:<%= subject_width %>px;height:<%= headers_height %>px;background: #eee;" class="gantt_hdr"></div>
|
||||
<div style="right:-2px;width:<%= subject_width %>px;height:<%= t_height %>px;border-left: 1px solid #c0c0c0;overflow:hidden;" class="gantt_hdr"></div>
|
||||
<%
|
||||
#
|
||||
# Tasks subjects
|
||||
#
|
||||
top = headers_height + 8
|
||||
@events.each do |i| %>
|
||||
<div style="position: absolute;line-height:1.2em;height:16px;top:<%= top %>px;left:4px;overflow:hidden;"><small>
|
||||
<% if i.is_a? Issue %>
|
||||
<%= h("#{i.project.name} -") unless @project && @project == i.project %>
|
||||
<%= link_to_issue i %>: <%=h i.subject %>
|
||||
<% else %>
|
||||
<%= link_to_version i, :class => "icon icon-package" %>
|
||||
<% end %>
|
||||
</small></div>
|
||||
<% top = top + 20
|
||||
end %>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;">
|
||||
<div style="width:<%= g_width-1 %>px;height:<%= headers_height %>px;background: #eee;" class="gantt_hdr"> </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="gantt_hdr">
|
||||
<%= link_to "#{month_f.year}-#{month_f.month}", { :year => month_f.year, :month => month_f.month, :zoom => @zoom, :months => @months, :tracker_ids => @selected_tracker_ids, :with_subprojects => params[:with_subprojects] }, :title => "#{month_name(month_f.month)} #{month_f.year}"%>
|
||||
</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="gantt_hdr"> </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="gantt_hdr">
|
||||
<small><%= week_f.cweek if width >= 16 %></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="gantt_hdr">
|
||||
<%= day_name(wday).first %>
|
||||
</div>
|
||||
<%
|
||||
left = left + width+1
|
||||
wday = wday + 1
|
||||
wday = 1 if wday > 7
|
||||
end
|
||||
end %>
|
||||
|
||||
<%
|
||||
#
|
||||
# Tasks
|
||||
#
|
||||
top = headers_height + 10
|
||||
@events.each do |i|
|
||||
if i.is_a? Issue
|
||||
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+1)*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 - 2 # total width of the issue (- 2 for left and right borders)
|
||||
d_width = ((i_done_date - i_start_date)*zoom).floor - 2 # done width
|
||||
l_width = i_late_date ? ((i_late_date - i_start_date+1)*zoom).floor - 2 : 0 # delay width
|
||||
%>
|
||||
<div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;" class="task task_todo"> </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>
|
||||
<% # === tooltip === %>
|
||||
<div class="tooltip" style="position: absolute;top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;height:12px;">
|
||||
<span class="tip">
|
||||
<%= render_issue_tooltip i %>
|
||||
</span></div>
|
||||
<% else
|
||||
i_left = ((i.start_date - @date_from)*zoom).floor
|
||||
%>
|
||||
<div style="top:<%= top %>px;left:<%= i_left %>px;width:15px;" class="task milestone"> </div>
|
||||
<div style="top:<%= top %>px;left:<%= i_left + 12 %>px;background:#fff;" class="task">
|
||||
<strong><%= i.name %></strong>
|
||||
</div>
|
||||
<% end %>
|
||||
<% top = top + 20
|
||||
end %>
|
||||
|
||||
<% end # cache
|
||||
%>
|
||||
|
||||
<%
|
||||
#
|
||||
# Today red line (excluded from cache)
|
||||
#
|
||||
if Date.today >= @date_from and Date.today <= @date_to %>
|
||||
<div style="position: absolute;height:<%= g_height %>px;top:<%= headers_height + 1 %>px;left:<%= ((Date.today-@date_from+1)*zoom).floor()-1 %>px;width:10px;border-left: 1px dashed red;"> </div>
|
||||
<% 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, :tracker_ids => @selected_tracker_ids, :with_subprojects => params[:with_subprojects] %></td>
|
||||
<td align="right"><%= link_to (l(:label_next) + ' »'), :year => (@date_from >> @months).year, :month => (@date_from >> @months).month, :zoom => @zoom, :months => @months, :tracker_ids => @selected_tracker_ids, :with_subprojects => params[:with_subprojects] %></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="contextual"><%= l(:label_export_to) %>
|
||||
<%= link_to 'PDF', {:zoom => @zoom, :year => @year_from, :month => @month_from, :months => @months, :tracker_ids => @selected_tracker_ids, :with_subprojects => params[:with_subprojects], :format => 'pdf'}, :class => 'icon icon-pdf' %>
|
||||
<%= link_to 'PNG', {:zoom => @zoom, :year => @year_from, :month => @month_from, :months => @months, :tracker_ids => @selected_tracker_ids, :with_subprojects => params[:with_subprojects], :format => 'png'}, :class => 'icon icon-image' if respond_to?('gantt_image') %>
|
||||
</div>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<h3><%= l(:label_gantt) %></h3>
|
||||
<% form_tag(params.merge(:tracker_ids => nil, :with_subprojects => nil)) do %>
|
||||
<% @trackers.each do |tracker| %>
|
||||
<label><%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %> <%= tracker.name %></label><br />
|
||||
<% end %>
|
||||
<% if @project.active_children.any? %>
|
||||
<br /><label><%= check_box_tag "with_subprojects", 1, params[:with_subprojects] %> <%=l(:label_subproject_plural)%></label>
|
||||
<% end %>
|
||||
<p><%= submit_tag l(:button_apply), :class => 'button-small' %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% set_html_title l(:label_gantt) -%>
|
||||
@@ -0,0 +1,20 @@
|
||||
<h2><%=l(:label_project_plural)%></h2>
|
||||
|
||||
<% @project_tree.keys.sort.each do |project| %>
|
||||
<h3><%= link_to h(project.name), {:action => 'show', :id => project}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %></h3>
|
||||
<%= textilizable(project.description, :project => project) %>
|
||||
|
||||
<% if @project_tree[project].any? %>
|
||||
<p><%= l(:label_subproject_plural) %>:
|
||||
<%= @project_tree[project].sort.collect {|subproject|
|
||||
link_to(h(subproject.name), {:action => 'show', :id => subproject}, :class => (User.current.member_of?(subproject) ? "icon icon-fav" : ""))}.join(', ') %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if User.current.logged? %>
|
||||
<div class="contextual">
|
||||
<span class="icon icon-fav"><%= l(:label_my_projects) %></span>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% set_html_title l(:label_project_plural) -%>
|
||||
@@ -0,0 +1,39 @@
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized l(:label_document_new),
|
||||
{:controller => 'projects', :action => 'add_document', :id => @project},
|
||||
:class => 'icon icon-add',
|
||||
:onclick => 'Element.show("add-document"); return false;' %>
|
||||
</div>
|
||||
|
||||
<div id="add-document" style="display:none;">
|
||||
<h2><%=l(:label_document_new)%></h2>
|
||||
<% form_tag({:action => 'add_document', :id => @project}, :class => "tabular", :multipart => true) do %>
|
||||
<%= render :partial => 'documents/form' %>
|
||||
<div class="box">
|
||||
<%= render :partial => 'common/attachments_form'%>
|
||||
</div>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-document")' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<h2><%=l(:label_document_plural)%></h2>
|
||||
|
||||
<% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %>
|
||||
|
||||
<% @grouped.keys.sort.each do |group| %>
|
||||
<h3><%= group %></h3>
|
||||
<%= render :partial => 'documents/document', :collection => @grouped[group] %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<h3><%= l(:label_sort_by, '') %></h3>
|
||||
<% form_tag({}, :method => :get) do %>
|
||||
<label><%= radio_button_tag 'sort_by', 'category', (@sort_by == 'category'), :onclick => 'this.form.submit();' %> <%= l(:field_category) %></label><br />
|
||||
<label><%= radio_button_tag 'sort_by', 'date', (@sort_by == 'date'), :onclick => 'this.form.submit();' %> <%= l(:label_date) %></label><br />
|
||||
<label><%= radio_button_tag 'sort_by', 'title', (@sort_by == 'title'), :onclick => 'this.form.submit();' %> <%= l(:field_title) %></label><br />
|
||||
<label><%= radio_button_tag 'sort_by', 'author', (@sort_by == 'author'), :onclick => 'this.form.submit();' %> <%= l(:field_author) %></label>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% set_html_title l(:label_document_plural) -%>
|
||||
@@ -0,0 +1,46 @@
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized l(:label_attachment_new), {:controller => 'projects', :action => 'add_file', :id => @project}, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<h2><%=l(:label_attachment_plural)%></h2>
|
||||
|
||||
<% delete_allowed = authorize_for('versions', 'destroy_file') %>
|
||||
|
||||
<table class="list">
|
||||
<thead><tr>
|
||||
<th><%=l(:field_version)%></th>
|
||||
<th><%=l(:field_filename)%></th>
|
||||
<th><%=l(:label_date)%></th>
|
||||
<th><%=l(:field_filesize)%></th>
|
||||
<th>D/L</th>
|
||||
<th>MD5</th>
|
||||
<% if delete_allowed %><th></th><% end %>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% for version in @versions %>
|
||||
<% unless version.attachments.empty? %>
|
||||
<tr><th colspan="7" align="left"><span class="icon icon-package"><b><%= version.name %></b></span></th></tr>
|
||||
<% for file in version.attachments %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td></td>
|
||||
<td><%= link_to file.filename, :controller => 'versions', :action => 'download', :id => version, :attachment_id => file %></td>
|
||||
<td align="center"><%= format_date(file.created_on) %></td>
|
||||
<td align="center"><%= number_to_human_size(file.filesize) %></td>
|
||||
<td align="center"><%= file.downloads %></td>
|
||||
<td align="center"><small><%= file.digest %></small></td>
|
||||
<% if delete_allowed %>
|
||||
<td align="center">
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized image_tag('delete.png'), {:controller => 'versions', :action => 'destroy_file', :id => version, :attachment_id => file}, :confirm => l(:text_are_you_sure), :method => :post %>
|
||||
</div>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end
|
||||
reset_cycle %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% set_html_title l(:label_attachment_plural) -%>
|
||||
@@ -0,0 +1,13 @@
|
||||
<h2><%=l(:label_member_plural)%></h2>
|
||||
|
||||
<% if @members.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
|
||||
|
||||
<% members = @members.group_by {|m| m.role } %>
|
||||
<% members.keys.sort{|x,y| x.position <=> y.position}.each do |role| %>
|
||||
<h3><%= role.name %></h3>
|
||||
<ul>
|
||||
<% members[role].each do |m| %>
|
||||
<li><%= link_to m.name, :controller => 'account', :action => 'show', :id => m.user %> (<%= format_date m.created_on %>)</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
@@ -0,0 +1,29 @@
|
||||
<h2><%=l(:button_move)%></h2>
|
||||
|
||||
|
||||
<% form_tag({:action => 'move_issues', :id => @project}, :class => 'tabular', :id => 'move_form') do %>
|
||||
|
||||
<div class="box">
|
||||
<p><label><%= l(:label_issue_plural) %> :</label>
|
||||
<% for issue in @issues %>
|
||||
<%= link_to_issue issue %>: <%=h issue.subject %>
|
||||
<%= hidden_field_tag "issue_ids[]", issue.id %><br />
|
||||
<% end %>
|
||||
<i>(<%= @issues.length%> <%= lwr(:label_issue, @issues.length)%>)</i></p>
|
||||
|
||||
|
||||
|
||||
<!--[form:issue]-->
|
||||
<p><label for="new_project_id"><%=l(:field_project)%> :</label>
|
||||
<%= select_tag "new_project_id",
|
||||
options_from_collection_for_select(@projects, 'id', 'name', @target_project.id),
|
||||
:onchange => remote_function(:url => {:action => 'move_issues' , :id => @project},
|
||||
:method => :get,
|
||||
:update => 'content',
|
||||
:with => "Form.serialize('move_form')") %></p>
|
||||
|
||||
<p><label for="new_tracker_id"><%=l(:field_tracker)%> :</label>
|
||||
<%= select_tag "new_tracker_id", "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(@trackers, "id", "name") %></p>
|
||||
</div>
|
||||
<%= submit_tag l(:button_move) %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,50 @@
|
||||
<h2><%=l(:label_roadmap)%></h2>
|
||||
|
||||
<% if @versions.empty? %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
<% @versions.each do |version| %>
|
||||
<%= tag 'a', :name => version.name %>
|
||||
<h3 class="icon22 icon22-package"><%= link_to h(version.name), :controller => 'versions', :action => 'show', :id => version %></h3>
|
||||
<%= render :partial => 'versions/overview', :locals => {:version => version} %>
|
||||
<%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %>
|
||||
|
||||
<% issues = version.fixed_issues.find(:all,
|
||||
:include => [:status, :tracker],
|
||||
:conditions => ["tracker_id in (#{@selected_tracker_ids.join(',')})"],
|
||||
:order => "#{Tracker.table_name}.position") unless @selected_tracker_ids.empty?
|
||||
issues ||= []
|
||||
%>
|
||||
<ul>
|
||||
<% if issues.size > 0 %>
|
||||
<% issues.each do |issue| %>
|
||||
<li>
|
||||
<%= link = link_to_issue(issue)
|
||||
issue.status.is_closed? ? content_tag("del", link) : link %>: <%=h issue.subject %>
|
||||
<%= content_tag "em", "(#{l(:label_closed_issues)})" if issue.status.is_closed? %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<% form_tag do %>
|
||||
<h3><%= l(:label_roadmap) %></h3>
|
||||
<% @trackers.each do |tracker| %>
|
||||
<label><%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %>
|
||||
<%= tracker.name %></label><br />
|
||||
<% end %>
|
||||
<br />
|
||||
<label for="completed"><%= check_box_tag "completed", 1, params[:completed] %> <%= l(:label_show_completed_versions) %>
|
||||
<p><%= submit_tag l(:button_apply), :class => 'button-small' %></p>
|
||||
<% end %>
|
||||
|
||||
<h3><%= l(:label_version_plural) %></h3>
|
||||
<% @versions.each do |version| %>
|
||||
<%= link_to version.name, :anchor => version.name %><br />
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% set_html_title l(:label_roadmap) %>
|
||||
@@ -0,0 +1,18 @@
|
||||
<h2><%=l(:label_settings)%></h2>
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<% project_settings_tabs.each do |tab| %>
|
||||
<li><%= link_to l(tab[:label]), {}, :id => "tab-#{tab[:name]}", :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<% project_settings_tabs.each do |tab| %>
|
||||
<%= content_tag('div', render(:partial => tab[:partial]), :id => "tab-content-#{tab[:name]}", :class => 'tab-content') %>
|
||||
<% end %>
|
||||
|
||||
<%= tab = params[:tab] ? h(params[:tab]) : project_settings_tabs.first[:name]
|
||||
javascript_tag "showTab('#{tab}');" %>
|
||||
|
||||
<% set_html_title l(:label_settings) -%>
|
||||
@@ -0,0 +1,28 @@
|
||||
<% if @project.boards.any? %>
|
||||
<table class="list">
|
||||
<thead><th><%= l(:label_board) %></th><th><%= l(:field_description) %></th><th style="width:15%"></th><th style="width:15%"></th><th style="width:15%"></th></thead>
|
||||
<tbody>
|
||||
<% @project.boards.each do |board|
|
||||
next if board.new_record? %>
|
||||
<tr class="<%= cycle 'odd', 'even' %>">
|
||||
<td><%=h board.name %></td>
|
||||
<td><%=h board.description %></td>
|
||||
<td align="center">
|
||||
<% if authorize_for("boards", "edit") %>
|
||||
<%= link_to image_tag('2uparrow.png', :alt => l(:label_sort_highest)), {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board, :position => 'highest'}, :method => :post, :title => l(:label_sort_highest) %>
|
||||
<%= link_to image_tag('1uparrow.png', :alt => l(:label_sort_higher)), {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board, :position => 'higher'}, :method => :post, :title => l(:label_sort_higher) %> -
|
||||
<%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %>
|
||||
<%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="center"><%= link_to_if_authorized l(:button_edit), {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board}, :class => 'icon icon-edit' %></td>
|
||||
<td align="center"><%= link_to_if_authorized l(:button_delete), {:controller => 'boards', :action => 'destroy', :project_id => @project, :id => board}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
<p><%= link_to_if_authorized l(:label_board_new), {:controller => 'boards', :action => 'new', :project_id => @project} %></p>
|
||||
@@ -0,0 +1,26 @@
|
||||
<% if @project.issue_categories.any? %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<th><%= l(:label_issue_category) %></th>
|
||||
<th><%= l(:field_assigned_to) %></th>
|
||||
<th style="width:15%"></th>
|
||||
<th style="width:15%"></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% for category in @project.issue_categories %>
|
||||
<% unless category.new_record? %>
|
||||
<tr class="<%= cycle 'odd', 'even' %>">
|
||||
<td><%=h(category.name) %></td>
|
||||
<td><%=h(category.assigned_to.name) if category.assigned_to %></td>
|
||||
<td align="center"><%= link_to_if_authorized l(:button_edit), { :controller => 'issue_categories', :action => 'edit', :id => category }, :class => 'icon icon-edit' %></td>
|
||||
<td align="center"><%= link_to_if_authorized l(:button_delete), {:controller => 'issue_categories', :action => 'destroy', :id => category}, :method => :post, :class => 'icon icon-del' %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
<p><%= link_to_if_authorized l(:label_issue_category_new), :controller => 'projects', :action => 'add_issue_category', :id => @project %></p>
|
||||
@@ -0,0 +1,48 @@
|
||||
<%= error_messages_for 'member' %>
|
||||
<% roles = Role.find_all_givable %>
|
||||
<% users = User.find_active(:all) - @project.users %>
|
||||
<% # members sorted by role position
|
||||
members = @project.members.find(:all, :include => [:role, :user]).sort{|x,y| x.role.position <=> y.role.position} %>
|
||||
|
||||
<% if members.any? %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<th><%= l(:label_user) %></th>
|
||||
<th><%= l(:label_role) %></th>
|
||||
<th style="width:15%"></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% members.each do |member| %>
|
||||
<% next if member.new_record? %>
|
||||
<tr class="<%= cycle 'odd', 'even' %>">
|
||||
<td><%= member.name %></td>
|
||||
<td align="center">
|
||||
<% if authorize_for('members', 'edit') %>
|
||||
<% remote_form_for(:member, member, :url => {:controller => 'members', :action => 'edit', :id => member}, :method => :post) do |f| %>
|
||||
<%= f.select :role_id, roles.collect{|role| [role.name, role.id]}, {}, :class => "small" %>
|
||||
<%= submit_tag l(:button_change), :class => "small" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to_remote l(:button_delete), { :url => {:controller => 'members', :action => 'destroy', :id => member},
|
||||
:method => :post
|
||||
}, :title => l(:button_delete),
|
||||
:class => 'icon icon-del' %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<% end; reset_cycle %>
|
||||
</table>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
<% if authorize_for('members', 'new') && !users.empty? %>
|
||||
<% remote_form_for(:member, @member, :url => {:controller => 'members', :action => 'new', :id => @project}, :method => :post) do |f| %>
|
||||
<p><label for="member_user_id"><%=l(:label_member_new)%></label><br />
|
||||
<%= f.select :user_id, users.collect{|user| [user.name, user.id]} %>
|
||||
<%= l(:label_role) %>: <%= f.select :role_id, roles.collect{|role| [role.name, role.id]}, :selected => nil %>
|
||||
<%= submit_tag l(:button_add) %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,16 @@
|
||||
<% form_for :project, @project,
|
||||
:url => { :action => 'modules', :id => @project },
|
||||
:html => {:id => 'modules-form'} do |f| %>
|
||||
|
||||
<div class=box>
|
||||
<strong>Select modules to enable for this project:</strong>
|
||||
<br />
|
||||
<% Redmine::AccessControl.available_project_modules.each do |m| %>
|
||||
<p><label><%= check_box_tag 'enabled_modules[]', m, @project.module_enabled?(m) %> <%= m.to_s.humanize %></label></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<p><%= check_all_links 'modules-form' %></p>
|
||||
<p><%= submit_tag l(:button_save) %></p>
|
||||
|
||||
<% end %>
|
||||
@@ -0,0 +1,20 @@
|
||||
<% remote_form_for :repository, @repository,
|
||||
:url => { :controller => 'repositories', :action => 'edit', :id => @project },
|
||||
:builder => TabularFormBuilder do |f| %>
|
||||
|
||||
<%= error_messages_for 'repository' %>
|
||||
|
||||
<div class="box tabular">
|
||||
<p><label>SCM</label><%= scm_select_tag(@repository) %></p>
|
||||
<%= repository_field_tags(f, @repository) if @repository %>
|
||||
</div>
|
||||
|
||||
<div class="contextual">
|
||||
<%= link_to(l(:button_delete), {:controller => 'repositories', :action => 'destroy', :id => @project},
|
||||
:confirm => l(:text_are_you_sure),
|
||||
:method => :post,
|
||||
:class => 'icon icon-del') if @repository && !@repository.new_record? %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag((@repository.nil? || @repository.new_record?) ? l(:button_create) : l(:button_save)) %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,29 @@
|
||||
<% if @project.versions.any? %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<th><%= l(:label_version) %></th>
|
||||
<th><%= l(:field_effective_date) %></th>
|
||||
<th><%= l(:field_description) %></th>
|
||||
<th><%= l(:label_wiki_page) unless @project.wiki.nil? %></th>
|
||||
<th style="width:15%"></th>
|
||||
<th style="width:15%"></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% for version in @project.versions.sort %>
|
||||
<tr class="<%= cycle 'odd', 'even' %>">
|
||||
<td><%= link_to h(version.name), :controller => 'versions', :action => 'show', :id => version %></td>
|
||||
<td align="center"><%= format_date(version.effective_date) %></td>
|
||||
<td><%=h version.description %></td>
|
||||
<td><%= link_to(version.wiki_page_title, :controller => 'wiki', :page => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || @project.wiki.nil? %></td>
|
||||
<td align="center"><%= link_to_if_authorized l(:button_edit), { :controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %></td>
|
||||
<td align="center"><%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy', :id => version}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %></td>
|
||||
</td>
|
||||
</tr>
|
||||
<% end; reset_cycle %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
<p><%= link_to_if_authorized l(:label_version_new), :controller => 'projects', :action => 'add_version', :id => @project %></p>
|
||||
@@ -0,0 +1,18 @@
|
||||
<% remote_form_for :wiki, @wiki,
|
||||
:url => { :controller => 'wikis', :action => 'edit', :id => @project },
|
||||
:builder => TabularFormBuilder do |f| %>
|
||||
|
||||
<%= error_messages_for 'wiki' %>
|
||||
|
||||
<div class="box tabular">
|
||||
<p><%= f.text_field :start_page, :size => 60, :required => true %><br />
|
||||
<em><%= l(:text_unallowed_characters) %>: , . / ? ; : |</em></p>
|
||||
</div>
|
||||
|
||||
<div class="contextual">
|
||||
<%= link_to(l(:button_delete), {:controller => 'wikis', :action => 'destroy', :id => @project},
|
||||
:class => 'icon icon-del') if @wiki && !@wiki.new_record? %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag((@wiki.nil? || @wiki.new_record?) ? l(:button_create) : l(:button_save)) %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,85 @@
|
||||
<h2><%=l(:label_overview)%></h2>
|
||||
|
||||
<div class="splitcontentleft">
|
||||
<%= textilizable @project.description %>
|
||||
<ul>
|
||||
<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %>
|
||||
<% if @subprojects.any? %>
|
||||
<li><%=l(:label_subproject_plural)%>: <%= @subprojects.collect{|p| link_to(h(p.name), :action => 'show', :id => p)}.join(", ") %></li>
|
||||
<% end %>
|
||||
<% if @project.parent %>
|
||||
<li><%=l(:field_parent)%>: <%= link_to h(@project.parent.name), :controller => 'projects', :action => 'show', :id => @project.parent %></li>
|
||||
<% end %>
|
||||
<% for custom_value in @custom_values %>
|
||||
<% if !custom_value.value.empty? %>
|
||||
<li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<% if User.current.allowed_to?(:view_issues, @project) %>
|
||||
<div class="box">
|
||||
<h3 class="icon22 icon22-tracker"><%=l(:label_issue_tracking)%></h3>
|
||||
<ul>
|
||||
<% for tracker in @trackers %>
|
||||
<li><%= link_to tracker.name, :controller => 'issues', :action => 'index', :project_id => @project,
|
||||
:set_filter => 1,
|
||||
"tracker_id" => tracker.id %>:
|
||||
<%= @open_issues_by_tracker[tracker] || 0 %> <%= lwr(:label_open_issues, @open_issues_by_tracker[tracker] || 0) %>
|
||||
<%= l(:label_on) %> <%= @total_issues_by_tracker[tracker] || 0 %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<p><%= link_to l(:label_issue_view_all), :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="splitcontentright">
|
||||
<% if @members_by_role.any? %>
|
||||
<div class="box">
|
||||
<h3 class="icon22 icon22-users"><%=l(:label_member_plural)%></h3>
|
||||
<p><% @members_by_role.keys.sort.each do |role| %>
|
||||
<%= role.name %>:
|
||||
<%= @members_by_role[role].collect(&:user).sort.collect{|u| link_to_user u}.join(", ") %>
|
||||
<br />
|
||||
<% end %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if @news.any? && authorize_for('news', 'index') %>
|
||||
<div class="box">
|
||||
<h3><%=l(:label_news_latest)%></h3>
|
||||
<%= render :partial => 'news/news', :collection => @news %>
|
||||
<p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<% if authorize_for('projects', 'add_issue') && @project.trackers.any? %>
|
||||
<h3><%= l(:label_issue_new) %></h3>
|
||||
<%= l(:label_tracker) %>: <%= new_issue_selector %>
|
||||
<% end %>
|
||||
|
||||
<% planning_links = []
|
||||
planning_links << link_to_if_authorized(l(:label_calendar), :action => 'calendar', :id => @project)
|
||||
planning_links << link_to_if_authorized(l(:label_gantt), :action => 'gantt', :id => @project)
|
||||
planning_links.compact!
|
||||
unless planning_links.empty? %>
|
||||
<h3>Planning</h3>
|
||||
<p><%= planning_links.join(' | ') %></p>
|
||||
<% end %>
|
||||
|
||||
<% if @total_hours && User.current.allowed_to?(:view_time_entries, @project) %>
|
||||
<h3><%= l(:label_spent_time) %></h3>
|
||||
<p><span class="icon icon-time"><%= lwr(:label_f_hour, @total_hours) %></span></p>
|
||||
<p><%= link_to(l(:label_details), {:controller => 'timelog', :action => 'details', :project_id => @project}) %> |
|
||||
<%= link_to(l(:label_report), {:controller => 'timelog', :action => 'report', :project_id => @project}) %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom, {:action => 'activity', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
|
||||
<% end %>
|
||||
|
||||
<% set_html_title l(:label_overview) -%>
|
||||
Reference in New Issue
Block a user