Redmine 3.4.4
This commit is contained in:
commit
64924a6376
2112 changed files with 259028 additions and 0 deletions
35
app/views/account/login.html.erb
Normal file
35
app/views/account/login.html.erb
Normal file
|
@ -0,0 +1,35 @@
|
|||
<%= call_hook :view_account_login_top %>
|
||||
|
||||
<div id="login-form">
|
||||
<%= form_tag(signin_path, onsubmit: 'return keepAnchorOnSignIn(this);') do %>
|
||||
<%= back_url_hidden_field_tag %>
|
||||
|
||||
<label for="username"><%=l(:field_login)%></label>
|
||||
<%= text_field_tag 'username', params[:username], :tabindex => '1' %>
|
||||
|
||||
<label for="password">
|
||||
<%=l(:field_password)%>
|
||||
<%= link_to l(:label_password_lost), lost_password_path, :class => "lost_password" if Setting.lost_password? %>
|
||||
</label>
|
||||
<%= password_field_tag 'password', nil, :tabindex => '2' %>
|
||||
|
||||
<% if Setting.openid? %>
|
||||
<label for="openid_url"><%=l(:field_identity_url)%></label>
|
||||
<%= text_field_tag "openid_url", nil, :tabindex => '3' %>
|
||||
<% end %>
|
||||
|
||||
<% if Setting.autologin? %>
|
||||
<label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label>
|
||||
<% end %>
|
||||
|
||||
<input type="submit" name="login" value="<%=l(:button_login)%>" tabindex="5" id="login-submit" />
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= call_hook :view_account_login_bottom %>
|
||||
|
||||
<% if params[:username].present? %>
|
||||
<%= javascript_tag "$('#password').focus();" %>
|
||||
<% else %>
|
||||
<%= javascript_tag "$('#username').focus();" %>
|
||||
<% end %>
|
3
app/views/account/logout.html.erb
Normal file
3
app/views/account/logout.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<%= form_tag(signout_path) do %>
|
||||
<p><%= submit_tag l(:label_logout) %></p>
|
||||
<% end %>
|
11
app/views/account/lost_password.html.erb
Normal file
11
app/views/account/lost_password.html.erb
Normal file
|
@ -0,0 +1,11 @@
|
|||
<h2><%=l(:label_password_lost)%></h2>
|
||||
|
||||
<%= form_tag(lost_password_path) do %>
|
||||
<div class="box tabular">
|
||||
<p>
|
||||
<label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label>
|
||||
<%= text_field_tag 'mail', nil, :size => 40 %>
|
||||
<%= submit_tag l(:button_submit) %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
20
app/views/account/password_recovery.html.erb
Normal file
20
app/views/account/password_recovery.html.erb
Normal file
|
@ -0,0 +1,20 @@
|
|||
<h2><%=l(:label_password_lost)%></h2>
|
||||
|
||||
<%= error_messages_for 'user' %>
|
||||
|
||||
<%= form_tag(lost_password_path) do %>
|
||||
<%= hidden_field_tag 'token', @token.value %>
|
||||
<div class="box tabular">
|
||||
<p>
|
||||
<label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label>
|
||||
<%= password_field_tag 'new_password', nil, :size => 25 %>
|
||||
<em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label>
|
||||
<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %>
|
||||
</p>
|
||||
</div>
|
||||
<p><%= submit_tag l(:button_save) %></p>
|
||||
<% end %>
|
38
app/views/account/register.html.erb
Normal file
38
app/views/account/register.html.erb
Normal file
|
@ -0,0 +1,38 @@
|
|||
<h2><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h2>
|
||||
|
||||
<%= labelled_form_for @user, :url => register_path do |f| %>
|
||||
<%= error_messages_for 'user' %>
|
||||
|
||||
<div class="box tabular">
|
||||
<% if @user.auth_source_id.nil? %>
|
||||
<p><%= f.text_field :login, :size => 25, :required => true %></p>
|
||||
|
||||
<p><%= f.password_field :password, :size => 25, :required => true %>
|
||||
<em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p>
|
||||
|
||||
<p><%= f.password_field :password_confirmation, :size => 25, :required => true %></p>
|
||||
<% end %>
|
||||
|
||||
<p><%= f.text_field :firstname, :required => true %></p>
|
||||
<p><%= f.text_field :lastname, :required => true %></p>
|
||||
<p><%= f.text_field :mail, :required => true %></p>
|
||||
<%= labelled_fields_for :pref, @user.pref do |pref_fields| %>
|
||||
<p><%= pref_fields.check_box :hide_mail %></p>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% unless @user.force_default_language? %>
|
||||
<p><%= f.select :language, lang_options_for_select %></p>
|
||||
<% end %>
|
||||
|
||||
<% if Setting.openid? %>
|
||||
<p><%= f.text_field :identity_url %></p>
|
||||
<% end %>
|
||||
|
||||
<% @user.custom_field_values.select {|v| (Setting.show_custom_fields_on_registration? && v.editable?) || v.required?}.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :user, value %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_submit) %>
|
||||
<% end %>
|
72
app/views/activities/index.html.erb
Normal file
72
app/views/activities/index.html.erb
Normal file
|
@ -0,0 +1,72 @@
|
|||
<h2><%= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h2>
|
||||
<p class="subtitle"><%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %></p>
|
||||
|
||||
<div id="activity">
|
||||
<% @events_by_day.keys.sort.reverse.each do |day| %>
|
||||
<h3><%= format_activity_day(day) %></h3>
|
||||
<dl>
|
||||
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
|
||||
<dt class="<%= e.event_type %> icon icon-<%= e.event_type %> <%= "grouped" if in_group %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
|
||||
<%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
|
||||
<span class="time"><%= format_time(e.event_datetime, false) %></span>
|
||||
<%= content_tag('span', e.project, :class => 'project') if @project.nil? || @project != e.project %>
|
||||
<%= link_to format_activity_title(e.event_title), e.event_url %>
|
||||
</dt>
|
||||
<dd class="<%= "grouped" if in_group %>"><span class="description"><%= format_activity_description(e.event_description) %></span>
|
||||
<span class="author"><%= link_to_user(e.event_author) if e.respond_to?(:event_author) %></span></dd>
|
||||
<% end -%>
|
||||
</dl>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<%= content_tag('p', l(:label_no_data), :class => 'nodata') if @events_by_day.empty? %>
|
||||
|
||||
<span class="pagination">
|
||||
<ul class="pages">
|
||||
<li class="previous page">
|
||||
<%= link_to("\xc2\xab " + l(:label_previous),
|
||||
{:params => request.query_parameters.merge(:from => @date_to - @days - 1)},
|
||||
:title => l(:label_date_from_to, :start => format_date(@date_to - 2*@days), :end => format_date(@date_to - @days - 1)),
|
||||
:accesskey => accesskey(:previous)) %>
|
||||
</li><% unless @date_to > User.current.today %><li class="next page">
|
||||
<%= link_to(l(:label_next) + " \xc2\xbb",
|
||||
{:params => request.query_parameters.merge(:from => @date_to + @days - 1)},
|
||||
:title => l(:label_date_from_to, :start => format_date(@date_to), :end => format_date(@date_to + @days - 1)),
|
||||
:accesskey => accesskey(:next)) %><% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</span>
|
||||
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to_with_query_parameters 'Atom', 'from' => nil, :key => User.current.rss_key %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom, :params => request.query_parameters.merge(:from => nil, :key => User.current.rss_key), :format => 'atom') %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= form_tag({}, :method => :get, :id => 'activity_scope_form') do %>
|
||||
<h3><%= l(:label_activity) %></h3>
|
||||
<ul>
|
||||
<% @activity.event_types.each do |t| %>
|
||||
<li>
|
||||
<%= check_box_tag "show_#{t}", 1, @activity.scope.include?(t) %>
|
||||
<label for="show_<%=t%>">
|
||||
<%= link_to(l("label_#{t.singularize}_plural"),
|
||||
{"show_#{t}" => 1, :user_id => params[:user_id], :from => params[:from]})%>
|
||||
</label>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% if @project && @project.descendants.active.any? %>
|
||||
<%= hidden_field_tag 'with_subprojects', 0, :id => nil %>
|
||||
<p><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label></p>
|
||||
<% end %>
|
||||
<%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %>
|
||||
<%= hidden_field_tag('from', params[:from]) unless params[:from].blank? %>
|
||||
<p><%= submit_tag l(:button_apply), :class => 'button-small', :name => 'submit' %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% html_title(l(:label_activity), @author) -%>
|
3
app/views/admin/_menu.html.erb
Normal file
3
app/views/admin/_menu.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<div id="admin-menu">
|
||||
<%= render_menu :admin_menu %>
|
||||
</div>
|
8
app/views/admin/_no_data.html.erb
Normal file
8
app/views/admin/_no_data.html.erb
Normal file
|
@ -0,0 +1,8 @@
|
|||
<div class="nodata">
|
||||
<%= form_tag({:action => 'default_configuration'}) do %>
|
||||
<%= simple_format(l(:text_no_configuration_data)) %>
|
||||
<p><%= l(:field_language) %>:
|
||||
<%= select_tag 'lang', options_for_select(lang_options_for_select(false), current_language.to_s) %>
|
||||
<%= submit_tag l(:text_load_default_configuration) %></p>
|
||||
<% end %>
|
||||
</div>
|
8
app/views/admin/index.html.erb
Normal file
8
app/views/admin/index.html.erb
Normal file
|
@ -0,0 +1,8 @@
|
|||
<h2><%=l(:label_administration)%></h2>
|
||||
|
||||
<div id="admin-index">
|
||||
<%= render :partial => 'no_data' if @no_configuration_data %>
|
||||
<%= render :partial => 'menu' %>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_administration)) -%>
|
18
app/views/admin/info.html.erb
Normal file
18
app/views/admin/info.html.erb
Normal file
|
@ -0,0 +1,18 @@
|
|||
<h2><%=l(:label_information_plural)%></h2>
|
||||
|
||||
<p><strong><%= Redmine::Info.versioned_name %></strong></p>
|
||||
|
||||
<table class="list">
|
||||
<% @checklist.each do |label, result| %>
|
||||
<tr>
|
||||
<td class="name"><%= label.is_a?(Symbol) ? l(label) : label %></td>
|
||||
<td class="tick"><span class="icon-only <%= (result ? 'icon-ok' : 'icon-error') %>"></span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<br />
|
||||
<div class="box">
|
||||
<pre><%= Redmine::Info.environment %></pre>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_information_plural)) -%>
|
63
app/views/admin/plugins.html.erb
Normal file
63
app/views/admin/plugins.html.erb
Normal file
|
@ -0,0 +1,63 @@
|
|||
<%= title l(:label_plugins) %>
|
||||
|
||||
<% if @plugins.any? %>
|
||||
<table class="list plugins">
|
||||
<% @plugins.each do |plugin| %>
|
||||
<tr id="plugin-<%= plugin.id %>">
|
||||
<td class="name"><span class="name"><%= plugin.name %></span>
|
||||
<%= content_tag('span', plugin.description, :class => 'description') unless plugin.description.blank? %>
|
||||
<%= content_tag('span', link_to(plugin.url, plugin.url), :class => 'url') unless plugin.url.blank? %>
|
||||
</td>
|
||||
<td class="author"><%= plugin.author_url.blank? ? plugin.author : link_to(plugin.author, plugin.author_url) %></td>
|
||||
<td class="version"><span class="icon"><%= plugin.version %></span></td>
|
||||
<td class="configure"><%= link_to(l(:button_configure), plugin_settings_path(plugin)) if plugin.configurable? %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<p><a href="#" id="check-for-updates"><%= l(:label_check_for_updates) %></a></p>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
$(document).ready(function(){
|
||||
$("#check-for-updates").click(function(e){
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
dataType: "jsonp",
|
||||
url: "https://www.redmine.org/plugins/check_updates",
|
||||
data: <%= raw_json plugin_data_for_updates(@plugins) %>,
|
||||
timeout: 3000,
|
||||
beforeSend: function(){
|
||||
$('#ajax-indicator').show();
|
||||
},
|
||||
success: function(data){
|
||||
$('#ajax-indicator').hide();
|
||||
$("table.plugins td.version span").addClass("unknown");
|
||||
$.each(data, function(plugin_id, plugin_data){
|
||||
var s = $("tr#plugin-"+plugin_id+" td.version span");
|
||||
s.removeClass("icon-ok icon-warning unknown");
|
||||
if (plugin_data.url) {
|
||||
if (s.parent("a").length>0) {
|
||||
s.unwrap();
|
||||
}
|
||||
s.addClass("found");
|
||||
s.wrap($("<a></a>").attr("href", plugin_data.url).attr("target", "_blank"));
|
||||
}
|
||||
if (plugin_data.c == s.text()) {
|
||||
s.addClass("icon-ok");
|
||||
} else if (plugin_data.c) {
|
||||
s.addClass("icon-warning");
|
||||
s.attr("title", "<%= escape_javascript l(:label_latest_compatible_version) %>: "+plugin_data.c);
|
||||
}
|
||||
});
|
||||
$("table.plugins td.version span.unknown").addClass("icon-help").attr("title", "<%= escape_javascript l(:label_unknown_plugin) %>");
|
||||
},
|
||||
error: function(){
|
||||
$('#ajax-indicator').hide();
|
||||
alert("Unable to retrieve plugin informations from www.redmine.org");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
<% end if @plugins.any? %>
|
48
app/views/admin/projects.html.erb
Normal file
48
app/views/admin/projects.html.erb
Normal file
|
@ -0,0 +1,48 @@
|
|||
<div class="contextual">
|
||||
<%= link_to l(:label_project_new), new_project_path, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<%= title l(:label_project_plural) %>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset><legend><%= l(:label_filter_plural) %></legend>
|
||||
<label for='status'><%= l(:field_status) %>:</label>
|
||||
<%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
|
||||
<label for='name'><%= l(:label_project) %>:</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), admin_projects_path, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% if @projects.any? %>
|
||||
<div class="autoscroll">
|
||||
<table class="list">
|
||||
<thead><tr>
|
||||
<th><%=l(:label_project)%></th>
|
||||
<th><%=l(:field_is_public)%></th>
|
||||
<th><%=l(:field_created_on)%></th>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% project_tree(@projects, :init_level => true) do |project, level| %>
|
||||
<tr class="<%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
|
||||
<td class="name"><span><%= link_to_project_settings(project, {}, :title => project.short_description) %></span></td>
|
||||
<td><%= checked_image project.is_public? %></td>
|
||||
<td><%= format_date(project.created_on) %></td>
|
||||
<td class="buttons">
|
||||
<%= link_to(l(:button_archive), archive_project_path(project, :status => params[:status]), :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock') unless project.archived? %>
|
||||
<%= link_to(l(:button_unarchive), unarchive_project_path(project, :status => params[:status]), :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %>
|
||||
<%= link_to(l(:button_copy), copy_project_path(project), :class => 'icon icon-copy') %>
|
||||
<%= link_to(l(:button_delete), project_path(project), :method => :delete, :class => 'icon icon-del') %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<span class="pagination"><%= pagination_links_full @project_pages, @project_count %></span>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
47
app/views/attachments/_form.html.erb
Normal file
47
app/views/attachments/_form.html.erb
Normal file
|
@ -0,0 +1,47 @@
|
|||
<% attachment_param ||= 'attachments' %>
|
||||
<% saved_attachments ||= container.saved_attachments if defined?(container) && container %>
|
||||
<% multiple = true unless defined?(multiple) && multiple == false %>
|
||||
<% show_add = multiple || saved_attachments.blank? %>
|
||||
<% description = (defined?(description) && description == false ? false : true) %>
|
||||
<% css_class = (defined?(filedrop) && filedrop == false ? '' : 'filedrop') %>
|
||||
|
||||
<span class="attachments_form">
|
||||
<span class="attachments_fields">
|
||||
<% if saved_attachments.present? %>
|
||||
<% saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("#{attachment_param}[p#{i}][filename]", attachment.filename, :class => 'filename') %>
|
||||
<% if attachment.container_id.present? %>
|
||||
<%= link_to l(:label_delete), "#", :onclick => "$(this).closest('.attachments_form').find('.add_attachment').show(); $(this).parent().remove(); return false;", :class => 'icon-only icon-del' %>
|
||||
<%= hidden_field_tag "#{attachment_param}[p#{i}][id]", attachment.id %>
|
||||
<% else %>
|
||||
<%= text_field_tag("#{attachment_param}[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description') if description %>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'icon-only icon-del remove-upload') %>
|
||||
<%= hidden_field_tag "#{attachment_param}[p#{i}][token]", attachment.token %>
|
||||
<% end %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="add_attachment" style="<%= show_add ? nil : 'display:none;' %>">
|
||||
<%= file_field_tag "#{attachment_param}[dummy][file]",
|
||||
:id => nil,
|
||||
:class => "file_selector #{css_class}",
|
||||
:multiple => multiple,
|
||||
:onchange => 'addInputFiles(this);',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js'),
|
||||
:param => attachment_param,
|
||||
:description => description,
|
||||
:description_placeholder => l(:label_optional_description)
|
||||
} %>
|
||||
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
45
app/views/attachments/_links.html.erb
Normal file
45
app/views/attachments/_links.html.erb
Normal file
|
@ -0,0 +1,45 @@
|
|||
<div class="attachments">
|
||||
<div class="contextual">
|
||||
<%= link_to(l(:label_edit_attachments),
|
||||
container_attachments_edit_path(container),
|
||||
:title => l(:label_edit_attachments),
|
||||
:class => 'icon-only icon-edit'
|
||||
) if options[:editable] %>
|
||||
</div>
|
||||
<table>
|
||||
<% for attachment in attachments %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= link_to_attachment attachment, class: 'icon icon-attachment' -%>
|
||||
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||
<%= link_to_attachment attachment, class: 'icon-only icon-download', title: l(:button_download), download: true -%>
|
||||
</td>
|
||||
<td><%= attachment.description unless attachment.description.blank? %></td>
|
||||
<td>
|
||||
<% if options[:author] %>
|
||||
<span class="author"><%= attachment.author %>, <%= format_time(attachment.created_on) %></span>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% if options[:deletable] %>
|
||||
<%= link_to l(:button_delete), attachment_path(attachment),
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:method => :delete,
|
||||
:class => 'delete icon-only icon-del',
|
||||
:title => l(:button_delete) %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% if defined?(thumbnails) && thumbnails %>
|
||||
<% images = attachments.select(&:thumbnailable?) %>
|
||||
<% if images.any? %>
|
||||
<div class="thumbnails">
|
||||
<% images.each do |attachment| %>
|
||||
<div><%= thumbnail_tag(attachment) %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
2
app/views/attachments/destroy.js.erb
Normal file
2
app/views/attachments/destroy.js.erb
Normal file
|
@ -0,0 +1,2 @@
|
|||
$('#attachments_<%= j params[:attachment_id] %>').closest('.attachments_form').find('.add_attachment').show();
|
||||
$('#attachments_<%= j params[:attachment_id] %>').remove();
|
10
app/views/attachments/diff.html.erb
Normal file
10
app/views/attachments/diff.html.erb
Normal file
|
@ -0,0 +1,10 @@
|
|||
<%= render :layout => 'layouts/file' do %>
|
||||
<%= form_tag({}, :method => 'get') do %>
|
||||
<p>
|
||||
<%= l(:label_view_diff) %>:
|
||||
<label><%= radio_button_tag 'type', 'inline', @diff_type != 'sbs', :onchange => "this.form.submit()" %> <%= l(:label_diff_inline) %></label>
|
||||
<label><%= radio_button_tag 'type', 'sbs', @diff_type == 'sbs', :onchange => "this.form.submit()" %> <%= l(:label_diff_side_by_side) %></label>
|
||||
</p>
|
||||
<% end %>
|
||||
<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type, :diff_style => nil} %>
|
||||
<% end %>
|
30
app/views/attachments/edit_all.html.erb
Normal file
30
app/views/attachments/edit_all.html.erb
Normal file
|
@ -0,0 +1,30 @@
|
|||
<h2><%= l(:label_edit_attachments) %></h2>
|
||||
|
||||
<%= error_messages_for *@attachments %>
|
||||
|
||||
<%= form_tag(container_attachments_path(@container), :method => 'patch') do %>
|
||||
<%= back_url_hidden_field_tag %>
|
||||
<div class="box attachments">
|
||||
<table>
|
||||
<% @attachments.each do |attachment| %>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<span class="icon icon-attachment"><%= attachment.filename_was %></span>
|
||||
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||
<span class="author"><%= attachment.author %>, <%= format_time(attachment.created_on) %></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="attachment-<%= attachment.id %>">
|
||||
<td><%= text_field_tag "attachments[#{attachment.id}][filename]", attachment.filename, :size => 40 %></td>
|
||||
<td>
|
||||
<%= text_field_tag "attachments[#{attachment.id}][description]", attachment.description, :size => 80, :placeholder => l(:label_optional_description) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
<p>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<%= link_to l(:button_cancel), back_url if back_url.present? %>
|
||||
</p>
|
||||
<% end %>
|
4
app/views/attachments/file.html.erb
Normal file
4
app/views/attachments/file.html.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
<%= render :layout => 'layouts/file' do %>
|
||||
|
||||
<%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %>
|
||||
<% end %>
|
3
app/views/attachments/image.html.erb
Normal file
3
app/views/attachments/image.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<%= render :layout => 'layouts/file' do %>
|
||||
<%= render :partial => 'common/image', :locals => {:path => download_named_attachment_path(@attachment, @attachment.filename), :alt => @attachment.filename} %>
|
||||
<% end %>
|
11
app/views/attachments/other.html.erb
Normal file
11
app/views/attachments/other.html.erb
Normal file
|
@ -0,0 +1,11 @@
|
|||
<%= render :layout => 'layouts/file' do %>
|
||||
<%= render :partial => 'common/other',
|
||||
:locals => {
|
||||
:download_link => link_to_attachment(
|
||||
@attachment,
|
||||
:text => l(:label_no_preview_download),
|
||||
:download => true,
|
||||
:class => 'icon icon-download'
|
||||
)
|
||||
} %>
|
||||
<% end %>
|
1
app/views/attachments/show.api.rsb
Normal file
1
app/views/attachments/show.api.rsb
Normal file
|
@ -0,0 +1 @@
|
|||
render_api_attachment(@attachment, api)
|
4
app/views/attachments/upload.api.rsb
Normal file
4
app/views/attachments/upload.api.rsb
Normal file
|
@ -0,0 +1,4 @@
|
|||
api.upload do
|
||||
api.id @attachment.id
|
||||
api.token @attachment.token
|
||||
end
|
14
app/views/attachments/upload.js.erb
Normal file
14
app/views/attachments/upload.js.erb
Normal file
|
@ -0,0 +1,14 @@
|
|||
var fileSpan = $('#attachments_<%= j params[:attachment_id] %>');
|
||||
<% if @attachment.new_record? %>
|
||||
fileSpan.hide();
|
||||
alert("<%= escape_javascript @attachment.errors.full_messages.join(', ') %>");
|
||||
<% else %>
|
||||
fileSpan.find('input.token').val('<%= j @attachment.token %>');
|
||||
fileSpan.find('a.remove-upload')
|
||||
.attr({
|
||||
"data-remote": true,
|
||||
"data-method": 'delete',
|
||||
href: '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>'
|
||||
})
|
||||
.off('click');
|
||||
<% end %>
|
6
app/views/auth_sources/_form.html.erb
Normal file
6
app/views/auth_sources/_form.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<%= error_messages_for 'auth_source' %>
|
||||
|
||||
<div class="box tabular">
|
||||
<p><%= f.text_field :name, :required => true %></p>
|
||||
<p><%= f.check_box :onthefly_register, :label => :field_onthefly %></p>
|
||||
</div>
|
24
app/views/auth_sources/_form_auth_source_ldap.html.erb
Normal file
24
app/views/auth_sources/_form_auth_source_ldap.html.erb
Normal file
|
@ -0,0 +1,24 @@
|
|||
<%= error_messages_for 'auth_source' %>
|
||||
|
||||
<div class="box tabular">
|
||||
<p><%= f.text_field :name, :required => true %></p>
|
||||
<p><%= f.text_field :host, :required => true %></p>
|
||||
<p><%= f.text_field :port, :required => true, :size => 6 %> <%= f.check_box :tls, :no_label => true %> LDAPS</p>
|
||||
<p><%= f.text_field :account %></p>
|
||||
<p><%= f.password_field :account_password, :label => :field_password,
|
||||
:name => 'dummy_password',
|
||||
:value => ((@auth_source.new_record? || @auth_source.account_password.blank?) ? '' : ('x'*15)),
|
||||
:onfocus => "this.value=''; this.name='auth_source[account_password]';",
|
||||
:onchange => "this.name='auth_source[account_password]';" %></p>
|
||||
<p><%= f.text_field :base_dn, :required => true, :size => 60 %></p>
|
||||
<p><%= f.text_area :filter, :size => 60, :label => :field_auth_source_ldap_filter %></p>
|
||||
<p><%= f.text_field :timeout, :size => 4 %></p>
|
||||
<p><%= f.check_box :onthefly_register, :label => :field_onthefly %></p>
|
||||
</div>
|
||||
|
||||
<fieldset class="box tabular"><legend><%=l(:label_attribute_plural)%></legend>
|
||||
<p><%= f.text_field :attr_login, :required => true, :size => 20 %></p>
|
||||
<p><%= f.text_field :attr_firstname, :size => 20 %></p>
|
||||
<p><%= f.text_field :attr_lastname, :size => 20 %></p>
|
||||
<p><%= f.text_field :attr_mail, :size => 20 %></p>
|
||||
</fieldset>
|
6
app/views/auth_sources/edit.html.erb
Normal file
6
app/views/auth_sources/edit.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<%= title [l(:label_auth_source_plural), auth_sources_path], @auth_source.name %>
|
||||
|
||||
<%= labelled_form_for @auth_source, :as => :auth_source, :url => auth_source_path(@auth_source), :html => {:id => 'auth_source_form'} do |f| %>
|
||||
<%= render :partial => auth_source_partial_name(@auth_source), :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
31
app/views/auth_sources/index.html.erb
Normal file
31
app/views/auth_sources/index.html.erb
Normal file
|
@ -0,0 +1,31 @@
|
|||
<div class="contextual">
|
||||
<%= link_to l(:label_auth_source_new), {:action => 'new'}, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<%= title l(:label_auth_source_plural) %>
|
||||
|
||||
<table class="list">
|
||||
<thead><tr>
|
||||
<th><%=l(:field_name)%></th>
|
||||
<th><%=l(:field_type)%></th>
|
||||
<th><%=l(:field_host)%></th>
|
||||
<th><%=l(:label_user_plural)%></th>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% for source in @auth_sources %>
|
||||
<tr id="auth-source-<%= source.id %>">
|
||||
<td class="name"><%= link_to(source.name, :action => 'edit', :id => source)%></td>
|
||||
<td><%= source.auth_method_name %></td>
|
||||
<td><%= source.host %></td>
|
||||
<td><%= source.users.count %></td>
|
||||
<td class="buttons">
|
||||
<%= link_to l(:button_test), try_connection_auth_source_path(source), :class => 'icon icon-test' %>
|
||||
<%= delete_link auth_source_path(source) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<span class="pagination"><%= pagination_links_full @auth_source_pages %></span>
|
7
app/views/auth_sources/new.html.erb
Normal file
7
app/views/auth_sources/new.html.erb
Normal file
|
@ -0,0 +1,7 @@
|
|||
<%= title [l(:label_auth_source_plural), auth_sources_path], "#{l(:label_auth_source_new)} (#{@auth_source.auth_method_name})" %>
|
||||
|
||||
<%= labelled_form_for @auth_source, :as => :auth_source, :url => auth_sources_path, :html => {:id => 'auth_source_form'} do |f| %>
|
||||
<%= hidden_field_tag 'type', @auth_source.type %>
|
||||
<%= render :partial => auth_source_partial_name(@auth_source), :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
7
app/views/auto_completes/issues.html.erb
Normal file
7
app/views/auto_completes/issues.html.erb
Normal file
|
@ -0,0 +1,7 @@
|
|||
<%= raw @issues.map {|issue| {
|
||||
'id' => issue.id,
|
||||
'label' => "#{issue.tracker} ##{issue.id}: #{issue.subject.to_s.truncate(60)}",
|
||||
'value' => issue.id
|
||||
}
|
||||
}.to_json
|
||||
%>
|
9
app/views/boards/_form.html.erb
Normal file
9
app/views/boards/_form.html.erb
Normal file
|
@ -0,0 +1,9 @@
|
|||
<%= error_messages_for @board %>
|
||||
|
||||
<div class="box tabular">
|
||||
<p><%= f.text_field :name, :required => true %></p>
|
||||
<p><%= f.text_field :description, :required => true, :size => 80 %></p>
|
||||
<% if @board.valid_parents.any? %>
|
||||
<p><%= f.select :parent_id, boards_options_for_select(@board.valid_parents), :include_blank => true, :label => :field_board_parent %></p>
|
||||
<% end %>
|
||||
</div>
|
6
app/views/boards/edit.html.erb
Normal file
6
app/views/boards/edit.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<h2><%= l(:label_board) %></h2>
|
||||
|
||||
<%= labelled_form_for @board, :url => project_board_path(@project, @board) do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
38
app/views/boards/index.html.erb
Normal file
38
app/views/boards/index.html.erb
Normal file
|
@ -0,0 +1,38 @@
|
|||
<h2><%= l(:label_board_plural) %></h2>
|
||||
|
||||
<table class="list boards">
|
||||
<thead><tr>
|
||||
<th><%= l(:label_board) %></th>
|
||||
<th><%= l(:label_topic_plural) %></th>
|
||||
<th><%= l(:label_message_plural) %></th>
|
||||
<th><%= l(:label_message_last) %></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% Board.board_tree(@boards) do |board, level| %>
|
||||
<tr>
|
||||
<td class="name" style="padding-left: <%= level * 18 %>px;">
|
||||
<%= link_to board.name, project_board_path(board.project, board), :class => "board" %><br />
|
||||
<%=h board.description %>
|
||||
</td>
|
||||
<td class="topic-count"><%= board.topics_count %></td>
|
||||
<td class="message-count"><%= board.messages_count %></td>
|
||||
<td class="last-message">
|
||||
<% if board.last_message %>
|
||||
<%= authoring board.last_message.created_on, board.last_message.author %><br />
|
||||
<%= link_to_message board.last_message %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_messages => 1, :key => User.current.rss_key} %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :show_messages => 1, :key => User.current.rss_key}) %>
|
||||
<% end %>
|
||||
|
||||
<% html_title l(:label_board_plural) %>
|
6
app/views/boards/new.html.erb
Normal file
6
app/views/boards/new.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<h2><%= l(:label_board_new) %></h2>
|
||||
|
||||
<%= labelled_form_for @board, :url => project_boards_path(@project) do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
66
app/views/boards/show.html.erb
Normal file
66
app/views/boards/show.html.erb
Normal file
|
@ -0,0 +1,66 @@
|
|||
<%= board_breadcrumb(@board) %>
|
||||
|
||||
<div class="contextual">
|
||||
<%= link_to l(:label_message_new),
|
||||
new_board_message_path(@board),
|
||||
:class => 'icon icon-add',
|
||||
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.allowed_to?(:add_messages, @board.project) %>
|
||||
<%= watcher_link(@board, User.current) %>
|
||||
</div>
|
||||
|
||||
<div id="add-message" style="display:none;">
|
||||
<% if User.current.allowed_to?(:add_messages, @board.project) %>
|
||||
<h2><%= link_to @board.name, project_board_path(@project, @board) %> » <%= l(:label_message_new) %></h2>
|
||||
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
||||
<%= render :partial => 'messages/form', :locals => {:f => f} %>
|
||||
<p><%= submit_tag l(:button_create) %>
|
||||
<%= preview_link(preview_board_message_path(@board), 'message-form') %> |
|
||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' %></p>
|
||||
<% end %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<h2><%= @board.name %></h2>
|
||||
<p class="subtitle"><%= @board.description %></p>
|
||||
|
||||
<% if @topics.any? %>
|
||||
<table class="list messages">
|
||||
<thead><tr>
|
||||
<th><%= l(:field_subject) %></th>
|
||||
<th><%= l(:field_author) %></th>
|
||||
<%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
|
||||
<%= sort_header_tag('replies', :caption => l(:label_reply_plural)) %>
|
||||
<%= sort_header_tag('updated_on', :caption => l(:label_message_last)) %>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% @topics.each do |topic| %>
|
||||
<tr id="message-<%= topic.id %>" class="message <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
|
||||
<td class="subject icon <%= 'icon-sticky' if topic.sticky? %> <%= 'icon-locked' if topic.locked? %>"><%= link_to topic.subject, board_message_path(@board, topic) %></td>
|
||||
<td class="author"><%= link_to_user(topic.author) %></td>
|
||||
<td class="created_on"><%= format_time(topic.created_on) %></td>
|
||||
<td class="reply-count"><%= topic.replies_count %></td>
|
||||
<td class="last_message">
|
||||
<% if topic.last_reply %>
|
||||
<%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
|
||||
<%= link_to_message topic.last_reply %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<span class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></span>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
|
||||
<% end %>
|
||||
|
||||
<% html_title @board.name %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %>
|
||||
<% end %>
|
45
app/views/calendars/show.html.erb
Normal file
45
app/views/calendars/show.html.erb
Normal file
|
@ -0,0 +1,45 @@
|
|||
<h2><%= @query.new_record? ? l(:label_calendar) : @query.name %></h2>
|
||||
|
||||
<%= form_tag({:controller => 'calendars', :action => 'show', :project_id => @project},
|
||||
:method => :get, :id => 'query_form') do %>
|
||||
<%= hidden_field_tag 'set_filter', '1' %>
|
||||
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
|
||||
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
|
||||
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
|
||||
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<p style="float:right;">
|
||||
<%= link_to_previous_month(@year, @month, :accesskey => accesskey(:previous)) %> | <%= link_to_next_month(@year, @month, :accesskey => accesskey(:next)) %>
|
||||
</p>
|
||||
|
||||
<p class="buttons">
|
||||
<%= label_tag('month', l(:label_month)) %>
|
||||
<%= select_month(@month, :prefix => "month", :discard_type => true) %>
|
||||
<%= label_tag('year', l(:label_year)) %>
|
||||
<%= select_year(@year, :prefix => "year", :discard_type => true) %>
|
||||
|
||||
<%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %>
|
||||
<%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= error_messages_for 'query' %>
|
||||
<% if @query.valid? %>
|
||||
<%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %>
|
||||
|
||||
<%= call_hook(:view_calendars_show_bottom, :year => @year, :month => @month, :project => @project, :query => @query) %>
|
||||
|
||||
<p class="legend cal">
|
||||
<span class="starting"><%= l(:text_tip_issue_begin_day) %></span>
|
||||
<span class="ending"><%= l(:text_tip_issue_end_day) %></span>
|
||||
<span class="starting ending"><%= l(:text_tip_issue_begin_end_day) %></span>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'issues/sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<% html_title(l(:label_calendar)) -%>
|
32
app/views/common/_calendar.html.erb
Normal file
32
app/views/common/_calendar.html.erb
Normal file
|
@ -0,0 +1,32 @@
|
|||
<table class="cal">
|
||||
<thead>
|
||||
<tr><th scope="col" title="<%= l(:label_week) %>" class="week-number"></th><% 7.times do |i| %><th scope="col"><%= day_name( (calendar.first_wday+i)%7 ) %></th><% end %></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<% day = calendar.startdt
|
||||
while day <= calendar.enddt %>
|
||||
<%= ("<td class='week-number' title='#{ l(:label_week) }'>#{(day+(11-day.cwday)%7).cweek}</td>".html_safe) if day.cwday == calendar.first_wday %>
|
||||
<td class="<%= day.month==calendar.month ? 'even' : 'odd' %><%= ' today' if User.current.today == day %>">
|
||||
<p class="day-num"><%= day.day %></p>
|
||||
<% calendar.events_on(day).each do |i| %>
|
||||
<% if i.is_a? Issue %>
|
||||
<div class="<%= i.css_classes %> <%= 'starting' if day == i.start_date %> <%= 'ending' if day == i.due_date %> tooltip">
|
||||
<%= "#{i.project} -" unless @project && @project == i.project %>
|
||||
<%= link_to_issue i, :truncate => 30 %>
|
||||
<span class="tip"><%= render_issue_tooltip i %></span>
|
||||
</div>
|
||||
<% else %>
|
||||
<span class="icon icon-package">
|
||||
<%= "#{i.project} -" unless @project && @project == i.project %>
|
||||
<%= link_to_version i%>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<%= '</tr><tr>'.html_safe if day.cwday==calendar.last_wday and day!=calendar.enddt %>
|
||||
<% day = day + 1
|
||||
end %>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
68
app/views/common/_diff.html.erb
Normal file
68
app/views/common/_diff.html.erb
Normal file
|
@ -0,0 +1,68 @@
|
|||
<% diff = Redmine::UnifiedDiff.new(
|
||||
diff, :type => diff_type,
|
||||
:max_lines => Setting.diff_max_lines_displayed.to_i,
|
||||
:style => diff_style) -%>
|
||||
|
||||
<% diff.each do |table_file| -%>
|
||||
<div class="autoscroll">
|
||||
<% if diff.diff_type == 'sbs' -%>
|
||||
<table class="filecontent">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4" class="filename">
|
||||
<%= table_file.file_name %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% table_file.each_line do |spacing, line| -%>
|
||||
<% if spacing -%>
|
||||
<tr class="spacing">
|
||||
<th class="line-num">...</th><td></td><th class="line-num">...</th><td></td>
|
||||
</tr>
|
||||
<% end -%>
|
||||
<tr>
|
||||
<th class="line-num"><%= line.nb_line_left %></th>
|
||||
<td class="line-code <%= line.type_diff_left %>">
|
||||
<pre><%= line.html_line_left.html_safe %></pre>
|
||||
</td>
|
||||
<th class="line-num"><%= line.nb_line_right %></th>
|
||||
<td class="line-code <%= line.type_diff_right %>">
|
||||
<pre><%= line.html_line_right.html_safe %></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<% end -%>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% else -%>
|
||||
<table class="filecontent">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" class="filename">
|
||||
<%= table_file.file_name %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% table_file.each_line do |spacing, line| %>
|
||||
<% if spacing -%>
|
||||
<tr class="spacing">
|
||||
<th class="line-num">...</th><th class="line-num">...</th><td></td>
|
||||
</tr>
|
||||
<% end -%>
|
||||
<tr>
|
||||
<th class="line-num"><%= line.nb_line_left %></th>
|
||||
<th class="line-num"><%= line.nb_line_right %></th>
|
||||
<td class="line-code <%= line.type_diff %>">
|
||||
<pre><%= line.html_line.html_safe %></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<% end -%>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end -%>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<%= l(:text_diff_truncated) if diff.truncated? %>
|
18
app/views/common/_file.html.erb
Normal file
18
app/views/common/_file.html.erb
Normal file
|
@ -0,0 +1,18 @@
|
|||
<div class="autoscroll">
|
||||
<table class="filecontent syntaxhl">
|
||||
<tbody>
|
||||
<% line_num = 1 %>
|
||||
<% syntax_highlight_lines(filename, Redmine::CodesetUtil.to_utf8_by_setting(content)).each do |line| %>
|
||||
<tr id="L<%= line_num %>">
|
||||
<th class="line-num">
|
||||
<a href="#L<%= line_num %>"><%= line_num %></a>
|
||||
</th>
|
||||
<td class="line-code">
|
||||
<pre><%= line.html_safe %></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<% line_num += 1 %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
1
app/views/common/_image.html.erb
Normal file
1
app/views/common/_image.html.erb
Normal file
|
@ -0,0 +1 @@
|
|||
<%= image_tag path, :alt => alt, :class => 'filecontent image' %>
|
7
app/views/common/_other.html.erb
Normal file
7
app/views/common/_other.html.erb
Normal file
|
@ -0,0 +1,7 @@
|
|||
<p class="nodata">
|
||||
<% if defined? download_link %>
|
||||
<%= t(:label_no_preview_alternative_html, link: download_link) %>
|
||||
<% else %>
|
||||
<%= l(:label_no_preview) %>
|
||||
<% end %>
|
||||
</p>
|
3
app/views/common/_preview.html.erb
Normal file
3
app/views/common/_preview.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<fieldset class="preview"><legend><%= l(:label_preview) %></legend>
|
||||
<%= textilizable @text, :attachments => @attachments, :object => @previewed %>
|
||||
</fieldset>
|
21
app/views/common/_tabs.html.erb
Normal file
21
app/views/common/_tabs.html.erb
Normal file
|
@ -0,0 +1,21 @@
|
|||
<div class="tabs">
|
||||
<ul>
|
||||
<% tabs.each do |tab| -%>
|
||||
<li><%= link_to l(tab[:label]), (tab[:url] || { :tab => tab[:name] }),
|
||||
:id => "tab-#{tab[:name]}",
|
||||
:class => (tab[:name] != selected_tab ? nil : 'selected'),
|
||||
:onclick => tab[:partial] ? "showTab('#{tab[:name]}', this.href); this.blur(); return false;" : nil %></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
<div class="tabs-buttons" style="display:none;">
|
||||
<button class="tab-left" type="button" onclick="moveTabLeft(this);"></button>
|
||||
<button class="tab-right" type="button" onclick="moveTabRight(this);"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% tabs.each do |tab| -%>
|
||||
<%= content_tag('div', render(:partial => tab[:partial], :locals => {:tab => tab} ),
|
||||
:id => "tab-content-#{tab[:name]}",
|
||||
:style => (tab[:name] != selected_tab ? 'display:none' : nil),
|
||||
:class => 'tab-content') if tab[:partial] %>
|
||||
<% end -%>
|
8
app/views/common/error.html.erb
Normal file
8
app/views/common/error.html.erb
Normal file
|
@ -0,0 +1,8 @@
|
|||
<h2><%= @status %></h2>
|
||||
|
||||
<% if @message.present? %>
|
||||
<p id="errorExplanation"><%= @message %></p>
|
||||
<% end %>
|
||||
<p><a href="javascript:history.back()"><%= l(:button_back) %></a></p>
|
||||
|
||||
<% html_title @status %>
|
5
app/views/common/error_messages.api.rsb
Normal file
5
app/views/common/error_messages.api.rsb
Normal file
|
@ -0,0 +1,5 @@
|
|||
api.array :errors do
|
||||
@error_messages.each do |message|
|
||||
api.error message
|
||||
end
|
||||
end
|
32
app/views/common/feed.atom.builder
Normal file
32
app/views/common/feed.atom.builder
Normal file
|
@ -0,0 +1,32 @@
|
|||
xml.instruct!
|
||||
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
|
||||
xml.title truncate_single_line_raw(@title, 100)
|
||||
xml.link "rel" => "self", "href" => url_for(:params => request.query_parameters, :only_path => false, :format => 'atom')
|
||||
xml.link "rel" => "alternate", "href" => url_for(:params => request.query_parameters.merge(:format => nil, :key => nil), :only_path => false)
|
||||
xml.id home_url
|
||||
xml.icon favicon_url
|
||||
xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
|
||||
xml.author { xml.name "#{Setting.app_title}" }
|
||||
xml.generator(:uri => Redmine::Info.url) { xml.text! Redmine::Info.app_name; }
|
||||
@items.each do |item|
|
||||
xml.entry do
|
||||
url = url_for(item.event_url(:only_path => false))
|
||||
if @project
|
||||
xml.title truncate_single_line_raw(item.event_title, 100)
|
||||
else
|
||||
xml.title truncate_single_line_raw("#{item.project} - #{item.event_title}", 100)
|
||||
end
|
||||
xml.link "rel" => "alternate", "href" => url
|
||||
xml.id url
|
||||
xml.updated item.event_datetime.xmlschema
|
||||
author = item.event_author if item.respond_to?(:event_author)
|
||||
xml.author do
|
||||
xml.name(author)
|
||||
xml.email(author.mail) if author.is_a?(User) && !author.mail.blank? && !author.pref.hide_mail
|
||||
end if author
|
||||
xml.content "type" => "html" do
|
||||
xml.text! textilizable(item, :event_description, :only_path => false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
156
app/views/context_menus/issues.html.erb
Normal file
156
app/views/context_menus/issues.html.erb
Normal file
|
@ -0,0 +1,156 @@
|
|||
<ul>
|
||||
<%= call_hook(:view_issues_context_menu_start, {:issues => @issues, :can => @can, :back => @back }) %>
|
||||
|
||||
<% if @issue -%>
|
||||
<li><%= context_menu_link l(:button_edit), edit_issue_path(@issue),
|
||||
:class => 'icon-edit', :disabled => !@can[:edit] %></li>
|
||||
<% else %>
|
||||
<li><%= context_menu_link l(:button_edit), bulk_edit_issues_path(:ids => @issue_ids),
|
||||
:class => 'icon-edit', :disabled => !@can[:edit] %></li>
|
||||
<% end %>
|
||||
|
||||
<% if @allowed_statuses.present? %>
|
||||
<li class="folder">
|
||||
<a href="#" class="submenu"><%= l(:field_status) %></a>
|
||||
<ul>
|
||||
<% @allowed_statuses.each do |s| -%>
|
||||
<li><%= context_menu_link s.name, bulk_update_issues_path(:ids => @issue_ids, :issue => {:status_id => s}, :back_url => @back), :method => :post,
|
||||
:selected => (@issue && s == @issue.status), :disabled => !@can[:edit] %></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if @trackers.present? %>
|
||||
<li class="folder">
|
||||
<a href="#" class="submenu"><%= l(:field_tracker) %></a>
|
||||
<ul>
|
||||
<% @trackers.each do |t| -%>
|
||||
<li><%= context_menu_link t.name, bulk_update_issues_path(:ids => @issue_ids, :issue => {'tracker_id' => t}, :back_url => @back), :method => :post,
|
||||
:selected => (@issue && t == @issue.tracker), :disabled => !@can[:edit] %></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if @safe_attributes.include?('priority_id') && @priorities.present? -%>
|
||||
<li class="folder">
|
||||
<a href="#" class="submenu"><%= l(:field_priority) %></a>
|
||||
<ul>
|
||||
<% @priorities.each do |p| -%>
|
||||
<li><%= context_menu_link p.name, bulk_update_issues_path(:ids => @issue_ids, :issue => {'priority_id' => p}, :back_url => @back), :method => :post,
|
||||
:selected => (@issue && p == @issue.priority), :disabled => (!@can[:edit]) %></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if @safe_attributes.include?('fixed_version_id') && @versions.present? -%>
|
||||
<li class="folder">
|
||||
<a href="#" class="submenu"><%= l(:field_fixed_version) %></a>
|
||||
<ul>
|
||||
<% @versions.sort.each do |v| -%>
|
||||
<li><%= context_menu_link format_version_name(v), bulk_update_issues_path(:ids => @issue_ids, :issue => {'fixed_version_id' => v}, :back_url => @back), :method => :post,
|
||||
:selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:edit] %></li>
|
||||
<% end -%>
|
||||
<li><%= context_menu_link l(:label_none), bulk_update_issues_path(:ids => @issue_ids, :issue => {'fixed_version_id' => 'none'}, :back_url => @back), :method => :post,
|
||||
:selected => (@issue && @issue.fixed_version.nil?), :disabled => !@can[:edit] %></li>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if @safe_attributes.include?('assigned_to_id') && @assignables.present? -%>
|
||||
<li class="folder">
|
||||
<a href="#" class="submenu"><%= l(:field_assigned_to) %></a>
|
||||
<ul>
|
||||
<% if @assignables.include?(User.current) %>
|
||||
<li><%= context_menu_link "<< #{l(:label_me)} >>", bulk_update_issues_path(:ids => @issue_ids, :issue => {'assigned_to_id' => User.current}, :back_url => @back), :method => :post,
|
||||
:disabled => !@can[:edit] %></li>
|
||||
<% end %>
|
||||
<% @assignables.each do |u| -%>
|
||||
<li><%= context_menu_link u.name, bulk_update_issues_path(:ids => @issue_ids, :issue => {'assigned_to_id' => u}, :back_url => @back), :method => :post,
|
||||
:selected => (@issue && u == @issue.assigned_to), :disabled => !@can[:edit] %></li>
|
||||
<% end -%>
|
||||
<li><%= context_menu_link l(:label_nobody), bulk_update_issues_path(:ids => @issue_ids, :issue => {'assigned_to_id' => 'none'}, :back_url => @back), :method => :post,
|
||||
:selected => (@issue && @issue.assigned_to.nil?), :disabled => !@can[:edit] %></li>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if @safe_attributes.include?('category_id') && @project && @project.issue_categories.any? -%>
|
||||
<li class="folder">
|
||||
<a href="#" class="submenu"><%= l(:field_category) %></a>
|
||||
<ul>
|
||||
<% @project.issue_categories.each do |u| -%>
|
||||
<li><%= context_menu_link u.name, bulk_update_issues_path(:ids => @issue_ids, :issue => {'category_id' => u}, :back_url => @back), :method => :post,
|
||||
:selected => (@issue && u == @issue.category), :disabled => !@can[:edit] %></li>
|
||||
<% end -%>
|
||||
<li><%= context_menu_link l(:label_none), bulk_update_issues_path(:ids => @issue_ids, :issue => {'category_id' => 'none'}, :back_url => @back), :method => :post,
|
||||
:selected => (@issue && @issue.category.nil?), :disabled => !@can[:edit] %></li>
|
||||
</ul>
|
||||
</li>
|
||||
<% end -%>
|
||||
|
||||
<% if @safe_attributes.include?('done_ratio') && Issue.use_field_for_done_ratio? %>
|
||||
<li class="folder">
|
||||
<a href="#" class="submenu"><%= l(:field_done_ratio) %></a>
|
||||
<ul>
|
||||
<% (0..10).map{|x|x*10}.each do |p| -%>
|
||||
<li><%= context_menu_link "#{p}%", bulk_update_issues_path(:ids => @issue_ids, :issue => {'done_ratio' => p}, :back_url => @back), :method => :post,
|
||||
:selected => (@issue && p == @issue.done_ratio), :disabled => (!@can[:edit] || @issues.detect {|i| !i.leaf?}) %></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% @options_by_custom_field.each do |field, options| %>
|
||||
<li class="folder cf_<%= field.id %>">
|
||||
<a href="#" class="submenu"><%= field.name %></a>
|
||||
<ul>
|
||||
<% options.each do |text, value| %>
|
||||
<li><%= bulk_update_custom_field_context_menu_link(field, text, value || text) %></li>
|
||||
<% end %>
|
||||
<% unless field.is_required? %>
|
||||
<li><%= bulk_update_custom_field_context_menu_link(field, l(:label_none), '__none__') %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if @can[:add_watchers] %>
|
||||
<li class="folder">
|
||||
<a href="#" class="submenu"><%= l(:label_issue_watchers) %></a>
|
||||
<ul>
|
||||
<li><%= context_menu_link l(:button_add),
|
||||
new_watchers_path(:object_type => 'issue', :object_id => @issue_ids),
|
||||
:remote => true,
|
||||
:class => 'icon-add' %></li>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if User.current.logged? %>
|
||||
<li><%= watcher_link(@issues, User.current) %></li>
|
||||
<% end %>
|
||||
|
||||
<% unless @issue %>
|
||||
<li><%= context_menu_link l(:button_filter), _project_issues_path(@project, :set_filter => 1, :status_id => "*", :issue_id => @issue_ids.join(",")),
|
||||
:class => 'icon-list' %></li>
|
||||
<% end %>
|
||||
|
||||
<% if @issue.present? %>
|
||||
<% if @can[:log_time] -%>
|
||||
<li><%= context_menu_link l(:button_log_time), new_issue_time_entry_path(@issue),
|
||||
:class => 'icon-time-add' %></li>
|
||||
<% end %>
|
||||
<li><%= context_menu_link l(:button_copy), project_copy_issue_path(@project, @issue),
|
||||
:class => 'icon-copy', :disabled => !@can[:copy] %></li>
|
||||
<% else %>
|
||||
<li><%= context_menu_link l(:button_copy), bulk_edit_issues_path(:ids => @issue_ids, :copy => '1'),
|
||||
:class => 'icon-copy', :disabled => !@can[:copy] %></li>
|
||||
<% end %>
|
||||
<li><%= context_menu_link l(:button_delete), issues_path(:ids => @issue_ids, :back_url => @back),
|
||||
:method => :delete, :data => {:confirm => issues_destroy_confirmation_message(@issues)}, :class => 'icon-del', :disabled => !@can[:delete] %></li>
|
||||
|
||||
<%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %>
|
||||
</ul>
|
45
app/views/context_menus/time_entries.html.erb
Normal file
45
app/views/context_menus/time_entries.html.erb
Normal file
|
@ -0,0 +1,45 @@
|
|||
<ul>
|
||||
<% if !@time_entry.nil? -%>
|
||||
<li><%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'edit', :id => @time_entry},
|
||||
:class => 'icon-edit', :disabled => !@can[:edit] %></li>
|
||||
<% else %>
|
||||
<li><%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id)},
|
||||
:class => 'icon-edit', :disabled => !@can[:edit] %></li>
|
||||
<% end %>
|
||||
|
||||
<%= call_hook(:view_time_entries_context_menu_start, {:time_entries => @time_entries, :can => @can, :back => @back }) %>
|
||||
|
||||
<% if @activities.present? -%>
|
||||
<li class="folder">
|
||||
<a href="#" class="submenu"><%= l(:field_activity) %></a>
|
||||
<ul>
|
||||
<% @activities.each do |u| -%>
|
||||
<li><%= context_menu_link u.name, {:controller => 'timelog', :action => 'bulk_update', :ids => @time_entries.collect(&:id), :time_entry => {'activity_id' => u}, :back_url => @back}, :method => :post,
|
||||
:selected => (@time_entry && u == @time_entry.activity), :disabled => !@can[:edit] %></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% @options_by_custom_field.each do |field, options| %>
|
||||
<li class="folder cf_<%= field.id %>">
|
||||
<a href="#" class="submenu"><%= field.name %></a>
|
||||
<ul>
|
||||
<% options.each do |text, value| %>
|
||||
<li><%= bulk_update_time_entry_custom_field_context_menu_link(field, text, value || text) %></li>
|
||||
<% end %>
|
||||
<% unless field.is_required? %>
|
||||
<li><%= bulk_update_time_entry_custom_field_context_menu_link(field, l(:label_none), '__none__') %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<%= call_hook(:view_time_entries_context_menu_end, {:time_entries => @time_entries, :can => @can, :back => @back }) %>
|
||||
|
||||
<li>
|
||||
<%= context_menu_link l(:button_delete),
|
||||
{:controller => 'timelog', :action => 'destroy', :ids => @time_entries.collect(&:id), :back_url => @back},
|
||||
:method => :delete, :data => {:confirm => l(:text_time_entries_destroy_confirmation)}, :class => 'icon-del', :disabled => !@can[:delete] %>
|
||||
</li>
|
||||
</ul>
|
2
app/views/custom_field_enumerations/create.js.erb
Normal file
2
app/views/custom_field_enumerations/create.js.erb
Normal file
|
@ -0,0 +1,2 @@
|
|||
$('#content').html('<%= escape_javascript(render(:template => 'custom_field_enumerations/index')) %>');
|
||||
$('#custom_field_enumeration_name').focus();
|
14
app/views/custom_field_enumerations/destroy.html.erb
Normal file
14
app/views/custom_field_enumerations/destroy.html.erb
Normal file
|
@ -0,0 +1,14 @@
|
|||
<%= title [l(:label_custom_field_plural), custom_fields_path],
|
||||
[l(@custom_field.type_name), custom_fields_path(:tab => @custom_field.class.name)],
|
||||
@custom_field.name %>
|
||||
|
||||
<%= form_tag(custom_field_enumeration_path(@custom_field, @value), :method => :delete) do %>
|
||||
<div class="box">
|
||||
<p><strong><%= l(:text_enumeration_destroy_question, :name => @value.name, :count => @value.objects_count) %></strong></p>
|
||||
<p><label for='reassign_to_id'><%= l(:text_enumeration_category_reassign_to) %></label>
|
||||
<%= select_tag('reassign_to_id', content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---", :value => '') + options_from_collection_for_select(@enumerations, 'id', 'name')) %></p>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_apply) %>
|
||||
<%= link_to l(:button_cancel), custom_field_enumerations_path(@custom_field) %>
|
||||
<% end %>
|
47
app/views/custom_field_enumerations/index.html.erb
Normal file
47
app/views/custom_field_enumerations/index.html.erb
Normal file
|
@ -0,0 +1,47 @@
|
|||
<%= custom_field_title @custom_field %>
|
||||
|
||||
<% if @custom_field.enumerations.any? %>
|
||||
<%= form_tag custom_field_enumerations_path(@custom_field), :method => 'put' do %>
|
||||
<div class="box">
|
||||
<ul id="custom_field_enumerations" class="flat">
|
||||
<% @custom_field.enumerations.each_with_index do |value, position| %>
|
||||
<li>
|
||||
<span class="sort-handle"></span>
|
||||
<%= hidden_field_tag "custom_field_enumerations[#{value.id}][position]", position, :class => 'position' %>
|
||||
<%= text_field_tag "custom_field_enumerations[#{value.id}][name]", value.name, :size => 40 %>
|
||||
<%= hidden_field_tag "custom_field_enumerations[#{value.id}][active]", 0 %>
|
||||
<label>
|
||||
<%= check_box_tag "custom_field_enumerations[#{value.id}][active]", 1, value.active? %>
|
||||
<%= l(:field_active) %>
|
||||
</label>
|
||||
<%= delete_link custom_field_enumeration_path(@custom_field, value) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<p>
|
||||
<%= submit_tag(l(:button_save)) %> |
|
||||
<%= link_to l(:button_back), edit_custom_field_path(@custom_field) %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<p><%= l(:label_enumeration_new) %></p>
|
||||
|
||||
<%= form_tag custom_field_enumerations_path(@custom_field), :method => 'post', :remote => true do %>
|
||||
<p><%= text_field_tag 'custom_field_enumeration[name]', '', :size => 40 %>
|
||||
<%= submit_tag(l(:button_add)) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
$(function() {
|
||||
$("#custom_field_enumerations").sortable({
|
||||
handle: ".sort-handle",
|
||||
update: function(event, ui) {
|
||||
$("#custom_field_enumerations li").each(function(){
|
||||
$(this).find("input.position").val($(this).index()+1);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
<% end %>
|
133
app/views/custom_fields/_form.html.erb
Normal file
133
app/views/custom_fields/_form.html.erb
Normal file
|
@ -0,0 +1,133 @@
|
|||
<%= error_messages_for 'custom_field' %>
|
||||
|
||||
<div class="splitcontentleft">
|
||||
<div class="box tabular">
|
||||
<p><%= f.select :field_format, custom_field_formats_for_select(@custom_field), {}, :disabled => !@custom_field.new_record? %></p>
|
||||
<p><%= f.text_field :name, :size => 50, :required => true %></p>
|
||||
<p><%= f.text_area :description, :rows => 7 %></p>
|
||||
|
||||
<% if @custom_field.format.multiple_supported %>
|
||||
<p>
|
||||
<%= f.check_box :multiple %>
|
||||
<% if !@custom_field.new_record? && @custom_field.multiple %>
|
||||
<em class="info"><%= l(:text_turning_multiple_off) %></em>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= render_custom_field_format_partial f, @custom_field %>
|
||||
|
||||
<%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %>
|
||||
</div>
|
||||
<p><%= submit_tag l(:button_save) %></p>
|
||||
</div>
|
||||
|
||||
<div class="splitcontentright">
|
||||
<div class="box tabular">
|
||||
<% case @custom_field.class.name
|
||||
when "IssueCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<% if @custom_field.format.is_filter_supported %>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<% end %>
|
||||
<% if @custom_field.format.searchable_supported %>
|
||||
<p><%= f.check_box :searchable %></p>
|
||||
<% end %>
|
||||
|
||||
<% when "UserCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<p><%= f.check_box :visible %></p>
|
||||
<p><%= f.check_box :editable %></p>
|
||||
<% if @custom_field.format.is_filter_supported %>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<% end %>
|
||||
|
||||
<% when "ProjectCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<p><%= f.check_box :visible %></p>
|
||||
<% if @custom_field.format.searchable_supported %>
|
||||
<p><%= f.check_box :searchable %></p>
|
||||
<% end %>
|
||||
<% if @custom_field.format.is_filter_supported %>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<% end %>
|
||||
|
||||
<% when "VersionCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<% if @custom_field.format.is_filter_supported %>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<% end %>
|
||||
|
||||
<% when "GroupCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<% if @custom_field.format.is_filter_supported %>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<% end %>
|
||||
|
||||
<% when "TimeEntryCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<% if @custom_field.format.is_filter_supported %>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<% end %>
|
||||
|
||||
<% else %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
|
||||
<% end %>
|
||||
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
|
||||
</div>
|
||||
|
||||
<% if @custom_field.is_a?(IssueCustomField) %>
|
||||
|
||||
<fieldset class="box tabular"><legend><%= l(:field_visible) %></legend>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'custom_field[visible]', 1, @custom_field.visible?, :id => 'custom_field_visible_on',
|
||||
:data => {:disables => '.custom_field_role input'} %>
|
||||
<%= l(:label_visibility_public) %>
|
||||
</label>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'custom_field[visible]', 0, !@custom_field.visible?, :id => 'custom_field_visible_off',
|
||||
:data => {:enables => '.custom_field_role input'} %>
|
||||
<%= l(:label_visibility_roles) %>:
|
||||
</label>
|
||||
<% role_ids = @custom_field.role_ids %>
|
||||
<% Role.givable.sorted.each do |role| %>
|
||||
<label class="block custom_field_role" style="padding-left:2em;">
|
||||
<%= check_box_tag 'custom_field[role_ids][]', role.id, role_ids.include?(role.id), :id => nil %>
|
||||
<%= role.name %>
|
||||
</label>
|
||||
<% end %>
|
||||
<%= hidden_field_tag 'custom_field[role_ids][]', '' %>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="box" id="custom_field_tracker_ids"><legend><%=l(:label_tracker_plural)%></legend>
|
||||
<% tracker_ids = @custom_field.tracker_ids %>
|
||||
<% Tracker.sorted.each do |tracker| %>
|
||||
<%= check_box_tag "custom_field[tracker_ids][]",
|
||||
tracker.id,
|
||||
tracker_ids.include?(tracker.id),
|
||||
:id => "custom_field_tracker_ids_#{tracker.id}" %>
|
||||
<label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>">
|
||||
<%= tracker.name %>
|
||||
</label>
|
||||
<% end %>
|
||||
<%= hidden_field_tag "custom_field[tracker_ids][]", '' %>
|
||||
<p><%= check_all_links 'custom_field_tracker_ids' %></p>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="box"><legend><%= l(:label_project_plural) %></legend>
|
||||
<p><%= f.check_box :is_for_all, :data => {:disables => '#custom_field_project_ids input'} %></p>
|
||||
|
||||
<div id="custom_field_project_ids">
|
||||
<% project_ids = @custom_field.project_ids.to_a %>
|
||||
<%= render_project_nested_lists(Project.all) do |p|
|
||||
content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, project_ids.include?(p.id), :id => nil) + ' ' + p)
|
||||
end %>
|
||||
<%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>
|
||||
<p><%= check_all_links 'custom_field_project_ids' %></p>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% include_calendar_headers_tags %>
|
30
app/views/custom_fields/_index.html.erb
Normal file
30
app/views/custom_fields/_index.html.erb
Normal file
|
@ -0,0 +1,30 @@
|
|||
<table class="list custom_fields">
|
||||
<thead><tr>
|
||||
<th><%=l(:field_name)%></th>
|
||||
<th><%=l(:field_field_format)%></th>
|
||||
<th><%=l(:field_is_required)%></th>
|
||||
<% if tab[:name] == 'IssueCustomField' %>
|
||||
<th><%=l(:field_is_for_all)%></th>
|
||||
<th><%=l(:label_used_by)%></th>
|
||||
<% end %>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% (@custom_fields_by_type[tab[:name]] || []).sort.each do |custom_field| -%>
|
||||
<% back_url = custom_fields_path(:tab => tab[:name]) %>
|
||||
<tr>
|
||||
<td class="name"><%= link_to custom_field.name, edit_custom_field_path(custom_field) %></td>
|
||||
<td><%= l(custom_field.format.label) %></td>
|
||||
<td><%= checked_image custom_field.is_required? %></td>
|
||||
<% if tab[:name] == 'IssueCustomField' %>
|
||||
<td><%= checked_image custom_field.is_for_all? %></td>
|
||||
<td><%= l(:label_x_projects, :count => @custom_fields_projects_count[custom_field.id] || 0) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %></td>
|
||||
<% end %>
|
||||
<td class="buttons">
|
||||
<%= reorder_handle(custom_field, :url => custom_field_path(custom_field), :param => 'custom_field') %>
|
||||
<%= delete_link custom_field_path(custom_field) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
5
app/views/custom_fields/edit.html.erb
Normal file
5
app/views/custom_fields/edit.html.erb
Normal file
|
@ -0,0 +1,5 @@
|
|||
<%= custom_field_title @custom_field %>
|
||||
|
||||
<%= labelled_form_for :custom_field, @custom_field, :url => custom_field_path(@custom_field), :html => {:method => :put, :id => 'custom_field_form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<% end %>
|
4
app/views/custom_fields/formats/_attachment.html.erb
Normal file
4
app/views/custom_fields/formats/_attachment.html.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
<p>
|
||||
<%= f.text_field :extensions_allowed, :size => 50, :label => :setting_attachment_extensions_allowed %>
|
||||
<em class="info"><%= l(:text_comma_separated) %> <%= l(:label_example) %>: txt, png</em>
|
||||
</p>
|
3
app/views/custom_fields/formats/_bool.html.erb
Normal file
3
app/views/custom_fields/formats/_bool.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<p><%= f.select :default_value, [[]]+@custom_field.possible_values_options %></p>
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
|
||||
<p><%= edit_tag_style_tag f, :include_radio => true %></p>
|
3
app/views/custom_fields/formats/_date.html.erb
Normal file
3
app/views/custom_fields/formats/_date.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<p><%= f.date_field(:default_value, :value => @custom_field.default_value, :size => 10) %></p>
|
||||
<%= calendar_for('custom_field_default_value') %>
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
|
12
app/views/custom_fields/formats/_enumeration.erb
Normal file
12
app/views/custom_fields/formats/_enumeration.erb
Normal file
|
@ -0,0 +1,12 @@
|
|||
<% unless @custom_field.new_record? %>
|
||||
<p>
|
||||
<label><%= l(:field_possible_values) %></label>
|
||||
<%= link_to l(:button_edit), custom_field_enumerations_path(@custom_field), :class => 'icon icon-edit' %>
|
||||
</p>
|
||||
<% if @custom_field.enumerations.active.any? %>
|
||||
<p><%= f.select :default_value, @custom_field.enumerations.active.map{|v| [v.name, v.id.to_s]}, :include_blank => true %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
|
||||
<p><%= edit_tag_style_tag f %></p>
|
3
app/views/custom_fields/formats/_link.html.erb
Normal file
3
app/views/custom_fields/formats/_link.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<%= render :partial => 'custom_fields/formats/regexp', :locals => {:f => f, :custom_field => custom_field} %>
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :field_url %></p>
|
||||
<p><%= f.text_field(:default_value) %></p>
|
7
app/views/custom_fields/formats/_list.html.erb
Normal file
7
app/views/custom_fields/formats/_list.html.erb
Normal file
|
@ -0,0 +1,7 @@
|
|||
<p>
|
||||
<%= f.text_area :possible_values, :value => @custom_field.possible_values.to_a.join("\n"), :rows => 15 %>
|
||||
<em class="info"><%= l(:text_custom_field_possible_values_info) %></em>
|
||||
</p>
|
||||
<p><%= f.text_field(:default_value) %></p>
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
|
||||
<p><%= edit_tag_style_tag f %></p>
|
3
app/views/custom_fields/formats/_numeric.html.erb
Normal file
3
app/views/custom_fields/formats/_numeric.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<%= render :partial => 'custom_fields/formats/regexp', :locals => {:f => f, :custom_field => custom_field} %>
|
||||
<p><%= f.text_field(:default_value) %></p>
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
|
9
app/views/custom_fields/formats/_regexp.html.erb
Normal file
9
app/views/custom_fields/formats/_regexp.html.erb
Normal file
|
@ -0,0 +1,9 @@
|
|||
<p>
|
||||
<label for="custom_field_min_length"><%=l(:label_min_max_length)%></label>
|
||||
<%= f.text_field :min_length, :size => 5, :no_label => true %> -
|
||||
<%= f.text_field :max_length, :size => 5, :no_label => true %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.text_field :regexp, :size => 50 %>
|
||||
<em class="info"><%= l(:text_regexp_info) %></em>
|
||||
</p>
|
4
app/views/custom_fields/formats/_string.html.erb
Normal file
4
app/views/custom_fields/formats/_string.html.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
<%= render :partial => 'custom_fields/formats/regexp', :locals => {:f => f, :custom_field => custom_field} %>
|
||||
<p><%= f.check_box :text_formatting, {:label => :setting_text_formatting, :data => {:disables => '#custom_field_url_pattern'}}, 'full', '' %></p>
|
||||
<p><%= f.text_field(:default_value) %></p>
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
|
6
app/views/custom_fields/formats/_text.html.erb
Normal file
6
app/views/custom_fields/formats/_text.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<%= render :partial => 'custom_fields/formats/regexp', :locals => {:f => f, :custom_field => custom_field} %>
|
||||
<p><%= f.check_box :text_formatting, {:label => :setting_text_formatting}, 'full', '' %></p>
|
||||
<% if @custom_field.class.name == "IssueCustomField" %>
|
||||
<p><%= f.check_box :full_width_layout %></p>
|
||||
<% end %>
|
||||
<p><%= f.text_area(:default_value, :rows => 5) %></p>
|
24
app/views/custom_fields/formats/_user.html.erb
Normal file
24
app/views/custom_fields/formats/_user.html.erb
Normal file
|
@ -0,0 +1,24 @@
|
|||
<p>
|
||||
<label><%= l(:label_role) %></label>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'status', 1, custom_field.user_role.blank?, :id => 'custom_field_user_role_all',
|
||||
:data => {:disables => '.custom_field_user_role input'} %>
|
||||
<%= l(:label_all) %>
|
||||
</label>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'status', 0, custom_field.user_role.present?, :id => 'custom_field_user_role_only',
|
||||
:data => {:enables => '.custom_field_user_role input'} %>
|
||||
<%= l(:label_only) %>:
|
||||
</label>
|
||||
<% Role.givable.sorted.each do |role| %>
|
||||
<label class="block custom_field_user_role" style="padding-left:2em;">
|
||||
<%= check_box_tag 'custom_field[user_role][]',
|
||||
role.id,
|
||||
custom_field.user_role.is_a?(Array) && custom_field.user_role.include?(role.id.to_s),
|
||||
:id => nil %>
|
||||
<%= role.name %>
|
||||
</label>
|
||||
<% end %>
|
||||
<%= hidden_field_tag 'custom_field[user_role][]', '' %>
|
||||
</p>
|
||||
<p><%= edit_tag_style_tag f %></p>
|
24
app/views/custom_fields/formats/_version.html.erb
Normal file
24
app/views/custom_fields/formats/_version.html.erb
Normal file
|
@ -0,0 +1,24 @@
|
|||
<p>
|
||||
<label><%= l(:field_status) %></label>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'status', 1, custom_field.version_status.blank?, :id => 'custom_field_version_status_all',
|
||||
:data => {:disables => '.custom_field_version_status input'} %>
|
||||
<%= l(:label_all) %>
|
||||
</label>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'status', 0, custom_field.version_status.present?, :id => 'custom_field_version_status_only',
|
||||
:data => {:enables => '.custom_field_version_status input'} %>
|
||||
<%= l(:label_only) %>:
|
||||
</label>
|
||||
<% Version::VERSION_STATUSES.each do |status| %>
|
||||
<label class="block custom_field_version_status" style="padding-left:2em;">
|
||||
<%= check_box_tag 'custom_field[version_status][]',
|
||||
status,
|
||||
custom_field.version_status.is_a?(Array) && custom_field.version_status.include?(status),
|
||||
:id => nil %>
|
||||
<%= l("version_status_#{status}") %>
|
||||
</label>
|
||||
<% end %>
|
||||
<%= hidden_field_tag 'custom_field[version_status][]', '' %>
|
||||
</p>
|
||||
<p><%= edit_tag_style_tag f %></p>
|
44
app/views/custom_fields/index.api.rsb
Normal file
44
app/views/custom_fields/index.api.rsb
Normal file
|
@ -0,0 +1,44 @@
|
|||
api.array :custom_fields do
|
||||
@custom_fields.each do |field|
|
||||
api.custom_field do
|
||||
api.id field.id
|
||||
api.name field.name
|
||||
api.customized_type field.class.customized_class.name.underscore if field.class.customized_class
|
||||
api.field_format field.field_format
|
||||
api.regexp field.regexp
|
||||
api.min_length field.min_length
|
||||
api.max_length field.max_length
|
||||
api.is_required field.is_required?
|
||||
api.is_filter field.is_filter?
|
||||
api.searchable field.searchable
|
||||
api.multiple field.multiple?
|
||||
api.default_value field.default_value
|
||||
api.visible field.visible?
|
||||
|
||||
values = field.possible_values_options
|
||||
if values.present?
|
||||
api.array :possible_values do
|
||||
values.each do |label, value|
|
||||
api.possible_value do
|
||||
api.value value || label
|
||||
api.label label
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if field.is_a?(IssueCustomField)
|
||||
api.array :trackers do
|
||||
field.trackers.each do |tracker|
|
||||
api.tracker :id => tracker.id, :name => tracker.name
|
||||
end
|
||||
end
|
||||
api.array :roles do
|
||||
field.roles.each do |role|
|
||||
api.role :id => role.id, :name => role.name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
15
app/views/custom_fields/index.html.erb
Normal file
15
app/views/custom_fields/index.html.erb
Normal file
|
@ -0,0 +1,15 @@
|
|||
<div class="contextual">
|
||||
<%= link_to l(:label_custom_field_new), new_custom_field_path, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<%= title l(:label_custom_field_plural) %>
|
||||
|
||||
<% if @custom_fields_by_type.present? %>
|
||||
<%= render_custom_fields_tabs(@custom_fields_by_type.keys) %>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
$(function() { $("table.custom_fields tbody").positionedItems(); });
|
||||
<% end %>
|
17
app/views/custom_fields/new.html.erb
Normal file
17
app/views/custom_fields/new.html.erb
Normal file
|
@ -0,0 +1,17 @@
|
|||
<%= custom_field_title @custom_field %>
|
||||
|
||||
<%= labelled_form_for :custom_field, @custom_field, :url => custom_fields_path, :html => {:id => 'custom_field_form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= hidden_field_tag 'type', @custom_field.type %>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
$('#custom_field_field_format').change(function(){
|
||||
$.ajax({
|
||||
url: '<%= new_custom_field_path(:format => 'js') %>',
|
||||
type: 'get',
|
||||
data: $('#custom_field_form').serialize(),
|
||||
complete: toggleDisabledInit
|
||||
});
|
||||
});
|
||||
<% end %>
|
1
app/views/custom_fields/new.js.erb
Normal file
1
app/views/custom_fields/new.js.erb
Normal file
|
@ -0,0 +1 @@
|
|||
$('#content').html('<%= escape_javascript(render :template => 'custom_fields/new', :layout => nil, :formats => [:html]) %>')
|
14
app/views/custom_fields/select_type.html.erb
Normal file
14
app/views/custom_fields/select_type.html.erb
Normal file
|
@ -0,0 +1,14 @@
|
|||
<%= custom_field_title @custom_field %>
|
||||
|
||||
<% selected = 0 %>
|
||||
<%= form_tag new_custom_field_path, :method => 'get' do %>
|
||||
<div class="box">
|
||||
<p><%= l(:label_custom_field_select_type) %>:</p>
|
||||
<p>
|
||||
<% custom_field_type_options.each do |name, type| %>
|
||||
<label style="display:block;"><%= radio_button_tag 'type', type, 1==selected+=1 %> <%= name %></label>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<p><%= submit_tag l(:label_next).html_safe + " »".html_safe, :name => nil %></p>
|
||||
<% end %>
|
6
app/views/documents/_document.html.erb
Normal file
6
app/views/documents/_document.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<h4><%= link_to document.title, document_path(document) %></h4>
|
||||
<p><em><%= format_time(document.updated_on) %></em></p>
|
||||
|
||||
<div class="wiki">
|
||||
<%= textilizable(truncate_lines(document.description), :object => document) %>
|
||||
</div>
|
19
app/views/documents/_form.html.erb
Normal file
19
app/views/documents/_form.html.erb
Normal file
|
@ -0,0 +1,19 @@
|
|||
<%= error_messages_for @document %>
|
||||
|
||||
<div class="box tabular">
|
||||
<p><%= f.select :category_id, DocumentCategory.active.collect {|c| [c.name, c.id]} %></p>
|
||||
<p><%= f.text_field :title, :required => true, :size => 60 %></p>
|
||||
<p><%= f.text_area :description, :cols => 60, :rows => 15, :class => 'wiki-edit' %></p>
|
||||
|
||||
<% @document.custom_field_values.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :document, value %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= wikitoolbar_for 'document_description' %>
|
||||
|
||||
<% if @document.new_record? %>
|
||||
<div class="box tabular">
|
||||
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form', :locals => {:container => @document} %></p>
|
||||
</div>
|
||||
<% end %>
|
8
app/views/documents/edit.html.erb
Normal file
8
app/views/documents/edit.html.erb
Normal file
|
@ -0,0 +1,8 @@
|
|||
<h2><%=l(:label_document)%></h2>
|
||||
|
||||
<%= labelled_form_for @document, :html => {:multipart => true} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<p><%= submit_tag l(:button_save) %></p>
|
||||
<% end %>
|
||||
|
||||
|
40
app/views/documents/index.html.erb
Normal file
40
app/views/documents/index.html.erb
Normal file
|
@ -0,0 +1,40 @@
|
|||
<div class="contextual">
|
||||
<%= link_to l(:label_document_new), new_project_document_path(@project), :class => 'icon icon-add',
|
||||
:onclick => 'showAndScrollTo("add-document", "document_title"); return false;' if User.current.allowed_to?(:add_documents, @project) %>
|
||||
</div>
|
||||
|
||||
<div id="add-document" style="display:none;">
|
||||
<h2><%=l(:label_document_new)%></h2>
|
||||
<%= labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<p>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-document").hide(); return false;' %>
|
||||
</p>
|
||||
<% 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>
|
||||
<ul>
|
||||
<li><%= link_to(l(:field_category), {:sort_by => 'category'},
|
||||
:class => (@sort_by == 'category' ? 'selected' :nil)) %></li>
|
||||
<li><%= link_to(l(:label_date), {:sort_by => 'date'},
|
||||
:class => (@sort_by == 'date' ? 'selected' :nil)) %></li>
|
||||
<li><%= link_to(l(:field_title), {:sort_by => 'title'},
|
||||
:class => (@sort_by == 'title' ? 'selected' :nil)) %></li>
|
||||
<li><%= link_to(l(:field_author), {:sort_by => 'author'},
|
||||
:class => (@sort_by == 'author' ? 'selected' :nil)) %></li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% html_title(l(:label_document_plural)) -%>
|
6
app/views/documents/new.html.erb
Normal file
6
app/views/documents/new.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<h2><%=l(:label_document_new)%></h2>
|
||||
|
||||
<%= labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<p><%= submit_tag l(:button_create) %></p>
|
||||
<% end %>
|
41
app/views/documents/show.html.erb
Normal file
41
app/views/documents/show.html.erb
Normal file
|
@ -0,0 +1,41 @@
|
|||
<div class="contextual">
|
||||
<% if User.current.allowed_to?(:edit_documents, @project) %>
|
||||
<%= link_to l(:button_edit), edit_document_path(@document), :class => 'icon icon-edit', :accesskey => accesskey(:edit) %>
|
||||
<% end %>
|
||||
<% if User.current.allowed_to?(:delete_documents, @project) %>
|
||||
<%= delete_link document_path(@document) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<h2><%= @document.title %></h2>
|
||||
|
||||
<p><em><%= @document.category.name %><br />
|
||||
<%= format_date @document.created_on %></em></p>
|
||||
|
||||
<% if @document.custom_field_values.any? %>
|
||||
<ul>
|
||||
<% render_custom_field_values(@document) do |custom_field, formatted| %>
|
||||
<li><span class="label"><%= custom_field.name %>:</span> <%= formatted %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<div class="wiki">
|
||||
<%= textilizable @document, :description, :attachments => @document.attachments %>
|
||||
</div>
|
||||
|
||||
<h3><%= l(:label_attachment_plural) %></h3>
|
||||
<%= link_to_attachments @document, :thumbnails => true %>
|
||||
|
||||
<% if authorize_for('documents', 'add_attachment') %>
|
||||
<p><%= link_to l(:label_attachment_new), {}, :onclick => "$('#add_attachment_form').show(); return false;",
|
||||
:id => 'attach_files_link' %></p>
|
||||
<%= form_tag({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %>
|
||||
<div class="box">
|
||||
<p><%= render :partial => 'attachments/form' %></p>
|
||||
</div>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% html_title @document.title -%>
|
26
app/views/email_addresses/_index.html.erb
Normal file
26
app/views/email_addresses/_index.html.erb
Normal file
|
@ -0,0 +1,26 @@
|
|||
<% if @addresses.present? %>
|
||||
<table class="list email_addresses">
|
||||
<% @addresses.each do |address| %>
|
||||
<tr>
|
||||
<td class="email"><%= address.address %></td>
|
||||
<td class="buttons">
|
||||
<%= toggle_email_address_notify_link(address) %>
|
||||
<%= delete_link user_email_address_path(@user, address), :remote => true %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
<% unless @addresses.size >= Setting.max_additional_emails.to_i %>
|
||||
<div>
|
||||
<%= form_for @address, :url => user_email_addresses_path(@user), :remote => true do |f| %>
|
||||
<p><%= l(:label_email_address_add) %></p>
|
||||
<%= error_messages_for @address %>
|
||||
<p>
|
||||
<%= f.text_field :address, :size => 40 %>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
2
app/views/email_addresses/index.html.erb
Normal file
2
app/views/email_addresses/index.html.erb
Normal file
|
@ -0,0 +1,2 @@
|
|||
<h2><%= @user.name %></h2>
|
||||
<%= render :partial => 'email_addresses/index' %>
|
3
app/views/email_addresses/index.js.erb
Normal file
3
app/views/email_addresses/index.js.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'email_addresses/index') %>');
|
||||
showModal('ajax-modal', '600px', '<%= escape_javascript l(:label_email_address_plural) %>');
|
||||
$('#email_address_address').focus();
|
11
app/views/enumerations/_form.html.erb
Normal file
11
app/views/enumerations/_form.html.erb
Normal file
|
@ -0,0 +1,11 @@
|
|||
<%= error_messages_for 'enumeration' %>
|
||||
|
||||
<div class="box tabular">
|
||||
<p><%= f.text_field :name %></p>
|
||||
<p><%= f.check_box :active %></p>
|
||||
<p><%= f.check_box :is_default %></p>
|
||||
|
||||
<% @enumeration.custom_field_values.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :enumeration, value %></p>
|
||||
<% end %>
|
||||
</div>
|
12
app/views/enumerations/destroy.html.erb
Normal file
12
app/views/enumerations/destroy.html.erb
Normal file
|
@ -0,0 +1,12 @@
|
|||
<%= title [l(@enumeration.option_name), enumerations_path], @enumeration.name %>
|
||||
|
||||
<%= form_tag({}, :method => :delete) do %>
|
||||
<div class="box">
|
||||
<p><strong><%= l(:text_enumeration_destroy_question, :name => @enumeration.name, :count => @enumeration.objects_count) %></strong></p>
|
||||
<p><label for='reassign_to_id'><%= l(:text_enumeration_category_reassign_to) %></label>
|
||||
<%= select_tag 'reassign_to_id', (content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---", :value => '') + options_from_collection_for_select(@enumerations, 'id', 'name')) %></p>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_apply) %>
|
||||
<%= link_to l(:button_cancel), enumerations_path %>
|
||||
<% end %>
|
6
app/views/enumerations/edit.html.erb
Normal file
6
app/views/enumerations/edit.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<%= title [l(@enumeration.option_name), enumerations_path], @enumeration.name %>
|
||||
|
||||
<%= labelled_form_for :enumeration, @enumeration, :url => enumeration_path(@enumeration), :html => {:method => :put, :multipart => true} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
10
app/views/enumerations/index.api.rsb
Normal file
10
app/views/enumerations/index.api.rsb
Normal file
|
@ -0,0 +1,10 @@
|
|||
api.array @klass.name.underscore.pluralize do
|
||||
@enumerations.each do |enumeration|
|
||||
api.__send__ @klass.name.underscore do
|
||||
api.id enumeration.id
|
||||
api.name enumeration.name
|
||||
api.is_default enumeration.is_default
|
||||
render_api_custom_values enumeration.visible_custom_field_values, api
|
||||
end
|
||||
end
|
||||
end
|
39
app/views/enumerations/index.html.erb
Normal file
39
app/views/enumerations/index.html.erb
Normal file
|
@ -0,0 +1,39 @@
|
|||
<h2><%=l(:label_enumerations)%></h2>
|
||||
|
||||
<% Enumeration.get_subclasses.each do |klass| %>
|
||||
<h3><%= l(klass::OptionName) %></h3>
|
||||
|
||||
<% enumerations = klass.shared %>
|
||||
|
||||
<p><%= link_to l(:label_enumeration_new), new_enumeration_path(:type => klass.name), :class => 'icon icon-add' %></p>
|
||||
|
||||
<% if enumerations.any? %>
|
||||
<table class="list enumerations"><thead>
|
||||
<tr>
|
||||
<th><%= l(:field_name) %></th>
|
||||
<th><%= l(:field_is_default) %></th>
|
||||
<th><%= l(:field_active) %></th>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
<% enumerations.each do |enumeration| %>
|
||||
<tr>
|
||||
<td class="name"><%= link_to enumeration, edit_enumeration_path(enumeration) %></td>
|
||||
<td class="tick"><%= checked_image enumeration.is_default? %></td>
|
||||
<td class="tick"><%= checked_image enumeration.active? %></td>
|
||||
<td class="buttons">
|
||||
<%= reorder_handle(enumeration, :url => enumeration_path(enumeration), :param => 'enumeration') %>
|
||||
<%= delete_link enumeration_path(enumeration) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% html_title(l(:label_enumerations)) -%>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
$(function() { $("table.enumerations tbody").positionedItems(); });
|
||||
<% end %>
|
7
app/views/enumerations/new.html.erb
Normal file
7
app/views/enumerations/new.html.erb
Normal file
|
@ -0,0 +1,7 @@
|
|||
<%= title [l(@enumeration.option_name), enumerations_path], l(:label_enumeration_new) %>
|
||||
|
||||
<%= labelled_form_for :enumeration, @enumeration, :url => enumerations_path, :html => {:multipart => true} do |f| %>
|
||||
<%= f.hidden_field :type %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
14
app/views/files/index.api.rsb
Normal file
14
app/views/files/index.api.rsb
Normal file
|
@ -0,0 +1,14 @@
|
|||
api.array :files do
|
||||
@containers.each do |container|
|
||||
container.attachments.each do |attachment|
|
||||
api.file do
|
||||
render_api_attachment_attributes(attachment, api)
|
||||
if container.is_a?(Version)
|
||||
api.version :id => container.id, :name => container.name
|
||||
end
|
||||
api.digest attachment.digest
|
||||
api.downloads attachment.downloads
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
46
app/views/files/index.html.erb
Normal file
46
app/views/files/index.html.erb
Normal file
|
@ -0,0 +1,46 @@
|
|||
<div class="contextual">
|
||||
<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
|
||||
</div>
|
||||
|
||||
<h2><%=l(:label_attachment_plural)%></h2>
|
||||
|
||||
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
|
||||
|
||||
<table class="list files">
|
||||
<thead><tr>
|
||||
<%= sort_header_tag('filename', :caption => l(:field_filename)) %>
|
||||
<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
|
||||
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
|
||||
<%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
|
||||
<th><%= l(:field_digest) %></th>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% @containers.each do |container| %>
|
||||
<% next if container.attachments.empty? -%>
|
||||
<% if container.is_a?(Version) -%>
|
||||
<tr>
|
||||
<th colspan="6">
|
||||
<%= link_to(container, {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
|
||||
</th>
|
||||
</tr>
|
||||
<% end -%>
|
||||
<% container.attachments.each do |file| %>
|
||||
<tr class="file">
|
||||
<td class="filename"><%= link_to_attachment file, :title => file.description -%></td>
|
||||
<td class="created_on"><%= format_time(file.created_on) %></td>
|
||||
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
|
||||
<td class="downloads"><%= file.downloads %></td>
|
||||
<td class="digest"><%= file.digest_type %>: <%= file.digest %></td>
|
||||
<td class="buttons">
|
||||
<%= link_to_attachment file, class: 'icon-only icon-download', title: l(:button_download), download: true %>
|
||||
<%= link_to(l(:button_delete), attachment_path(file), :class => 'icon-only icon-del',
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% html_title(l(:label_attachment_plural)) -%>
|
16
app/views/files/new.html.erb
Normal file
16
app/views/files/new.html.erb
Normal file
|
@ -0,0 +1,16 @@
|
|||
<h2><%=l(:label_attachment_new)%></h2>
|
||||
|
||||
<%= error_messages_for 'attachment' %>
|
||||
<%= form_tag(project_files_path(@project), :multipart => true, :class => "tabular") do %>
|
||||
<div class="box">
|
||||
|
||||
<% if @versions.any? %>
|
||||
<p><label for="version_id"><%=l(:field_version)%></label>
|
||||
<%= select_tag "version_id", content_tag('option', '') +
|
||||
options_from_collection_for_select(@versions, "id", "name") %></p>
|
||||
<% end %>
|
||||
|
||||
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
|
||||
</div>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<% end %>
|
372
app/views/gantts/show.html.erb
Normal file
372
app/views/gantts/show.html.erb
Normal file
|
@ -0,0 +1,372 @@
|
|||
<% @gantt.view = self %>
|
||||
<div class="contextual">
|
||||
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
||||
<%= link_to l(:button_edit), edit_query_path(@query, :gantt => 1), :class => 'icon icon-edit' %>
|
||||
<%= delete_link query_path(@query, :gantt => 1) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<h2><%= @query.new_record? ? l(:label_gantt) : @query.name %></h2>
|
||||
|
||||
<%= form_tag({:controller => 'gantts', :action => 'show',
|
||||
:project_id => @project, :month => params[:month],
|
||||
:year => params[:year], :months => params[:months]},
|
||||
:method => :get, :id => 'query_form') do %>
|
||||
<%= hidden_field_tag 'set_filter', '1' %>
|
||||
<%= hidden_field_tag 'gantt', '1' %>
|
||||
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
|
||||
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
|
||||
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
|
||||
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset id="options" class="collapsible collapsed">
|
||||
<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
|
||||
<div style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend><%= l(:label_related_issues) %></legend>
|
||||
<label for="draw_relations">
|
||||
<%= check_box 'query', 'draw_relations', :id => 'draw_relations' %>
|
||||
<% rels = [IssueRelation::TYPE_BLOCKS, IssueRelation::TYPE_PRECEDES] %>
|
||||
<% rels.each do |rel| %>
|
||||
<% color = Redmine::Helpers::Gantt::DRAW_TYPES[rel][:color] %>
|
||||
<%= content_tag(:span, ' '.html_safe,
|
||||
:style => "background-color: #{color}") %>
|
||||
<%= l(IssueRelation::TYPES[rel][:name]) %>
|
||||
<% end %>
|
||||
</label>
|
||||
</fieldset>
|
||||
</td>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend><%= l(:label_gantt_progress_line) %></legend>
|
||||
<label for="draw_progress_line">
|
||||
<%= check_box 'query', 'draw_progress_line', :id => 'draw_progress_line' %>
|
||||
<%= l(:label_display) %>
|
||||
</label>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<p class="contextual">
|
||||
<%= gantt_zoom_link(@gantt, :in) %>
|
||||
<%= gantt_zoom_link(@gantt, :out) %>
|
||||
</p>
|
||||
|
||||
<p class="buttons">
|
||||
<%= text_field_tag 'months', @gantt.months, :size => 2 %>
|
||||
<%= l(:label_months_from) %>
|
||||
<%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %>
|
||||
<%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %>
|
||||
<%= hidden_field_tag 'zoom', @gantt.zoom %>
|
||||
|
||||
<%= link_to_function l(:button_apply), '$("#query_form").submit()',
|
||||
:class => 'icon icon-checked' %>
|
||||
<%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 },
|
||||
:class => 'icon icon-reload' %>
|
||||
<% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %>
|
||||
<%= link_to_function l(:button_save),
|
||||
"$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit();",
|
||||
:class => 'icon icon-save' %>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= error_messages_for 'query' %>
|
||||
<% if @query.valid? %>
|
||||
<%
|
||||
zoom = 1
|
||||
@gantt.zoom.times { zoom = zoom * 2 }
|
||||
|
||||
subject_width = 330
|
||||
header_height = 18
|
||||
|
||||
headers_height = header_height
|
||||
show_weeks = false
|
||||
show_days = false
|
||||
show_day_num = false
|
||||
|
||||
if @gantt.zoom > 1
|
||||
show_weeks = true
|
||||
headers_height = 2 * header_height
|
||||
if @gantt.zoom > 2
|
||||
show_days = true
|
||||
headers_height = 3 * header_height
|
||||
if @gantt.zoom > 3
|
||||
show_day_num = true
|
||||
headers_height = 4 * header_height
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Width of the entire chart
|
||||
g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i
|
||||
@gantt.render(:top => headers_height + 8,
|
||||
:zoom => zoom,
|
||||
:g_width => g_width,
|
||||
:subject_width => subject_width)
|
||||
g_height = [(20 * (@gantt.number_of_rows + 6)) + 150, 206].max
|
||||
t_height = g_height + headers_height
|
||||
%>
|
||||
|
||||
<% if @gantt.truncated %>
|
||||
<p class="warning"><%= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p>
|
||||
<% end %>
|
||||
|
||||
<table style="width:100%; border:0; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="width:<%= subject_width %>px; padding:0px;" class="gantt_subjects_column">
|
||||
<%
|
||||
style = ""
|
||||
style += "position:relative;"
|
||||
style += "height: #{t_height + 24}px;"
|
||||
style += "width: #{subject_width + 1}px;"
|
||||
%>
|
||||
<%= content_tag(:div, :style => style, :class => "gantt_subjects_container") do %>
|
||||
<%
|
||||
style = ""
|
||||
style += "right:-2px;"
|
||||
style += "width: #{subject_width}px;"
|
||||
style += "height: #{headers_height}px;"
|
||||
style += 'background: #eee;'
|
||||
%>
|
||||
<%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %>
|
||||
<%
|
||||
style = ""
|
||||
style += "right:-2px;"
|
||||
style += "width: #{subject_width}px;"
|
||||
style += "height: #{t_height}px;"
|
||||
style += 'border-left: 1px solid #c0c0c0;'
|
||||
style += 'overflow: hidden;'
|
||||
%>
|
||||
<%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %>
|
||||
<%= content_tag(:div, :class => "gantt_subjects") do %>
|
||||
<%= @gantt.subjects.html_safe %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;" id="gantt_area">
|
||||
<%
|
||||
style = ""
|
||||
style += "width: #{g_width - 1}px;"
|
||||
style += "height: #{headers_height}px;"
|
||||
style += 'background: #eee;'
|
||||
%>
|
||||
<%= content_tag(:div, ' '.html_safe, :style => style, :class => "gantt_hdr") %>
|
||||
|
||||
<% ###### Months headers ###### %>
|
||||
<%
|
||||
month_f = @gantt.date_from
|
||||
left = 0
|
||||
height = (show_weeks ? header_height : header_height + g_height)
|
||||
%>
|
||||
<% @gantt.months.times do %>
|
||||
<%
|
||||
width = (((month_f >> 1) - month_f) * zoom - 1).to_i
|
||||
style = ""
|
||||
style += "left: #{left}px;"
|
||||
style += "width: #{width}px;"
|
||||
style += "height: #{height}px;"
|
||||
%>
|
||||
<%= content_tag(:div, :style => style, :class => "gantt_hdr") do %>
|
||||
<%= link_to "#{month_f.year}-#{month_f.month}",
|
||||
@gantt.params.merge(:year => month_f.year, :month => month_f.month),
|
||||
:title => "#{month_name(month_f.month)} #{month_f.year}" %>
|
||||
<% end %>
|
||||
<%
|
||||
left = left + width + 1
|
||||
month_f = month_f >> 1
|
||||
%>
|
||||
<% end %>
|
||||
|
||||
<% ###### Weeks headers ###### %>
|
||||
<% if show_weeks %>
|
||||
<%
|
||||
left = 0
|
||||
height = (show_days ? header_height - 1 : header_height - 1 + g_height)
|
||||
%>
|
||||
<% if @gantt.date_from.cwday == 1 %>
|
||||
<%
|
||||
# @date_from is monday
|
||||
week_f = @gantt.date_from
|
||||
%>
|
||||
<% else %>
|
||||
<%
|
||||
# find next monday after @date_from
|
||||
week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1)
|
||||
width = (7 - @gantt.date_from.cwday + 1) * zoom - 1
|
||||
style = ""
|
||||
style += "left: #{left}px;"
|
||||
style += "top: 19px;"
|
||||
style += "width: #{width}px;"
|
||||
style += "height: #{height}px;"
|
||||
%>
|
||||
<%= content_tag(:div, ' '.html_safe,
|
||||
:style => style, :class => "gantt_hdr") %>
|
||||
<% left = left + width + 1 %>
|
||||
<% end %>
|
||||
<% while week_f <= @gantt.date_to %>
|
||||
<%
|
||||
width = ((week_f + 6 <= @gantt.date_to) ?
|
||||
7 * zoom - 1 :
|
||||
(@gantt.date_to - week_f + 1) * zoom - 1).to_i
|
||||
style = ""
|
||||
style += "left: #{left}px;"
|
||||
style += "top: 19px;"
|
||||
style += "width: #{width}px;"
|
||||
style += "height: #{height}px;"
|
||||
%>
|
||||
<%= content_tag(:div, :style => style, :class => "gantt_hdr") do %>
|
||||
<%= content_tag(:small) do %>
|
||||
<%= week_f.cweek if width >= 16 %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%
|
||||
left = left + width + 1
|
||||
week_f = week_f + 7
|
||||
%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% ###### Day numbers headers ###### %>
|
||||
<% if show_day_num %>
|
||||
<%
|
||||
left = 0
|
||||
height = g_height + header_height*2 - 1
|
||||
wday = @gantt.date_from.cwday
|
||||
day_num = @gantt.date_from
|
||||
%>
|
||||
<% (@gantt.date_to - @gantt.date_from + 1).to_i.times do %>
|
||||
<%
|
||||
width = zoom - 1
|
||||
style = ""
|
||||
style += "left:#{left}px;"
|
||||
style += "top:37px;"
|
||||
style += "width:#{width}px;"
|
||||
style += "height:#{height}px;"
|
||||
style += "font-size:0.7em;"
|
||||
clss = "gantt_hdr"
|
||||
clss << " nwday" if @gantt.non_working_week_days.include?(wday)
|
||||
%>
|
||||
<%= content_tag(:div, :style => style, :class => clss) do %>
|
||||
<%= day_num.day %>
|
||||
<% end %>
|
||||
<%
|
||||
left = left + width+1
|
||||
day_num = day_num + 1
|
||||
wday = wday + 1
|
||||
wday = 1 if wday > 7
|
||||
%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% ###### Days headers ####### %>
|
||||
<% if show_days %>
|
||||
<%
|
||||
left = 0
|
||||
height = g_height + header_height - 1
|
||||
top = (show_day_num ? 55 : 37)
|
||||
wday = @gantt.date_from.cwday
|
||||
%>
|
||||
<% (@gantt.date_to - @gantt.date_from + 1).to_i.times do %>
|
||||
<%
|
||||
width = zoom - 1
|
||||
style = ""
|
||||
style += "left: #{left}px;"
|
||||
style += "top: #{top}px;"
|
||||
style += "width: #{width}px;"
|
||||
style += "height: #{height}px;"
|
||||
style += "font-size:0.7em;"
|
||||
clss = "gantt_hdr"
|
||||
clss << " nwday" if @gantt.non_working_week_days.include?(wday)
|
||||
%>
|
||||
<%= content_tag(:div, :style => style, :class => clss) do %>
|
||||
<%= day_letter(wday) %>
|
||||
<% end %>
|
||||
<%
|
||||
left = left + width + 1
|
||||
wday = wday + 1
|
||||
wday = 1 if wday > 7
|
||||
%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= @gantt.lines.html_safe %>
|
||||
|
||||
<% ###### Today red line (excluded from cache) ###### %>
|
||||
<% if User.current.today >= @gantt.date_from and User.current.today <= @gantt.date_to %>
|
||||
<%
|
||||
today_left = (((User.current.today - @gantt.date_from + 1) * zoom).floor() - 1).to_i
|
||||
style = ""
|
||||
style += "position: absolute;"
|
||||
style += "height: #{g_height}px;"
|
||||
style += "top: #{headers_height + 1}px;"
|
||||
style += "left: #{today_left}px;"
|
||||
style += "width:10px;"
|
||||
style += "border-left: 1px dashed red;"
|
||||
%>
|
||||
<%= content_tag(:div, ' '.html_safe, :style => style, :id => 'today_line') %>
|
||||
<% end %>
|
||||
<%
|
||||
style = ""
|
||||
style += "position: absolute;"
|
||||
style += "height: #{g_height}px;"
|
||||
style += "top: #{headers_height + 1}px;"
|
||||
style += "left: 0px;"
|
||||
style += "width: #{g_width - 1}px;"
|
||||
%>
|
||||
<%= content_tag(:div, '', :style => style, :id => "gantt_draw_area") %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
<td style="text-align:left;">
|
||||
<%= link_to("\xc2\xab " + l(:label_previous),
|
||||
{:params => request.query_parameters.merge(@gantt.params_previous)},
|
||||
:accesskey => accesskey(:previous)) %>
|
||||
</td>
|
||||
<td style="text-align:right;">
|
||||
<%= link_to(l(:label_next) + " \xc2\xbb",
|
||||
{:params => request.query_parameters.merge(@gantt.params_next)},
|
||||
:accesskey => accesskey(:next)) %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to_with_query_parameters 'PDF', @gantt.params %>
|
||||
<%= f.link_to_with_query_parameters('PNG', @gantt.params) if @gantt.respond_to?('to_image') %>
|
||||
<% end %>
|
||||
<% end # query.valid? %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'issues/sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<% html_title(l(:label_gantt)) -%>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'raphael' %>
|
||||
<%= javascript_include_tag 'gantt' %>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
var issue_relation_type = <%= raw Redmine::Helpers::Gantt::DRAW_TYPES.to_json %>;
|
||||
$(document).ready(drawGanttHandler);
|
||||
$(window).resize(drawGanttHandler);
|
||||
$(function() {
|
||||
$("#draw_relations").change(drawGanttHandler);
|
||||
$("#draw_progress_line").change(drawGanttHandler);
|
||||
});
|
||||
<% end %>
|
10
app/views/groups/_form.html.erb
Normal file
10
app/views/groups/_form.html.erb
Normal file
|
@ -0,0 +1,10 @@
|
|||
<%= error_messages_for @group %>
|
||||
|
||||
<div class="box tabular">
|
||||
<p><%= f.text_field :name, :required => true, :size => 60,
|
||||
:disabled => !@group.safe_attribute?('name') %></p>
|
||||
|
||||
<% @group.custom_field_values.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :group, value %></p>
|
||||
<% end %>
|
||||
</div>
|
4
app/views/groups/_general.html.erb
Normal file
4
app/views/groups/_general.html.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
<%= labelled_form_for @group, :url => group_path(@group), :html => {:multipart => true} do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
1
app/views/groups/_memberships.html.erb
Normal file
1
app/views/groups/_memberships.html.erb
Normal file
|
@ -0,0 +1 @@
|
|||
<%= render_principal_memberships @group %>
|
9
app/views/groups/_new_users_form.html.erb
Normal file
9
app/views/groups/_new_users_form.html.erb
Normal file
|
@ -0,0 +1,9 @@
|
|||
<fieldset class="box">
|
||||
<legend><%= label_tag "user_search", l(:label_user_search) %></legend>
|
||||
<p><%= text_field_tag 'user_search', nil %></p>
|
||||
<%= javascript_tag "observeSearchfield('user_search', null, '#{ escape_javascript autocomplete_for_user_group_path(@group) }')" %>
|
||||
|
||||
<div id="users">
|
||||
<%= render_principals_for_new_group_users(@group) %>
|
||||
</div>
|
||||
</fieldset>
|
9
app/views/groups/_new_users_modal.html.erb
Normal file
9
app/views/groups/_new_users_modal.html.erb
Normal file
|
@ -0,0 +1,9 @@
|
|||
<h3 class="title"><%= l(:label_user_new) %></h3>
|
||||
|
||||
<%= form_for(@group, :url => group_users_path(@group), :remote => true, :method => :post) do |f| %>
|
||||
<%= render :partial => 'new_users_form' %>
|
||||
<p class="buttons">
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
|
||||
</p>
|
||||
<% end %>
|
22
app/views/groups/_users.html.erb
Normal file
22
app/views/groups/_users.html.erb
Normal file
|
@ -0,0 +1,22 @@
|
|||
<p><%= link_to l(:label_user_new), new_group_users_path(@group), :remote => true, :class => "icon icon-add" %></p>
|
||||
|
||||
<% if @group.users.any? %>
|
||||
<table class="list users">
|
||||
<thead><tr>
|
||||
<th><%= l(:label_user) %></th>
|
||||
<th style="width:15%"></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% @group.users.sort.each do |user| %>
|
||||
<tr id="user-<%= user.id %>">
|
||||
<td class="name"><%= link_to_user user %></td>
|
||||
<td class="buttons">
|
||||
<%= delete_link group_user_path(@group, :user_id => user), :remote => true %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
5
app/views/groups/add_users.js.erb
Normal file
5
app/views/groups/add_users.js.erb
Normal file
|
@ -0,0 +1,5 @@
|
|||
hideModal();
|
||||
$('#tab-content-users').html('<%= escape_javascript(render :partial => 'groups/users') %>');
|
||||
<% @users.each do |user| %>
|
||||
$('#user-<%= user.id %>').effect("highlight");
|
||||
<% end %>
|
1
app/views/groups/autocomplete_for_user.js.erb
Normal file
1
app/views/groups/autocomplete_for_user.js.erb
Normal file
|
@ -0,0 +1 @@
|
|||
$('#users').html('<%= escape_javascript(render_principals_for_new_group_users(@group)) %>');
|
1
app/views/groups/destroy_membership.js.erb
Normal file
1
app/views/groups/destroy_membership.js.erb
Normal file
|
@ -0,0 +1 @@
|
|||
$('#tab-content-memberships').html('<%= escape_javascript(render :partial => 'groups/memberships') %>');
|
3
app/views/groups/edit.html.erb
Normal file
3
app/views/groups/edit.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<%= title [l(:label_group_plural), groups_path], @group.name %>
|
||||
|
||||
<%= render_tabs group_settings_tabs(@group) %>
|
6
app/views/groups/edit_membership.js.erb
Normal file
6
app/views/groups/edit_membership.js.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<% if @membership.valid? %>
|
||||
$('#tab-content-memberships').html('<%= escape_javascript(render :partial => 'groups/memberships') %>');
|
||||
$('#member-<%= @membership.id %>').effect("highlight");
|
||||
<% else %>
|
||||
alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => @membership.errors.full_messages.join(', ')))) %>');
|
||||
<% end %>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue