Merge branch 'release/5.0' into dev

pull/4091/merge
Oliver Günther 9 years ago
commit 9a91256176
  1. 4
      app/assets/stylesheets/content/_in_place_editing.sass
  2. 4
      app/controllers/activities_controller.rb
  3. 1
      app/controllers/boards_controller.rb
  4. 1
      app/controllers/groups_controller.rb
  5. 1
      app/controllers/news_controller.rb
  6. 5
      app/controllers/projects_controller.rb
  7. 1
      app/controllers/roles_controller.rb
  8. 14
      app/controllers/wiki_controller.rb
  9. 2
      app/helpers/application_helper.rb
  10. 4
      app/views/account/_login.html.erb
  11. 2
      app/views/my/page_layout.html.erb
  12. 3
      config/locales/en.yml
  13. 4
      frontend/app/components/routing/controllers/work-packages-list.controller.js
  14. 4
      frontend/app/templates/work_packages/menus/query_select_dropdown_menu.html
  15. 10
      frontend/app/work_packages/controllers/menus/query-select-dropdown-menu-controller.js

@ -176,6 +176,10 @@
.user-field-user-link
display: inline
.macro-unavailable.permanent
position: relative
top: 0
.inplace-edit--preview
border: 1px solid $inplace-edit--border-color
padding: 0.375rem

@ -39,7 +39,7 @@ class ActivitiesController < ApplicationController
begin; @date_to = params[:from].to_date + 1; rescue; end
end
@date_to ||= Date.today + 1
@date_to ||= User.current.today + 1
@date_from = @date_to - @days
@with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_work_packages? : (params[:with_subprojects] == '1')
@author = (params[:user_id].blank? ? nil : User.active.find(params[:user_id]))
@ -56,7 +56,7 @@ class ActivitiesController < ApplicationController
if events.empty? || stale?(etag: [@activity.scope, @date_to, @date_from, @with_subprojects, @author, events.first, User.current, current_language])
respond_to do |format|
format.html do
@events_by_day = events.group_by { |e| e.event_datetime.to_date }
@events_by_day = events.group_by { |e| e.event_datetime.in_time_zone(User.current.time_zone).to_date }
render layout: false if request.xhr?
end
format.atom do

@ -135,6 +135,7 @@ class BoardsController < ApplicationController
def destroy
@board.destroy
flash[:notice] = l(:notice_successful_delete)
redirect_to_settings_in_projects
end

@ -111,6 +111,7 @@ class GroupsController < ApplicationController
@group.destroy
respond_to do |format|
flash[:notice] = l(:notice_successful_delete)
format.html do redirect_to(groups_url) end
format.xml do head :ok end
end

@ -95,6 +95,7 @@ class NewsController < ApplicationController
def destroy
@news.destroy
flash[:notice] = l(:notice_successful_delete)
redirect_to action: 'index', project_id: @project
end

@ -227,7 +227,10 @@ class ProjectsController < ApplicationController
OpenProject::Notifications.send('project_deletion_imminent', project: @project_to_destroy)
@project_to_destroy.destroy
respond_to do |format|
format.html do redirect_to controller: '/admin', action: 'projects' end
format.html do
flash[:notice] = l(:notice_successful_delete)
redirect_to controller: '/admin', action: 'projects'
end
end
hide_project_in_layout

@ -89,6 +89,7 @@ class RolesController < ApplicationController
def destroy
@role = Role.find(params[:id])
@role.destroy
flash[:notice] = l(:notice_successful_delete)
redirect_to action: 'index'
notify_changed_roles(:removed, @role)
rescue

@ -182,7 +182,11 @@ class WikiController < ApplicationController
# Creates a new page or updates an existing one
def update
@page = @wiki.find_or_new_page(wiki_page_title)
return render_403 unless editable?
unless editable?
flash[:error] = l(:error_unable_update_wiki)
return render_403
end
@page.content = WikiContent.new(page: @page) if @page.new_record?
@content = @page.content_for_version(params[:version])
@ -205,6 +209,7 @@ class WikiController < ApplicationController
attachments = Attachment.attach_files(@page, params[:attachments])
render_attachment_warning_if_needed(@page)
call_hook(:controller_wiki_edit_after_save, params: params, page: @page)
flash[:notice] = l(:notice_successful_update)
redirect_to_show
else
render action: 'edit'
@ -278,7 +283,10 @@ class WikiController < ApplicationController
# Removes a wiki page and its history
# Children can be either set as root pages, removed or reassigned to another parent page
def destroy
return render_403 unless editable?
unless editable?
flash[:error] = l(:error_unable_delete_wiki)
return render_403
end
@descendants_count = @page.descendants.size
if @descendants_count > 0
@ -303,8 +311,10 @@ class WikiController < ApplicationController
@page.destroy
if page = @wiki.find_page(@wiki.start_page) || @wiki.pages.first
flash[:notice] = l(:notice_successful_delete)
redirect_to action: 'index', project_id: @project, id: page
else
flash[:notice] = l(:notice_successful_delete)
redirect_to project_path(@project)
end
end

