diff --git a/app/assets/fonts/openproject_icon/openproject-icon-font.eot b/app/assets/fonts/openproject_icon/openproject-icon-font.eot index 711329f39d..62387de3f8 100644 Binary files a/app/assets/fonts/openproject_icon/openproject-icon-font.eot and b/app/assets/fonts/openproject_icon/openproject-icon-font.eot differ diff --git a/app/assets/fonts/openproject_icon/openproject-icon-font.svg b/app/assets/fonts/openproject_icon/openproject-icon-font.svg index 5ad68c9778..5eebd564c8 100644 --- a/app/assets/fonts/openproject_icon/openproject-icon-font.svg +++ b/app/assets/fonts/openproject_icon/openproject-icon-font.svg @@ -238,4 +238,9 @@ + + + + + diff --git a/app/assets/fonts/openproject_icon/openproject-icon-font.ttf b/app/assets/fonts/openproject_icon/openproject-icon-font.ttf index 3943211240..020958ad4b 100644 Binary files a/app/assets/fonts/openproject_icon/openproject-icon-font.ttf and b/app/assets/fonts/openproject_icon/openproject-icon-font.ttf differ diff --git a/app/assets/fonts/openproject_icon/openproject-icon-font.woff b/app/assets/fonts/openproject_icon/openproject-icon-font.woff index ec513740df..ce31d1a211 100644 Binary files a/app/assets/fonts/openproject_icon/openproject-icon-font.woff and b/app/assets/fonts/openproject_icon/openproject-icon-font.woff differ diff --git a/app/assets/javascripts/angular/controllers/dialogs/settings.js b/app/assets/javascripts/angular/controllers/dialogs/settings.js index e0e1727c48..78b78e3edb 100644 --- a/app/assets/javascripts/angular/controllers/dialogs/settings.js +++ b/app/assets/javascripts/angular/controllers/dialogs/settings.js @@ -37,7 +37,7 @@ angular.module('openproject.workPackages.controllers') }]) .controller('SettingsModalController', ['$scope', 'settingsModal', 'QueryService', - function($scope, settingsModal, QueryService) { + function($scope, settingsModal, QueryService) { this.name = 'Settings'; this.closeMe = settingsModal.deactivate; $scope.query = QueryService.getQuery(); diff --git a/app/assets/javascripts/angular/controllers/work-packages-controller.js b/app/assets/javascripts/angular/controllers/work-packages-controller.js index c4b80e2659..b0b2b3464b 100644 --- a/app/assets/javascripts/angular/controllers/work-packages-controller.js +++ b/app/assets/javascripts/angular/controllers/work-packages-controller.js @@ -52,6 +52,8 @@ angular.module('openproject.workPackages.controllers') // Setup function initialSetup() { + $scope.query_id = null; + QueryService.resetAll(); setupPageParamsFromUrl($window.location); initProject(); @@ -175,8 +177,8 @@ angular.module('openproject.workPackages.controllers') $scope.availableOptions = QueryService.getAvailableOptions(); // maybe generalize this approach $scope.$watch('availableOptions.availableGroupedQueries', function(availableQueries) { if (availableQueries) { - $scope.groups = [{ name: 'CUSTOM QUERIES', models: availableQueries['user_queries']}, - { name: 'GLOBAL QUERIES', models: availableQueries['queries']}]; + $scope.groups = [{ name: 'GLOBAL QUERIES', models: availableQueries['queries']}, + { name: 'CUSTOM QUERIES', models: availableQueries['user_queries']}]; } }); } @@ -236,7 +238,6 @@ angular.module('openproject.workPackages.controllers') }); $rootScope.$on('queryResetRequired', function(event, message) { - $scope.query_id = null; initialSetup(); }); diff --git a/app/assets/javascripts/angular/helpers/components/work-packages-helper.js b/app/assets/javascripts/angular/helpers/components/work-packages-helper.js index 5552e8ee59..93e4673289 100644 --- a/app/assets/javascripts/angular/helpers/components/work-packages-helper.js +++ b/app/assets/javascripts/angular/helpers/components/work-packages-helper.js @@ -97,9 +97,9 @@ angular.module('openproject.workPackages.helpers') formatValue: function(value, dataType) { switch(dataType) { case 'datetime': - return dateFilter(WorkPackagesHelper.parseDateTime(value), 'medium'); + return value ? dateFilter(WorkPackagesHelper.parseDateTime(value), 'medium') : ''; case 'date': - return dateFilter(value, 'mediumDate'); + return value ? dateFilter(WorkPackagesHelper.parseDateTime(value), 'mediumDate') : ''; case 'currency': return currencyFilter(value, 'EUR '); default: diff --git a/app/assets/javascripts/angular/models/query.js b/app/assets/javascripts/angular/models/query.js index c753f1db3b..9c3bd164fe 100644 --- a/app/assets/javascripts/angular/models/query.js +++ b/app/assets/javascripts/angular/models/query.js @@ -185,10 +185,7 @@ angular.module('openproject.models') var selectedColumns = this.columns.map(function(column) { return column.name; }); - // To be able to group the work packages we need to add in the group by column if it is not already in the selected columns - if(selectedColumns.indexOf(this.groupBy) == -1){ - selectedColumns.push(this.groupBy); - } + return selectedColumns; }, diff --git a/app/assets/javascripts/angular/services/query-service.js b/app/assets/javascripts/angular/services/query-service.js index 8d485b58b1..e271beb5a7 100644 --- a/app/assets/javascripts/angular/services/query-service.js +++ b/app/assets/javascripts/angular/services/query-service.js @@ -89,6 +89,15 @@ angular.module('openproject.services') query = null; }, + resetAll: function(){ + QueryService.resetQuery(); + availableOptions = {}; + availableColumns = [], + availableUnusedColumns = [], + availableFilterValues = {}, + availableFilters = {}; + }, + getQuery: function() { return query; }, diff --git a/app/assets/javascripts/autocompleter.js b/app/assets/javascripts/autocompleter.js index 5badabe887..55803ea07d 100644 --- a/app/assets/javascripts/autocompleter.js +++ b/app/assets/javascripts/autocompleter.js @@ -223,4 +223,4 @@ callback(data); } }; -}(jQuery)); \ No newline at end of file +}(jQuery)); diff --git a/app/assets/javascripts/contextual_fieldset.js b/app/assets/javascripts/contextual_fieldset.js index 7ce042571f..3c2aca2137 100644 --- a/app/assets/javascripts/contextual_fieldset.js +++ b/app/assets/javascripts/contextual_fieldset.js @@ -32,4 +32,3 @@ jQuery(document).ready(function($) { event.stopPropagation(); }); }); - diff --git a/app/assets/javascripts/findDomElement.js b/app/assets/javascripts/findDomElement.js index 8fdb84414c..7bb838f28b 100644 --- a/app/assets/javascripts/findDomElement.js +++ b/app/assets/javascripts/findDomElement.js @@ -59,4 +59,4 @@ } }; -})( jQuery ); \ No newline at end of file +})( jQuery ); diff --git a/app/assets/javascripts/members_select_boxes.js b/app/assets/javascripts/members_select_boxes.js index 8a11e513f9..38bdef6b12 100644 --- a/app/assets/javascripts/members_select_boxes.js +++ b/app/assets/javascripts/members_select_boxes.js @@ -53,7 +53,7 @@ jQuery(document).ready(function($) { formatItemSelection = function (item) { return item.name; }; - + $("#members_add_form select.select2-select").each(function (ix, elem){ if ($(elem).hasClass("remote") || $(elem).attr("data-ajaxURL") !== undefined) { // remote loading @@ -110,4 +110,3 @@ jQuery(document).ready(function($) { memberstab.click(init_members_cb); } }); - diff --git a/app/assets/javascripts/repository_navigation.js b/app/assets/javascripts/repository_navigation.js index ffa29abeeb..78b7ca772f 100644 --- a/app/assets/javascripts/repository_navigation.js +++ b/app/assets/javascripts/repository_navigation.js @@ -27,7 +27,7 @@ //++ Event.observe(window,'load',function() { - /* + /* If we're viewing a tag or branch, don't display it in the revision box */ @@ -37,7 +37,7 @@ Event.observe(window,'load',function() { $('rev').setValue(''); } - /* + /* Copy the branch/tag value into the revision box, then disable the dropdowns before submitting the form */ diff --git a/app/assets/javascripts/select_list_move.js b/app/assets/javascripts/select_list_move.js index 8a9c940068..5b5aa59f85 100644 --- a/app/assets/javascripts/select_list_move.js +++ b/app/assets/javascripts/select_list_move.js @@ -64,4 +64,3 @@ function moveOptionDown(selectionId) { function selectAllOptions(id) { jQuery("#" + id + " option").attr('selected',true); } - diff --git a/app/assets/javascripts/timelines_select_boxes.js b/app/assets/javascripts/timelines_select_boxes.js index f10a1dd229..86b1186620 100644 --- a/app/assets/javascripts/timelines_select_boxes.js +++ b/app/assets/javascripts/timelines_select_boxes.js @@ -39,7 +39,7 @@ jQuery(document).ready(function($) { $("#timeline_options_grouping_two_sort"), $("#timeline_options_planning_element_time_relative_one_unit"), $("#timeline_options_planning_element_time_relative_two_unit") - ].each(function (item) { + ].forEach(function (item) { $("input[name='" + $(item).attr("name")+"']").remove(); $(item).select2({ @@ -69,7 +69,7 @@ jQuery(document).ready(function($) { $("#timeline_options_planning_element_responsibles"), $("#timeline_options_planning_element_assignee"), $("#timeline_options_grouping_two_selection") - ].each(function (item) { + ].forEach(function (item) { $(item).autocomplete({ multiple: true, ajax: {null_element: {id: -1, name: I18n.t("js.filter.noneElement")}} }); @@ -79,7 +79,7 @@ jQuery(document).ready(function($) { $("#timeline_options_planning_element_types"), $("#timeline_options_planning_element_time_types"), $("#timeline_options_planning_element_status") - ].each(function (item) { + ].forEach(function (item) { $(item).autocomplete({ multiple: true }); @@ -94,7 +94,7 @@ jQuery(document).ready(function($) { [ $("#reporting_reporting_to_project_id"), $("#project_association_select_project_b_id") - ].each(function (item) { + ].forEach(function (item) { // Stuff borrowed from Core application.js Project Jump Box $(item).autocomplete({ multiple: false, @@ -112,7 +112,7 @@ jQuery(document).ready(function($) { [ $("#timeline_options_grouping_one_selection") - ].each(function (item) { + ].forEach(function (item) { // Stuff borrowed from Core application.js Project Jump Box $(item).autocomplete({ multiple: true, @@ -131,7 +131,7 @@ jQuery(document).ready(function($) { [ $("#timeline_options_parents") - ].each(function (item) { + ].forEach(function (item) { // Stuff borrowed from Core application.js Project Jump Box $(item).autocomplete({ multiple: true, @@ -168,4 +168,3 @@ jQuery(document).ready(function($) { field.closest("fieldset").removeClass('collapsed').children("div").show(); } }); - diff --git a/app/assets/javascripts/work_packages.js.erb b/app/assets/javascripts/work_packages.js.erb index 59a49b643c..9ec1000463 100644 --- a/app/assets/javascripts/work_packages.js.erb +++ b/app/assets/javascripts/work_packages.js.erb @@ -35,7 +35,7 @@ var WorkPackage = WorkPackage || {}; var init; init = function () { - + $.ajaxAppend({ trigger: '.action_menu_specific .edit', indicator_class: 'ajax-indicator', diff --git a/app/assets/stylesheets/content/_action_menu_main.sass b/app/assets/stylesheets/content/_action_menu_main.sass index ac13c6714a..98fa4ff2b7 100644 --- a/app/assets/stylesheets/content/_action_menu_main.sass +++ b/app/assets/stylesheets/content/_action_menu_main.sass @@ -30,7 +30,6 @@ ul list-style-type: none margin: 0 - width: 200px border: 1px solid #dddddd box-shadow: 1px 1px 4px #cccccc @@ -41,6 +40,7 @@ padding: 4px 13px 4px 10px &:hover background: #f0f0f0 + cursor: pointer &.has-no-icon padding: 4px 10px 4px 35px &.dropdown-divider diff --git a/app/assets/stylesheets/content/_forms.md b/app/assets/stylesheets/content/_forms.md index 130d855f5a..08c97e64ab 100644 --- a/app/assets/stylesheets/content/_forms.md +++ b/app/assets/stylesheets/content/_forms.md @@ -1 +1,26 @@ # Forms + +``` + + +
+
+ + + +
+
+ + +``` diff --git a/app/assets/stylesheets/content/_forms.sass b/app/assets/stylesheets/content/_forms.sass index d46de7f16c..8aeb6dc244 100644 --- a/app/assets/stylesheets/content/_forms.sass +++ b/app/assets/stylesheets/content/_forms.sass @@ -171,3 +171,59 @@ fieldset width: auto margin-left: 0 font-weight: normal + +.checkbox-label + position: relative + display: inline-block + vertical-align: top + line-height: 18px + user-select: none + + input[type=checkbox] + border: 0 + clip: rect(0 0 0 0) + height: 18px + margin: 0 -18px -18px 0 + overflow: hidden + padding: 0 + position: absolute + width: 18px + opacity: 0.001 + + \:checked + .styled-checkbox:after + opacity: 1 + + \:focus + .styled-checkbox:before + +.styled-checkbox + display: inline-block + vertical-align: top + width: 18px + height: 18px + padding: 0 5px + user-select: none + &:before + content: '' + position: absolute + box-sizing: border-box + width: 18px + height: 18px + background: #ffffff + border: 1px solid #cacaca + border-radius: 2px + cursor: pointer + box-shadow: inset 0 1px #fff + &:after + opacity: 0 + content: '' + position: absolute + margin: 5px 2px + /* Length of check tail + width: 11px + /* Lenght of check foot + height: 3px + background: transparent + border: 3px solid #666666 + border-top: none + border-right: none + @include transform(rotate(-50deg)) diff --git a/app/assets/stylesheets/content/_legacy_actions.sass b/app/assets/stylesheets/content/_legacy_actions.sass index 8b71f4d2b0..8ebd1b0bf8 100644 --- a/app/assets/stylesheets/content/_legacy_actions.sass +++ b/app/assets/stylesheets/content/_legacy_actions.sass @@ -83,4 +83,3 @@ ul.legacy-actions-more .message-reply-menu @include contextual(-39px) - diff --git a/app/assets/stylesheets/content/_modal.sass b/app/assets/stylesheets/content/_modal.sass index 232b93c753..45b3be45cb 100644 --- a/app/assets/stylesheets/content/_modal.sass +++ b/app/assets/stylesheets/content/_modal.sass @@ -77,7 +77,6 @@ $ng-modal-image-width: $ng-modal-image-height #modal-sorting - min-width: 900px .select2-container @media(max-width: 1800px) width: 280px diff --git a/app/assets/stylesheets/content/_wiki.sass b/app/assets/stylesheets/content/_wiki.sass index f6f0a004f8..2f1f8fe762 100644 --- a/app/assets/stylesheets/content/_wiki.sass +++ b/app/assets/stylesheets/content/_wiki.sass @@ -28,6 +28,11 @@ @import global/all div.wiki + font-size: 14px + line-height: 1.6em + h1, h2 + margin: 1em 0 1em 0 + table border: 1px solid #505050 border-collapse: collapse @@ -57,7 +62,6 @@ div.wiki margin-right: 12px margin-left: 0 display: table - font-size: 0.8em &.right float: right margin-left: 12px @@ -76,13 +80,22 @@ div.wiki padding-left: 16px li list-style-type: none - ul - margin: 0 - padding: 0 + + ol, ul + padding: 0 0 0 2em + margin: 0.3em 0 + li + list-style-position: outside margin: 0 - li li - margin-left: 1.5em + + ol li + list-style-type: decimal + + ul li + list-style-type: disc + + fieldset legend font-weight: bold font-size: 10px @@ -103,6 +116,8 @@ h1:hover, h2:hover, h3:hover color: #ddd .wiki + p + margin-bottom: 1em p, span &.see-also, &.caution, &.important, &.info, &.tip, &.note display: block @@ -162,6 +177,9 @@ h1:hover, h2:hover, h3:hover background: url(image-path('wiki_styles/note_small.png')) 5px 4px no-repeat #F5FFFA border: 1px solid #C7CFCA +.wiki-content + width: 700px + .controller-wiki #content overflow: visible diff --git a/app/assets/stylesheets/default/main.css.erb b/app/assets/stylesheets/default/main.css.erb index 5acb81077e..e68fb459bd 100644 --- a/app/assets/stylesheets/default/main.css.erb +++ b/app/assets/stylesheets/default/main.css.erb @@ -1028,16 +1028,10 @@ table.files { #content blockquote, .wiki ol, .wiki ul { padding-left: 22px; } -.wiki p { - margin-bottom: 5px; -} blockquote { font-style: italic; background: url(<%= asset_path 'blockquote-bg.png' %>) no-repeat 5px 3px; } -.wiki ul li { - list-style: disc inside none; -} .file-thumbs { margin: 20px 0 0; overflow: hidden; @@ -1434,11 +1428,6 @@ tr.time-entry { display: none; } -/* comments */ -.wiki ol li { - list-style: decimal inside; -} - /* scm */ #content table .changeset td.id a:hover { text-decoration: underline; @@ -1703,7 +1692,7 @@ content { padding-bottom: 11px; } -#history .journal, #content .wiki-content p, #content .wiki-content li { +#history .journal { width: 700px; } diff --git a/app/assets/stylesheets/fonts/_openproject_icon_font.md b/app/assets/stylesheets/fonts/_openproject_icon_font.md index 5b6cb2a2b7..5cc53db2cf 100644 --- a/app/assets/stylesheets/fonts/_openproject_icon_font.md +++ b/app/assets/stylesheets/fonts/_openproject_icon_font.md @@ -238,5 +238,10 @@ - + + + + + + ``` diff --git a/app/assets/stylesheets/fonts/_openproject_icon_font.sass b/app/assets/stylesheets/fonts/_openproject_icon_font.sass index 6a27968fd9..f01cf6a548 100644 --- a/app/assets/stylesheets/fonts/_openproject_icon_font.sass +++ b/app/assets/stylesheets/fonts/_openproject_icon_font.sass @@ -913,6 +913,21 @@ dt > .icon-wiki-page:before, .icon-toggle:before content: "\e0e3" + +.icon-sort-by:before + content: "\e0e4" + +.icon-group-by:before + content: "\e0e5" + +.icon-filter-big:before + content: "\e0e6" + +.icon-group-by2:before + content: "\e0e7" + +.icon-sort-by2:before + content: "\e0e8" /* remove once all menu items have an icon */ .no-icon diff --git a/app/assets/stylesheets/layout/_drop_down.sass b/app/assets/stylesheets/layout/_drop_down.sass index 834281deef..ef732e9226 100644 --- a/app/assets/stylesheets/layout/_drop_down.sass +++ b/app/assets/stylesheets/layout/_drop_down.sass @@ -43,16 +43,16 @@ .dropdown .dropdown-menu, .dropdown .dropdown-panel - min-width: 160px + min-width: 200px max-width: 360px list-style: none background: #FFF border: solid 1px #DDD border: solid 1px rgba(0, 0, 0, .2) border-radius: 0px - box-shadow: 0 5px 10px rgba(0, 0, 0, .2) + box-shadow: 1px 1px 4px #cccccc overflow: visible - padding: 4px 0 + padding: 3px 0 margin: 0 .dropdown .dropdown-panel @@ -104,11 +104,11 @@ .dropdown .dropdown-menu LI > A, .dropdown .dropdown-menu LABEL display: block - color: #555 + color: $main_menu_font_color text-decoration: none - line-height: 18px - padding: 3px 32px + padding: 4px 13px 4px 10px white-space: nowrap + font-weight: normal .dropdown .dropdown-menu LI > A:hover, .dropdown .dropdown-menu LABEL:hover @@ -120,9 +120,8 @@ .dropdown LI > A.dropdown-menu-hasicons display: block - color: #555 + color: $main_menu_font_color text-decoration: none - line-height: 18px padding: 3px 10px white-space: nowrap @@ -131,7 +130,7 @@ font-size: 1px border-top: solid 1px #E5E5E5 padding: 0 - margin: 4px 0 + margin: 3px 0 /* Icon Examples - icons courtesy of http://p.yusukekamiyamane.com/ */ .dropdown.has-icons LI > A diff --git a/app/assets/stylesheets/layout/_toolbar.css.sass b/app/assets/stylesheets/layout/_toolbar.css.sass index 30470686c5..c13eb5a59b 100644 --- a/app/assets/stylesheets/layout/_toolbar.css.sass +++ b/app/assets/stylesheets/layout/_toolbar.css.sass @@ -58,6 +58,10 @@ li float: none + .dropdown-scrollable + overflow-y: auto + max-height: 500px + #querySelectDropdown min-width: 250px border: 1px solid #dddddd @@ -69,11 +73,11 @@ clear: both width: 100% display: block - ul.query-menu + ul.query-menu width: 100% margin: 0 0 10px 0 float: left - li + li padding: 4px 25px display: block &:hover @@ -85,7 +89,7 @@ &:hover text-decoration: none .search-query-wrapper - padding: 15px + padding: 15px input margin: 0 auto width: 100% diff --git a/app/controllers/api/v2/planning_element_journals_controller.rb b/app/controllers/api/v2/planning_element_journals_controller.rb index 015d050976..33627d735b 100644 --- a/app/controllers/api/v2/planning_element_journals_controller.rb +++ b/app/controllers/api/v2/planning_element_journals_controller.rb @@ -44,4 +44,3 @@ module Api end end - diff --git a/app/controllers/api/v3/queries_controller.rb b/app/controllers/api/v3/queries_controller.rb index d2267ec9d0..f06e7d1e5c 100644 --- a/app/controllers/api/v3/queries_controller.rb +++ b/app/controllers/api/v3/queries_controller.rb @@ -110,23 +110,23 @@ module Api::V3 def setup_query_for_create @query = Query.new params[:query] ? permitted_params.query : nil @query.project = @project unless params[:query_is_for_all] - prepare_query @query + prepare_query @query.user = User.current end def setup_existing_query @query = Query.find(params[:id]) - prepare_query(@query) + prepare_query end # Note: Not dry - lifted straight from old queries controller - def prepare_query(query) + def prepare_query @query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin? view_context.add_filter_from_params if params[:fields] || params[:f] - @query.group_by ||= params[:group_by] + @query.group_by = params[:group_by] if params[:group_by].present? @query.sort_criteria = prepare_sort_criteria if params[:sort] @query.project = nil if params[:query_is_for_all] - @query.display_sums ||= params[:display_sums].present? + @query.display_sums = params[:display_sums] if params[:display_sums].present? @query.column_names = params[:c] if params[:c] @query.column_names = nil if params[:default_columns] @query.name = params[:name] if params[:name] diff --git a/app/controllers/api/v3/work_packages_controller.rb b/app/controllers/api/v3/work_packages_controller.rb index 88f28956cc..44e002848b 100644 --- a/app/controllers/api/v3/work_packages_controller.rb +++ b/app/controllers/api/v3/work_packages_controller.rb @@ -51,7 +51,14 @@ module Api def index @custom_field_column_names = @query.columns.select{|c| c.name.to_s =~ /cf_(.*)/}.map(&:name) - @column_names = ['id'] | @query.columns.map(&:name) - @custom_field_column_names + @column_names = [:id] | @query.columns.map(&:name) - @custom_field_column_names + if !@query.group_by.blank? + if @query.group_by =~ /cf_(.*)/ + @custom_field_column_names << @query.group_by + else + @column_names << @query.group_by.to_sym + end + end # determine what actions may be performed @allowed_statuses = @work_packages.map do |i| diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index c5eb893bc0..66342b5cf3 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -52,7 +52,7 @@ class BoardsController < ApplicationController def show sort_init 'updated_on', 'desc' - sort_update 'created_on' => "#{Message.table_name}.created_on", + sort_update 'created_on' => "#{Message.table_name}.created_on", 'replies' => "#{Message.table_name}.replies_count", 'updated_on' => "#{Message.table_name}.updated_on" diff --git a/app/controllers/copy_projects_controller.rb b/app/controllers/copy_projects_controller.rb index 02caa91196..1a439406a4 100644 --- a/app/controllers/copy_projects_controller.rb +++ b/app/controllers/copy_projects_controller.rb @@ -94,4 +94,4 @@ class CopyProjectsController < ApplicationController end true end -end \ No newline at end of file +end diff --git a/app/controllers/query_menu_items_controller.rb b/app/controllers/query_menu_items_controller.rb index 910a3380b8..cda260c2b1 100644 --- a/app/controllers/query_menu_items_controller.rb +++ b/app/controllers/query_menu_items_controller.rb @@ -28,75 +28,75 @@ #++ class QueryMenuItemsController < ApplicationController - before_filter :load_project_and_query - before_filter :authorize - - def create - @query_menu_item = MenuItems::QueryMenuItem.find_or_initialize_by_name_and_navigatable_id normalized_query_name, @query.id, title: @query.name - if @query_menu_item.save - flash[:notice] = l(:notice_successful_create) - else - flash[:error] = l(:error_menu_item_not_created) - end - - redirect_to query_path - end - - def update - @query_menu_item = MenuItems::QueryMenuItem.find params[:id] - - if @query_menu_item.update_attributes query_menu_item_params - flash[:notice] = l(:notice_successful_update) - else - flash[:error] = l(:error_menu_item_not_saved) - end - - redirect_to query_path - end - - def destroy - @query_menu_item = MenuItems::QueryMenuItem.find params[:id] - - @query_menu_item.destroy - flash[:notice] = l(:notice_successful_delete) - - redirect_to query_path - end - - def edit - @query_menu_item = MenuItems::QueryMenuItem.find params[:id] - end - - private - - def load_project_and_query - @project = Project.find params[:project_id] - @query = Query.find params[:query_id] - end - - def query_path - project_work_packages_path(@project, :query_id => @query.id) - end - - def normalized_query_name - @query.name.parameterize.underscore - end - - # inherit permissions from queries where create and update are performed bei new and edit actions - def authorize(ctrl = 'queries', action = params[:action], global = false) - action = case action - when 'create' - 'new' - when 'update' - 'edit' - else - action - end - - super - end - - def query_menu_item_params - params.require(:menu_items_query_menu_item).permit(:name, :title, :navigatable_id, :parent_id) - end + before_filter :load_project_and_query + before_filter :authorize + + def create + @query_menu_item = MenuItems::QueryMenuItem.find_or_initialize_by_name_and_navigatable_id normalized_query_name, @query.id, title: @query.name + if @query_menu_item.save + flash[:notice] = l(:notice_successful_create) + else + flash[:error] = l(:error_menu_item_not_created) + end + + redirect_to query_path + end + + def update + @query_menu_item = MenuItems::QueryMenuItem.find params[:id] + + if @query_menu_item.update_attributes query_menu_item_params + flash[:notice] = l(:notice_successful_update) + else + flash[:error] = l(:error_menu_item_not_saved) + end + + redirect_to query_path + end + + def destroy + @query_menu_item = MenuItems::QueryMenuItem.find params[:id] + + @query_menu_item.destroy + flash[:notice] = l(:notice_successful_delete) + + redirect_to query_path + end + + def edit + @query_menu_item = MenuItems::QueryMenuItem.find params[:id] + end + + private + + def load_project_and_query + @project = Project.find params[:project_id] + @query = Query.find params[:query_id] + end + + def query_path + project_work_packages_path(@project, :query_id => @query.id) + end + + def normalized_query_name + @query.name.parameterize.underscore + end + + # inherit permissions from queries where create and update are performed bei new and edit actions + def authorize(ctrl = 'queries', action = params[:action], global = false) + action = case action + when 'create' + 'new' + when 'update' + 'edit' + else + action + end + + super + end + + def query_menu_item_params + params.require(:menu_items_query_menu_item).permit(:name, :title, :navigatable_id, :parent_id) + end end diff --git a/app/controllers/work_packages/moves_controller.rb b/app/controllers/work_packages/moves_controller.rb index 63bc9ccc33..26341c8c77 100644 --- a/app/controllers/work_packages/moves_controller.rb +++ b/app/controllers/work_packages/moves_controller.rb @@ -112,4 +112,3 @@ class WorkPackages::MovesController < ApplicationController end end - diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f2a6b03556..9298148d4c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -227,7 +227,7 @@ module ApplicationHelper def format_version_name(version) if version.project == @project - h(version) + h(version) else h("#{version.project} - #{version}") end diff --git a/app/helpers/query_menu_items_helper.rb b/app/helpers/query_menu_items_helper.rb index 230c2835ca..32675baac1 100644 --- a/app/helpers/query_menu_items_helper.rb +++ b/app/helpers/query_menu_items_helper.rb @@ -31,4 +31,4 @@ module QueryMenuItemsHelper def update_query_menu_item_path(project, query_menu_item) query_menu_item.persisted? ? query_menu_item_path(project, query_menu_item.query, query_menu_item) : query_menu_items_path(project, query_menu_item.query) end -end \ No newline at end of file +end diff --git a/app/helpers/sort_helper.rb b/app/helpers/sort_helper.rb index f677b9f91d..ca289d99dd 100644 --- a/app/helpers/sort_helper.rb +++ b/app/helpers/sort_helper.rb @@ -265,4 +265,3 @@ module SortHelper content_tag('th', sort_link(column, caption, default_order, :lang => lang), options) end end - diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb index f415ee83b1..33db9a77d1 100644 --- a/app/helpers/timelog_helper.rb +++ b/app/helpers/timelog_helper.rb @@ -67,10 +67,10 @@ module TimelogHelper end def select_hours(data, criteria, value) - if value.to_s.empty? - data.select {|row| row[criteria].blank? } + if value.to_s.empty? + data.select {|row| row[criteria].blank? } else - data.select {|row| row[criteria].to_s == value.to_s} + data.select {|row| row[criteria].to_s == value.to_s} end end diff --git a/app/models/board.rb b/app/models/board.rb index 6b8fd1b75b..64f8574833 100644 --- a/app/models/board.rb +++ b/app/models/board.rb @@ -36,7 +36,7 @@ class Board < ActiveRecord::Base belongs_to :last_message, :class_name => 'Message', :foreign_key => :last_message_id acts_as_list :scope => :project_id acts_as_watchable - + attr_protected :project_id validates_presence_of :name, :description diff --git a/app/models/group.rb b/app/models/group.rb index a70ebeab9a..537d5c1a9c 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -39,7 +39,7 @@ class Group < Principal before_destroy :remove_references_before_destroy - + alias_attribute(:groupname, :lastname) validates_presence_of :groupname validate :uniqueness_of_groupname @@ -109,8 +109,8 @@ class Group < Principal Journal::WorkPackageJournal.update_all({ :assigned_to_id => deleted_user.id }, { :assigned_to_id => id }) end - - + + def uniqueness_of_groupname groups_with_name = Group.where("lastname = ? AND id <> ?", groupname, id ? id : 0).count if groups_with_name > 0 diff --git a/app/models/group_user.rb b/app/models/group_user.rb index 0a7a5e619e..548486fc16 100644 --- a/app/models/group_user.rb +++ b/app/models/group_user.rb @@ -30,6 +30,6 @@ class GroupUser < ActiveRecord::Base belongs_to :group belongs_to :user - + validates_presence_of :group, :user end diff --git a/app/models/issue_priority_custom_field.rb b/app/models/issue_priority_custom_field.rb index 178c8ce1eb..1a558b8774 100644 --- a/app/models/issue_priority_custom_field.rb +++ b/app/models/issue_priority_custom_field.rb @@ -32,4 +32,3 @@ class IssuePriorityCustomField < CustomField :enumeration_work_package_priorities end end - diff --git a/app/models/menu_items/wiki_menu_item.rb b/app/models/menu_items/wiki_menu_item.rb index 1f7df7114e..d0402d7682 100644 --- a/app/models/menu_items/wiki_menu_item.rb +++ b/app/models/menu_items/wiki_menu_item.rb @@ -55,4 +55,4 @@ class MenuItems::WikiMenuItem < MenuItem def new_wiki_page=(value) options[:new_wiki_page] = value end -end \ No newline at end of file +end diff --git a/app/models/notifier.rb b/app/models/notifier.rb index c49cd49a8b..b15eeca2a5 100644 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@ -31,7 +31,7 @@ module Notifier def self.notify?(event) notified_events.include?(event.to_s) end - + def self.notified_events Setting.notified_events.to_a end diff --git a/app/models/query_custom_field_column.rb b/app/models/query_custom_field_column.rb index 157ac47f35..c5aef9e378 100644 --- a/app/models/query_custom_field_column.rb +++ b/app/models/query_custom_field_column.rb @@ -52,4 +52,3 @@ class QueryCustomFieldColumn < QueryColumn cv && @cf.cast_value(cv.value) end end - diff --git a/app/models/setting.rb b/app/models/setting.rb index 7a8ab5b2e4..41043048d4 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -30,15 +30,15 @@ class Setting < ActiveRecord::Base DATE_FORMATS = [ - '%Y-%m-%d', - '%d/%m/%Y', - '%d.%m.%Y', - '%d-%m-%Y', - '%m/%d/%Y', - '%d %b %Y', - '%d %B %Y', - '%b %d, %Y', - '%B %d, %Y' + '%Y-%m-%d', + '%d/%m/%Y', + '%d.%m.%Y', + '%d-%m-%Y', + '%m/%d/%Y', + '%d %b %Y', + '%d %B %Y', + '%b %d, %Y', + '%B %d, %Y' ] TIME_FORMATS = [ diff --git a/app/models/time_entry_activity_custom_field.rb b/app/models/time_entry_activity_custom_field.rb index 97d270ecc1..e2ac25b543 100644 --- a/app/models/time_entry_activity_custom_field.rb +++ b/app/models/time_entry_activity_custom_field.rb @@ -32,4 +32,3 @@ class TimeEntryActivityCustomField < CustomField :enumeration_activities end end - diff --git a/app/models/time_entry_custom_field.rb b/app/models/time_entry_custom_field.rb index b8170a4d23..de2a1345f3 100644 --- a/app/models/time_entry_custom_field.rb +++ b/app/models/time_entry_custom_field.rb @@ -32,4 +32,3 @@ class TimeEntryCustomField < CustomField :label_spent_time end end - diff --git a/app/models/token.rb b/app/models/token.rb index 23506330a1..c78f670694 100644 --- a/app/models/token.rb +++ b/app/models/token.rb @@ -30,7 +30,7 @@ class Token < ActiveRecord::Base belongs_to :user validates_uniqueness_of :value - + #attr_protected :user_id before_create :delete_previous_tokens diff --git a/app/models/user_custom_field.rb b/app/models/user_custom_field.rb index beafe9bb77..1042156bef 100644 --- a/app/models/user_custom_field.rb +++ b/app/models/user_custom_field.rb @@ -32,4 +32,3 @@ class UserCustomField < CustomField :label_user_plural end end - diff --git a/app/models/work_package.rb b/app/models/work_package.rb index e4200ef56a..672b4aa4d4 100644 --- a/app/models/work_package.rb +++ b/app/models/work_package.rb @@ -106,7 +106,7 @@ class WorkPackage < ActiveRecord::Base scope :with_author, lambda { |author| {:conditions => {:author_id => author.id}} } - + # <<< issues.rb <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< after_initialize :set_default_values diff --git a/app/models/work_package/scheduling_rules.rb b/app/models/work_package/scheduling_rules.rb index 47053f3157..59c9a774b3 100644 --- a/app/models/work_package/scheduling_rules.rb +++ b/app/models/work_package/scheduling_rules.rb @@ -64,4 +64,4 @@ module WorkPackage::SchedulingRules 1 end end -end \ No newline at end of file +end diff --git a/app/models/work_package/status_transitions.rb b/app/models/work_package/status_transitions.rb index 76f9928809..7c5aa2c2de 100644 --- a/app/models/work_package/status_transitions.rb +++ b/app/models/work_package/status_transitions.rb @@ -56,4 +56,4 @@ module WorkPackage::StatusTransitions end false end -end \ No newline at end of file +end diff --git a/app/models/work_package_custom_field.rb b/app/models/work_package_custom_field.rb index 901619adc5..5f165ee7fd 100644 --- a/app/models/work_package_custom_field.rb +++ b/app/models/work_package_custom_field.rb @@ -38,4 +38,3 @@ class WorkPackageCustomField < CustomField :label_work_package_plural end end - diff --git a/app/services/reports/assignee_report.rb b/app/services/reports/assignee_report.rb index 44d6960051..a7e8c4a7c6 100644 --- a/app/services/reports/assignee_report.rb +++ b/app/services/reports/assignee_report.rb @@ -49,4 +49,4 @@ class Reports::AssigneeReport < Reports::Report @title ||= WorkPackage.human_attribute_name(:assigned_to) end -end \ No newline at end of file +end diff --git a/app/services/reports/author_report.rb b/app/services/reports/author_report.rb index f634cf646c..0855699a46 100644 --- a/app/services/reports/author_report.rb +++ b/app/services/reports/author_report.rb @@ -48,4 +48,4 @@ class Reports::AuthorReport < Reports::Report def title @title ||= WorkPackage.human_attribute_name(:author) end -end \ No newline at end of file +end diff --git a/app/services/reports/category_report.rb b/app/services/reports/category_report.rb index 20eef05359..07842745df 100644 --- a/app/services/reports/category_report.rb +++ b/app/services/reports/category_report.rb @@ -48,4 +48,4 @@ class Reports::CategoryReport < Reports::Report def title @title ||= WorkPackage.human_attribute_name(:category) end -end \ No newline at end of file +end diff --git a/app/services/reports/priority_report.rb b/app/services/reports/priority_report.rb index 0eebbcb704..92e59cacac 100644 --- a/app/services/reports/priority_report.rb +++ b/app/services/reports/priority_report.rb @@ -48,4 +48,4 @@ class Reports::PriorityReport < Reports::Report def title @title ||= WorkPackage.human_attribute_name(:priority) end -end \ No newline at end of file +end diff --git a/app/services/reports/report.rb b/app/services/reports/report.rb index 8d4f008b87..a68d7fc096 100644 --- a/app/services/reports/report.rb +++ b/app/services/reports/report.rb @@ -63,11 +63,3 @@ class Reports::Report end end - - - - - - - - diff --git a/app/services/reports/subproject_report.rb b/app/services/reports/subproject_report.rb index aca2780f7f..43b6855e8c 100644 --- a/app/services/reports/subproject_report.rb +++ b/app/services/reports/subproject_report.rb @@ -48,4 +48,4 @@ class Reports::SubprojectReport < Reports::Report def title l(:label_subproject_plural) end -end \ No newline at end of file +end diff --git a/app/services/reports/type_report.rb b/app/services/reports/type_report.rb index e276d5ce65..a1d0564546 100644 --- a/app/services/reports/type_report.rb +++ b/app/services/reports/type_report.rb @@ -50,4 +50,3 @@ class Reports::TypeReport < Reports::Report end end - diff --git a/app/services/reports/version_report.rb b/app/services/reports/version_report.rb index c0f1ad2d9c..dcd7f5535d 100644 --- a/app/services/reports/version_report.rb +++ b/app/services/reports/version_report.rb @@ -49,4 +49,4 @@ class Reports::VersionReport < Reports::Report @title ||= WorkPackage.human_attribute_name(:version) end -end \ No newline at end of file +end diff --git a/app/views/admin/plugins.html.erb b/app/views/admin/plugins.html.erb index 3079671d2d..bde12a666b 100644 --- a/app/views/admin/plugins.html.erb +++ b/app/views/admin/plugins.html.erb @@ -37,8 +37,8 @@ See doc/COPYRIGHT.rdoc for more details. <%=h plugin.name %> <%= 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', link_to(h(plugin.url), plugin.url), :class => 'url') unless plugin.url.blank? %> + <%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %> <%=h plugin.version %> <%= link_to(l(:button_configure), :controller => '/settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %> diff --git a/app/views/admin/projects.html.erb b/app/views/admin/projects.html.erb index 7b9cfc31b3..cfe6da7003 100644 --- a/app/views/admin/projects.html.erb +++ b/app/views/admin/projects.html.erb @@ -28,7 +28,7 @@ See doc/COPYRIGHT.rdoc for more details. ++#%>
- <%= render :partial => 'no_data' if @no_configuration_data %> + <%= render :partial => 'no_data' if @no_configuration_data %>
<% content_for :action_menu_specific do %> @@ -64,9 +64,9 @@ See doc/COPYRIGHT.rdoc for more details. <% project_tree(@projects) do |project, level| %> <%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>"> - <%= link_to project, settings_project_path(project), :title => project.short_description %> - <%= checked_image project.is_public? %> - <%= format_date(project.created_on) %> + <%= link_to project, settings_project_path(project), :title => project.short_description %> + <%= checked_image project.is_public? %> + <%= format_date(project.created_on) %> <%= link_to(l(:button_archive), archive_project_path(project, :status => params[:status]), diff --git a/app/views/api/v3/work_packages/index.api.rabl b/app/views/api/v3/work_packages/index.api.rabl index 43dca73ba4..6ac49aa547 100644 --- a/app/views/api/v3/work_packages/index.api.rabl +++ b/app/views/api/v3/work_packages/index.api.rabl @@ -45,7 +45,7 @@ child @work_packages => :work_packages do when Version wp.send(column_name).as_json(only: [:id, :name]) when WorkPackage - wp.send(column_name).as_json(only: [:id, :name]) + wp.send(column_name).as_json(only: [:id, :subject]) else wp.send(column_name) end diff --git a/app/views/auth_sources/edit.html.erb b/app/views/auth_sources/edit.html.erb index 828158449d..02dceb8ec5 100644 --- a/app/views/auth_sources/edit.html.erb +++ b/app/views/auth_sources/edit.html.erb @@ -35,4 +35,3 @@ See doc/COPYRIGHT.rdoc for more details. <%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_save) %> <% end %> - diff --git a/app/views/auth_sources/index.html.erb b/app/views/auth_sources/index.html.erb index e19f6d7335..9946815d74 100644 --- a/app/views/auth_sources/index.html.erb +++ b/app/views/auth_sources/index.html.erb @@ -39,11 +39,11 @@ See doc/COPYRIGHT.rdoc for more details. - - - - - + + + + + <% for source in @auth_sources %> diff --git a/app/views/common/list_attachments.json.erb b/app/views/common/list_attachments.json.erb index 58edf7a1e6..ff2c5c1451 100644 --- a/app/views/common/list_attachments.json.erb +++ b/app/views/common/list_attachments.json.erb @@ -34,4 +34,4 @@ See doc/COPYRIGHT.rdoc for more details. :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 %> \ No newline at end of file + }.to_json.html_safe %> diff --git a/app/views/copy_projects/copy_settings/_block_checkbox.html.erb b/app/views/copy_projects/copy_settings/_block_checkbox.html.erb index 1efa383266..da3d7259f4 100644 --- a/app/views/copy_projects/copy_settings/_block_checkbox.html.erb +++ b/app/views/copy_projects/copy_settings/_block_checkbox.html.erb @@ -31,4 +31,4 @@ See doc/COPYRIGHT.rdoc for more details. <%= check_box_tag 'only[]', name, checked, :id => "only_#{name}" %> <%= "#{label} (#{count})" %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/custom_fields/_form.html.erb b/app/views/custom_fields/_form.html.erb index 558726ec01..9379a8a459 100644 --- a/app/views/custom_fields/_form.html.erb +++ b/app/views/custom_fields/_form.html.erb @@ -95,14 +95,14 @@ function toggle_custom_field_format() { if (p_searchable) Element.hide(p_searchable.parentNode); hide_and_disable(p_values); break; - case "user": + case "user": case "version": Element.hide(p_length.parentNode); Element.hide(p_regexp.parentNode); if (p_searchable) Element.hide(p_searchable.parentNode); hide_and_disable(p_values); Element.hide(p_default_value); - break; + break; default: Element.show(p_length.parentNode); Element.show(p_regexp.parentNode); @@ -206,7 +206,7 @@ jQuery(".locale_selector").each(function (index) { <%= check_box_tag "custom_field[type_ids][]", type.id, (@custom_field.types.include? type), :id => "custom_field_type_ids_#{type.id}" %> <%= content_tag :label, (type.is_standard) ? l(:label_custom_field_default_type) : h(type), :class => "no-css", :for => "custom_field_type_ids_#{type.id}" %> <% end %> - <%= hidden_field_tag "custom_field[type_ids][]", '' %> + <%= hidden_field_tag "custom_field[type_ids][]", '' %>  

<%= f.check_box :is_required %>

diff --git a/app/views/groups/_memberships.html.erb b/app/views/groups/_memberships.html.erb index d2f48c01cb..8f5ac45b0a 100644 --- a/app/views/groups/_memberships.html.erb +++ b/app/views/groups/_memberships.html.erb @@ -33,16 +33,16 @@ See doc/COPYRIGHT.rdoc for more details.
<% if @group.memberships.any? %>
<%= AuthSource.human_attribute_name(:name) %><%= AuthSource.human_attribute_name(:type) %><%= AuthSource.human_attribute_name(:host) %><%= l(:label_user_plural)%><%= AuthSource.human_attribute_name(:name) %><%= AuthSource.human_attribute_name(:type) %><%= AuthSource.human_attribute_name(:host) %><%= l(:label_user_plural)%>
- - - - - - - <% @group.memberships.each do |membership| %> - <% next if membership.new_record? %> - - + + + + + + + <% @group.memberships.each do |membership| %> + <% next if membership.new_record? %> + + - - + + <% end; reset_cycle %>
<%= Project.model_name.human %><%= l(:label_role_plural) %>
<%=h membership.project %>
<%= Project.model_name.human %><%= l(:label_role_plural) %>
<%=h membership.project %> <%=h membership.roles.sort.collect(&:to_s).join(', ') %> <%= form_tag(membership_of_group_path(@group, membership), @@ -50,7 +50,7 @@ See doc/COPYRIGHT.rdoc for more details. :remote => true, :id => "member-#{membership.id}-roles-form", :style => 'display:none;') do %> -

<% roles.each do |role| %> +

<% roles.each do |role| %>
<% end %>

<%= submit_tag l(:button_change) %> @@ -64,8 +64,8 @@ See doc/COPYRIGHT.rdoc for more details. :remote => true, :class => 'icon icon-delete' %>

<% else %> diff --git a/app/views/groups/_users.html.erb b/app/views/groups/_users.html.erb index 0cb667785c..5b3ed2d5ce 100644 --- a/app/views/groups/_users.html.erb +++ b/app/views/groups/_users.html.erb @@ -29,28 +29,28 @@ See doc/COPYRIGHT.rdoc for more details.
<% if @group.users.any? %> - - - - - - - <% @group.users.sort.each do |user| %> - - - + + <% end %> + +
<%= User.model_name.human %>
<%= link_to_user user %> + + + + + + + <% @group.users.sort.each do |user| %> + + + - - <% end %> - -
<%= User.model_name.human %>
<%= link_to_user user %> <%= link_to l(:button_delete), member_of_group_path(@group, user), :method => :delete, :remote => :true, :class => 'icon icon-delete' %> -
+
<% else %> -

<%= l(:label_no_data) %>

+

<%= l(:label_no_data) %>

<% end %>
@@ -60,8 +60,8 @@ See doc/COPYRIGHT.rdoc for more details. <%= form_tag(members_of_group_path(@group), :method => :post, :remote => true) do |f| %>
<%=l(:label_user_new)%> -

<%= label_tag "user_search", l(:label_user_search) %><%= text_field_tag 'user_search', nil %>

- <%= observe_field(:user_search, +

<%= label_tag "user_search", l(:label_user_search) %><%= text_field_tag 'user_search', nil %>

+ <%= observe_field(:user_search, :frequency => 0.5, :update => :users, :url => { :controller => '/groups', :action => 'autocomplete_for_user', :id => @group }, @@ -69,12 +69,12 @@ See doc/COPYRIGHT.rdoc for more details. :method => :get) %> -
- <%= principals_check_box_tags 'user_ids[]', users %> -
+
+ <%= principals_check_box_tags 'user_ids[]', users %> +

<%= submit_tag l(:button_add) %>

-
+ <% end %> <% end %> diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index bc4154af2d..20cb25b238 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -31,7 +31,7 @@ See doc/COPYRIGHT.rdoc for more details. default_breadcrumb) %> <% @page_header_title = l(:label_administration) %> <% content_for :main_menu do %> - <%= render :partial => 'admin/menu' %> + <%= render :partial => 'admin/menu' %> <% end %> <%= render :file => "layouts/base" %> diff --git a/app/views/members/_autocomplete_for_member.html.erb b/app/views/members/_autocomplete_for_member.html.erb index 598f8419e3..67cf0863b4 100644 --- a/app/views/members/_autocomplete_for_member.html.erb +++ b/app/views/members/_autocomplete_for_member.html.erb @@ -56,4 +56,3 @@ See doc/COPYRIGHT.rdoc for more details.

<%= submit_tag l(:button_add), :id => 'member-add-submit' %>

<% end %> - diff --git a/app/views/members/autocomplete_for_member.json.erb b/app/views/members/autocomplete_for_member.json.erb index 86340318bc..54b7846a44 100644 --- a/app/views/members/autocomplete_for_member.json.erb +++ b/app/views/members/autocomplete_for_member.json.erb @@ -31,12 +31,12 @@ See doc/COPYRIGHT.rdoc for more details. "results": { "items":[ - <% @principals.each_with_index do |principal, ix| %> + <% @principals.each_with_index do |principal, ix| %> { "id": <%= principal.id.to_json.html_safe %>, "name": <%= principal.name.to_json.html_safe %> - } <%= "," unless ix == @principals.length - 1 %> - <% end %> ], + } <%= "," unless ix == @principals.length - 1 %> + <% end %> ], "total": <%= @total ? @total : @principals.size %>, "more": <%= @more ? @more : 0 %> } diff --git a/app/views/messages/_form.html.erb b/app/views/messages/_form.html.erb index 56b89abc7b..c64756450b 100644 --- a/app/views/messages/_form.html.erb +++ b/app/views/messages/_form.html.erb @@ -46,7 +46,7 @@ See doc/COPYRIGHT.rdoc for more details.

<% if !replying && !@message.new_record? && User.current.allowed_to?(:edit_messages, @project) %> -


+


<%= f.select :board_id, @project.boards.collect {|b| [b.name, b.id]} %>

<% end %> diff --git a/app/views/my/page_layout.html.erb b/app/views/my/page_layout.html.erb index c74d111e9b..8da1b4b6d1 100644 --- a/app/views/my/page_layout.html.erb +++ b/app/views/my/page_layout.html.erb @@ -34,9 +34,9 @@ function recreateSortables() { Sortable.destroy('list-left'); Sortable.destroy('list-right'); - Sortable.create("list-top", {constraint:false, containment:['list-top','list-left','list-right'], dropOnEmpty:true, handle:'handle', onUpdate:function(){new Ajax.Request('<%= url_for(:controller => '/my', :action => 'order_blocks', :group => 'top') %>', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("list-top")})}, only:'mypage-box', tag:'div'}) - Sortable.create("list-left", {constraint:false, containment:['list-top','list-left','list-right'], dropOnEmpty:true, handle:'handle', onUpdate:function(){new Ajax.Request('<%= url_for(:controller => '/my', :action => 'order_blocks', :group => 'left') %>', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("list-left")})}, only:'mypage-box', tag:'div'}) - Sortable.create("list-right", {constraint:false, containment:['list-top','list-left','list-right'], dropOnEmpty:true, handle:'handle', onUpdate:function(){new Ajax.Request('<%= url_for(:controller => '/my', :action => 'order_blocks', :group => 'right') %>', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("list-right")})}, only:'mypage-box', tag:'div'}) + Sortable.create("list-top", {constraint:false, containment:['list-top','list-left','list-right'], dropOnEmpty:true, handle:'handle', onUpdate:function(){new Ajax.Request('<%= url_for(:controller => '/my', :action => 'order_blocks', :group => 'top') %>', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("list-top")})}, only:'mypage-box', tag:'div'}) + Sortable.create("list-left", {constraint:false, containment:['list-top','list-left','list-right'], dropOnEmpty:true, handle:'handle', onUpdate:function(){new Ajax.Request('<%= url_for(:controller => '/my', :action => 'order_blocks', :group => 'left') %>', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("list-left")})}, only:'mypage-box', tag:'div'}) + Sortable.create("list-right", {constraint:false, containment:['list-top','list-left','list-right'], dropOnEmpty:true, handle:'handle', onUpdate:function(){new Ajax.Request('<%= url_for(:controller => '/my', :action => 'order_blocks', :group => 'right') %>', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("list-right")})}, only:'mypage-box', tag:'div'}) } function updateSelect() { @@ -87,24 +87,24 @@ function removeBlock(block) { <%= render :partial => 'layouts/action_menu_specific' %>
- <% @blocks['top'].each do |b| - next unless MyController.available_blocks.keys.include? b %> - <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %> - <% end if @blocks['top'] %> + <% @blocks['top'].each do |b| + next unless MyController.available_blocks.keys.include? b %> + <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %> + <% end if @blocks['top'] %>
- <% @blocks['left'].each do |b| - next unless MyController.available_blocks.keys.include? b %> - <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %> - <% end if @blocks['left'] %> + <% @blocks['left'].each do |b| + next unless MyController.available_blocks.keys.include? b %> + <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %> + <% end if @blocks['left'] %>
- <% @blocks['right'].each do |b| - next unless MyController.available_blocks.keys.include? b %> - <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %> - <% end if @blocks['right'] %> + <% @blocks['right'].each do |b| + next unless MyController.available_blocks.keys.include? b %> + <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %> + <% end if @blocks['right'] %>
<%= sortable_element 'list-top', diff --git a/app/views/projects/form/attributes/_project_type_id.html.erb b/app/views/projects/form/attributes/_project_type_id.html.erb index 984fc7222c..91cb1f18fe 100644 --- a/app/views/projects/form/attributes/_project_type_id.html.erb +++ b/app/views/projects/form/attributes/_project_type_id.html.erb @@ -27,4 +27,4 @@ See doc/COPYRIGHT.rdoc for more details. ++#%> -

<%= form.select :project_type_id, options_for_project_types, :include_blank => true %>

\ No newline at end of file +

<%= form.select :project_type_id, options_for_project_types, :include_blank => true %>

diff --git a/app/views/projects/settings/_boards.html.erb b/app/views/projects/settings/_boards.html.erb index eb8d29cd64..8b8b3c1833 100644 --- a/app/views/projects/settings/_boards.html.erb +++ b/app/views/projects/settings/_boards.html.erb @@ -29,16 +29,16 @@ See doc/COPYRIGHT.rdoc for more details. <% if @project.boards.any? %> - - - - - - - + + + + + + + <% @project.boards.each do |board| - next if board.new_record? %> - + next if board.new_record? %> + - + <% end %> - +
<%= Board.model_name.human %><%= Board.human_attribute_name(:description) %>
<%= Board.model_name.human %><%= Board.human_attribute_name(:description) %>
<%=h board.name %> <%=h board.description %> @@ -50,9 +50,9 @@ See doc/COPYRIGHT.rdoc for more details. <%= link_to_if_authorized l(:button_edit), {:controller => '/boards', :action => 'edit', :project_id => @project, :id => board}, :class => 'icon icon-edit' %> <%= link_to_if_authorized l(:button_delete), {:controller => '/boards', :action => 'destroy', :project_id => @project, :id => board}, :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-delete' %>
<% else %>

<%= l(:label_no_data) %>

diff --git a/app/views/projects/settings/_categories.html.erb b/app/views/projects/settings/_categories.html.erb index e451c254f2..86121d36a3 100644 --- a/app/views/projects/settings/_categories.html.erb +++ b/app/views/projects/settings/_categories.html.erb @@ -29,15 +29,15 @@ See doc/COPYRIGHT.rdoc for more details. <% if @project.categories.any? %> - - - - - - + + + + + + <% for category in @project.categories %> - <% unless category.new_record? %> - + <% unless category.new_record? %> + - - <% end %> + + <% end %> <% end %>
<%= Category.model_name.human %><%= Category.human_attribute_name(:assigned_to) %>
<%= Category.model_name.human %><%= Category.human_attribute_name(:assigned_to) %>
<%=h(category.name) %> <%=h(category.assigned_to.name) if category.assigned_to %> @@ -50,8 +50,8 @@ See doc/COPYRIGHT.rdoc for more details. :confirm => l(:text_are_you_sure), :class => 'icon icon-delete' %>
diff --git a/app/views/queries/_filters.html.erb b/app/views/queries/_filters.html.erb index ea0351afb7..151fc3870f 100644 --- a/app/views/queries/_filters.html.erb +++ b/app/views/queries/_filters.html.erb @@ -52,7 +52,7 @@ function toggle_filter(field) { if (check_box.checked) { Element.show("operators_" + field); - Form.Element.enable("operators_" + field); + Form.Element.enable("operators_" + field); Form.Element.enable("values_" + field); toggle_operator(field); } else { diff --git a/app/views/repositories/committers.html.erb b/app/views/repositories/committers.html.erb index f9415b58ce..fdea77b4d0 100644 --- a/app/views/repositories/committers.html.erb +++ b/app/views/repositories/committers.html.erb @@ -38,26 +38,26 @@ See doc/COPYRIGHT.rdoc for more details. <%= form_tag({}) do %> - - - - + + + + <% i = 0 -%> <% @committers.each do |committer, user_id| -%> - - - - - <% i += 1 -%> + + + + + <% i += 1 -%> <% end -%>
<%= User.human_attribute_name(:login) %><%= User.model_name.human %>
<%= User.human_attribute_name(:login) %><%= User.model_name.human %>
<%=h committer %> - <%= hidden_field_tag "committers[#{i}][]", committer %> - <%= select_tag "committers[#{i}][]", content_tag('option', "-- #{l :actionview_instancetag_blank_option} --", :value => '') + options_from_collection_for_select(@users, 'id', 'name', user_id.to_i) %> -
<%=h committer %> + <%= hidden_field_tag "committers[#{i}][]", committer %> + <%= select_tag "committers[#{i}][]", content_tag('option', "-- #{l :actionview_instancetag_blank_option} --", :value => '') + options_from_collection_for_select(@users, 'id', 'name', user_id.to_i) %> +

<%= submit_tag(l(:button_update)) %>

<% end %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/settings/_mail_handler.html.erb b/app/views/settings/_mail_handler.html.erb index e87a9df651..905d5636b3 100644 --- a/app/views/settings/_mail_handler.html.erb +++ b/app/views/settings/_mail_handler.html.erb @@ -38,11 +38,11 @@ See doc/COPYRIGHT.rdoc for more details.

<%= setting_check_box :mail_handler_api_enabled, - :onclick => "if (this.checked) { Form.Element.enable('settings_mail_handler_api_key'); } else { Form.Element.disable('settings_mail_handler_api_key'); }"%>

+ :onclick => "if (this.checked) { Form.Element.enable('settings_mail_handler_api_key'); } else { Form.Element.disable('settings_mail_handler_api_key'); }"%>

<%= setting_text_field :mail_handler_api_key, :size => 30, - :id => 'settings_mail_handler_api_key', - :disabled => !Setting.mail_handler_api_enabled? %> + :id => 'settings_mail_handler_api_key', + :disabled => !Setting.mail_handler_api_enabled? %> <%= link_to_function l(:label_generate_key), "if ($('settings_mail_handler_api_key').disabled == false) { $('settings_mail_handler_api_key').value = randomKey(20) }" %>

diff --git a/app/views/settings/_projects.html.erb b/app/views/settings/_projects.html.erb index 75ad4b4ddd..edff44224d 100644 --- a/app/views/settings/_projects.html.erb +++ b/app/views/settings/_projects.html.erb @@ -38,8 +38,8 @@ See doc/COPYRIGHT.rdoc for more details.

<%= setting_check_box :sequential_project_identifiers %>

<%= setting_select :new_project_user_role_id, - Role.find_all_givable.collect {|r| [r.name, r.id.to_s]}, - :blank => "--- #{l(:actionview_instancetag_blank_option)} ---" %>

+ Role.find_all_givable.collect {|r| [r.name, r.id.to_s]}, + :blank => "--- #{l(:actionview_instancetag_blank_option)} ---" %>

<%= submit_tag l(:button_save) %> diff --git a/app/views/settings/_repositories.html.erb b/app/views/settings/_repositories.html.erb index 58962ec3c4..73a1d3d60c 100644 --- a/app/views/settings/_repositories.html.erb +++ b/app/views/settings/_repositories.html.erb @@ -33,12 +33,12 @@ See doc/COPYRIGHT.rdoc for more details.

<%= setting_check_box :autofetch_changesets %>

<%= setting_check_box :sys_api_enabled, - :onclick => "if (this.checked) { Form.Element.enable('settings_sys_api_key'); } else { Form.Element.disable('settings_sys_api_key'); }" %>

+ :onclick => "if (this.checked) { Form.Element.enable('settings_sys_api_key'); } else { Form.Element.disable('settings_sys_api_key'); }" %>

<%= setting_text_field :sys_api_key, :size => 30, - :id => 'settings_sys_api_key', - :disabled => !Setting.sys_api_enabled?, - :label => :setting_mail_handler_api_key %> + :id => 'settings_sys_api_key', + :disabled => !Setting.sys_api_enabled?, + :label => :setting_mail_handler_api_key %> <%= link_to_function l(:label_generate_key), "if ($('settings_sys_api_key').disabled == false) { $('settings_sys_api_key').value = randomKey(20) }" %>

diff --git a/app/views/time_entries/reports/show.html.erb b/app/views/time_entries/reports/show.html.erb index 23006d9749..6d760a50d4 100644 --- a/app/views/time_entries/reports/show.html.erb +++ b/app/views/time_entries/reports/show.html.erb @@ -102,4 +102,3 @@ See doc/COPYRIGHT.rdoc for more details. <% end %> <% html_title l(:label_spent_time), l(:label_report) %> - diff --git a/app/views/timelines/_custom_fields.html.erb b/app/views/timelines/_custom_fields.html.erb index 27fea9517d..541c405942 100644 --- a/app/views/timelines/_custom_fields.html.erb +++ b/app/views/timelines/_custom_fields.html.erb @@ -60,4 +60,4 @@ custom_fields.each do |custom_field| <% end end -%> \ No newline at end of file +%> diff --git a/app/views/timelines/_timeline.html.erb b/app/views/timelines/_timeline.html.erb index e690ef5375..9305d05b6c 100644 --- a/app/views/timelines/_timeline.html.erb +++ b/app/views/timelines/_timeline.html.erb @@ -67,4 +67,3 @@ See doc/COPYRIGHT.rdoc for more details. <% @timeline_header_included = true %> <% end %> <% end %> - diff --git a/app/views/timelog/edit.html.erb b/app/views/timelog/edit.html.erb index 0006ac300f..d31905bd75 100644 --- a/app/views/timelog/edit.html.erb +++ b/app/views/timelog/edit.html.erb @@ -40,7 +40,7 @@ See doc/COPYRIGHT.rdoc for more details.

<%= f.text_field :comments, :size => 100 %>

<%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %>

<% @time_entry.custom_field_values.each do |value| %> -

<%= custom_field_tag_with_label :time_entry, value %>

+

<%= custom_field_tag_with_label :time_entry, value %>

<% end %> <%= call_hook(:view_timelog_edit_form_bottom, { :time_entry => @time_entry, :form => f }) %> diff --git a/app/views/types/_form.html.erb b/app/views/types/_form.html.erb index 7787faf6f1..c3152f4738 100644 --- a/app/views/types/_form.html.erb +++ b/app/views/types/_form.html.erb @@ -41,13 +41,13 @@ See doc/COPYRIGHT.rdoc for more details. <% if WorkPackageCustomField.all.any? %>

- - <% WorkPackageCustomField.all.each do |field| %> - - <% end %> + + <% WorkPackageCustomField.all.each do |field| %> + + <% end %>

<%= hidden_field_tag 'type[custom_field_ids][]', '' %> <% end %> diff --git a/app/views/user_mailer/work_package_added.html.erb b/app/views/user_mailer/work_package_added.html.erb index 7621f629d8..20b58f208f 100644 --- a/app/views/user_mailer/work_package_added.html.erb +++ b/app/views/user_mailer/work_package_added.html.erb @@ -30,5 +30,3 @@ See doc/COPYRIGHT.rdoc for more details. <%= t(:text_work_package_added, :id => "##{@issue.id}", :author => @issue.author) %>
<%= render :partial => 'issue_details', :locals => { :issue => @issue } %> - - diff --git a/app/views/users/_mail_notifications.html.erb b/app/views/users/_mail_notifications.html.erb index b492f2f69d..5602c7b697 100644 --- a/app/views/users/_mail_notifications.html.erb +++ b/app/views/users/_mail_notifications.html.erb @@ -39,4 +39,3 @@ See doc/COPYRIGHT.rdoc for more details.

<%= l(:text_user_mail_option) %>

<% end %>

- diff --git a/app/views/users/_memberships.html.erb b/app/views/users/_memberships.html.erb index c88a5b9b1f..a21b2f9d2c 100644 --- a/app/views/users/_memberships.html.erb +++ b/app/views/users/_memberships.html.erb @@ -33,16 +33,16 @@ See doc/COPYRIGHT.rdoc for more details.
<% if @user.memberships.any? %> - - - - + + + + <%= call_hook(:view_users_memberships_table_header, :user => @user )%> - - - <% @user.memberships.each do |membership| %> - <% next if membership.new_record? %> - + + + <% @user.memberships.each do |membership| %> + <% next if membership.new_record? %> + @@ -51,9 +51,9 @@ See doc/COPYRIGHT.rdoc for more details. <%= form_for(:membership, :remote => true, :url => { :action => 'edit_membership', :id => @user, :membership_id => membership }, :html => { :id => "member-#{membership.id}-roles-form", :style => 'display:none;'}) do %> -

<% roles.each do |role| %> +

<% roles.each do |role| %>
+ :disabled => membership.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %>
<% end %>

<%= submit_tag l(:button_change) %> <%= link_to_function l(:button_cancel), "$('member-#{membership.id}-roles').show(); $('member-#{membership.id}-roles-form').hide(); return false;" %>

@@ -70,9 +70,9 @@ See doc/COPYRIGHT.rdoc for more details. :class => 'icon icon-delete') if membership.deletable? %> <%= call_hook(:view_users_memberships_table_row, :user => @user, :membership => membership, :roles => roles, :projects => projects )%> - + <% end; reset_cycle %> - +
<%= Project.model_name.human %><%= l(:label_role_plural) %>
<%= Project.model_name.human %><%= l(:label_role_plural) %>
<%= link_to_project membership.project %>
<% else %>

<%= l(:label_no_data) %>

diff --git a/app/views/users/_preferences.html.erb b/app/views/users/_preferences.html.erb index 65c84f1073..1f0a6310a5 100644 --- a/app/views/users/_preferences.html.erb +++ b/app/views/users/_preferences.html.erb @@ -36,4 +36,3 @@ See doc/COPYRIGHT.rdoc for more details.

<%= pref_fields.select :theme, OpenProject::Themes.all.map {|t| [t.name, t.identifier]}, :label => :label_theme %>

<% end %> <% end %> - diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 261bc12b0b..679239d486 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -65,10 +65,10 @@ See doc/COPYRIGHT.rdoc for more details. - <%= sort_header_tag('login', :caption => User.human_attribute_name(:login)) %> - <%= sort_header_tag('firstname', :caption => User.human_attribute_name(:firstname)) %> - <%= sort_header_tag('lastname', :caption => User.human_attribute_name(:lastname)) %> - <%= sort_header_tag('mail', :caption => User.human_attribute_name(:mail)) %> + <%= sort_header_tag('login', :caption => User.human_attribute_name(:login)) %> + <%= sort_header_tag('firstname', :caption => User.human_attribute_name(:firstname)) %> + <%= sort_header_tag('lastname', :caption => User.human_attribute_name(:lastname)) %> + <%= sort_header_tag('mail', :caption => User.human_attribute_name(:mail)) %> <%= sort_header_tag('admin', :caption => User.human_attribute_name(:admin), :default_order => 'desc') %> <%= sort_header_tag('created_on', :caption => User.human_attribute_name(:created_on), :default_order => 'desc') %> <%= sort_header_tag('last_login_on', :caption => User.human_attribute_name(:last_login_on), :default_order => 'desc') %> @@ -79,11 +79,11 @@ See doc/COPYRIGHT.rdoc for more details. <% for user in @users -%> <%= %w(anon active registered locked)[user.status] %> <%= 'blocked' if user.failed_too_many_recent_login_attempts? %>"> - - - - - + + + + + " @@ -539,13 +539,13 @@ class RedCloth3 < String LISTS_CONTENT_RE = /^([#*]+)(#{A}#{C}) (.*)$/m # Parses Textile lists and generates HTML - def block_textile_lists( text ) + def block_textile_lists( text ) text.gsub!( LISTS_RE ) do |match| lines = match.split( /\n/ ) last_line = -1 depth = [] lines.each_with_index do |line, line_id| - if line =~ LISTS_CONTENT_RE + if line =~ LISTS_CONTENT_RE tl,atts,content = $~[1..3] if depth.last if depth.last.length > tl.length @@ -581,17 +581,17 @@ class RedCloth3 < String lines.join( "\n" ) end end - + QUOTES_RE = /(^>+([^\n]*?)(\n|$))+/m QUOTES_CONTENT_RE = /^([> ]+)(.*)$/m - + def block_textile_quotes( text ) text.gsub!( QUOTES_RE ) do |match| lines = match.split( /\n/ ) quotes = '' indent = 0 lines.each do |line| - line =~ QUOTES_CONTENT_RE + line =~ QUOTES_CONTENT_RE bq,content = $1, $2 l = bq.count('>') if l != indent @@ -612,7 +612,7 @@ class RedCloth3 < String @ (?=\W)/x - def inline_textile_code( text ) + def inline_textile_code( text ) text.gsub!( CODE_RE ) do |m| before,lang,code,after = $~[1..4] lang = " lang=\"#{ lang }\"" if lang @@ -620,7 +620,7 @@ class RedCloth3 < String end end - def lT( text ) + def lT( text ) text =~ /\#$/ ? 'o' : 'u' end @@ -655,7 +655,7 @@ class RedCloth3 < String end end - block_applied = 0 + block_applied = 0 @rules.each do |rule_name| block_applied += 1 if ( rule_name.to_s.match /^block_/ and method( rule_name ).call( blk ) ) end @@ -702,7 +702,7 @@ class RedCloth3 < String BLOCK_RE = /^(([a-z]+)(\d*))(#{A}#{C})\.(?::(\S+))? (.*)$/m - def block_textile_prefix( text ) + def block_textile_prefix( text ) if text =~ BLOCK_RE tag,tagpre,num,atts,cite,content = $~[1..6] atts = pba( atts ) @@ -712,12 +712,12 @@ class RedCloth3 < String if respond_to? "textile_#{ tag }", true replacement = method( "textile_#{ tag }" ).call( tag, atts, cite, content ) elsif respond_to? "textile_#{ tagpre }_", true - replacement = method( "textile_#{ tagpre }_" ).call( tagpre, num, atts, cite, content ) + replacement = method( "textile_#{ tagpre }_" ).call( tagpre, num, atts, cite, content ) end text.gsub!( $& ) { replacement } if replacement end end - + SETEXT_RE = /\A(.+?)\n([=-])[=-]* *$/m def block_markdown_setext( text ) if text =~ SETEXT_RE @@ -769,10 +769,10 @@ class RedCloth3 < String def block_markdown_lists( text ) end - def inline_textile_span( text ) + def inline_textile_span( text ) QTAGS.each do |qtag_rc, ht, qtag_re, rtype| text.gsub!( qtag_re ) do |m| - + case rtype when :limit sta,oqs,qtag,content,oqa = $~[1..6] @@ -805,14 +805,14 @@ class RedCloth3 < String ( # $url (\/|[a-zA-Z]+:\/\/|www\.|mailto:) # $proto [\w\/]\S+? - ) + ) (\/)? # $slash ([^\w\=\/;\(\)]*?) # $post ) (?=<|\s|$) - /x + /x #" - def inline_textile_link( text ) + def inline_textile_link( text ) text.gsub!( LINK_RE ) do |m| all,pre,atts,text,title,url,proto,slash,post = $~[1..9] if text.include?('
') @@ -820,7 +820,7 @@ class RedCloth3 < String else url, url_title = check_refs( url ) title ||= url_title - + # Idea below : an URL with unbalanced parethesis and # ending by ')' is put into external parenthesis if ( url[-1]==?) and ((url.count("(") - url.count(")")) < 0 ) ) @@ -831,9 +831,9 @@ class RedCloth3 < String atts = " href=\"#{ htmlesc url }#{ slash }\"#{ atts }" atts << " title=\"#{ htmlesc title }\"" if title atts = shelve( atts ) if atts - + external = (url =~ /^https?:\/\//) ? ' class="external"' : '' - + "#{ pre }#{ text }#{ post }" end end @@ -844,9 +844,9 @@ class RedCloth3 < String [ ]? # opt. space (?:\n[ ]*)? # one optional newline followed by spaces \[(.*?)\] # $id - /x + /x - def inline_markdown_reflink( text ) + def inline_markdown_reflink( text ) text.gsub!( MARKDOWN_REFLINK_RE ) do |m| text, id = $~[1..2] @@ -855,11 +855,11 @@ class RedCloth3 < String else url, title = check_refs( id ) end - + atts = " href=\"#{ url }\"" atts << " title=\"#{ title }\"" if title atts = shelve( atts ) - + "#{ text }" end end @@ -876,16 +876,16 @@ class RedCloth3 < String \3 # matching quote )? # title is optional \) - /x + /x - def inline_markdown_link( text ) + def inline_markdown_link( text ) text.gsub!( MARKDOWN_LINK_RE ) do |m| text, url, quote, title = $~[1..4] atts = " href=\"#{ url }\"" atts << " title=\"#{ title }\"" if title atts = shelve( atts ) - + "#{ text }" end end @@ -899,14 +899,14 @@ class RedCloth3 < String end end - def refs_textile( text ) + def refs_textile( text ) text.gsub!( TEXTILE_REFS_RE ) do |m| flag, url = $~[2..3] @urlrefs[flag.downcase] = [url, nil] nil end end - + def refs_markdown( text ) text.gsub!( MARKDOWN_REFS_RE ) do |m| flag, url = $~[2..3] @@ -916,7 +916,7 @@ class RedCloth3 < String end end - def check_refs( text ) + def check_refs( text ) ret = @urlrefs[text.downcase] if text ret || [text, nil] end @@ -932,16 +932,16 @@ class RedCloth3 < String (?:\(((?:[^\(\)]|\([^\)]+\))+?)\))? # optional title \! # closing (?::#{ HYPERLINK })? # optional href - /x + /x - def inline_textile_image( text ) + def inline_textile_image( text ) text.gsub!( IMAGE_RE ) do |m| stln,algn,atts,url,title,href,href_a1,href_a2 = $~[1..8] htmlesc title atts = pba( atts ) atts = " src=\"#{ htmlesc url.dup }\"#{ atts }" atts << " title=\"#{ title }\"" if title - atts << " alt=\"#{ title }\"" + atts << " alt=\"#{ title }\"" # size = @getimagesize($url); # if($size) $atts.= " $size[3]"; @@ -952,8 +952,8 @@ class RedCloth3 < String out << "" if href out << "" out << "#{ href_a1 }#{ href_a2 }" if href - - if algn + + if algn algn = h_align( algn ) if stln == "

" out = "

#{ out }" @@ -968,18 +968,18 @@ class RedCloth3 < String end end - def shelve( val ) + def shelve( val ) @shelf << val " :redsh##{ @shelf.length }:" end - - def retrieve( text ) + + def retrieve( text ) @shelf.each_with_index do |r, i| text.gsub!( " :redsh##{ i + 1 }:", r ) end end - def incoming_entities( text ) + def incoming_entities( text ) ## turn any incoming ampersands into a dummy character for now. ## This uses a negative lookahead for alphanumerics followed by a semicolon, ## implying an incoming html entity, to be skipped @@ -987,14 +987,14 @@ class RedCloth3 < String text.gsub!( /&(?![#a-z0-9]+;)/i, "x%x%" ) end - def no_textile( text ) + def no_textile( text ) text.gsub!( /(^|\s)==([^=]+.*?)==(\s|$)?/, '\1\2\3' ) text.gsub!( /^ *==([^=]+.*?)==/m, '\1\2\3' ) end - def clean_white_space( text ) + def clean_white_space( text ) # normalize line breaks text.gsub!( /\r\n/, "\n" ) text.gsub!( /\r/, "\n" ) @@ -1020,11 +1020,11 @@ class RedCloth3 < String end end - def footnote_ref( text ) + def footnote_ref( text ) text.gsub!( /\b\[([0-9]+?)\](\s)?/, '\1\2' ) end - + OFFTAGS = /(code|pre|kbd|notextile)/ OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }\W|\Z)/mi OFFTAG_OPEN = /<#{ OFFTAGS }/ @@ -1046,7 +1046,7 @@ class RedCloth3 < String elsif line =~ OFFTAG_CLOSE codepre -= 1 codepre = 0 if codepre < 0 - end + end elsif codepre.zero? glyphs_textile( line, level + 1 ) else @@ -1093,7 +1093,7 @@ class RedCloth3 < String end codepre -= 1 unless codepre.zero? used_offtags = {} if codepre.zero? - end + end line end end @@ -1107,7 +1107,7 @@ class RedCloth3 < String end end - def inline( text ) + def inline( text ) [/^inline_/, /^glyphs_/].each do |meth_re| @rules.each do |rule_name| method( rule_name ).call( text ) if rule_name.to_s.match( meth_re ) @@ -1115,11 +1115,11 @@ class RedCloth3 < String end end - def h_align( text ) + def h_align( text ) H_ALGN_VALS[text] end - def v_align( text ) + def v_align( text ) V_ALGN_VALS[text] end @@ -1133,7 +1133,7 @@ class RedCloth3 < String 'img' => ['src', 'alt', 'title'], 'br' => [], 'i' => nil, - 'u' => nil, + 'u' => nil, 'b' => nil, 'pre' => nil, 'kbd' => nil, @@ -1158,7 +1158,7 @@ class RedCloth3 < String 'h3' => nil, 'h4' => nil, 'h5' => nil, - 'h6' => nil, + 'h6' => nil, 'blockquote' => ['cite'] } @@ -1186,11 +1186,10 @@ class RedCloth3 < String end end end - + ALLOWED_TAGS = %w(redpre pre code notextile) - + def escape_html_tags(text) text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "<#{$1}#{'>' unless $3.blank?}" } end end - diff --git a/lib/redmine/menu_manager/mapper.rb b/lib/redmine/menu_manager/mapper.rb index 2be8dc57db..573d799762 100644 --- a/lib/redmine/menu_manager/mapper.rb +++ b/lib/redmine/menu_manager/mapper.rb @@ -131,4 +131,4 @@ class Redmine::MenuManager::MapDeferrer defer(method, *args) end end -end \ No newline at end of file +end diff --git a/lib/redmine/wiki_formatting/null_formatter/formatter.rb b/lib/redmine/wiki_formatting/null_formatter/formatter.rb index 95d8bd0cc5..428e0e76e7 100644 --- a/lib/redmine/wiki_formatting/null_formatter/formatter.rb +++ b/lib/redmine/wiki_formatting/null_formatter/formatter.rb @@ -46,4 +46,4 @@ module Redmine end end end -end \ No newline at end of file +end diff --git a/lib/redmine/wiki_formatting/null_formatter/helper.rb b/lib/redmine/wiki_formatting/null_formatter/helper.rb index 440c3cb1ec..c9afada16b 100644 --- a/lib/redmine/wiki_formatting/null_formatter/helper.rb +++ b/lib/redmine/wiki_formatting/null_formatter/helper.rb @@ -43,4 +43,4 @@ module Redmine end end end -end \ No newline at end of file +end diff --git a/public/templates/components/selectable_title.html b/public/templates/components/selectable_title.html index 4f6f963238..4d18e48002 100644 --- a/public/templates/components/selectable_title.html +++ b/public/templates/components/selectable_title.html @@ -8,13 +8,15 @@ -

- +
diff --git a/public/templates/work_packages.html b/public/templates/work_packages.html index 9a0f9f45e2..6cb3cadd6f 100644 --- a/public/templates/work_packages.html +++ b/public/templates/work_packages.html @@ -19,7 +19,7 @@
  • @@ -59,8 +59,8 @@
  • <%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %><%= h(user.firstname) %><%= h(user.lastname) %><%= checked_image user.admin? %><%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %><%= h(user.firstname) %><%= h(user.lastname) %><%= checked_image user.admin? %> <%= format_time(user.created_on) %>