Revision 1298:4f746d8966dd .svn/pristine/2e
| .svn/pristine/2e/2e1157d3f81f3880c0395bb75f0b975ce97e7bd4.svn-base | ||
|---|---|---|
| 1 |
<%= error_messages_for @group %> |
|
| 2 |
|
|
| 3 |
<div class="box tabular"> |
|
| 4 |
<p><%= f.text_field :name, :required => true, :size => 60 %></p> |
|
| 5 |
<% @group.custom_field_values.each do |value| %> |
|
| 6 |
<p><%= custom_field_tag_with_label :group, value %></p> |
|
| 7 |
<% end %> |
|
| 8 |
</div> |
|
| .svn/pristine/2e/2e26af3877bdd2fe792449a4fd743a6ba7463f7e.svn-base | ||
|---|---|---|
| 1 |
# Redmine - project management software |
|
| 2 |
# Copyright (C) 2006-2013 Jean-Philippe Lang |
|
| 3 |
# |
|
| 4 |
# This program is free software; you can redistribute it and/or |
|
| 5 |
# modify it under the terms of the GNU General Public License |
|
| 6 |
# as published by the Free Software Foundation; either version 2 |
|
| 7 |
# of the License, or (at your option) any later version. |
|
| 8 |
# |
|
| 9 |
# This program is distributed in the hope that it will be useful, |
|
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 12 |
# GNU General Public License for more details. |
|
| 13 |
# |
|
| 14 |
# You should have received a copy of the GNU General Public License |
|
| 15 |
# along with this program; if not, write to the Free Software |
|
| 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
| 17 |
|
|
| 18 |
class PreviewsController < ApplicationController |
|
| 19 |
before_filter :find_project, :find_attachments |
|
| 20 |
|
|
| 21 |
def issue |
|
| 22 |
@issue = @project.issues.find_by_id(params[:id]) unless params[:id].blank? |
|
| 23 |
if @issue |
|
| 24 |
@description = params[:issue] && params[:issue][:description] |
|
| 25 |
if @description && @description.gsub(/(\r?\n|\n\r?)/, "\n") == @issue.description.to_s.gsub(/(\r?\n|\n\r?)/, "\n") |
|
| 26 |
@description = nil |
|
| 27 |
end |
|
| 28 |
# params[:notes] is useful for preview of notes in issue history |
|
| 29 |
@notes = params[:notes] || (params[:issue] ? params[:issue][:notes] : nil) |
|
| 30 |
else |
|
| 31 |
@description = (params[:issue] ? params[:issue][:description] : nil) |
|
| 32 |
end |
|
| 33 |
render :layout => false |
|
| 34 |
end |
|
| 35 |
|
|
| 36 |
def news |
|
| 37 |
if params[:id].present? && news = News.visible.find_by_id(params[:id]) |
|
| 38 |
@previewed = news |
|
| 39 |
end |
|
| 40 |
@text = (params[:news] ? params[:news][:description] : nil) |
|
| 41 |
render :partial => 'common/preview' |
|
| 42 |
end |
|
| 43 |
|
|
| 44 |
private |
|
| 45 |
|
|
| 46 |
def find_project |
|
| 47 |
project_id = (params[:issue] && params[:issue][:project_id]) || params[:project_id] |
|
| 48 |
@project = Project.find(project_id) |
|
| 49 |
rescue ActiveRecord::RecordNotFound |
|
| 50 |
render_404 |
|
| 51 |
end |
|
| 52 |
|
|
| 53 |
end |
|
| .svn/pristine/2e/2e2d614b9e64145af9606e9c3e56e58eb315056d.svn-base | ||
|---|---|---|
| 1 |
<div id="query_form_content" class="hide-when-print"> |
|
| 2 |
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> |
|
| 3 |
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> |
|
| 4 |
<div style="<%= @query.new_record? ? "" : "display: none;" %>"> |
|
| 5 |
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
|
|
| 6 |
</div> |
|
| 7 |
</fieldset> |
|
| 8 |
<fieldset class="collapsible collapsed"> |
|
| 9 |
<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend> |
|
| 10 |
<div style="display: none;"> |
|
| 11 |
<table> |
|
| 12 |
<tr> |
|
| 13 |
<td><%= l(:field_column_names) %></td> |
|
| 14 |
<td><%= render_query_columns_selection(@query) %></td> |
|
| 15 |
</tr> |
|
| 16 |
</table> |
|
| 17 |
</div> |
|
| 18 |
</fieldset> |
|
| 19 |
</div> |
|
| 20 |
|
|
| 21 |
<p class="buttons hide-when-print"> |
|
| 22 |
<%= link_to_function l(:button_apply), 'submit_query_form("query_form")', :class => 'icon icon-checked' %>
|
|
| 23 |
<%= link_to l(:button_clear), {:project_id => @project, :issue_id => @issue}, :class => 'icon icon-reload' %>
|
|
| 24 |
</p> |
|
| 25 |
|
|
| 26 |
<div class="tabs"> |
|
| 27 |
<% query_params = params.slice(:f, :op, :v, :sort) %> |
|
| 28 |
<ul> |
|
| 29 |
<li><%= link_to(l(:label_details), query_params.merge({:controller => 'timelog', :action => 'index', :project_id => @project, :issue_id => @issue }),
|
|
| 30 |
:class => (action_name == 'index' ? 'selected' : nil)) %></li> |
|
| 31 |
<li><%= link_to(l(:label_report), query_params.merge({:controller => 'timelog', :action => 'report', :project_id => @project, :issue_id => @issue}),
|
|
| 32 |
:class => (action_name == 'report' ? 'selected' : nil)) %></li> |
|
| 33 |
</ul> |
|
| 34 |
</div> |
|
| .svn/pristine/2e/2e4d7c7eff8f75e07fa65599f46a1983efb8afeb.svn-base | ||
|---|---|---|
| 1 |
<h2><%= @copy ? l(:button_copy) : l(:label_bulk_edit_selected_issues) %></h2> |
|
| 2 |
|
|
| 3 |
<ul id="bulk-selection"> |
|
| 4 |
<% @issues.each do |issue| %> |
|
| 5 |
<%= content_tag 'li', link_to_issue(issue) %> |
|
| 6 |
<% end %> |
|
| 7 |
</ul> |
|
| 8 |
|
|
| 9 |
<%= form_tag(bulk_update_issues_path, :id => 'bulk_edit_form') do %> |
|
| 10 |
<%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join("\n").html_safe %>
|
|
| 11 |
<div class="box tabular"> |
|
| 12 |
<fieldset class="attributes"> |
|
| 13 |
<legend><%= l(:label_change_properties) %></legend> |
|
| 14 |
|
|
| 15 |
<div class="splitcontentleft"> |
|
| 16 |
<% if @allowed_projects.present? %> |
|
| 17 |
<p> |
|
| 18 |
<label for="issue_project_id"><%= l(:field_project) %></label> |
|
| 19 |
<%= select_tag('issue[project_id]', content_tag('option', l(:label_no_change_option), :value => '') + project_tree_options_for_select(@allowed_projects, :selected => @target_project),
|
|
| 20 |
:onchange => "updateBulkEditFrom('#{escape_javascript url_for(:action => 'bulk_edit', :format => 'js')}')") %>
|
|
| 21 |
</p> |
|
| 22 |
<% end %> |
|
| 23 |
<p> |
|
| 24 |
<label for="issue_tracker_id"><%= l(:field_tracker) %></label> |
|
| 25 |
<%= select_tag('issue[tracker_id]', content_tag('option', l(:label_no_change_option), :value => '') + options_from_collection_for_select(@trackers, :id, :name)) %>
|
|
| 26 |
</p> |
|
| 27 |
<% if @available_statuses.any? %> |
|
| 28 |
<p> |
|
| 29 |
<label for='issue_status_id'><%= l(:field_status) %></label> |
|
| 30 |
<%= select_tag('issue[status_id]',content_tag('option', l(:label_no_change_option), :value => '') + options_from_collection_for_select(@available_statuses, :id, :name)) %>
|
|
| 31 |
</p> |
|
| 32 |
<% end %> |
|
| 33 |
|
|
| 34 |
<% if @safe_attributes.include?('priority_id') -%>
|
|
| 35 |
<p> |
|
| 36 |
<label for='issue_priority_id'><%= l(:field_priority) %></label> |
|
| 37 |
<%= select_tag('issue[priority_id]', content_tag('option', l(:label_no_change_option), :value => '') + options_from_collection_for_select(IssuePriority.active, :id, :name)) %>
|
|
| 38 |
</p> |
|
| 39 |
<% end %> |
|
| 40 |
|
|
| 41 |
<% if @safe_attributes.include?('assigned_to_id') -%>
|
|
| 42 |
<p> |
|
| 43 |
<label for='issue_assigned_to_id'><%= l(:field_assigned_to) %></label> |
|
| 44 |
<%= select_tag('issue[assigned_to_id]', content_tag('option', l(:label_no_change_option), :value => '') +
|
|
| 45 |
content_tag('option', l(:label_nobody), :value => 'none') +
|
|
| 46 |
principals_options_for_select(@assignables)) %> |
|
| 47 |
</p> |
|
| 48 |
<% end %> |
|
| 49 |
|
|
| 50 |
<% if @safe_attributes.include?('category_id') -%>
|
|
| 51 |
<p> |
|
| 52 |
<label for='issue_category_id'><%= l(:field_category) %></label> |
|
| 53 |
<%= select_tag('issue[category_id]', content_tag('option', l(:label_no_change_option), :value => '') +
|
|
| 54 |
content_tag('option', l(:label_none), :value => 'none') +
|
|
| 55 |
options_from_collection_for_select(@categories, :id, :name)) %> |
|
| 56 |
</p> |
|
| 57 |
<% end %> |
|
| 58 |
|
|
| 59 |
<% if @safe_attributes.include?('fixed_version_id') -%>
|
|
| 60 |
<p> |
|
| 61 |
<label for='issue_fixed_version_id'><%= l(:field_fixed_version) %></label> |
|
| 62 |
<%= select_tag('issue[fixed_version_id]', content_tag('option', l(:label_no_change_option), :value => '') +
|
|
| 63 |
content_tag('option', l(:label_none), :value => 'none') +
|
|
| 64 |
version_options_for_select(@versions.sort)) %> |
|
| 65 |
</p> |
|
| 66 |
<% end %> |
|
| 67 |
|
|
| 68 |
<% @custom_fields.each do |custom_field| %> |
|
| 69 |
<p><label><%= h(custom_field.name) %></label> <%= custom_field_tag_for_bulk_edit('issue', custom_field, @projects) %></p>
|
|
| 70 |
<% end %> |
|
| 71 |
|
|
| 72 |
<% if @copy && @attachments_present %> |
|
| 73 |
<p> |
|
| 74 |
<label for='copy_attachments'><%= l(:label_copy_attachments) %></label> |
|
| 75 |
<%= check_box_tag 'copy_attachments', '1', true %> |
|
| 76 |
</p> |
|
| 77 |
<% end %> |
|
| 78 |
|
|
| 79 |
<% if @copy && @subtasks_present %> |
|
| 80 |
<p> |
|
| 81 |
<label for='copy_subtasks'><%= l(:label_copy_subtasks) %></label> |
|
| 82 |
<%= check_box_tag 'copy_subtasks', '1', true %> |
|
| 83 |
</p> |
|
| 84 |
<% end %> |
|
| 85 |
|
|
| 86 |
<%= call_hook(:view_issues_bulk_edit_details_bottom, { :issues => @issues }) %>
|
|
| 87 |
</div> |
|
| 88 |
|
|
| 89 |
<div class="splitcontentright"> |
|
| 90 |
<% if @safe_attributes.include?('is_private') %>
|
|
| 91 |
<p> |
|
| 92 |
<label for='issue_is_private'><%= l(:field_is_private) %></label> |
|
| 93 |
<%= select_tag('issue[is_private]', content_tag('option', l(:label_no_change_option), :value => '') +
|
|
| 94 |
content_tag('option', l(:general_text_Yes), :value => '1') +
|
|
| 95 |
content_tag('option', l(:general_text_No), :value => '0')) %>
|
|
| 96 |
</p> |
|
| 97 |
<% end %> |
|
| 98 |
|
|
| 99 |
<% if @safe_attributes.include?('parent_issue_id') && @project %>
|
|
| 100 |
<p> |
|
| 101 |
<label for='issue_parent_issue_id'><%= l(:field_parent_issue) %></label> |
|
| 102 |
<%= text_field_tag 'issue[parent_issue_id]', '', :size => 10 %> |
|
| 103 |
</p> |
|
| 104 |
<%= javascript_tag "observeAutocompleteField('issue_parent_issue_id', '#{escape_javascript auto_complete_issues_path(:project_id => @project)}')" %>
|
|
| 105 |
<% end %> |
|
| 106 |
|
|
| 107 |
<% if @safe_attributes.include?('start_date') %>
|
|
| 108 |
<p> |
|
| 109 |
<label for='issue_start_date'><%= l(:field_start_date) %></label> |
|
| 110 |
<%= text_field_tag 'issue[start_date]', '', :size => 10 %><%= calendar_for('issue_start_date') %>
|
|
| 111 |
</p> |
|
| 112 |
<% end %> |
|
| 113 |
|
|
| 114 |
<% if @safe_attributes.include?('due_date') %>
|
|
| 115 |
<p> |
|
| 116 |
<label for='issue_due_date'><%= l(:field_due_date) %></label> |
|
| 117 |
<%= text_field_tag 'issue[due_date]', '', :size => 10 %><%= calendar_for('issue_due_date') %>
|
|
| 118 |
</p> |
|
| 119 |
<% end %> |
|
| 120 |
|
|
| 121 |
<% if @safe_attributes.include?('done_ratio') && Issue.use_field_for_done_ratio? %>
|
|
| 122 |
<p> |
|
| 123 |
<label for='issue_done_ratio'><%= l(:field_done_ratio) %></label> |
|
| 124 |
<%= select_tag 'issue[done_ratio]', options_for_select([[l(:label_no_change_option), '']] + (0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %>
|
|
| 125 |
</p> |
|
| 126 |
<% end %> |
|
| 127 |
</div> |
|
| 128 |
|
|
| 129 |
</fieldset> |
|
| 130 |
|
|
| 131 |
<fieldset><legend><%= l(:field_notes) %></legend> |
|
| 132 |
<%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %> |
|
| 133 |
<%= wikitoolbar_for 'notes' %> |
|
| 134 |
</fieldset> |
|
| 135 |
</div> |
|
| 136 |
|
|
| 137 |
<p> |
|
| 138 |
<% if @copy %> |
|
| 139 |
<%= hidden_field_tag 'copy', '1' %> |
|
| 140 |
<%= submit_tag l(:button_copy) %> |
|
| 141 |
<%= submit_tag l(:button_copy_and_follow), :name => 'follow' %> |
|
| 142 |
<% elsif @target_project %> |
|
| 143 |
<%= submit_tag l(:button_move) %> |
|
| 144 |
<%= submit_tag l(:button_move_and_follow), :name => 'follow' %> |
|
| 145 |
<% else %> |
|
| 146 |
<%= submit_tag l(:button_submit) %> |
|
| 147 |
<% end %> |
|
| 148 |
</p> |
|
| 149 |
|
|
| 150 |
<% end %> |
|
| .svn/pristine/2e/2e9778d3950cea9aad42938a07deac546bf3beda.svn-base | ||
|---|---|---|
| 1 |
# Redmine - project management software |
|
| 2 |
# Copyright (C) 2006-2013 Jean-Philippe Lang |
|
| 3 |
# |
|
| 4 |
# This program is free software; you can redistribute it and/or |
|
| 5 |
# modify it under the terms of the GNU General Public License |
|
| 6 |
# as published by the Free Software Foundation; either version 2 |
|
| 7 |
# of the License, or (at your option) any later version. |
|
| 8 |
# |
|
| 9 |
# This program is distributed in the hope that it will be useful, |
|
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 12 |
# GNU General Public License for more details. |
|
| 13 |
# |
|
| 14 |
# You should have received a copy of the GNU General Public License |
|
| 15 |
# along with this program; if not, write to the Free Software |
|
| 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
| 17 |
|
|
| 18 |
require File.expand_path('../../../../test_helper', __FILE__)
|
|
| 19 |
|
|
| 20 |
class ThemesTest < ActionController::IntegrationTest |
|
| 21 |
|
|
| 22 |
def setup |
|
| 23 |
@theme = Redmine::Themes.themes.last |
|
| 24 |
Setting.ui_theme = @theme.id |
|
| 25 |
end |
|
| 26 |
|
|
| 27 |
def teardown |
|
| 28 |
Setting.ui_theme = '' |
|
| 29 |
end |
|
| 30 |
|
|
| 31 |
def test_application_css |
|
| 32 |
get '/' |
|
| 33 |
|
|
| 34 |
assert_response :success |
|
| 35 |
assert_tag :tag => 'link', |
|
| 36 |
:attributes => {:href => %r{^/themes/#{@theme.dir}/stylesheets/application.css}}
|
|
| 37 |
end |
|
| 38 |
|
|
| 39 |
def test_without_theme_js |
|
| 40 |
get '/' |
|
| 41 |
|
|
| 42 |
assert_response :success |
|
| 43 |
assert_no_tag :tag => 'script', |
|
| 44 |
:attributes => {:src => %r{^/themes/#{@theme.dir}/javascripts/theme.js}}
|
|
| 45 |
end |
|
| 46 |
|
|
| 47 |
def test_with_theme_js |
|
| 48 |
# Simulates a theme.js |
|
| 49 |
@theme.javascripts << 'theme' |
|
| 50 |
get '/' |
|
| 51 |
|
|
| 52 |
assert_response :success |
|
| 53 |
assert_tag :tag => 'script', |
|
| 54 |
:attributes => {:src => %r{^/themes/#{@theme.dir}/javascripts/theme.js}}
|
|
| 55 |
|
|
| 56 |
ensure |
|
| 57 |
@theme.javascripts.delete 'theme' |
|
| 58 |
end |
|
| 59 |
|
|
| 60 |
def test_with_sub_uri |
|
| 61 |
Redmine::Utils.relative_url_root = '/foo' |
|
| 62 |
@theme.javascripts << 'theme' |
|
| 63 |
get '/' |
|
| 64 |
|
|
| 65 |
assert_response :success |
|
| 66 |
assert_tag :tag => 'link', |
|
| 67 |
:attributes => {:href => %r{^/foo/themes/#{@theme.dir}/stylesheets/application.css}}
|
|
| 68 |
assert_tag :tag => 'script', |
|
| 69 |
:attributes => {:src => %r{^/foo/themes/#{@theme.dir}/javascripts/theme.js}}
|
|
| 70 |
|
|
| 71 |
ensure |
|
| 72 |
Redmine::Utils.relative_url_root = '' |
|
| 73 |
end |
|
| 74 |
end |
|
| .svn/pristine/2e/2ee21f20a298f9183bcf6da4115281a958daccfb.svn-base | ||
|---|---|---|
| 1 |
<h2><%= link_to l(:label_issue_status_plural), issue_statuses_path %> » <%=h @issue_status %></h2> |
|
| 2 |
|
|
| 3 |
<% form_for @issue_status, :builder => TabularFormBuilder do |f| %> |
|
| 4 |
<%= render :partial => 'form', :locals => {:f => f} %>
|
|
| 5 |
<%= submit_tag l(:button_save) %> |
|
| 6 |
<% end %> |
|
Also available in: Unified diff