@ -124,7 +124,7 @@ module ApplicationHelper
end
def format_activity_day(date)
date == Date.today ? l(:label_today).titleize : format_date(date)
date == User.current.today ? l(:label_today).titleize : format_date(date)
end
def format_activity_description(text)

@ -51,7 +51,7 @@ See doc/COPYRIGHT.rdoc for more details.
<div class="form--field -required">
<%= styled_label_tag 'password-pulldown', User.human_attribute_name(:password) %>
<div class="form--field-container">
<%= styled_password_field_tag 'password', nil, id: 'password-pulldown', tabindex: 2 %>
<%= styled_password_field_tag 'password', nil, id: 'password-pulldown', tabindex: 1 %>
</div>
<div class="form--field-extra-actions">
<% if Setting.lost_password? %>
@ -70,7 +70,7 @@ See doc/COPYRIGHT.rdoc for more details.
&nbsp;
</label>
<input type="submit" name="login" id="login-pulldown"
value="<%=l(:button_login)%>" class="button -highlight" tabindex="3" />
value="<%=l(:button_login)%>" class="button -highlight" tabindex="1" />
</div>
</div>

@ -80,7 +80,7 @@ See doc/COPYRIGHT.rdoc for more details.
<li class="toolbar-item">
<%= link_to({action: 'page'}, class: 'button') do %>
<i class="button--icon icon-cancel"></i>
<span class="button--text"><%= l(:button_back) %></span>
<span class="button--text"><%= l(:button_save_back) %></span>
<% end %>
</li>
<% end %>

@ -552,6 +552,7 @@ en:
button_reset: "Reset"
button_rollback: "Rollback to this version"
button_save: "Save"
button_save_back: "Save and back"
button_show: "Show"
button_sort: "Sort"
button_submit: "Submit"
@ -763,6 +764,8 @@ en:
error_unable_delete_status: "The work package status cannot be deleted since it is used by at least one work package."
error_unable_delete_default_status: "Unable to delete the default work package status. Please select another default work package status before deleting the current one."
error_unable_to_connect: "Unable to connect (%{value})"
error_unable_delete_wiki: "Unable to delete the wiki page."
error_unable_update_wiki: "Unable to update the wiki page."
error_workflow_copy_source: "Please select a source type or role"
error_workflow_copy_target: "Please select target type(s) and role(s)"
error_menu_item_not_created: Menu item could not be added

@ -216,7 +216,9 @@ function WorkPackagesListController($scope, $rootScope, $state, $stateParams, $l
$scope.loadQuery = function(queryId) {
// Clear unsaved changes to current query
clearUrlQueryParams();
loadingIndicator.mainPage = $state.go('work-packages.list', { 'query_id': queryId });
loadingIndicator.mainPage = $state.go('work-packages.list',
{ 'query_id': queryId },
{ reload: true });
};
function updateResults() {

@ -15,10 +15,8 @@
<div class="title-group-header">{{ group.name }}</div>
<li ng-repeat="model in group.models"
ng-class="{'selected': model.highlighted }">
<a href=""
<a ng-click="switchToSelectedQuery(model.id)"
title="{{ model.label }}"
ui-sref="work-packages.list({ query_id: model.id, query_props: undefined })"
ui-sref-opts="{ reload: true }"
ng-bind-html="model.labelHtml">
</a>
</li>

@ -89,10 +89,6 @@ module.exports = function($scope, $sce, LABEL_MAX_CHARS, KEY_CODES) {
}).indexOf(scope.selectedId);
}
function performSelect() {
scope.transitionMethod(scope.selectedId);
}
function nextNonEmptyGroup(groups, currentGroupIndex) {
currentGroupIndex = (currentGroupIndex === undefined) ? -1 : currentGroupIndex;
while (currentGroupIndex < groups.length - 1) {
@ -184,7 +180,7 @@ module.exports = function($scope, $sce, LABEL_MAX_CHARS, KEY_CODES) {
scope.handleSelection = function(event) {
switch(event.which) {
case KEY_CODES.enter:
performSelect();
scope.switchToSelectedQuery(scope.selectedId);
preventDefault(event);
break;
case KEY_CODES.down:
@ -200,6 +196,10 @@ module.exports = function($scope, $sce, LABEL_MAX_CHARS, KEY_CODES) {
}
};
scope.switchToSelectedQuery = function(queryId) {
scope.transitionMethod(queryId);
}
scope.reload = function(modelId, newTitle) {
scope.selectedTitle = newTitle;
scope.reloadMethod(modelId);

Loading…
Cancel
Save