mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Merge branch 'dev' into sec-fixes
This commit is contained in:
@@ -31,7 +31,7 @@ wizards:
|
||||
- https://github.com/pkgr/addon-legacy-installer.git
|
||||
- https://github.com/pkgr/addon-mysql.git
|
||||
- https://github.com/pkgr/addon-apache2.git
|
||||
- https://github.com/pkgr/addon-svn-dav.git
|
||||
- https://github.com/finnlabs/addon-repositories.git
|
||||
- https://github.com/pkgr/addon-smtp.git
|
||||
- https://github.com/pkgr/addon-memcached.git
|
||||
- https://github.com/pkgr/addon-openproject.git
|
||||
|
||||
@@ -58,6 +58,9 @@ gem 'color-tools', '~> 1.3.0', require: 'color'
|
||||
|
||||
gem 'ruby-progressbar'
|
||||
|
||||
# Provide timezone info for TZInfo used by AR
|
||||
gem 'tzinfo-data'
|
||||
|
||||
# to generate html-diffs (e.g. for wiki comparison)
|
||||
gem 'htmldiff'
|
||||
|
||||
|
||||
+4
-1
@@ -45,7 +45,7 @@ GIT
|
||||
|
||||
GIT
|
||||
remote: https://github.com/opf/openproject-translations.git
|
||||
revision: e018b2fe8bcef4e164354a0092a2bbf54654e701
|
||||
revision: 1fcd6d780d746dad6583290a154bd09ffd817609
|
||||
branch: dev
|
||||
specs:
|
||||
openproject-translations (5.0.0.pre.alpha)
|
||||
@@ -501,6 +501,8 @@ GEM
|
||||
timecop (0.7.3)
|
||||
tzinfo (1.2.2)
|
||||
thread_safe (~> 0.1)
|
||||
tzinfo-data (1.2015.6)
|
||||
tzinfo (>= 1.0.0)
|
||||
uber (0.0.13)
|
||||
unicorn (4.9.0)
|
||||
kgio (~> 2.6)
|
||||
@@ -629,6 +631,7 @@ DEPENDENCIES
|
||||
thin
|
||||
timecop (~> 0.7.1)
|
||||
transactional_lock!
|
||||
tzinfo-data
|
||||
unicorn
|
||||
warden (~> 1.2)
|
||||
warden-basic_auth (~> 0.2.1)
|
||||
|
||||
@@ -33,8 +33,8 @@ window.OpenProject = (function ($) {
|
||||
var OP = function (options) {
|
||||
options = options || {};
|
||||
this.urlRoot = options.urlRoot || "";
|
||||
|
||||
this.loginUrl = options.loginUrl || "";
|
||||
this.environment = options.environment || "";
|
||||
|
||||
if (!/\/$/.test(this.urlRoot)) {
|
||||
this.urlRoot += '/';
|
||||
|
||||
@@ -101,7 +101,7 @@ var WorkPackage = WorkPackage || {};
|
||||
// remove blank lines generated by redmine format_text
|
||||
text = text.replace(/^\s*$[\n\r]{1,}/gm, '');
|
||||
|
||||
var quotedText = "<%= ::I18n.t(:text_user_wrote, :value => "{{{user}}}", :locale => Setting.default_language.to_s.gsub(%r{(.+)\-(.+)$}) { "#{$1}-#{$2.upcase}" }.presence || 'en') %>\n> ";
|
||||
var quotedText = "<%= ::I18n.t(:text_user_wrote, value: "{{{user}}}", locale: Setting.default_language.to_s.gsub(%r{(.+)\-(.+)$}) { "#{$1}-#{$2.upcase}" }.presence || 'en') %>\n> ";
|
||||
quotedText = quotedText.replace("{{{user}}}", user);
|
||||
quotedText += text.replace(/(\r?\n|\r\n?)/g, "\n> ") + "\n\n";
|
||||
|
||||
|
||||
@@ -599,11 +599,6 @@ div.indent
|
||||
margin-left: 10px
|
||||
padding-top: 0
|
||||
|
||||
#content
|
||||
.wiki-content
|
||||
p, li
|
||||
width: 700px
|
||||
|
||||
/*Cost-Plugin specific styles */
|
||||
|
||||
input::-webkit-input-placeholder, :-moz-placeholder
|
||||
@@ -640,3 +635,7 @@ h4.comment
|
||||
border: 0
|
||||
@include breakpoint(medium down)
|
||||
font-size: $h2-font-size
|
||||
|
||||
a.impaired--empty-link,
|
||||
.impaired--empty-link
|
||||
color: inherit
|
||||
|
||||
@@ -30,5 +30,7 @@
|
||||
|
||||
span.errorSpan
|
||||
font-weight: bold
|
||||
|
||||
textarea, select, input
|
||||
border: 2px solid red
|
||||
&, &:hover, &:focus
|
||||
border: 2px solid $content-form-danger-zone-bg-color
|
||||
|
||||
@@ -112,15 +112,27 @@ $form--field-types: (text-field, text-area, select, check-box, radio-button, ran
|
||||
flex-basis: 50%
|
||||
margin: 0 0.5rem 0 0
|
||||
|
||||
.button.-highlight
|
||||
.button
|
||||
@extend %input--sizing
|
||||
background: $content-form-danger-zone-bg-color
|
||||
color: $content-form-danger-zone-font-color
|
||||
border-color: $content-form-danger-zone-bg-color
|
||||
&.icon:before,
|
||||
&.icon-context:before
|
||||
|
||||
&.-highlight
|
||||
background: $content-form-danger-zone-bg-color
|
||||
color: $content-form-danger-zone-font-color
|
||||
padding-left: 0px
|
||||
border-color: $content-form-danger-zone-bg-color
|
||||
&.icon:before,
|
||||
&.icon-context:before
|
||||
color: $content-form-danger-zone-font-color
|
||||
padding-left: 0px
|
||||
|
||||
+ .form--field-instructions
|
||||
max-width: 100%
|
||||
|
||||
.form--field-instructions
|
||||
margin: 0 0 1rem 0
|
||||
|
||||
.errorSpan
|
||||
flex-basis: 50%
|
||||
margin-right: 0.5rem
|
||||
|
||||
.form--separator
|
||||
border: 0
|
||||
|
||||
@@ -47,6 +47,12 @@ div.box-actions
|
||||
#list-top
|
||||
padding: 0 4px
|
||||
|
||||
.container
|
||||
margin-bottom: 24px
|
||||
|
||||
> h3:first-child
|
||||
margin-bottom: 14px
|
||||
|
||||
#visible-grid
|
||||
.handle
|
||||
cursor: move
|
||||
|
||||
@@ -184,7 +184,7 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
|
||||
width: $nm-notification-width
|
||||
margin-left: -($nm-notification-width / 2)
|
||||
left: 50%
|
||||
z-index: 15
|
||||
z-index: 200
|
||||
|
||||
.notification-box--casing
|
||||
position: relative
|
||||
|
||||
@@ -238,7 +238,7 @@ $se2-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.columns-modal-content {
|
||||
.select2-modal-content {
|
||||
.select2-container {
|
||||
max-width: calc(100% - 45px);
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ $filters--border-color: $gray !default
|
||||
|
||||
.simple-filters--filter
|
||||
flex-basis: 33.33%
|
||||
padding: 0 1rem 0 0
|
||||
|
||||
&.-label-columns-3
|
||||
.simple-filters--filter
|
||||
@@ -67,16 +68,17 @@ $filters--border-color: $gray !default
|
||||
// is 50% and two elements should be within a row and padding is anything but
|
||||
// 0. The elements will in sum take up more than 100% and thus the second
|
||||
// element will move to the next row.
|
||||
.simple-filters--filter,
|
||||
padding: 0
|
||||
.simple-filters--filter
|
||||
padding: 0 1rem 0 0
|
||||
display: flex
|
||||
align-items: center
|
||||
@include breakpoint(large)
|
||||
margin-bottom: 1rem
|
||||
|
||||
@media only screen and (max-width: 1200px)
|
||||
margin-bottom: 1rem
|
||||
|
||||
.simple-filters--filter-name
|
||||
flex-basis: 15%
|
||||
margin-top: 5px
|
||||
.simple-filters--filter-value
|
||||
flex-basis: 75%
|
||||
|
||||
@@ -84,7 +86,7 @@ $filters--border-color: $gray !default
|
||||
margin-right: 20px
|
||||
|
||||
.simple-filters--controls
|
||||
padding: 0
|
||||
padding: 0 0 0 1rem
|
||||
align-self: center
|
||||
@include breakpoint(large)
|
||||
flex: 1
|
||||
@@ -105,10 +107,13 @@ $filters--border-color: $gray !default
|
||||
// element will move to the next row.
|
||||
.simple-filters--filter,
|
||||
.simple-filters--controls
|
||||
padding: 0
|
||||
padding: 0 0 0 1rem
|
||||
align-self: center
|
||||
@include breakpoint(large)
|
||||
|
||||
button,
|
||||
.button
|
||||
margin-bottom: 0rem
|
||||
|
||||
.simple-filters--filters + .simple-filter--trailing-labels
|
||||
margin-top: 1rem
|
||||
|
||||
@@ -236,8 +236,8 @@
|
||||
```
|
||||
<div class="generic-table--container" style="height:150px">
|
||||
<div class="generic-table--no-results-container">
|
||||
<i class="icon-info"></i>
|
||||
<h2 class="generic-table--no-results-title">
|
||||
<i class="icon-info"></i>
|
||||
Nothing to display
|
||||
</h2>
|
||||
<div class="generic-table--no-results-description">
|
||||
|
||||
@@ -240,17 +240,33 @@ table.generic-table
|
||||
z-index: 0
|
||||
|
||||
.generic-table--no-results-container
|
||||
background: #fff
|
||||
border: 1px solid $light-gray
|
||||
background: $gray-light
|
||||
border: 1px solid $gray
|
||||
border-radius: $global-radius
|
||||
padding: 20px
|
||||
padding: 14px 14px 14px 36px
|
||||
|
||||
> i,
|
||||
.generic-table--no-results-title
|
||||
display: inline-block
|
||||
font-size: rem-calc(17)
|
||||
line-height: 1.4
|
||||
vertical-align: top
|
||||
|
||||
> i
|
||||
margin: 1px 0 0 -24px
|
||||
width: 20px
|
||||
|
||||
.generic-table--no-results-title
|
||||
// properties to reset h2
|
||||
border: 0
|
||||
font-weight: normal
|
||||
margin: 0
|
||||
padding: 0
|
||||
text-transform: none
|
||||
color: black
|
||||
width: 99%
|
||||
|
||||
.generic-table--no-results-description
|
||||
color: black
|
||||
font-size: rem-calc(15)
|
||||
line-height: 1.4
|
||||
margin-top: 4px
|
||||
|
||||
p:last-child
|
||||
margin-bottom: 0
|
||||
|
||||
@@ -37,7 +37,8 @@ div.wiki
|
||||
border: 0
|
||||
font-size: $wiki-max-heading-font-size
|
||||
line-height: 1.4
|
||||
height: 45px
|
||||
margin-bottom: 16px
|
||||
|
||||
h2
|
||||
font-size: $wiki-max-heading-font-size * 0.8
|
||||
h3
|
||||
@@ -160,9 +161,6 @@ h1:hover, h2:hover, h3:hover
|
||||
font-weight: bold
|
||||
font-size: $wiki-default-font-size
|
||||
|
||||
.wiki-content
|
||||
width: 700px
|
||||
|
||||
blockquote
|
||||
font-style: italic
|
||||
&.icon:before
|
||||
|
||||
@@ -155,8 +155,8 @@
|
||||
```
|
||||
<div class="generic-table--container work-package-table--container" style="height:150px">
|
||||
<div class="generic-table--no-results-container">
|
||||
<i class="icon-info"></i>
|
||||
<h2 class="generic-table--no-results-title">
|
||||
<i class="icon-info"></i>
|
||||
No work packages to display
|
||||
</h2>
|
||||
<div class="generic-table--no-results-description">
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
// important for IE
|
||||
display: inline-block
|
||||
max-width: 100%
|
||||
vertical-align: top
|
||||
p
|
||||
word-wrap: break-word
|
||||
|
||||
|
||||
@@ -109,6 +109,8 @@
|
||||
padding: 4px 13px 4px 10px
|
||||
white-space: nowrap
|
||||
font-weight: normal
|
||||
text-overflow: ellipsis
|
||||
overflow: hidden
|
||||
|
||||
.dropdown .dropdown-menu LI > A:hover,
|
||||
.dropdown .dropdown-menu LABEL:hover
|
||||
|
||||
@@ -117,7 +117,7 @@ class MyController < ApplicationController
|
||||
# Configure user's mail notifications
|
||||
def mail_notifications
|
||||
@user = User.current
|
||||
write_settings(redirect_to: :mail_notifications)
|
||||
write_email_settings(redirect_to: :mail_notifications) if request.patch?
|
||||
end
|
||||
|
||||
def first_login
|
||||
@@ -251,6 +251,16 @@ class MyController < ApplicationController
|
||||
false
|
||||
end
|
||||
|
||||
def write_email_settings(redirect_to:)
|
||||
update_service = UpdateUserEmailSettingsService.new(@user)
|
||||
if update_service.call(mail_notification: permitted_params.user[:mail_notification],
|
||||
self_notified: params[:self_notified] == '1',
|
||||
notified_project_ids: params[:notified_project_ids])
|
||||
flash[:notice] = l(:notice_account_updated)
|
||||
redirect_to(action: redirect_to)
|
||||
end
|
||||
end
|
||||
|
||||
def write_settings(redirect_to:)
|
||||
if request.patch?
|
||||
@user.attributes = permitted_params.user
|
||||
@@ -262,9 +272,6 @@ class MyController < ApplicationController
|
||||
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
|
||||
if @user.save
|
||||
@user.pref.save
|
||||
@user.notified_project_ids =
|
||||
(@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
|
||||
set_language_if_valid @user.language
|
||||
flash[:notice] = l(:notice_account_updated)
|
||||
redirect_to(action: redirect_to)
|
||||
end
|
||||
|
||||
@@ -161,31 +161,36 @@ class ProjectsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def update_identifier
|
||||
@project.attributes = permitted_params.project
|
||||
|
||||
if @project.save
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
redirect_to action: 'settings', id: @project
|
||||
end
|
||||
end
|
||||
OpenProject::Notifications.send('project_renamed', project: @project)
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
load_project_settings
|
||||
render action: 'identifier'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def types
|
||||
flash[:notice] = []
|
||||
project_params = {}
|
||||
|
||||
if params.has_key? :project
|
||||
project_params = permitted_params.project
|
||||
if UpdateProjectsTypesService.new(@project).call(permitted_params.projects_type_ids)
|
||||
flash[:notice] = l('notice_successful_update')
|
||||
else
|
||||
project_params = { 'type_ids' => [::Type.standard_type.id] }
|
||||
flash[:notice] << l(:notice_automatic_set_of_standard_type)
|
||||
flash[:error] = @project.errors.full_messages
|
||||
end
|
||||
|
||||
project_params.assert_valid_keys('type_ids')
|
||||
|
||||
selected_type_ids = project_params['type_ids'].map(&:to_i)
|
||||
|
||||
if types_missing?(selected_type_ids)
|
||||
flash.delete :notice
|
||||
flash[:error] = I18n.t(:error_types_in_use_by_work_packages,
|
||||
types: missing_types(selected_type_ids).map(&:name).join(', '))
|
||||
elsif @project.update_attributes(project_params)
|
||||
flash[:notice] << l('notice_successful_update')
|
||||
else
|
||||
flash[:error] = l('timelines.cannot_update_planning_element_types')
|
||||
end
|
||||
redirect_to action: 'settings', tab: 'types'
|
||||
redirect_to settings_project_path(@project.identifier, tab: 'types')
|
||||
end
|
||||
|
||||
def modules
|
||||
@@ -285,20 +290,6 @@ class ProjectsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def types_missing?(selected_type_ids)
|
||||
!missing_types(selected_type_ids).empty?
|
||||
end
|
||||
|
||||
def missing_types(selected_type_ids)
|
||||
types_used_by_work_packages.select { |t| !selected_type_ids.include?(t.id) }
|
||||
end
|
||||
|
||||
def types_used_by_work_packages
|
||||
@types_used_by_work_packages ||= ::Type.where(id: WorkPackage.where(project_id: @project.id)
|
||||
.select(:type_id)
|
||||
.uniq)
|
||||
end
|
||||
|
||||
# Validates parent_id param according to user's permissions
|
||||
# TODO: move it to Project model in a validation that depends on User.current
|
||||
def validate_parent_id
|
||||
|
||||
@@ -45,8 +45,6 @@ class UsersController < ApplicationController
|
||||
before_filter :check_if_deletion_allowed, only: [:deletion_info,
|
||||
:destroy]
|
||||
|
||||
before_filter :block_if_password_login_disabled, only: [:new, :create]
|
||||
|
||||
accept_key_auth :index, :show, :create, :update, :destroy
|
||||
|
||||
include SortHelper
|
||||
@@ -160,17 +158,21 @@ class UsersController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
if @user.save
|
||||
# TODO: Similar to My#account
|
||||
@user.pref.attributes = if params[:pref].present?
|
||||
permitted_params.pref
|
||||
else
|
||||
{}
|
||||
end
|
||||
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
|
||||
@user.pref.save
|
||||
pref_params = if params[:pref].present?
|
||||
permitted_params.pref
|
||||
else
|
||||
{}
|
||||
end
|
||||
|
||||
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
|
||||
if @user.save
|
||||
update_email_service = UpdateUserEmailSettingsService.new(@user)
|
||||
update_email_service.call(mail_notification: pref_params.delete(:mail_notification),
|
||||
self_notified: params[:self_notified] == '1',
|
||||
notified_project_ids: params[:notified_project_ids])
|
||||
|
||||
|
||||
@user.pref.attributes = pref_params
|
||||
@user.pref.save
|
||||
|
||||
if !@user.password.blank? && @user.change_password_allowed?
|
||||
send_information = params[:send_information]
|
||||
@@ -343,10 +345,6 @@ class UsersController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def block_if_password_login_disabled
|
||||
render_404 if OpenProject::Configuration.disable_password_login?
|
||||
end
|
||||
|
||||
def set_password?(params)
|
||||
params[:user][:password].present? && !OpenProject::Configuration.disable_password_choice?
|
||||
end
|
||||
|
||||
@@ -37,7 +37,7 @@ class WikisController < ApplicationController
|
||||
@wiki.attributes = permitted_params.wiki
|
||||
@wiki.save if request.post?
|
||||
# there's is no wiki anymore, see: opf/openproject/master#e375875
|
||||
# render(:update) {|page| page.replace_html "tab-content-wiki", :partial => 'projects/settings/wiki'}
|
||||
# render(:update) {|page| page.replace_html "tab-content-wiki", partial: 'projects/settings/wiki'}
|
||||
render nothing: true
|
||||
end
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class WorkPackages::BulkController < ApplicationController
|
||||
attributes = parse_params_for_bulk_work_package_attributes params, work_package.project
|
||||
work_package.assign_attributes attributes
|
||||
|
||||
call_hook(:controller_work_package_bulk_before_save, params: params, work_package: work_package)
|
||||
call_hook(:controller_work_packages_bulk_edit_before_save, params: params, work_package: work_package)
|
||||
JournalManager.send_notification = params[:send_notification] == '0' ? false : true
|
||||
unless work_package.save
|
||||
unsaved_work_package_ids << work_package.id
|
||||
|
||||
@@ -204,7 +204,7 @@ module ApplicationHelper
|
||||
|
||||
content_tag :div, html_options do
|
||||
if User.current.impaired?
|
||||
concat(content_tag('a', join_flash_messages(message), href: 'javascript:;'))
|
||||
concat(content_tag('a', join_flash_messages(message), href: 'javascript:;', class: 'impaired--empty-link'))
|
||||
concat(content_tag(:i, '', class: 'icon-close close-handler', tabindex: '0', role: 'button', aria: { label: ::I18n.t('js.close_popup_title') }))
|
||||
else
|
||||
concat(join_flash_messages(message))
|
||||
@@ -559,6 +559,7 @@ module ApplicationHelper
|
||||
tags += javascript_tag(%{
|
||||
window.openProject = new OpenProject({
|
||||
urlRoot : '#{OpenProject::Configuration.rails_relative_url_root}',
|
||||
environment: '#{Rails.env}',
|
||||
loginUrl: '#{url_for controller: '/account', action: 'login'}'
|
||||
});
|
||||
I18n.defaultLocale = "#{I18n.default_locale}";
|
||||
|
||||
@@ -45,6 +45,6 @@ module AttachmentsHelper
|
||||
forced_str.force_encoding('UTF-8')
|
||||
return forced_str if forced_str.valid_encoding?
|
||||
|
||||
str.encode('UTF-8', invalid: :replace, undef: :replace, replace: '') # better :replace => '?'
|
||||
str.encode('UTF-8', invalid: :replace, undef: :replace, replace: '') # better replace: '?'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,15 +29,16 @@
|
||||
|
||||
module CustomFieldsHelper
|
||||
def custom_fields_tabs
|
||||
tabs = [{ name: 'WorkPackageCustomField', partial: 'custom_fields/index', label: :label_work_package_plural },
|
||||
{ name: 'TimeEntryCustomField', partial: 'custom_fields/index', label: :label_spent_time },
|
||||
{ name: 'ProjectCustomField', partial: 'custom_fields/index', label: :label_project_plural },
|
||||
{ name: 'VersionCustomField', partial: 'custom_fields/index', label: :label_version_plural },
|
||||
{ name: 'UserCustomField', partial: 'custom_fields/index', label: :label_user_plural },
|
||||
{ name: 'GroupCustomField', partial: 'custom_fields/index', label: :label_group_plural },
|
||||
{ name: 'TimeEntryActivityCustomField', partial: 'custom_fields/index', label: TimeEntryActivity::OptionName },
|
||||
{ name: 'IssuePriorityCustomField', partial: 'custom_fields/index', label: IssuePriority::OptionName }
|
||||
]
|
||||
[
|
||||
{ name: 'WorkPackageCustomField', partial: 'custom_fields/tab', label: :label_work_package_plural },
|
||||
{ name: 'TimeEntryCustomField', partial: 'custom_fields/tab', label: :label_spent_time },
|
||||
{ name: 'ProjectCustomField', partial: 'custom_fields/tab', label: :label_project_plural },
|
||||
{ name: 'VersionCustomField', partial: 'custom_fields/tab', label: :label_version_plural },
|
||||
{ name: 'UserCustomField', partial: 'custom_fields/tab', label: :label_user_plural },
|
||||
{ name: 'GroupCustomField', partial: 'custom_fields/tab', label: :label_group_plural },
|
||||
{ name: 'TimeEntryActivityCustomField', partial: 'custom_fields/tab', label: TimeEntryActivity::OptionName },
|
||||
{ name: 'IssuePriorityCustomField', partial: 'custom_fields/tab', label: IssuePriority::OptionName }
|
||||
]
|
||||
end
|
||||
|
||||
# Return custom field html tag corresponding to its format
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is a project management system.
|
||||
# Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License version 3.
|
||||
#
|
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# See doc/COPYRIGHT.rdoc for more details.
|
||||
#++
|
||||
|
||||
module NoResultsHelper
|
||||
|
||||
# Helper to render the /common/no_results partial custamizable content.
|
||||
# Example usage:
|
||||
# no_results_box action_url: new_project_version_path(@project),
|
||||
# display_action: authorize_for('messages', 'new')
|
||||
#
|
||||
# All arguments are optional.
|
||||
# - 'action_url' The url for the link in the content.
|
||||
# - 'display_action' Whether or not the link should be displayed.
|
||||
# - 'custom_title' custom text for the title.
|
||||
# - 'custom_action_text' custom text for the title.
|
||||
#
|
||||
# Calling this on its on without any arguments creates the box in its simplest
|
||||
# form with only the title. Providing an action_url and display_action: true
|
||||
# Displays the box with the title and link to the passed in url.
|
||||
# The title and action_text are found using the locales key lookup unless
|
||||
# custom_title and custom_action_text are provided.
|
||||
def no_results_box(action_url: nil,
|
||||
display_action: false,
|
||||
custom_title: nil,
|
||||
custom_action_text: nil)
|
||||
|
||||
title = custom_title || t('.no_results_title_text', cascade: true)
|
||||
action_text = custom_action_text || t('.no_results_content_text')
|
||||
|
||||
render partial: '/common/no_results',
|
||||
locals: {
|
||||
title_text: title,
|
||||
action_text: display_action ? action_text : '',
|
||||
action_url: action_url || ''
|
||||
}
|
||||
end
|
||||
end
|
||||
@@ -60,18 +60,18 @@
|
||||
# sort_init 'last_name'
|
||||
# sort_update %w(first_name last_name)
|
||||
# @contact_pages, @items = paginate :contacts,
|
||||
# :order_by => sort_clause,
|
||||
# :per_page => 10
|
||||
# order_by: sort_clause,
|
||||
# per_page: 10
|
||||
# end
|
||||
#
|
||||
# View (table header in list.rhtml):
|
||||
#
|
||||
# <thead>
|
||||
# <tr>
|
||||
# <%= sort_header_tag('id', :title => 'Sort by contact ID') %>
|
||||
# <%= sort_header_tag('last_name', :caption => 'Name') %>
|
||||
# <%= sort_header_tag('id', title: 'Sort by contact ID') %>
|
||||
# <%= sort_header_tag('last_name', caption: 'Name') %>
|
||||
# <%= sort_header_tag('phone') %>
|
||||
# <%= sort_header_tag('address', :width => 200) %>
|
||||
# <%= sort_header_tag('address', width: 200) %>
|
||||
# </tr>
|
||||
# </thead>
|
||||
#
|
||||
@@ -254,7 +254,7 @@ module SortHelper
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# <%= sort_header_tag('id', :title => 'Sort by contact ID') %>
|
||||
# <%= sort_header_tag('id', title: 'Sort by contact ID') %>
|
||||
#
|
||||
# Generates (for the users controller and if the table is sorted by the column)
|
||||
# <th>
|
||||
|
||||
@@ -56,14 +56,14 @@ module WorkPackagesHelper
|
||||
# Examples:
|
||||
#
|
||||
# link_to_work_package(package) # => Defect #6: This is the subject
|
||||
# link_to_work_package(package, :all_link => true) # => Defect #6: This is the subject (everything within the link)
|
||||
# link_to_work_package(package, :truncate => 9) # => Defect #6: This i...
|
||||
# link_to_work_package(package, :subject => false) # => Defect #6
|
||||
# link_to_work_package(package, :type => false) # => #6: This is the subject
|
||||
# link_to_work_package(package, :project => true) # => Foo - Defect #6
|
||||
# link_to_work_package(package, :id_only => true) # => #6
|
||||
# link_to_work_package(package, :subject_only => true) # => This is the subject (as link)
|
||||
# link_to_work_package(package, :status => true) # => #6 New (if #id => true)
|
||||
# link_to_work_package(package, all_link: true) # => Defect #6: This is the subject (everything within the link)
|
||||
# link_to_work_package(package, truncate: 9) # => Defect #6: This i...
|
||||
# link_to_work_package(package, subject: false) # => Defect #6
|
||||
# link_to_work_package(package, type: false) # => #6: This is the subject
|
||||
# link_to_work_package(package, project: true) # => Foo - Defect #6
|
||||
# link_to_work_package(package, id_only: true) # => #6
|
||||
# link_to_work_package(package, subject_only: true) # => This is the subject (as link)
|
||||
# link_to_work_package(package, status: true) # => #6 New (if #id => true)
|
||||
def link_to_work_package(package, options = {})
|
||||
if options[:subject_only]
|
||||
options.merge!(type: false,
|
||||
|
||||
@@ -108,8 +108,8 @@ class Attachment < ActiveRecord::Base
|
||||
# Bulk attaches a set of files to an object
|
||||
#
|
||||
# Returns a Hash of the results:
|
||||
# :files => array of the attached files
|
||||
# :unsaved => array of the files that could not be attached
|
||||
# files: array of the attached files
|
||||
# unsaved: array of the files that could not be attached
|
||||
def self.attach_files(obj, attachments)
|
||||
attached = []
|
||||
if attachments && attachments.is_a?(Hash)
|
||||
|
||||
@@ -141,7 +141,7 @@ class CustomField < ActiveRecord::Base
|
||||
# Notes: You SHOULD pass a customizable if this CF has a format of user or version.
|
||||
# You MUST NOT pass a customizable if this CF has any other format
|
||||
# read_attribute is localized - to get values for a specific locale pass the following options hash
|
||||
# :locale => <locale (-> :en, :de, ...)>
|
||||
# locale: <locale (-> :en, :de, ...)>
|
||||
def possible_values(obj = nil)
|
||||
case field_format
|
||||
when 'user', 'version'
|
||||
|
||||
@@ -46,7 +46,7 @@ class LegacyJournal < ActiveRecord::Base
|
||||
# Define a default class_name to prevent `uninitialized constant Journal::Journaled`
|
||||
# subclasses will be given an actual class name when they are created by aaj
|
||||
#
|
||||
# e.g. IssueJournal will get :class_name => 'Issue'
|
||||
# e.g. IssueJournal will get class_name: 'Issue'
|
||||
belongs_to :journaled, class_name: 'Journal'
|
||||
belongs_to :user
|
||||
|
||||
|
||||
@@ -135,6 +135,10 @@ class PermittedParams
|
||||
params.require(:project_type).permit(*self.class.permitted_attributes[:project_type])
|
||||
end
|
||||
|
||||
def projects_type_ids
|
||||
params.require(:project).require(:type_ids).map(&:to_i).select { |x| x > 0 }
|
||||
end
|
||||
|
||||
def project_type_move
|
||||
params.require(:project_type).permit(*self.class.permitted_attributes[:move_to])
|
||||
end
|
||||
@@ -626,7 +630,7 @@ class PermittedParams
|
||||
## Add attributes as permitted attributes (only to be used by the plugins plugin)
|
||||
#
|
||||
# attributes should be given as a Hash in the form
|
||||
# {:key => [:param1, :param2]}
|
||||
# {key: [:param1, :param2]}
|
||||
def self.add_permitted_attributes(attributes)
|
||||
# Make sure the permitted attributes are cached in @whitelisted_params
|
||||
permitted_attributes
|
||||
|
||||
+14
-16
@@ -285,14 +285,6 @@ class Project < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def identifier=(identifier)
|
||||
super unless identifier_frozen?
|
||||
end
|
||||
|
||||
def identifier_frozen?
|
||||
errors[:identifier].nil? && !(new_record? || identifier.blank?)
|
||||
end
|
||||
|
||||
def possible_members(criteria, limit)
|
||||
Principal.active_or_registered.like(criteria).not_in_project(self).limit(limit)
|
||||
end
|
||||
@@ -328,9 +320,9 @@ class Project < ActiveRecord::Base
|
||||
# Returns a ActiveRecord::Relation to find all projects for which +user+ has the given +permission+
|
||||
#
|
||||
# Valid options:
|
||||
# * :project => limit the condition to project
|
||||
# * :with_subprojects => limit the condition to project and its subprojects
|
||||
# * :member => limit the condition to the user projects
|
||||
# * project: limit the condition to project
|
||||
# * with_subprojects: limit the condition to project and its subprojects
|
||||
# * member: limit the condition to the user projects
|
||||
def self.allowed_to(user, permission, options = {})
|
||||
where(allowed_to_condition(user, permission, options))
|
||||
.references(:projects)
|
||||
@@ -339,9 +331,9 @@ class Project < ActiveRecord::Base
|
||||
# Returns a SQL conditions string used to find all projects for which +user+ has the given +permission+
|
||||
#
|
||||
# Valid options:
|
||||
# * :project => limit the condition to project
|
||||
# * :with_subprojects => limit the condition to project and its subprojects
|
||||
# * :member => limit the condition to the user projects
|
||||
# * project: limit the condition to project
|
||||
# * with_subprojects: limit the condition to project and its subprojects
|
||||
# * member: limit the condition to the user projects
|
||||
def self.allowed_to_condition(user, permission, options = {})
|
||||
base_statement = "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"
|
||||
if perm = Redmine::AccessControl.permission(permission)
|
||||
@@ -552,6 +544,12 @@ class Project < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def types_used_by_work_packages
|
||||
::Type.where(id: WorkPackage.where(project_id: project.id)
|
||||
.select(:type_id)
|
||||
.uniq)
|
||||
end
|
||||
|
||||
# Returns an array of the types used by the project and its active sub projects
|
||||
def rolled_up_types
|
||||
@rolled_up_types ||=
|
||||
@@ -726,7 +724,7 @@ class Project < ActiveRecord::Base
|
||||
|
||||
# Return true if this project is allowed to do the specified action.
|
||||
# action can be:
|
||||
# * a parameter-like Hash (eg. :controller => '/projects', :action => 'edit')
|
||||
# * a parameter-like Hash (eg. controller: '/projects', action: 'edit')
|
||||
# * a permission Symbol (eg. :edit_project)
|
||||
def allows_to?(action)
|
||||
if action.is_a? Hash
|
||||
@@ -783,7 +781,7 @@ class Project < ActiveRecord::Base
|
||||
#
|
||||
# where each entry has the form
|
||||
#
|
||||
# project_info = { :project => the_project, :children => [ child_info_1, child_info_2, ... ] }
|
||||
# project_info = { project: the_project, children: [ child_info_1, child_info_2, ... ] }
|
||||
#
|
||||
# if a project has no children the :children array is just empty
|
||||
#
|
||||
|
||||
@@ -43,7 +43,7 @@ class Repository < ActiveRecord::Base
|
||||
after_destroy :delete_managed_repository, if: Proc.new { |repo| repo.managed? }
|
||||
|
||||
# Raw SQL to delete changesets and changes in the database
|
||||
# has_many :changesets, :dependent => :destroy is too slow for big repositories
|
||||
# has_many :changesets, dependent: :destroy is too slow for big repositories
|
||||
before_destroy :clear_changesets
|
||||
|
||||
validates_length_of :password, maximum: 255, allow_nil: true
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ class Role < ActiveRecord::Base
|
||||
|
||||
# Return true if role is allowed to do the specified action
|
||||
# action can be:
|
||||
# * a parameter-like Hash (eg. :controller => '/projects', :action => 'edit')
|
||||
# * a parameter-like Hash (eg. controller: '/projects', action: 'edit')
|
||||
# * a permission Symbol (eg. :edit_project)
|
||||
def allowed_to?(action)
|
||||
if action.is_a? Hash
|
||||
|
||||
+5
-21
@@ -605,7 +605,7 @@ class User < Principal
|
||||
|
||||
# Return true if the user is allowed to do the specified action on a specific context
|
||||
# Action can be:
|
||||
# * a parameter-like Hash (eg. :controller => '/projects', :action => 'edit')
|
||||
# * a parameter-like Hash (eg. controller: '/projects', action: 'edit')
|
||||
# * a permission Symbol (eg. :edit_project)
|
||||
# Context can be:
|
||||
# * a project : returns true if user is allowed to do the specified action on this project
|
||||
@@ -679,31 +679,15 @@ class User < Principal
|
||||
true
|
||||
when 'selected'
|
||||
# user receives notifications for created/assigned issues on unselected projects
|
||||
if object.is_a?(WorkPackage) && (object.author == self || is_or_belongs_to?(object.assigned_to))
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
object.is_a?(WorkPackage) && (object.author == self || is_or_belongs_to?(object.assigned_to))
|
||||
when 'none'
|
||||
false
|
||||
when 'only_my_events'
|
||||
if object.is_a?(WorkPackage) && (object.author == self || is_or_belongs_to?(object.assigned_to))
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
object.is_a?(WorkPackage) && (object.author == self || is_or_belongs_to?(object.assigned_to))
|
||||
when 'only_assigned'
|
||||
if object.is_a?(WorkPackage) && is_or_belongs_to?(object.assigned_to)
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
object.is_a?(WorkPackage) && is_or_belongs_to?(object.assigned_to)
|
||||
when 'only_owner'
|
||||
if object.is_a?(WorkPackage) && object.author == self
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
object.is_a?(WorkPackage) && object.author == self
|
||||
else
|
||||
false
|
||||
end
|
||||
|
||||
@@ -57,6 +57,14 @@ class UserPreference < ActiveRecord::Base
|
||||
comments_sorting == 'desc'
|
||||
end
|
||||
|
||||
def self_notified?
|
||||
!others[:no_self_notified]
|
||||
end
|
||||
|
||||
def self_notified=(value)
|
||||
others[:no_self_notified] = !value
|
||||
end
|
||||
|
||||
def warn_on_leaving_unsaved?
|
||||
# Need to cast here as previous values were '0' / '1'
|
||||
to_boolean(others.fetch(:warn_on_leaving_unsaved) { true })
|
||||
|
||||
@@ -68,7 +68,7 @@ class Version < ActiveRecord::Base
|
||||
# based on the earlist start_date of the fixed_issues
|
||||
def start_date
|
||||
# when self.id is nil (e.g. when self is a new_record),
|
||||
# minimum('start_date') works on all issues with :fixed_version => nil
|
||||
# minimum('start_date') works on all issues with fixed_version: nil
|
||||
# but we expect only issues belonging to this version
|
||||
read_attribute(:start_date) || fixed_issues.where(WorkPackage.arel_table[:fixed_version_id].not_eq(nil)).minimum('start_date')
|
||||
end
|
||||
|
||||
@@ -218,7 +218,7 @@ class WikiPage < ActiveRecord::Base
|
||||
end
|
||||
|
||||
# Returns the wiki menu item of nearest ancestor page that has a wiki menu item.
|
||||
# To restrict the result to main menu items pass <tt>:is_main_item => true</tt> as +options+ hash
|
||||
# To restrict the result to main menu items pass <tt>is_main_item: true</tt> as +options+ hash
|
||||
def nearest_parent_menu_item(options = {})
|
||||
return nil unless parent
|
||||
|
||||
|
||||
@@ -503,47 +503,6 @@ class WorkPackage < ActiveRecord::Base
|
||||
write_attribute :estimated_hours, !!converted_hours ? converted_hours : h
|
||||
end
|
||||
|
||||
# Safely sets attributes
|
||||
# Should be called from controllers instead of #attributes=
|
||||
# attr_accessible is too rough because we still want things like
|
||||
# WorkPackage.new(:project => foo) to work
|
||||
# TODO: move workflow/permission checks from controllers to here
|
||||
def safe_attributes=(attrs, user = User.current)
|
||||
return unless attrs.is_a?(Hash)
|
||||
|
||||
# User can change issue attributes only if he has :edit permission
|
||||
# or if a workflow transition is allowed
|
||||
attrs = delete_unsafe_attributes(attrs, user)
|
||||
return if attrs.empty?
|
||||
|
||||
# ::Type must be set before since new_statuses_allowed_to depends on it.
|
||||
if t = attrs.delete('type_id')
|
||||
self.type_id = t
|
||||
end
|
||||
|
||||
if attrs['status_id']
|
||||
unless new_statuses_allowed_to(user).map(&:id).include?(attrs['status_id'].to_i)
|
||||
attrs.delete('status_id')
|
||||
end
|
||||
end
|
||||
|
||||
if parent.present?
|
||||
attrs.reject! do |k, _v|
|
||||
%w(priority_id done_ratio start_date due_date estimated_hours).include?(k)
|
||||
end
|
||||
end
|
||||
|
||||
if attrs.has_key?('parent_id')
|
||||
if !user.allowed_to?(:manage_subtasks, project)
|
||||
attrs.delete('parent_id')
|
||||
elsif !attrs['parent_id'].blank?
|
||||
attrs.delete('parent_id') unless WorkPackage.visible(user).exists?(attrs['parent_id'].to_i)
|
||||
end
|
||||
end
|
||||
|
||||
self.attributes = attrs
|
||||
end
|
||||
|
||||
# Saves an issue, time_entry, attachments, and a journal from the parameters
|
||||
# Returns false if save fails
|
||||
def save_issue_with_child_records(params, existing_time_entry = nil)
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is a project management system.
|
||||
# Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License version 3.
|
||||
#
|
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# See doc/COPYRIGHT.rdoc for more details.
|
||||
#++
|
||||
|
||||
class BaseProjectService
|
||||
def initialize(project)
|
||||
self.project = project
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
attr_accessor :project
|
||||
end
|
||||
@@ -46,7 +46,7 @@ class Scm::CreateManagedRepositoryService < Scm::BaseRepositoryService
|
||||
# creating and deleting repositories, which provides transactional DB access
|
||||
# as well as filesystem access.
|
||||
if repository.class.manages_remote?
|
||||
Scm::CreateRemoteRepositoryJob.new(repository).perform
|
||||
Scm::CreateRemoteRepositoryJob.new(repository, perform_now: true).perform
|
||||
else
|
||||
Scm::CreateLocalRepositoryJob.new(repository).perform
|
||||
end
|
||||
|
||||
@@ -38,7 +38,7 @@ class Scm::DeleteManagedRepositoryService < Scm::BaseRepositoryService
|
||||
return false unless repository.managed?
|
||||
|
||||
if repository.class.manages_remote?
|
||||
Scm::DeleteRemoteRepositoryJob.new(repository).perform
|
||||
Scm::DeleteRemoteRepositoryJob.new(repository, perform_now: true).perform
|
||||
true
|
||||
else
|
||||
delete_local_repository
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is a project management system.
|
||||
# Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License version 3.
|
||||
#
|
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# See doc/COPYRIGHT.rdoc for more details.
|
||||
#++
|
||||
|
||||
class UpdateProjectsTypesService < BaseProjectService
|
||||
def call(type_ids)
|
||||
type_ids = [::Type.standard_type.id] if type_ids.nil? || type_ids.empty?
|
||||
|
||||
if types_missing?(type_ids)
|
||||
project.errors.add(:type,
|
||||
:in_use_by_work_packages,
|
||||
types: missing_types(type_ids).map(&:name).join(', '))
|
||||
false
|
||||
else
|
||||
project.type_ids = type_ids
|
||||
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def types_missing?(type_ids)
|
||||
!missing_types(type_ids).empty?
|
||||
end
|
||||
|
||||
def missing_types(type_ids)
|
||||
types_used_by_work_packages.select { |t| !type_ids.include?(t.id) }
|
||||
end
|
||||
|
||||
def types_used_by_work_packages
|
||||
@types_used_by_work_packages ||= project.types_used_by_work_packages
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,62 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is a project management system.
|
||||
# Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License version 3.
|
||||
#
|
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# See doc/COPYRIGHT.rdoc for more details.
|
||||
#++
|
||||
|
||||
UpdateUserEmailSettingsService = Struct.new(:user) do
|
||||
def call(mail_notification: nil,
|
||||
self_notified: nil,
|
||||
notified_project_ids: [])
|
||||
|
||||
set_mail_notification(mail_notification)
|
||||
set_self_notified(self_notified)
|
||||
|
||||
ret_value = false
|
||||
|
||||
user.transaction do
|
||||
if (ret_value = user.save && user.pref.save)
|
||||
set_notified_project_ids(notified_project_ids)
|
||||
end
|
||||
end
|
||||
|
||||
ret_value
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_mail_notification(mail_notification)
|
||||
user.mail_notification = mail_notification unless mail_notification.nil?
|
||||
end
|
||||
|
||||
def set_self_notified(self_notified)
|
||||
user.pref.self_notified = self_notified unless self_notified.nil?
|
||||
end
|
||||
|
||||
def set_notified_project_ids(notified_project_ids)
|
||||
user.notified_project_ids = notified_project_ids if user.mail_notification == 'selected'
|
||||
end
|
||||
end
|
||||
@@ -51,7 +51,7 @@ class UserSearchService
|
||||
def ids_search(scope)
|
||||
ids = params[:ids].split(',')
|
||||
|
||||
scope.where(id: ids)
|
||||
scope.not_builtin.where(id: ids)
|
||||
end
|
||||
|
||||
def query_search(scope)
|
||||
|
||||
@@ -49,7 +49,7 @@ module FileUploader
|
||||
tmp = Tempfile.new 'op_uploaded_files'
|
||||
path = Pathname(tmp)
|
||||
|
||||
tmp.delete # delete temp file
|
||||
tmp.close! # delete temp file
|
||||
path.mkdir # create temp directory
|
||||
|
||||
path.to_s
|
||||
|
||||
@@ -28,8 +28,8 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
++#%>
|
||||
|
||||
<div id="nav-login-content">
|
||||
<%= styled_form_tag({:controller => '/account', :action=> "login"},
|
||||
:autocomplete => 'off', class: '-vertical') do %>
|
||||
<%= styled_form_tag({controller: '/account', action: "login"},
|
||||
autocomplete: 'off', class: '-vertical') do %>
|
||||
<%= back_url_to_current_page_hidden_field_tag %>
|
||||
|
||||
<div class="grid-block">
|
||||
@@ -43,7 +43,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<label class="form--label-with-check-box" for="autologin"><%= styled_check_box_tag 'autologin', 1, false %> <%= l(:label_stay_logged_in) %></label>
|
||||
<% elsif Setting.self_registration? %>
|
||||
<%# show here if autologin is disabled, otherwise below lost_password link %>
|
||||
<%= link_to l(:label_register), { :controller => '/account', :action => 'register' } %>
|
||||
<%= link_to l(:label_register), { controller: '/account', action: 'register' } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -55,12 +55,12 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
</div>
|
||||
<div class="form--field-extra-actions">
|
||||
<% if Setting.lost_password? %>
|
||||
<%= link_to l(:label_password_lost), {:controller => '/account', :action => 'lost_password'} %>
|
||||
<%= link_to l(:label_password_lost), {controller: '/account', action: 'lost_password'} %>
|
||||
<% end %>
|
||||
<% if Setting.autologin? && Setting.self_registration? %>
|
||||
<%# show here if autologin is enabled, otherwise below login field %>
|
||||
<%= '<br>'.html_safe if Setting.lost_password? %>
|
||||
<%= link_to l(:label_register), { :controller => '/account', :action => 'register' } %>
|
||||
<%= link_to l(:label_register), { controller: '/account', action: 'register' } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -74,6 +74,6 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'account/auth_providers' %>
|
||||
<%= render partial: 'account/auth_providers' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -28,5 +28,5 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
++#%>
|
||||
|
||||
<div id="nav-login-content">
|
||||
<%= render :partial => 'account/auth_providers' %>
|
||||
<%= render partial: 'account/auth_providers' %>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++#%>
|
||||
|
||||
<%= styled_form_tag({:action=> "login"}, autocomplete: 'off', class: '-wide-labels') do %>
|
||||
<%= styled_form_tag({action: "login"}, autocomplete: 'off', class: '-wide-labels') do %>
|
||||
<%= back_url_hidden_field_tag %>
|
||||
|
||||
<div class="form--field">
|
||||
@@ -58,11 +58,11 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<div class="login-options-container">
|
||||
<div class="login-links">
|
||||
<% if Setting.lost_password? %>
|
||||
<%= link_to l(:label_password_lost), :controller => '/account', :action => 'lost_password' %>
|
||||
<%= link_to l(:label_password_lost), controller: '/account', action: 'lost_password' %>
|
||||
<br>
|
||||
<% end %>
|
||||
<% if Setting.self_registration? %>
|
||||
<%= link_to l(:label_register), { :controller => '/account', :action => 'register' } %>
|
||||
<%= link_to l(:label_register), { controller: '/account', action: 'register' } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,11 +29,11 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% disable_accessibility_css! %>
|
||||
<%= toolbar title: l(:label_password_lost) %>
|
||||
<section class="form--section">
|
||||
<%= styled_form_tag({:action=> "lost_password"}) do %>
|
||||
<%= styled_form_tag({action: "lost_password"}) do %>
|
||||
<div class="form--field -required">
|
||||
<%= styled_label_tag 'mail', User.human_attribute_name(:mail) %>
|
||||
<span class="form--field-container">
|
||||
<%= styled_text_field_tag 'mail', nil, :size => 40 %>
|
||||
<%= styled_text_field_tag 'mail', nil, size: 40 %>
|
||||
</span>
|
||||
</div>
|
||||
<%= styled_button_tag l(:button_submit), class: '-highlight -with-icon icon-yes' %>
|
||||
|
||||
@@ -29,12 +29,12 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% disable_accessibility_css! %>
|
||||
<%= toolbar title: l(:label_password_lost) %>
|
||||
<%= error_messages_for 'user' %>
|
||||
<%= styled_form_tag({:token => @token.value}, :autocomplete => 'off') do %>
|
||||
<%= styled_form_tag({token: @token.value}, autocomplete: 'off') do %>
|
||||
<section class="form--section">
|
||||
<div class="form--field -required">
|
||||
<%= styled_label_tag 'new_password', User.human_attribute_name(:new_password) %>
|
||||
<div class="form--field-container">
|
||||
<%= styled_password_field_tag 'new_password', nil, :size => 25, container_class: '-middle' %>
|
||||
<%= styled_password_field_tag 'new_password', nil, size: 25, container_class: '-middle' %>
|
||||
</div>
|
||||
<div class="form--field-instructions">
|
||||
<%= password_complexity_requirements %>
|
||||
@@ -44,7 +44,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<%= styled_label_tag 'new_password_confirmation',
|
||||
User.human_attribute_name(:new_password_confirmation) %>
|
||||
<div class="form--field-container">
|
||||
<%= styled_password_field_tag 'new_password_confirmation', nil, :size => 25, container_class: '-middle' %>
|
||||
<%= styled_password_field_tag 'new_password_confirmation', nil, size: 25, container_class: '-middle' %>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -30,48 +30,48 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% disable_accessibility_css! %>
|
||||
<%= toolbar title: l(:label_register) %>
|
||||
|
||||
<%= labelled_tabular_form_for(@user, :url => url_for(:action => 'register')) do |f| %>
|
||||
<%= labelled_tabular_form_for(@user, url: url_for(action: 'register')) do |f| %>
|
||||
<%= back_url_hidden_field_tag %>
|
||||
<%= error_messages_for :user %>
|
||||
|
||||
<section class="form--section">
|
||||
<% if @user.auth_source_id.nil? %>
|
||||
<div class="form--field">
|
||||
<%= f.text_field :login, :size => 25, :required => true %>
|
||||
<%= f.text_field :login, size: 25, required: true %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if @user.change_password_allowed? %>
|
||||
<div class="form--field">
|
||||
<%= f.password_field :password,
|
||||
:required => true,
|
||||
:size => 25,
|
||||
:autocomplete => 'off' %>
|
||||
required: true,
|
||||
size: 25,
|
||||
autocomplete: 'off' %>
|
||||
<div class="form--field-instructions">
|
||||
<%= password_complexity_requirements %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form--field">
|
||||
<%= f.password_field :password_confirmation,
|
||||
:required => true,
|
||||
:size => 25,
|
||||
:autocomplete => 'off' %>
|
||||
required: true,
|
||||
size: 25,
|
||||
autocomplete: 'off' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="form--field">
|
||||
<%= f.text_field :firstname, :required => true %>
|
||||
<%= f.text_field :firstname, required: true %>
|
||||
</div>
|
||||
|
||||
<div class="form--field">
|
||||
<%= f.text_field :lastname, :required => true %>
|
||||
<%= f.text_field :lastname, required: true %>
|
||||
</div>
|
||||
|
||||
<div class="form--field">
|
||||
<%= f.text_field :mail, :required => true %>
|
||||
<%= f.text_field :mail, required: true %>
|
||||
</div>
|
||||
|
||||
<%= call_hook :view_account_register_after_basic_information, :f => f %>
|
||||
<%= call_hook :view_account_register_after_basic_information, f: f %>
|
||||
<div class="form--field"><%= f.select(:language, lang_options_for_select) %></div>
|
||||
|
||||
<%= render partial: 'customizable/field',
|
||||
|
||||
@@ -42,7 +42,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<%= icon_wrapper("icon-context icon-#{e.event_type}", e.event_name) %>
|
||||
<%= avatar(e.event_author) if e.respond_to?(:event_author) %>
|
||||
<span class="time"><%= format_time(e.event_datetime.to_time, false) %></span>
|
||||
<%= content_tag('span', link_to(e.project.name, e.project), :class => 'project') if (@project.nil? || @project != e.project) && e.project %>
|
||||
<%= content_tag('span', link_to(e.project.name, e.project), class: 'project') if (@project.nil? || @project != e.project) && e.project %>
|
||||
<%= link_to format_activity_title(e.event_title), e.event_path%>
|
||||
</dt>
|
||||
<dd>
|
||||
@@ -54,31 +54,34 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<%= content_tag('p', l(:label_no_data), :class => 'nodata') if @events_by_day.empty? %>
|
||||
<% if @events_by_day.empty? %>
|
||||
<%= no_results_box %>
|
||||
<br>
|
||||
<% end %>
|
||||
|
||||
<div style="float:left;">
|
||||
<%= link_to_content_update(l(:label_previous),
|
||||
params.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)),
|
||||
:class => 'navigate-left'}) %>
|
||||
params.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)),
|
||||
class: 'navigate-left'}) %>
|
||||
</div>
|
||||
<div style="float:right;">
|
||||
<%= link_to_content_update(l(:label_next),
|
||||
params.merge(:from => @date_to + @days - 1),
|
||||
{:title => l(:label_date_from_to, :start => format_date(@date_to), :end => format_date(@date_to + @days - 1)),
|
||||
:class => 'navigate-right'}) unless @date_to >= Date.today %>
|
||||
params.merge(from: @date_to + @days - 1),
|
||||
{title: l(:label_date_from_to, start: format_date(@date_to), end: format_date(@date_to + @days - 1)),
|
||||
class: 'navigate-right'}) unless @date_to >= Date.today %>
|
||||
</div>
|
||||
|
||||
<%= other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom', :url => params.merge(:from => nil, :key => User.current.rss_key) %>
|
||||
<%= f.link_to 'Atom', url: params.merge(from: nil, key: User.current.rss_key) %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom, params.merge(:format => 'atom', :from => nil, :key => User.current.rss_key)) %>
|
||||
<%= auto_discovery_link_tag(:atom, params.merge(format: 'atom', from: nil, key: User.current.rss_key)) %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<%= form_tag({}, method: :get) do %>
|
||||
<h3><%= l(:description_filter) %></h3>
|
||||
<p>
|
||||
<% @activity.event_types.each do |t| %>
|
||||
@@ -93,7 +96,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% end %>
|
||||
<%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %>
|
||||
<%= hidden_field_tag('apply', true) %>
|
||||
<p><%= submit_tag l(:button_apply), :class => 'button -tiny -round -highlight', :name => nil %></p>
|
||||
<p><%= submit_tag l(:button_apply), class: 'button -tiny -round -highlight', name: nil %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -42,12 +42,12 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% @plugins.each do |plugin| %>
|
||||
<tr>
|
||||
<td><span class="name"><%=h plugin.name %></span>
|
||||
<%= content_tag('span', h(plugin.description), :class => 'description') unless plugin.description.blank? %>
|
||||
<%= content_tag('span', link_to(h(plugin.url), plugin.url), :class => 'url') unless plugin.url.blank? %>
|
||||
<%= content_tag('span', h(plugin.description), class: 'description') unless plugin.description.blank? %>
|
||||
<%= content_tag('span', link_to(h(plugin.url), plugin.url), class: 'url') unless plugin.url.blank? %>
|
||||
</td>
|
||||
<td class="author"><%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %></td>
|
||||
<td class="version"><%=h plugin.version %></td>
|
||||
<td class="configure"><%= link_to(l(:button_configure), :controller => '/settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %></td>
|
||||
<td class="configure"><%= link_to(l(:button_configure), controller: '/settings', action: 'plugin', id: plugin.id) if plugin.configurable? %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
@@ -56,15 +56,5 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="generic-table--container">
|
||||
<div class="generic-table--no-results-container">
|
||||
<h2 class="generic-table--no-results-title">
|
||||
<i class="icon-info"></i>
|
||||
<%= l(:label_nothing_display) %>
|
||||
</h2>
|
||||
<div class="generic-table--no-results-description">
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= no_results_box %>
|
||||
<% end %>
|
||||
|
||||
@@ -36,20 +36,20 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<%= form_tag({}, method: :get) do %>
|
||||
<fieldset class="simple-filters--container">
|
||||
<legend><%= l(:label_filter_plural) %></legend>
|
||||
<ul class="simple-filters--filters">
|
||||
<li class="simple-filters--filter">
|
||||
<label class='simple-filters--filter-name' for='status'><%= Project.human_attribute_name(:status) %></label>
|
||||
<%= select_tag 'status', project_status_options_for_select(@status), :onchange => "this.form.submit(); return false;", :class => 'simple-filters--filter-value' %>
|
||||
<%= select_tag 'status', project_status_options_for_select(@status), onchange: "this.form.submit(); return false;", class: 'simple-filters--filter-value' %>
|
||||
</li>
|
||||
<li class="simple-filters--filter">
|
||||
<label class='simple-filters--filter-name' for='name'><%= Project.model_name.human %></label>
|
||||
<%= text_field_tag 'name', params[:name], :class => 'simple-filters--filter-value' %>
|
||||
<%= text_field_tag 'name', params[:name], class: 'simple-filters--filter-value' %>
|
||||
</li>
|
||||
<li class="simple-filters--controls">
|
||||
<%= submit_tag l(:button_apply), :class => 'button -highlight', :name => nil %>
|
||||
<%= submit_tag l(:button_apply), class: 'button -highlight', name: nil %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -61,86 +61,91 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
count: Project.count,
|
||||
storage: number_to_human_size(Project.total_projects_size, precision: 2)) %>
|
||||
</p>
|
||||
<div class="generic-table--container">
|
||||
<div class="generic-table--results-container">
|
||||
<table interactive-table role="grid" class="generic-table">
|
||||
<colgroup>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<%= sort_header_tag_with_lsg('name', caption: Project.model_name.human) %>
|
||||
|
||||
<% if @projects.any? %>
|
||||
<div class="generic-table--container">
|
||||
<div class="generic-table--results-container">
|
||||
<table interactive-table role="grid" class="generic-table">
|
||||
<colgroup>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<%= sort_header_tag_with_lsg('name', caption: Project.model_name.human) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<%= sort_header_tag_with_lsg('is_public',
|
||||
caption: Project.human_attribute_name(:is_public)) %>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<%= sort_header_tag_with_lsg('is_public',
|
||||
caption: Project.human_attribute_name(:is_public)) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<%= sort_header_tag_with_lsg('required_disk_space',
|
||||
caption: I18n.t(:label_required_disk_storage)) %>
|
||||
</span>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<%= sort_header_tag_with_lsg('required_disk_space',
|
||||
caption: I18n.t(:label_required_disk_storage)) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<%= sort_header_tag_with_lsg('created_on',
|
||||
caption: Project.human_attribute_name(:created_on)) %>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<%= sort_header_tag_with_lsg('created_on',
|
||||
caption: Project.human_attribute_name(:created_on)) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% project_tree_when_sorted(@projects) do |project, level| %>
|
||||
<tr class="<%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
|
||||
<td class="name project--hierarchy"><span class="<%= level > 0 ? 'icon-context icon-pulldown-arrow4' : nil %>"><%= link_to project, settings_project_path(project), :title => project.short_description %></span></td>
|
||||
<td><%= checked_image project.is_public? %></td>
|
||||
<td><%= number_to_human_size(project.required_disk_space, precision: 2) if project.required_disk_space.to_i > 0 %></td>
|
||||
<td><%= format_date(project.created_on) %></td>
|
||||
<td class="buttons">
|
||||
<%= link_to('',
|
||||
archive_project_path(project, :status => params[:status]),
|
||||
data: { confirm: l(:text_are_you_sure) },
|
||||
:method => :put,
|
||||
:title => l(:button_archive),
|
||||
:class => 'icon icon-locked') if project.active? %>
|
||||
<%= link_to('',
|
||||
unarchive_project_path(project, :status => params[:status]),
|
||||
:method => :put,
|
||||
:title => l(:button_unarchive),
|
||||
:class => 'icon icon-unlocked') if !project.active? && (project.parent.nil? || project.parent.active?) %>
|
||||
<%= link_to('',
|
||||
copy_from_project_path(project, :admin),
|
||||
:title => l(:button_copy),
|
||||
:class => 'icon icon-copy') %>
|
||||
<%= link_to('',
|
||||
confirm_destroy_project_path(project),
|
||||
:title => l(:button_delete),
|
||||
:class => 'icon icon-delete') %>
|
||||
</td>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="generic-table--header-background"></div>
|
||||
<%= pagination_links_full @projects %>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% project_tree_when_sorted(@projects) do |project, level| %>
|
||||
<tr class="<%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
|
||||
<td class="name project--hierarchy"><span class="<%= level > 0 ? 'icon-context icon-pulldown-arrow4' : nil %>"><%= link_to project, settings_project_path(project), title: project.short_description %></span></td>
|
||||
<td><%= checked_image project.is_public? %></td>
|
||||
<td><%= number_to_human_size(project.required_disk_space, precision: 2) if project.required_disk_space.to_i > 0 %></td>
|
||||
<td><%= format_date(project.created_on) %></td>
|
||||
<td class="buttons">
|
||||
<%= link_to('',
|
||||
archive_project_path(project, status: params[:status]),
|
||||
data: { confirm: l(:text_are_you_sure) },
|
||||
method: :put,
|
||||
title: l(:button_archive),
|
||||
class: 'icon icon-locked') if project.active? %>
|
||||
<%= link_to('',
|
||||
unarchive_project_path(project, status: params[:status]),
|
||||
method: :put,
|
||||
title: l(:button_unarchive),
|
||||
class: 'icon icon-unlocked') if !project.active? && (project.parent.nil? || project.parent.active?) %>
|
||||
<%= link_to('',
|
||||
copy_from_project_path(project, :admin),
|
||||
title: l(:button_copy),
|
||||
class: 'icon icon-copy') %>
|
||||
<%= link_to('',
|
||||
confirm_destroy_project_path(project),
|
||||
title: l(:button_delete),
|
||||
class: 'icon icon-delete') %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="generic-table--header-background"></div>
|
||||
<%= pagination_links_full @projects %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= no_results_box(action_url: new_project_path, display_action: true) %>
|
||||
<% end %>
|
||||
|
||||
@@ -36,7 +36,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<div class="form--field">
|
||||
<div class="attachment_field form--field-container -vertical -shrink">
|
||||
<div class="form--file-container">
|
||||
<%= file_field_tag 'attachments[1][file]', :size => 15, :id => nil, :class => "attachment_choose_file" -%>
|
||||
<%= file_field_tag 'attachments[1][file]', size: 15, id: nil, class: "attachment_choose_file" -%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,13 +45,13 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<%= l(:label_optional_description) %>
|
||||
</label>
|
||||
<div class="form--text-field-container">
|
||||
<%= text_field_tag 'attachments[1][description]', '', :size => 38, :id => nil %>
|
||||
<%= text_field_tag 'attachments[1][description]', '', size: 38, id: nil %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="add_another_file">
|
||||
<%= link_to l(:label_add_another_file), '#', :onclick => 'addFileField(); return false;' %>
|
||||
<%= link_to l(:label_add_another_file), '#', onclick: 'addFileField(); return false;' %>
|
||||
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</span>
|
||||
</fieldset>
|
||||
|
||||
@@ -33,7 +33,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% for attachment in attachments %>
|
||||
<tr id="attachment_<%= attachment.id %>">
|
||||
<td>
|
||||
<%= link_to_attachment attachment, :class => 'icon icon-attachment' -%>
|
||||
<%= link_to_attachment attachment, class: 'icon icon-attachment' -%>
|
||||
<%= h(" - #{attachment.description}") unless attachment.description.blank? %>
|
||||
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||
<% if options[:deletable] %>
|
||||
|
||||
@@ -52,9 +52,9 @@ an attachments_attributes= and not every model supports this we build a nested f
|
||||
<div class="attachment_field form--field-container -vertical -shrink">
|
||||
<div class="form--file-container">
|
||||
<%= file_field_tag "#{prefix}[1][file]",
|
||||
:size => 15,
|
||||
:id => nil,
|
||||
:class => "attachment_choose_file" -%>
|
||||
size: 15,
|
||||
id: nil,
|
||||
class: "attachment_choose_file" -%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,14 +65,14 @@ an attachments_attributes= and not every model supports this we build a nested f
|
||||
<div class="form--text-field-container">
|
||||
<%= text_field_tag "#{prefix}[1][description]",
|
||||
'',
|
||||
:size => 38,
|
||||
:id => nil %>
|
||||
size: 38,
|
||||
id: nil %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="add_another_file">
|
||||
<%= link_to l(:label_add_another_file), '#', :onclick => 'addFileField(); return false;' %>
|
||||
<%= link_to l(:label_add_another_file), '#', onclick: 'addFileField(); return false;' %>
|
||||
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -30,10 +30,10 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<div class="attachments">
|
||||
<p><%= h("#{@attachment.description} - ") unless @attachment.description.blank? %>
|
||||
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
|
||||
<p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%>
|
||||
<p><%= link_to_attachment @attachment, text: l(:button_download), download: true -%>
|
||||
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span></p>
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
|
||||
<%= render partial: 'common/diff', locals: {diff: @diff, diff_type: @diff_type} %>
|
||||
|
||||
<% html_title h(@attachment.filename) %>
|
||||
|
||||
@@ -36,11 +36,11 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span>
|
||||
</p>
|
||||
<p>
|
||||
<%= link_to_attachment @attachment, :text => t(:button_download), :download => true -%>
|
||||
<%= link_to_attachment @attachment, text: t(:button_download), download: true -%>
|
||||
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %>
|
||||
<%= render partial: 'common/file', locals: {content: @content, filename: @attachment.filename} %>
|
||||
|
||||
<% html_title @attachment.filename %>
|
||||
|
||||
@@ -29,11 +29,11 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
<%#
|
||||
needs locals:
|
||||
:f => labelled form builder
|
||||
f: labelled form builder
|
||||
%>
|
||||
|
||||
<%= error_messages_for :auth_source %>
|
||||
<section class="form--section">
|
||||
<div class="form--field"><%= f.text_field 'name', :required => true %></div>
|
||||
<div class="form--field"><%= f.check_box 'onthefly_register', :label => AuthSource.human_attribute_name(:onthefly) %></div>
|
||||
<div class="form--field"><%= f.text_field 'name', required: true %></div>
|
||||
<div class="form--field"><%= f.check_box 'onthefly_register', label: AuthSource.human_attribute_name(:onthefly) %></div>
|
||||
</section>
|
||||
|
||||
@@ -30,7 +30,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% html_title l(:label_administration), "#{l(:label_edit)} #{l(:label_auth_source)} #{@auth_source.name}" %>
|
||||
<%= toolbar title: "#{l(:label_auth_source)} (#{h @auth_source.auth_method_name})" %>
|
||||
|
||||
<%= labelled_tabular_form_for @auth_source, :as => :auth_source do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= labelled_tabular_form_for @auth_source, as: :auth_source do |f| %>
|
||||
<%= render partial: 'form', locals: { f: f } %>
|
||||
<%= styled_button_tag l(:button_save), class: '-highlight -with-icon icon-yes' %>
|
||||
<% end %>
|
||||
|
||||
@@ -36,77 +36,82 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="generic-table--container">
|
||||
<div class="generic-table--results-container">
|
||||
<table interactive-table role="grid" class="generic-table">
|
||||
<colgroup>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= AuthSource.human_attribute_name(:name) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= AuthSource.human_attribute_name(:type) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= AuthSource.human_attribute_name(:host) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= l(:label_user_plural)%>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% for source in @auth_sources %>
|
||||
|
||||
<% if @auth_sources.any? %>
|
||||
<div class="generic-table--container">
|
||||
<div class="generic-table--results-container">
|
||||
<table interactive-table role="grid" class="generic-table">
|
||||
<colgroup>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><%= 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), { :action => 'test_connection', :id => source } %>
|
||||
<%= link_to l(:button_delete), { :action => 'destroy', :id => source },
|
||||
:method => :delete,
|
||||
data: { confirm: l(:text_are_you_sure) },
|
||||
:class => 'icon icon-delete',
|
||||
:disabled => source.users.any? %>
|
||||
</td>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= AuthSource.human_attribute_name(:name) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= AuthSource.human_attribute_name(:type) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= AuthSource.human_attribute_name(:host) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= l(:label_user_plural)%>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="generic-table--header-background"></div>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% for source in @auth_sources %>
|
||||
<tr>
|
||||
<td><%= 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), { action: 'test_connection', id: source } %>
|
||||
<%= link_to l(:button_delete), { action: 'destroy', id: source },
|
||||
method: :delete,
|
||||
data: { confirm: l(:text_are_you_sure) },
|
||||
class: 'icon icon-delete',
|
||||
disabled: source.users.any? %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="generic-table--header-background"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= pagination_links_full @auth_sources %>
|
||||
<%= pagination_links_full @auth_sources %>
|
||||
<% else %>
|
||||
<%= no_results_box(action_url: { action: 'new' }, display_action: true) %>
|
||||
<% end %>
|
||||
|
||||
@@ -30,7 +30,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% html_title l(:label_administration), l(:label_auth_source_new) %>
|
||||
<%= toolbar title: "#{l(:label_auth_source_new)} (#{h @auth_source.auth_method_name})" %>
|
||||
|
||||
<%= labelled_tabular_form_for @auth_source, :as => :auth_source do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= labelled_tabular_form_for @auth_source, as: :auth_source do |f| %>
|
||||
<%= render partial: 'form', locals: { f: f } %>
|
||||
<%= styled_button_tag l(:button_create), class: '-highlight -with-icon icon-yes' %>
|
||||
<% end %>
|
||||
|
||||
@@ -29,6 +29,6 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<%= toolbar title: Board.name.humanize %>
|
||||
|
||||
<%= labelled_tabular_form_for [@project, @board] do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<%= render partial: 'form', locals: {f: f} %>
|
||||
<%= f.button l(:button_save), class: 'button -highlight -with-icon icon-yes' %>
|
||||
<% end %>
|
||||
|
||||
@@ -81,7 +81,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% for board in @boards %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= link_to h(board.name), {:action => 'show', :id => board}, :class => "board" %><br />
|
||||
<%= link_to h(board.name), {action: 'show', id: board}, class: "board" %><br />
|
||||
<%=h board.description %>
|
||||
</td>
|
||||
<td><%= board.topics_count %></td>
|
||||
@@ -100,10 +100,10 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
</div>
|
||||
</div>
|
||||
<%= other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom', :url => {:controller => '/activities', :action => 'index', :id => @project, :show_messages => 1, :key => User.current.rss_key} %>
|
||||
<%= 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}) %>
|
||||
<%= auto_discovery_link_tag(:atom, {controller: '/activities', action: 'index', id: @project, format: 'atom', show_messages: 1, key: User.current.rss_key}) %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -30,6 +30,6 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<%= toolbar title: l(:label_board_new) %>
|
||||
|
||||
<%= labelled_tabular_form_for [@project, @board] do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<%= render partial: 'form', locals: {f: f} %>
|
||||
<%= f.button l(:button_create), class: 'button -highlight -with-icon icon-yes' %>
|
||||
<% end %>
|
||||
|
||||
@@ -42,7 +42,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<hr class="form--separator">
|
||||
<%= styled_button_tag l(:button_create), class: '-highlight -with-icon icon-yes' %>
|
||||
<%= preview_link preview_board_topics_path(@board), 'message-form-preview' %>
|
||||
<%= link_to l(:button_cancel), "#", onclick: 'Element.hide("add-message")', class: 'button' %>
|
||||
<%= link_to l(:button_cancel), '', onclick: 'Element.hide("add-message")', class: 'button' %>
|
||||
<% end %>
|
||||
<div id="preview"></div>
|
||||
<% end %>
|
||||
@@ -161,17 +161,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<table-pagination total-entries="totalMessageCount" update-results="loadMessages()"></table-pagination>
|
||||
<modal-loading></modal-loading>
|
||||
<% else %>
|
||||
<div class="generic-table--container">
|
||||
<div class="generic-table--no-results-container">
|
||||
<h2 class="generic-table--no-results-title">
|
||||
<i class="icon-info"></i>
|
||||
<%= l(:label_nothing_display) %>
|
||||
</h2>
|
||||
<div class="generic-table--no-results-description">
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= no_results_box %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -27,17 +27,17 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++#%>
|
||||
<%= toolbar title: "#{Category.model_name.human} #{h @category.name}" %>
|
||||
<%= form_tag({}, {:method => :delete}) do %>
|
||||
<%= form_tag({}, {method: :delete}) do %>
|
||||
<div class="box">
|
||||
<p><strong><%= l(:text_work_package_category_destroy_question, @issue_count) %></strong></p>
|
||||
<p><label><%= radio_button_tag 'todo', 'nullify', true %> <%= l(:text_work_package_category_destroy_assignments) %></label>
|
||||
<% if @categories.size > 0 %>
|
||||
<label><%= radio_button_tag 'todo', 'reassign', false %> <%= l(:text_work_package_category_reassign_to) %></label>
|
||||
<%= label_tag "reassign_to_id", l(:description_work_package_category_reassign), :class => "hidden-for-sighted" %>
|
||||
<%= label_tag "reassign_to_id", l(:description_work_package_category_reassign), class: "hidden-for-sighted" %>
|
||||
<%= select_tag 'reassign_to_id', options_from_collection_for_select(@categories, 'id', 'name') %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= submit_tag l(:button_apply), class: 'button -highlight' %>
|
||||
<%= link_to l(:button_cancel), { :controller => '/projects', :action => 'settings', :id => @project, :tab => 'categories' },
|
||||
<%= link_to l(:button_cancel), { controller: '/projects', action: 'settings', id: @project, tab: 'categories' },
|
||||
class: 'button' %>
|
||||
<% end %>
|
||||
|
||||
@@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++#%>
|
||||
<%= toolbar title: Category.model_name.human %>
|
||||
<%= labelled_tabular_form_for @category, :as => :category do |f| %>
|
||||
<%= render :partial => 'categories/form', :locals => { :f => f } %>
|
||||
<%= labelled_tabular_form_for @category, as: :category do |f| %>
|
||||
<%= render partial: 'categories/form', locals: { f: f } %>
|
||||
<%= f.button l(:button_save), class: 'button -highlight -with-icon icon-yes' %>
|
||||
<% end %>
|
||||
|
||||
@@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++#%>
|
||||
<%= toolbar title: l(:label_work_package_category_new) %>
|
||||
<%= labelled_tabular_form_for [@project, @category], :as => :category do |f| %>
|
||||
<%= render :partial => 'categories/form', :locals => { :f => f } %>
|
||||
<%= labelled_tabular_form_for [@project, @category], as: :category do |f| %>
|
||||
<%= render partial: 'categories/form', locals: { f: f } %>
|
||||
<%= f.button l(:button_create), class: 'button -highlight -with-icon icon-yes' %>
|
||||
<% end %>
|
||||
|
||||
@@ -54,13 +54,13 @@ while day <= calendar.enddt %>
|
||||
<% date_img = content_tag(:span, '', class: "icon icon-arrow-right7 ending") %>
|
||||
<% end %>
|
||||
<%= date_img %>
|
||||
<%= link_to_work_package i, :truncate => 30%>
|
||||
<%= link_to_work_package i, truncate: 30%>
|
||||
<span class="tip"><%= render_issue_tooltip i %></span>
|
||||
</div>
|
||||
<% else %>
|
||||
<div>
|
||||
<%= h("#{i.project} -") unless @project && @project == i.project %>
|
||||
<%= link_to_version i, {}, {:before_text => icon_wrapper('icon-context icon-version', Version.model_name.human) }%>
|
||||
<%= link_to_version i, {}, {before_text: icon_wrapper('icon-context icon-version', Version.model_name.human) }%>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++#%>
|
||||
<% diff = Redmine::UnifiedDiff.new(diff, :type => diff_type, :max_lines => Setting.diff_max_lines_displayed.to_i) -%>
|
||||
<% diff = Redmine::UnifiedDiff.new(diff, type: diff_type, max_lines: Setting.diff_max_lines_displayed.to_i) -%>
|
||||
<% diff.each do |table_file| -%>
|
||||
<div class="autoscroll">
|
||||
<% if diff.diff_type == 'sbs' -%>
|
||||
|
||||
@@ -26,11 +26,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++#%>
|
||||
<div class="nodata">
|
||||
<%= form_tag({:action => 'default_configuration'}) do %>
|
||||
<%= simple_format(l(:text_no_configuration_data)) %>
|
||||
<p><%= User.human_attribute_name(:language) %>:
|
||||
<%= select_tag 'lang', options_for_select(lang_options_for_select(false), current_language.to_s) %>
|
||||
<%= submit_tag l(:text_load_default_configuration), class: 'button -highlight' %></p>
|
||||
<div class="generic-table--no-results-container">
|
||||
<i class="icon-info"></i>
|
||||
<h2 class="generic-table--no-results-title">
|
||||
<%= title_text %>
|
||||
</h2>
|
||||
<% if action_text.present? && action_url.present? %>
|
||||
<div class="generic-table--no-results-description">
|
||||
<%= link_to action_text, action_url %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -28,10 +28,10 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
++#%>
|
||||
|
||||
<%= attachments.select { |a| a.readable? and a.visible? }
|
||||
.map { |a| { :content_type => CGI::escape_html(a.content_type),
|
||||
:filename => CGI::escape_html(a.filename),
|
||||
:description => CGI::escape_html(a.description),
|
||||
:url => url_for(:controller => '/attachments', :action => 'show', :id => a, :filename => a.filename),
|
||||
:is_image => !!a.image? # doing the !! as image? for whatever reason returns null or a number
|
||||
.map { |a| { content_type: CGI::escape_html(a.content_type),
|
||||
filename: CGI::escape_html(a.filename),
|
||||
description: CGI::escape_html(a.description),
|
||||
url: url_for(controller: '/attachments', action: 'show', id: a, filename: a.filename),
|
||||
is_image: !!a.image? # doing the !! as image? for whatever reason returns null or a number
|
||||
}
|
||||
}.to_json.html_safe %>
|
||||
|
||||
@@ -32,28 +32,28 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
<%= labelled_tabular_form_for @copy_project, url: { action: 'copy', coming_from: 'settings' } do |f| %>
|
||||
<section class="form--section">
|
||||
<%= render :partial => "projects/form/attributes/name", :locals => { :form => f } %>
|
||||
<%= render :partial => "projects/form/attributes/identifier", :locals => { :form => f,
|
||||
:project => @copy_project } %>
|
||||
<%= render :partial => "projects/form/attributes/description", :locals => { :form => f } %>
|
||||
<%= render :partial => "customizable/form", :locals => { :project => @project, form: f } %>
|
||||
<%= render :partial => "projects/form/attributes/responsible_id", :locals => { :form => f,
|
||||
:project => @project } %>
|
||||
<%= render :partial => "projects/form/attributes/hidden_field",
|
||||
:locals => { :form => f, :name => :project_type_id, :value => @project.project_type_id } %>
|
||||
<%= render :partial => "projects/form/attributes/hidden_field",
|
||||
:locals => { :form => f, :name => :parent_id, :value => @project.parent_id } %>
|
||||
<%= render :partial => "projects/form/attributes/hidden_field",
|
||||
:locals => { :form => f, :name => :is_public, :value => @project.is_public } %>
|
||||
<%= render :partial => "copy_projects/copy_settings/hidden_types",
|
||||
:locals => { :form => f, :types => @types, :project => @project } %>
|
||||
<%= render :partial => "copy_projects/copy_settings/hidden_custom_fields",
|
||||
:locals => { :form => f, :project => @project, :issue_custom_fields => @issue_custom_fields } %>
|
||||
<%= render :partial => "copy_projects/copy_settings/enabled_module_names",
|
||||
:locals => { :project => @project } %>
|
||||
<%= render partial: "projects/form/attributes/name", locals: { form: f } %>
|
||||
<%= render partial: "projects/form/attributes/identifier", locals: { form: f,
|
||||
project: @copy_project } %>
|
||||
<%= render partial: "projects/form/attributes/description", locals: { form: f } %>
|
||||
<%= render partial: "customizable/form", locals: { project: @project, form: f, all_fields: true, only_required: false } %>
|
||||
<%= render partial: "projects/form/attributes/responsible_id", locals: { form: f,
|
||||
project: @project } %>
|
||||
<%= render partial: "projects/form/attributes/hidden_field",
|
||||
locals: { form: f, name: :project_type_id, value: @project.project_type_id } %>
|
||||
<%= render partial: "projects/form/attributes/hidden_field",
|
||||
locals: { form: f, name: :parent_id, value: @project.parent_id } %>
|
||||
<%= render partial: "projects/form/attributes/hidden_field",
|
||||
locals: { form: f, name: :is_public, value: @project.is_public } %>
|
||||
<%= render partial: "copy_projects/copy_settings/hidden_types",
|
||||
locals: { form: f, types: @types, project: @project } %>
|
||||
<%= render partial: "copy_projects/copy_settings/hidden_custom_fields",
|
||||
locals: { form: f, project: @project, issue_custom_fields: @issue_custom_fields } %>
|
||||
<%= render partial: "copy_projects/copy_settings/enabled_module_names",
|
||||
locals: { project: @project } %>
|
||||
</section>
|
||||
|
||||
<%= render :partial => "copy_projects/copy_settings/copy_associations", :locals => { :project => @project } %>
|
||||
<%= render partial: "copy_projects/copy_settings/copy_associations", locals: { project: @project } %>
|
||||
|
||||
<%= submit_tag l(:button_copy), class: 'button -highlight' %>
|
||||
<% end %>
|
||||
|
||||
@@ -28,7 +28,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
++#%>
|
||||
<% if count > 0 %>
|
||||
<label class="block">
|
||||
<%= check_box_tag 'only[]', name, checked, :id => "only_#{name}" %>
|
||||
<%= check_box_tag 'only[]', name, checked, id: "only_#{name}" %>
|
||||
<%= "#{label} (#{count})" %>
|
||||
</label>
|
||||
<% end %>
|
||||
|
||||
@@ -30,39 +30,39 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<fieldset class="form--fieldset">
|
||||
<legend class="form--fieldset-legend"><%= l(:button_copy) %></legend>
|
||||
|
||||
<%= render :partial => "copy_projects/copy_settings/block_checkbox",
|
||||
:locals => { :name => "queries", :checked => true, :label => l(:label_query_plural),
|
||||
:count => project.queries.count } %>
|
||||
<%= render :partial => "copy_projects/copy_settings/block_checkbox",
|
||||
:locals => { :name => "boards", :checked => false, :label => l(:label_board_plural),
|
||||
:count => project.boards.count } %>
|
||||
<%= render :partial => "copy_projects/copy_settings/block_checkbox",
|
||||
:locals => { :name => "members", :checked => true, :label => l(:label_member_plural),
|
||||
:count => project.members.count } %>
|
||||
<%= render :partial => "copy_projects/copy_settings/block_checkbox",
|
||||
:locals => { :name => "project_associations",
|
||||
:checked => true,
|
||||
:label => l(:'timelines.project_menu.project_associations'),
|
||||
:count => project.project_associations.count } %>
|
||||
<%= render :partial => "copy_projects/copy_settings/block_checkbox",
|
||||
:locals => { :name => "timelines", :checked => true, :label => l(:'timelines.timelines'),
|
||||
:count => project.timelines.count } %>
|
||||
<%= render :partial => "copy_projects/copy_settings/block_checkbox",
|
||||
:locals => { :name => "reportings", :checked => true, :label => l(:label_reporting_plural),
|
||||
:count => project.reportings.count } %>
|
||||
<%= render :partial => "copy_projects/copy_settings/block_checkbox",
|
||||
:locals => { :name => "versions", :checked => true, :label => l(:label_version_plural),
|
||||
:count => project.versions.count } %>
|
||||
<%= render :partial => "copy_projects/copy_settings/block_checkbox",
|
||||
:locals => { :name => "wiki", :checked => true, :label => l(:label_wiki_page_plural),
|
||||
:count => project.wiki.nil? ? 0 : project.wiki.pages.count } %>
|
||||
<%= render :partial => "copy_projects/copy_settings/block_checkbox",
|
||||
:locals => { :name => "work_packages", :checked => false, :label => l(:label_work_package_plural),
|
||||
:count => project.work_packages.count } %>
|
||||
<%= render :partial => "copy_projects/copy_settings/block_checkbox",
|
||||
:locals => { :name => "categories", :checked => true,
|
||||
:label => l(:label_work_package_category_plural),
|
||||
:count => project.categories.count } %>
|
||||
<%= render partial: "copy_projects/copy_settings/block_checkbox",
|
||||
locals: { name: "queries", checked: true, label: l(:label_query_plural),
|
||||
count: project.queries.count } %>
|
||||
<%= render partial: "copy_projects/copy_settings/block_checkbox",
|
||||
locals: { name: "boards", checked: false, label: l(:label_board_plural),
|
||||
count: project.boards.count } %>
|
||||
<%= render partial: "copy_projects/copy_settings/block_checkbox",
|
||||
locals: { name: "members", checked: true, label: l(:label_member_plural),
|
||||
count: project.members.count } %>
|
||||
<%= render partial: "copy_projects/copy_settings/block_checkbox",
|
||||
locals: { name: "project_associations",
|
||||
checked: true,
|
||||
label: l(:'timelines.project_menu.project_associations'),
|
||||
count: project.project_associations.count } %>
|
||||
<%= render partial: "copy_projects/copy_settings/block_checkbox",
|
||||
locals: { name: "timelines", checked: true, label: l(:'timelines.timelines'),
|
||||
count: project.timelines.count } %>
|
||||
<%= render partial: "copy_projects/copy_settings/block_checkbox",
|
||||
locals: { name: "reportings", checked: true, label: l(:label_reporting_plural),
|
||||
count: project.reportings.count } %>
|
||||
<%= render partial: "copy_projects/copy_settings/block_checkbox",
|
||||
locals: { name: "versions", checked: true, label: l(:label_version_plural),
|
||||
count: project.versions.count } %>
|
||||
<%= render partial: "copy_projects/copy_settings/block_checkbox",
|
||||
locals: { name: "wiki", checked: true, label: l(:label_wiki_page_plural),
|
||||
count: project.wiki.nil? ? 0 : project.wiki.pages.count } %>
|
||||
<%= render partial: "copy_projects/copy_settings/block_checkbox",
|
||||
locals: { name: "work_packages", checked: false, label: l(:label_work_package_plural),
|
||||
count: project.work_packages.count } %>
|
||||
<%= render partial: "copy_projects/copy_settings/block_checkbox",
|
||||
locals: { name: "categories", checked: true,
|
||||
label: l(:label_work_package_category_plural),
|
||||
count: project.categories.count } %>
|
||||
<%= hidden_field_tag 'only[]', '' %>
|
||||
|
||||
<br />
|
||||
|
||||
@@ -28,5 +28,5 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
++#%>
|
||||
|
||||
<% project.enabled_module_names.each do |m| %>
|
||||
<%= hidden_field_tag "enabled_modules[]", m, :id => "enabled_module_names_#{m}" %>
|
||||
<%= hidden_field_tag "enabled_modules[]", m, id: "enabled_module_names_#{m}" %>
|
||||
<% end %>
|
||||
|
||||
@@ -29,9 +29,9 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
<% issue_custom_fields.each do |custom_field| %>
|
||||
<% if @project.all_work_package_custom_fields.include?(custom_field) %>
|
||||
<%= render :partial => "projects/form/attributes/hidden_field",
|
||||
:locals => { :form => form, :name => :'work_package_custom_field_ids',
|
||||
:options => {:multiple => true},
|
||||
:value => custom_field.id } %>
|
||||
<%= render partial: "projects/form/attributes/hidden_field",
|
||||
locals: { form: form, name: :'work_package_custom_field_ids',
|
||||
options: {multiple: true},
|
||||
value: custom_field.id } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -30,10 +30,10 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% unless types.empty? %>
|
||||
<% types.each do |type| %>
|
||||
<% if project.types.include?(type) %>
|
||||
<%= render :partial => "projects/form/attributes/hidden_field",
|
||||
:locals => { :form => form, :name => :'type_ids',
|
||||
:options => {:multiple => true},
|
||||
:value => type.id } %>
|
||||
<%= render partial: "projects/form/attributes/hidden_field",
|
||||
locals: { form: form, name: :'type_ids',
|
||||
options: {multiple: true},
|
||||
value: type.id } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -31,7 +31,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<section class="form--section" id="custom_field_form">
|
||||
<div class="form--field -required" id="custom_field_name_attributes">
|
||||
<%= f.text_field :name,
|
||||
:multi_locale => true %>
|
||||
multi_locale: true %>
|
||||
</div>
|
||||
<div class="form--field">
|
||||
<%= f.select :field_format,
|
||||
@@ -56,7 +56,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
<div class="form--field">
|
||||
<%= f.text_field :regexp,
|
||||
:size => 50 %>
|
||||
size: 50 %>
|
||||
<span class="form--field-instructions">
|
||||
<%=l(:text_regexp_info)%>
|
||||
</span>
|
||||
@@ -69,30 +69,30 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
h
|
||||
end %>
|
||||
<%= f.text_area :possible_values,
|
||||
:value => possible_values,
|
||||
:rows => 15,
|
||||
:multi_locale => true %><br>
|
||||
value: possible_values,
|
||||
rows: 15,
|
||||
multi_locale: true %><br>
|
||||
<% end %>
|
||||
<span class="form--field-instructions"><%= l(:text_custom_field_possible_values_info) %></span>
|
||||
</div>
|
||||
<div id="custom_field_default_value_attributes">
|
||||
<div class="form--field" id="default_value_text_multi">
|
||||
<% unless @custom_field.field_format == 'bool' %>
|
||||
<%= f.text_field(:default_value, :multi_locale => true) %>
|
||||
<%= f.text_field(:default_value, multi_locale: true) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form--field" id="default_value_text_single">
|
||||
<% if @custom_field.new_record? || ['date', 'float', 'int'].include?(@custom_field.field_format) %>
|
||||
<%= f.text_field(:default_value, :single_locale => true) %>
|
||||
<%= f.text_field(:default_value, single_locale: true) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form--field" style="display:none" id="default_value_bool">
|
||||
<% if @custom_field.new_record? || @custom_field.field_format == 'bool' %>
|
||||
<%= f.check_box(:default_value, :single_locale => true) %>
|
||||
<%= f.check_box(:default_value, single_locale: true) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %>
|
||||
<%= call_hook(:view_custom_fields_form_upper_box, custom_field: @custom_field, form: f) %>
|
||||
</section>
|
||||
|
||||
<section class="form--section">
|
||||
@@ -102,11 +102,11 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<legend class="form--fieldset-legend"><%=l(:label_type_plural)%></legend>
|
||||
<% for type in @types %>
|
||||
<%= check_box_tag "custom_field[type_ids][]", type.id, (@custom_field.types.include? type),
|
||||
:id => "custom_field_type_ids_#{type.id}",
|
||||
id: "custom_field_type_ids_#{type.id}",
|
||||
class: 'form--checkbox' %>
|
||||
<%= content_tag :label, (type.is_standard) ? l(:label_custom_field_default_type) : h(type),
|
||||
:class => "no-css",
|
||||
:for => "custom_field_type_ids_#{type.id}" %>
|
||||
class: "no-css",
|
||||
for: "custom_field_type_ids_#{type.id}" %>
|
||||
<% end %>
|
||||
<%= hidden_field_tag "custom_field[type_ids][]", '' %>
|
||||
</fieldset>
|
||||
@@ -129,6 +129,6 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% else %>
|
||||
<div class="form--field"><%= f.check_box :is_required %></div>
|
||||
<% end %>
|
||||
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
|
||||
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", custom_field: @custom_field, form: f) %>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
<%#-- copyright
|
||||
OpenProject is a project management system.
|
||||
Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License version 3.
|
||||
|
||||
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
Copyright (C) 2010-2013 the ChiliProject Team
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++#%>
|
||||
<div class="generic-table--container">
|
||||
<div class="generic-table--results-container">
|
||||
<table interactive-table role="grid" class="generic-table">
|
||||
<colgroup>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<% if tab[:name] == 'WorkPackageCustomField' %>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<% end %>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= CustomField.human_attribute_name(:name) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= CustomField.human_attribute_name(:field_format) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= CustomField.human_attribute_name(:is_required) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<% if tab[:name] == 'WorkPackageCustomField' %>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= CustomField.human_attribute_name(:is_for_all) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%=l(:label_used_by)%>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<% end %>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%=l(:button_sort)%>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% (@custom_fields_by_type[tab[:name]] || []).sort.each do |custom_field| -%>
|
||||
<tr>
|
||||
<td><%= link_to h(custom_field.name), edit_custom_field_path(custom_field), lang: custom_field.name_locale %></td>
|
||||
<td><%= Redmine::CustomFieldFormat.label_for(custom_field.field_format) %></td>
|
||||
<td><%= checked_image custom_field.is_required? %></td>
|
||||
<% if tab[:name] == 'WorkPackageCustomField' %>
|
||||
<td><%= checked_image custom_field.is_for_all? %></td>
|
||||
<td><%= l(:label_x_projects, :count => custom_field.projects.count) if custom_field.is_a? WorkPackageCustomField and !custom_field.is_for_all? %></td>
|
||||
<% end %>
|
||||
<td><%= reorder_links('custom_field', {:action => 'update', :id => custom_field}, method: :put) %></td>
|
||||
<td class="buttons">
|
||||
<%= delete_link custom_field_path(custom_field) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="generic-table--header-background"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p><%= link_to l(:label_custom_field_new), new_custom_field_path(:type => tab[:name]), :class => 'icon icon-add' %></p>
|
||||
@@ -0,0 +1,134 @@
|
||||
<%#-- copyright
|
||||
OpenProject is a project management system.
|
||||
Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License version 3.
|
||||
|
||||
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
Copyright (C) 2010-2013 the ChiliProject Team
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++#%>
|
||||
|
||||
<% if (@custom_fields_by_type[tab[:name]] || []).any? %>
|
||||
<div class="generic-table--container">
|
||||
<div class="generic-table--results-container">
|
||||
<table interactive-table role="grid" class="generic-table">
|
||||
<colgroup>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<% if tab[:name] == 'WorkPackageCustomField' %>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<% end %>
|
||||
<col highlight-col>
|
||||
<col highlight-col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= CustomField.human_attribute_name(:name) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= CustomField.human_attribute_name(:field_format) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= CustomField.human_attribute_name(:is_required) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<% if tab[:name] == 'WorkPackageCustomField' %>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%= CustomField.human_attribute_name(:is_for_all) %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%=l(:label_used_by)%>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<% end %>
|
||||
<th>
|
||||
<div class="generic-table--sort-header-outer">
|
||||
<div class="generic-table--sort-header">
|
||||
<span>
|
||||
<%=l(:button_sort)%>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% (@custom_fields_by_type[tab[:name]] || []).sort.each do |custom_field| -%>
|
||||
<tr>
|
||||
<td><%= link_to h(custom_field.name), edit_custom_field_path(custom_field), lang: custom_field.name_locale %></td>
|
||||
<td><%= Redmine::CustomFieldFormat.label_for(custom_field.field_format) %></td>
|
||||
<td><%= checked_image custom_field.is_required? %></td>
|
||||
<% if tab[:name] == 'WorkPackageCustomField' %>
|
||||
<td><%= checked_image custom_field.is_for_all? %></td>
|
||||
<td><%= l(:label_x_projects, count: custom_field.projects.count) if custom_field.is_a? WorkPackageCustomField and !custom_field.is_for_all? %></td>
|
||||
<% end %>
|
||||
<td><%= reorder_links('custom_field', {action: 'update', id: custom_field}, method: :put) %></td>
|
||||
<td class="buttons">
|
||||
<%= delete_link custom_field_path(custom_field) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="generic-table--header-background"></div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<%= link_to new_custom_field_path(type: tab[:name]), class: 'button -alt-highlight' do %>
|
||||
<i class="button--icon icon-add"></i>
|
||||
<span class="button--text"><%= l(:label_custom_field_new) %></span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= no_results_box(action_url: new_custom_field_path(type: tab[:name]), display_action: true) %>
|
||||
<% end %>
|
||||
@@ -35,9 +35,9 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
}.squish
|
||||
%>
|
||||
|
||||
<%= labelled_tabular_form_for @custom_field, :as => :custom_field,
|
||||
:url => custom_field_path(@custom_field),
|
||||
:html => {:method => :put, :id => 'custom_field_form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= labelled_tabular_form_for @custom_field, as: :custom_field,
|
||||
url: custom_field_path(@custom_field),
|
||||
html: {method: :put, id: 'custom_field_form'} do |f| %>
|
||||
<%= render partial: 'form', locals: { f: f } %>
|
||||
<%= styled_button_tag l(:button_save), class: '-highlight -with-icon icon-yes' %>
|
||||
<% end %>
|
||||
|
||||
@@ -34,10 +34,10 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
}.squish
|
||||
%>
|
||||
|
||||
<%= labelled_tabular_form_for @custom_field, :as => :custom_field,
|
||||
:url => custom_fields_path,
|
||||
:html => {:id => 'custom_field_form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= labelled_tabular_form_for @custom_field, as: :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 %>
|
||||
<%= styled_button_tag l(:button_save), class: '-highlight -with-icon icon-yes' %>
|
||||
<% end %>
|
||||
|
||||
@@ -27,13 +27,16 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++#%>
|
||||
|
||||
<%# locals: form %>
|
||||
<%# locals: form, all_fields, only_required #%>
|
||||
|
||||
<% form.object.custom_field_values.each do |value| %>
|
||||
<%= form.fields_for_custom_fields :custom_field_values, value do |value_form| %>
|
||||
<% required = value.custom_field.is_required? %>
|
||||
<div class="form--field <%= required ? '-required' : '' %>">
|
||||
<%= value_form.custom_field %>
|
||||
<%# display all fields OR only display required fields OR only display optional fields #%>
|
||||
<% if all_fields || (only_required && required) || (!only_required && !required) %>
|
||||
<%= value_form.custom_field %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -29,13 +29,13 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
<%#
|
||||
needs locals:
|
||||
:f => labelled form builder
|
||||
f: labelled form builder
|
||||
%>
|
||||
|
||||
<%= error_messages_for :enumeration %>
|
||||
<section class="form--section">
|
||||
<%= f.hidden_field 'type' %>
|
||||
<div class="form--field"><%= f.text_field 'name', :required => true %></div>
|
||||
<div class="form--field"><%= f.text_field 'name', required: true %></div>
|
||||
<div class="form--field"><%= f.check_box 'active' %></div>
|
||||
<div class="form--field"><%= f.check_box 'is_default' %></div>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++#%>
|
||||
<%= toolbar title: "#{link_to l(@enumeration.option_name), enumerations_path} » #{h @enumeration}" %>
|
||||
<%= styled_form_tag({}, :method => :delete) do %>
|
||||
<%= styled_form_tag({}, method: :delete) do %>
|
||||
<section class="form--section">
|
||||
<p><strong><%= l(:text_enumeration_destroy_question, @enumeration.objects_count) %></strong></p>
|
||||
<div class="form--field">
|
||||
@@ -38,6 +38,6 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
</div>
|
||||
</section>
|
||||
<%= styled_submit_tag l(:button_apply), class: '-highlight' %>
|
||||
<%= link_to l(:button_cancel), { :controller => '/enumerations', :action => 'index' },
|
||||
<%= link_to l(:button_cancel), { controller: '/enumerations', action: 'index' },
|
||||
class: 'button' %>
|
||||
<% end %>
|
||||
|
||||
@@ -31,10 +31,10 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<%= toolbar title: "#{link_to l(@enumeration.option_name), enumerations_path} » #{h @enumeration}" %>
|
||||
|
||||
<%= labelled_tabular_form_for @enumeration do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= render partial: 'form', locals: { f: f } %>
|
||||
<%= styled_button_tag l(:button_save), class: '-highlight -with-icon icon-yes' %>
|
||||
<% end %>
|
||||
|
||||
<%= styled_form_tag(enumeration_path(@enumeration), :method => :delete) do %>
|
||||
<%= styled_form_tag(enumeration_path(@enumeration), method: :delete) do %>
|
||||
<%= styled_submit_tag l(:button_delete) %>
|
||||
<% end %>
|
||||
|
||||
@@ -85,15 +85,15 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
</thead>
|
||||
<% enumerations.each do |enumeration| %>
|
||||
<tr>
|
||||
<td><%= link_to h(enumeration), :action => 'edit', :id => enumeration %></td>
|
||||
<td><%= link_to h(enumeration), action: 'edit', id: enumeration %></td>
|
||||
<td style="width:200px;"><%= checked_image enumeration.is_default? %></td>
|
||||
<td style="width:200px;"><%= checked_image enumeration.active? %></td>
|
||||
<td style="width:200px;"><%= reorder_links('enumeration', {:action => 'update', :id => enumeration}, :method => :put) %></td>
|
||||
<td style="width:200px;"><%= reorder_links('enumeration', {action: 'update', id: enumeration}, method: :put) %></td>
|
||||
<td class="buttons" style="width:200px;">
|
||||
<%= link_to l(:button_delete), { :action => 'destroy', :id => enumeration },
|
||||
:method => :delete,
|
||||
<%= link_to l(:button_delete), { action: 'destroy', id: enumeration },
|
||||
method: :delete,
|
||||
data: { confirm: l(:text_are_you_sure) },
|
||||
:class => 'icon icon-delete' %>
|
||||
class: 'icon icon-delete' %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -102,5 +102,5 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<p><%= link_to l(:label_enumeration_new), { :action => 'new', :type => klass.name } %></p>
|
||||
<p><%= link_to l(:label_enumeration_new), { action: 'new', type: klass.name } %></p>
|
||||
<% end %>
|
||||
|
||||
@@ -30,6 +30,6 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% html_title l(:label_administration), l(:label_enumeration_new) %>
|
||||
<%= toolbar title: "#{link_to l(@enumeration.option_name), enumerations_path} » #{l(:label_enumeration_new)}" %>
|
||||
<%= labelled_tabular_form_for @enumeration do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= render partial: 'form', locals: { f: f } %>
|
||||
<%= styled_button_tag l(:button_create), class: '-highlight -with-icon icon-yes' %>
|
||||
<% end %>
|
||||
|
||||
@@ -29,14 +29,14 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
<%#
|
||||
needs locals:
|
||||
:f => labelled form builder
|
||||
f: labelled form builder
|
||||
%>
|
||||
|
||||
<%= error_messages_for :group %>
|
||||
|
||||
<section class="form--section">
|
||||
<div class="form--field">
|
||||
<%= f.text_field :lastname, :label => Group.human_attribute_name(:name), :required => true %>
|
||||
<%= f.text_field :lastname, label: Group.human_attribute_name(:name), required: true %>
|
||||
</div>
|
||||
|
||||
<%= render partial: 'customizable/form', locals: { form: f } %>
|
||||
|
||||
@@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++#%>
|
||||
|
||||
<%= labelled_tabular_form_for @group, :url => group_path(@group), :html => {:method => :put}, :as => :group do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= labelled_tabular_form_for @group, url: group_path(@group), html: {method: :put}, as: :group do |f| %>
|
||||
<%= render partial: 'form', locals: { f: f } %>
|
||||
<%= styled_button_tag l(:button_save), class: '-highlight -with-icon icon-yes' %>
|
||||
<% end %>
|
||||
|
||||
@@ -71,10 +71,10 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<td class="roles">
|
||||
<span id="member-<%= membership.id %>-roles"><%=h membership.roles.sort.collect(&:to_s).join(', ') %></span>
|
||||
<%= form_tag(membership_of_group_path(@group, membership),
|
||||
:method => :put,
|
||||
:remote => true,
|
||||
:id => "member-#{membership.id}-roles-form",
|
||||
:style => 'display:none;') do %>
|
||||
method: :put,
|
||||
remote: true,
|
||||
id: "member-#{membership.id}-roles-form",
|
||||
style: 'display:none;') do %>
|
||||
<p><% roles.each do |role| %>
|
||||
<label><%= check_box_tag 'membership[role_ids][]', role.id, membership.roles.include?(role) %> <%=h role %></label>
|
||||
<% end %></p>
|
||||
@@ -86,11 +86,11 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="buttons">
|
||||
<%= link_to_function l(:button_edit), "$('member-#{membership.id}-roles').hide(); $('member-#{membership.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %>
|
||||
<%= link_to_function l(:button_edit), "$('member-#{membership.id}-roles').hide(); $('member-#{membership.id}-roles-form').show(); return false;", class: 'icon icon-edit' %>
|
||||
<%= link_to l(:button_remove), membership_of_group_path(@group, membership),
|
||||
:method => :delete,
|
||||
:remote => true,
|
||||
:class => 'icon icon-remove' %>
|
||||
method: :delete,
|
||||
remote: true,
|
||||
class: 'icon icon-remove' %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -100,25 +100,17 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="generic-table--no-results-container">
|
||||
<h2 class="generic-table--no-results-title">
|
||||
<i class="icon-info"></i>
|
||||
<%= l(:label_nothing_display) %>
|
||||
</h2>
|
||||
<div class="generic-table--no-results-description">
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
</div>
|
||||
</div>
|
||||
<%= no_results_box %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="grid-content">
|
||||
<% if projects.any? %>
|
||||
<%= styled_form_tag(memberships_of_group_path(@group),
|
||||
:method => :post,
|
||||
:remote => true) do %>
|
||||
method: :post,
|
||||
remote: true) do %>
|
||||
<fieldset class="form--fieldset">
|
||||
<legend class="form--fieldset-legend"><%=l(:label_project_new)%></legend>
|
||||
<%= label_tag "membership_project_id", l(:description_choose_project), :class => "hidden-for-sighted" %>
|
||||
<%= label_tag "membership_project_id", l(:description_choose_project), class: "hidden-for-sighted" %>
|
||||
<%= styled_select_tag 'membership[project_id]', options_for_membership_project_select(@group, projects) %>
|
||||
<div class="form--field -vertical">
|
||||
<%= styled_label_tag nil, "#{l(:label_role_plural)}:" %>
|
||||
|
||||
@@ -56,9 +56,9 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
<td class="user"><%= link_to_user user %></td>
|
||||
<td class="buttons">
|
||||
<%= link_to l(:button_remove), member_of_group_path(@group, user),
|
||||
:method => :delete,
|
||||
:remote => :true,
|
||||
:class => 'icon icon-remove' %>
|
||||
method: :delete,
|
||||
remote: :true,
|
||||
class: 'icon icon-remove' %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -68,23 +68,13 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="generic-table--container">
|
||||
<div class="generic-table--no-results-container">
|
||||
<h2 class="generic-table--no-results-title">
|
||||
<i class="icon-info"></i>
|
||||
<%= l(:label_nothing_display) %>
|
||||
</h2>
|
||||
<div class="generic-table--no-results-description">
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= no_results_box %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="grid-content">
|
||||
<% users = User.active.not_in_group(@group).limit(100) %>
|
||||
<% if users.any? %>
|
||||
<%= styled_form_tag(members_of_group_path(@group), :method => :post, :remote => true) do |f| %>
|
||||
<%= styled_form_tag(members_of_group_path(@group), method: :post, remote: true) do |f| %>
|
||||
<fieldset class="form--fieldset">
|
||||
<legend class="form--fieldset-legend"><%=l(:label_user_new)%></legend>
|
||||
<div class="form--field -vertical">
|
||||
@@ -95,11 +85,11 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
</div>
|
||||
<div class="form--field -vertical">
|
||||
<%= observe_field(:user_search,
|
||||
:frequency => 0.5,
|
||||
:update => :users,
|
||||
:url => { :controller => '/groups', :action => 'autocomplete_for_user', :id => @group },
|
||||
:with => 'q',
|
||||
:method => :get)
|
||||
frequency: 0.5,
|
||||
update: :users,
|
||||
url: { controller: '/groups', action: 'autocomplete_for_user', id: @group },
|
||||
with: 'q',
|
||||
method: :get)
|
||||
%>
|
||||
<div id="users" class="form--field-container -vertical">
|
||||
<%= principals_check_box_tags 'user_ids[]', users %>
|
||||
|
||||
@@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++#%>
|
||||
|
||||
jQuery('#tab-content-users').html("<%= escape_javascript render(:partial => 'groups/users') %>")
|
||||
jQuery('#tab-content-users').html("<%= escape_javascript render(partial: 'groups/users') %>")
|
||||
<% @users.each do |user| %>
|
||||
jQuery('#user-<%= user.id %>').effect("highlight", {}, 2000);
|
||||
<% end if @users.present? %>
|
||||
|
||||
@@ -35,5 +35,5 @@ See doc/COPYRIGHT.rdoc for more details.
|
||||
jQuery('#tab-content-memberships').prepend('<%= flash_message %>');
|
||||
jQuery('#member-<%= @membership.id %>').effect("highlight", {}, 2000);
|
||||
<% else %>
|
||||
alert('<%= escape_javascript(l(:notice_failed_to_save_members, :errors => @membership.errors.full_messages.join(', '))).html_safe %>');
|
||||
alert('<%= escape_javascript(l(:notice_failed_to_save_members, errors: @membership.errors.full_messages.join(', '))).html_safe %>');
|
||||
<% end %>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user