Revision 1297:0a574315af3e .svn/pristine/b2
| .svn/pristine/b2/b276250e954ac8b398b0737a04404d7c1ed1df94.svn-base | ||
|---|---|---|
| 1 |
<%= error_messages_for 'custom_field' %> |
|
| 2 |
|
|
| 3 |
<div class="box tabular"> |
|
| 4 |
<p><%= f.text_field :name, :required => true %></p> |
|
| 5 |
<p><%= f.select :field_format, custom_field_formats_for_select(@custom_field), {}, :disabled => !@custom_field.new_record? %></p>
|
|
| 6 |
|
|
| 7 |
<% if @custom_field.format_in? 'list', 'user', 'version' %> |
|
| 8 |
<p><%= f.check_box :multiple, :disabled => @custom_field.multiple && !@custom_field.new_record? %></p> |
|
| 9 |
<% end %> |
|
| 10 |
|
|
| 11 |
<% unless @custom_field.format_in? 'list', 'bool', 'date', 'user', 'version' %> |
|
| 12 |
<p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label> |
|
| 13 |
<%= f.text_field :min_length, :size => 5, :no_label => true %> - |
|
| 14 |
<%= f.text_field :max_length, :size => 5, :no_label => true %><br />(<%=l(:text_min_max_length_info)%>)</p> |
|
| 15 |
<p><%= f.text_field :regexp, :size => 50 %><br />(<%=l(:text_regexp_info)%>)</p> |
|
| 16 |
<% end %> |
|
| 17 |
|
|
| 18 |
<% if @custom_field.format_in? 'list' %> |
|
| 19 |
<p> |
|
| 20 |
<%= f.text_area :possible_values, :value => @custom_field.possible_values.to_a.join("\n"), :rows => 15 %>
|
|
| 21 |
<em class="info"><%= l(:text_custom_field_possible_values_info) %></em> |
|
| 22 |
</p> |
|
| 23 |
<% end %> |
|
| 24 |
|
|
| 25 |
<% unless @custom_field.format_in? 'user', 'version' %> |
|
| 26 |
<p><%= @custom_field.field_format == 'bool' ? f.check_box(:default_value) : f.text_field(:default_value) %></p> |
|
| 27 |
<% end %> |
|
| 28 |
|
|
| 29 |
<%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %> |
|
| 30 |
</div> |
|
| 31 |
|
|
| 32 |
<div class="box tabular"> |
|
| 33 |
<% case @custom_field.class.name |
|
| 34 |
when "IssueCustomField" %> |
|
| 35 |
|
|
| 36 |
<fieldset><legend><%=l(:label_tracker_plural)%></legend> |
|
| 37 |
<% Tracker.sorted.all.each do |tracker| %> |
|
| 38 |
<%= check_box_tag "custom_field[tracker_ids][]", |
|
| 39 |
tracker.id, |
|
| 40 |
(@custom_field.trackers.include? tracker), |
|
| 41 |
:id => "custom_field_tracker_ids_#{tracker.id}" %>
|
|
| 42 |
<label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>"> |
|
| 43 |
<%= h(tracker.name) %> |
|
| 44 |
</label> |
|
| 45 |
<% end %> |
|
| 46 |
<%= hidden_field_tag "custom_field[tracker_ids][]", '' %> |
|
| 47 |
</fieldset> |
|
| 48 |
|
|
| 49 |
<p><%= f.check_box :is_required %></p> |
|
| 50 |
<p><%= f.check_box :is_for_all %></p> |
|
| 51 |
<p><%= f.check_box :is_filter %></p> |
|
| 52 |
<p><%= f.check_box :searchable %></p> |
|
| 53 |
|
|
| 54 |
<% when "UserCustomField" %> |
|
| 55 |
<p><%= f.check_box :is_required %></p> |
|
| 56 |
<p><%= f.check_box :visible %></p> |
|
| 57 |
<p><%= f.check_box :editable %></p> |
|
| 58 |
<p><%= f.check_box :is_filter %></p> |
|
| 59 |
|
|
| 60 |
<% when "ProjectCustomField" %> |
|
| 61 |
<p><%= f.check_box :is_required %></p> |
|
| 62 |
<p><%= f.check_box :visible %></p> |
|
| 63 |
<p><%= f.check_box :searchable %></p> |
|
| 64 |
<p><%= f.check_box :is_filter %></p> |
|
| 65 |
|
|
| 66 |
<% when "VersionCustomField" %> |
|
| 67 |
<p><%= f.check_box :is_required %></p> |
|
| 68 |
<p><%= f.check_box :is_filter %></p> |
|
| 69 |
|
|
| 70 |
<% when "GroupCustomField" %> |
|
| 71 |
<p><%= f.check_box :is_required %></p> |
|
| 72 |
<p><%= f.check_box :is_filter %></p> |
|
| 73 |
|
|
| 74 |
<% when "TimeEntryCustomField" %> |
|
| 75 |
<p><%= f.check_box :is_required %></p> |
|
| 76 |
|
|
| 77 |
<% else %> |
|
| 78 |
<p><%= f.check_box :is_required %></p> |
|
| 79 |
|
|
| 80 |
<% end %> |
|
| 81 |
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
|
|
| 82 |
</div> |
|
| .svn/pristine/b2/b279683e40e793804fbad932586afda247f91b94.svn-base | ||
|---|---|---|
| 1 |
<%= error_messages_for 'user' %> |
|
| 2 |
|
|
| 3 |
<div id="user_form"> |
|
| 4 |
<!--[form:user]--> |
|
| 5 |
<div class="splitcontentleft"> |
|
| 6 |
<fieldset class="box tabular"> |
|
| 7 |
<legend><%=l(:label_information_plural)%></legend> |
|
| 8 |
<p><%= f.text_field :login, :required => true, :size => 25 %></p> |
|
| 9 |
<p><%= f.text_field :firstname, :required => true %></p> |
|
| 10 |
<p><%= f.text_field :lastname, :required => true %></p> |
|
| 11 |
<p><%= f.text_field :mail, :required => true %></p> |
|
| 12 |
<p><%= f.select :language, lang_options_for_select %></p> |
|
| 13 |
<% if Setting.openid? %> |
|
| 14 |
<p><%= f.text_field :identity_url %></p> |
|
| 15 |
<% end %> |
|
| 16 |
|
|
| 17 |
<% @user.custom_field_values.each do |value| %> |
|
| 18 |
<p><%= custom_field_tag_with_label :user, value %></p> |
|
| 19 |
<% end %> |
|
| 20 |
|
|
| 21 |
<p><%= f.check_box :admin, :disabled => (@user == User.current) %></p> |
|
| 22 |
<%= call_hook(:view_users_form, :user => @user, :form => f) %> |
|
| 23 |
</fieldset> |
|
| 24 |
|
|
| 25 |
<fieldset class="box tabular"> |
|
| 26 |
<legend><%=l(:label_authentication)%></legend> |
|
| 27 |
<% unless @auth_sources.empty? %> |
|
| 28 |
<p><%= f.select :auth_source_id, ([[l(:label_internal), ""]] + @auth_sources.collect { |a| [a.name, a.id] }), {}, :onchange => "if (this.value=='') {$('#password_fields').show();} else {$('#password_fields').hide();}" %></p>
|
|
| 29 |
<% end %> |
|
| 30 |
<div id="password_fields" style="<%= 'display:none;' if @user.auth_source %>"> |
|
| 31 |
<p><%= f.password_field :password, :required => true, :size => 25 %> |
|
| 32 |
<em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p> |
|
| 33 |
<p><%= f.password_field :password_confirmation, :required => true, :size => 25 %></p> |
|
| 34 |
</div> |
|
| 35 |
</fieldset> |
|
| 36 |
</div> |
|
| 37 |
|
|
| 38 |
<div class="splitcontentright"> |
|
| 39 |
<fieldset class="box"> |
|
| 40 |
<legend><%=l(:field_mail_notification)%></legend> |
|
| 41 |
<%= render :partial => 'users/mail_notifications' %> |
|
| 42 |
</fieldset> |
|
| 43 |
|
|
| 44 |
<fieldset class="box tabular"> |
|
| 45 |
<legend><%=l(:label_preferences)%></legend> |
|
| 46 |
<%= render :partial => 'users/preferences' %> |
|
| 47 |
</fieldset> |
|
| 48 |
</div> |
|
| 49 |
</div> |
|
| 50 |
<div style="clear:left;"></div> |
|
| 51 |
<!--[eoform:user]--> |
|
| .svn/pristine/b2/b2c1aa68021c22919992fd8f625f07f1b0ce5a24.svn-base | ||
|---|---|---|
| 1 |
/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */ |
|
| 2 |
/* Javad Mowlanezhad -- jmowla@gmail.com */ |
|
| 3 |
/* Jalali calendar should supported soon! (Its implemented but I have to test it) */ |
|
| 4 |
jQuery(function($) {
|
|
| 5 |
$.datepicker.regional['fa'] = {
|
|
| 6 |
closeText: 'بستن', |
|
| 7 |
prevText: '<قبلی', |
|
| 8 |
nextText: 'بعدی>', |
|
| 9 |
currentText: 'امروز', |
|
| 10 |
monthNames: [ |
|
| 11 |
'فروردين', |
|
| 12 |
'ارديبهشت', |
|
| 13 |
'خرداد', |
|
| 14 |
'تير', |
|
| 15 |
'مرداد', |
|
| 16 |
'شهريور', |
|
| 17 |
'مهر', |
|
| 18 |
'آبان', |
|
| 19 |
'آذر', |
|
| 20 |
'دی', |
|
| 21 |
'بهمن', |
|
| 22 |
'اسفند' |
|
| 23 |
], |
|
| 24 |
monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], |
|
| 25 |
dayNames: [ |
|
| 26 |
'يکشنبه', |
|
| 27 |
'دوشنبه', |
|
| 28 |
'سهشنبه', |
|
| 29 |
'چهارشنبه', |
|
| 30 |
'پنجشنبه', |
|
| 31 |
'جمعه', |
|
| 32 |
'شنبه' |
|
| 33 |
], |
|
| 34 |
dayNamesShort: [ |
|
| 35 |
'ی', |
|
| 36 |
'د', |
|
| 37 |
'س', |
|
| 38 |
'چ', |
|
| 39 |
'پ', |
|
| 40 |
'ج', |
|
| 41 |
'ش' |
|
| 42 |
], |
|
| 43 |
dayNamesMin: [ |
|
| 44 |
'ی', |
|
| 45 |
'د', |
|
| 46 |
'س', |
|
| 47 |
'چ', |
|
| 48 |
'پ', |
|
| 49 |
'ج', |
|
| 50 |
'ش' |
|
| 51 |
], |
|
| 52 |
weekHeader: 'هف', |
|
| 53 |
dateFormat: 'yy/mm/dd', |
|
| 54 |
firstDay: 6, |
|
| 55 |
isRTL: true, |
|
| 56 |
showMonthAfterYear: false, |
|
| 57 |
yearSuffix: ''}; |
|
| 58 |
$.datepicker.setDefaults($.datepicker.regional['fa']); |
|
| 59 |
}); |
|
| .svn/pristine/b2/b2da07c5b59f5a76f7942979d584cb5b875f39ed.svn-base | ||
|---|---|---|
| 1 |
class AddUniqueIndexToIssueRelations < ActiveRecord::Migration |
|
| 2 |
def self.up |
|
| 3 |
|
|
| 4 |
# Remove duplicates |
|
| 5 |
IssueRelation.connection.select_values("SELECT r.id FROM #{IssueRelation.table_name} r" +
|
|
| 6 |
" WHERE r.id > (SELECT min(r1.id) FROM #{IssueRelation.table_name} r1 WHERE r1.issue_from_id = r.issue_from_id AND r1.issue_to_id = r.issue_to_id)").each do |i|
|
|
| 7 |
IssueRelation.delete_all(["id = ?", i]) |
|
| 8 |
end |
|
| 9 |
|
|
| 10 |
add_index :issue_relations, [:issue_from_id, :issue_to_id], :unique => true |
|
| 11 |
end |
|
| 12 |
|
|
| 13 |
def self.down |
|
| 14 |
remove_index :issue_relations, :column => [:issue_from_id, :issue_to_id] |
|
| 15 |
end |
|
| 16 |
end |
|
| .svn/pristine/b2/b2e850115d38f72b8bb02be2b155cf948264198f.svn-base | ||
|---|---|---|
| 1 |
# Redmine - project management software |
|
| 2 |
# Copyright (C) 2006-2012 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 RoutingNewsTest < ActionController::IntegrationTest |
|
| 21 |
def test_news_index |
|
| 22 |
assert_routing( |
|
| 23 |
{ :method => 'get', :path => "/news" },
|
|
| 24 |
{ :controller => 'news', :action => 'index' }
|
|
| 25 |
) |
|
| 26 |
assert_routing( |
|
| 27 |
{ :method => 'get', :path => "/news.atom" },
|
|
| 28 |
{ :controller => 'news', :action => 'index', :format => 'atom' }
|
|
| 29 |
) |
|
| 30 |
assert_routing( |
|
| 31 |
{ :method => 'get', :path => "/news.xml" },
|
|
| 32 |
{ :controller => 'news', :action => 'index', :format => 'xml' }
|
|
| 33 |
) |
|
| 34 |
assert_routing( |
|
| 35 |
{ :method => 'get', :path => "/news.json" },
|
|
| 36 |
{ :controller => 'news', :action => 'index', :format => 'json' }
|
|
| 37 |
) |
|
| 38 |
end |
|
| 39 |
|
|
| 40 |
def test_news |
|
| 41 |
assert_routing( |
|
| 42 |
{ :method => 'get', :path => "/news/2" },
|
|
| 43 |
{ :controller => 'news', :action => 'show', :id => '2' }
|
|
| 44 |
) |
|
| 45 |
assert_routing( |
|
| 46 |
{ :method => 'get', :path => "/news/234" },
|
|
| 47 |
{ :controller => 'news', :action => 'show', :id => '234' }
|
|
| 48 |
) |
|
| 49 |
assert_routing( |
|
| 50 |
{ :method => 'get', :path => "/news/567/edit" },
|
|
| 51 |
{ :controller => 'news', :action => 'edit', :id => '567' }
|
|
| 52 |
) |
|
| 53 |
assert_routing( |
|
| 54 |
{ :method => 'put', :path => "/news/567" },
|
|
| 55 |
{ :controller => 'news', :action => 'update', :id => '567' }
|
|
| 56 |
) |
|
| 57 |
assert_routing( |
|
| 58 |
{ :method => 'delete', :path => "/news/567" },
|
|
| 59 |
{ :controller => 'news', :action => 'destroy', :id => '567' }
|
|
| 60 |
) |
|
| 61 |
end |
|
| 62 |
|
|
| 63 |
def test_news_scoped_under_project |
|
| 64 |
assert_routing( |
|
| 65 |
{ :method => 'get', :path => "/projects/567/news" },
|
|
| 66 |
{ :controller => 'news', :action => 'index', :project_id => '567' }
|
|
| 67 |
) |
|
| 68 |
assert_routing( |
|
| 69 |
{ :method => 'get', :path => "/projects/567/news.atom" },
|
|
| 70 |
{ :controller => 'news', :action => 'index', :format => 'atom',
|
|
| 71 |
:project_id => '567' } |
|
| 72 |
) |
|
| 73 |
assert_routing( |
|
| 74 |
{ :method => 'get', :path => "/projects/567/news.xml" },
|
|
| 75 |
{ :controller => 'news', :action => 'index', :format => 'xml',
|
|
| 76 |
:project_id => '567' } |
|
| 77 |
) |
|
| 78 |
assert_routing( |
|
| 79 |
{ :method => 'get', :path => "/projects/567/news.json" },
|
|
| 80 |
{ :controller => 'news', :action => 'index', :format => 'json',
|
|
| 81 |
:project_id => '567' } |
|
| 82 |
) |
|
| 83 |
assert_routing( |
|
| 84 |
{ :method => 'get', :path => "/projects/567/news/new" },
|
|
| 85 |
{ :controller => 'news', :action => 'new', :project_id => '567' }
|
|
| 86 |
) |
|
| 87 |
assert_routing( |
|
| 88 |
{ :method => 'post', :path => "/projects/567/news" },
|
|
| 89 |
{ :controller => 'news', :action => 'create', :project_id => '567' }
|
|
| 90 |
) |
|
| 91 |
end |
|
| 92 |
end |
|
Also available in: Unified diff