##// END OF EJS Templates
[#20288] Update the i18n'ed core doc to match CodeRay 1.1.0 capabilities....
[#20288] Update the i18n'ed core doc to match CodeRay 1.1.0 capabilities. This commit includes: <pre> 1. an update of the list of languages supported by CodeRay: * added: + clojure [added in CodeRay 1.0.x] + diff (patch) [added in CodeRay 0.8.x] + go [added in CodeRay 1.1.x] + haml [added in CodeRay 1.0.x] + lua [added in CodeRay 1.1.x] + sass [added in CodeRay 1.1.x] + taskpaper [added in CodeRay 1.1.x] + text (plain, plaintext) [never been documented in Redmine] * removed: - scheme [removed from CodeRay 1.0.x] * renamed: ~ erb (eruby, rhtml) [renamed from rhtml in CodeRay 1.0.x] 2. the inclusion of additional, comma-separated language mappings (aliases) inside parentheses: * cpp (c++, cplusplus) * delphi (pascal) * diff (patch) * erb (eruby, rhtml) * html (xhtml) * javascript (ecmascript, ecma_script, java_script, js) * ruby (irb) * text (plain, plaintext) * yaml (yml) </pre> Regarding the i18n: I used English as the base language. The changed sentence was the same in 94 out of 98 language files, public\help\xx[-xx]\wiki_syntax_detailed_[markdown||textile].html. The only four exceptions were: * cs; public\help\cs\wiki_syntax_detailed_textile.html * fr; public\help\fr\wiki_syntax_detailed_textile.html * ja; public\help\ja\wiki_syntax_detailed_textile.html * zh-tw; public\help\zh-tw\wiki_syntax_detailed_textile.html In the above given files, the sentence containing the supported languages is translated (and/or stylized). I have chosen to replace the whole translated sentence with the new English base sentence, as such leaving decisions about stylizing language names to translators and the people that actually use the respective languages. In general (and for English, as it's the base language) I think we can better stick to non-capitalized language names to prevent any formatting confusion. Contributed by Mischa The Evil. git-svn-id: http://svn.redmine.org/redmine/trunk@14489 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r13951:d6f389658b9e
r14107:7c46fe1e4bd6
Show More
groups_controller.rb
149 lines | 3.8 KiB | text/x-ruby | RubyLexer
/ app / controllers / groups_controller.rb
Jean-Philippe Lang
User groups branch merged....
r2755 # Redmine - project management software
Jean-Philippe Lang
Copyright update....
r13490 # Copyright (C) 2006-2015 Jean-Philippe Lang
Jean-Philippe Lang
User groups branch merged....
r2755 #
# 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.
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/groups_controller.rb....
r6784 #
Jean-Philippe Lang
User groups branch merged....
r2755 # 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.
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/groups_controller.rb....
r6784 #
Jean-Philippe Lang
User groups branch merged....
r2755 # 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.
class GroupsController < ApplicationController
Jean-Philippe Lang
Adds an admin layout that displays the admin menu in the sidebar....
r3062 layout 'admin'
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/groups_controller.rb....
r6784
Jean-Philippe Lang
User groups branch merged....
r2755 before_filter :require_admin
Jean-Philippe Lang
REST Api for Groups (#8981)....
r9575 before_filter :find_group, :except => [:index, :new, :create]
accept_api_auth :index, :show, :create, :update, :destroy, :add_users, :remove_user
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/groups_controller.rb....
r6784
Jean-Philippe Lang
Require password re-entry for sensitive actions (#19851)....
r13951 require_sudo_mode :add_users, :remove_user, :create, :update, :destroy, :edit_membership, :destroy_membership
Jean-Philippe Lang
User groups branch merged....
r2755 helper :custom_fields
Jean-Philippe Lang
Adds a single controller for users and groups memberships and support for adding multiple projects at once (#11702)....
r13116 helper :principal_memberships
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/groups_controller.rb....
r6784
Jean-Philippe Lang
User groups branch merged....
r2755 def index
respond_to do |format|
Jean-Philippe Lang
Count users with a single query on group list (#16905)....
r12874 format.html {
Jean-Philippe Lang
Merged rails-4.1 branch (#14534)....
r13100 @groups = Group.sorted.to_a
Jean-Philippe Lang
Count users with a single query on group list (#16905)....
r12874 @user_count_by_group_id = user_count_by_group_id
}
Jean-Philippe Lang
Adds buit-in groups to give specific permissions to anonymous and non members users per project (#17976)....
r13053 format.api {
scope = Group.sorted
scope = scope.givable unless params[:builtin] == '1'
Jean-Philippe Lang
Merged rails-4.1 branch (#14534)....
r13100 @groups = scope.to_a
Jean-Philippe Lang
Adds buit-in groups to give specific permissions to anonymous and non members users per project (#17976)....
r13053 }
Jean-Philippe Lang
User groups branch merged....
r2755 end
end
def show
respond_to do |format|
Jean-Philippe Lang
Removed auto-generated comments....
r9564 format.html
Jean-Philippe Lang
REST Api for Groups (#8981)....
r9575 format.api
Jean-Philippe Lang
User groups branch merged....
r2755 end
end
def new
@group = Group.new
end
def create
Jean-Philippe Lang
Use safe_attributes in GroupsController....
r9563 @group = Group.new
@group.safe_attributes = params[:group]
Jean-Philippe Lang
User groups branch merged....
r2755
respond_to do |format|
if @group.save
Jean-Philippe Lang
Adds 'Create and continue' button on the new group form....
r6184 format.html {
flash[:notice] = l(:notice_successful_create)
redirect_to(params[:continue] ? new_group_path : groups_path)
}
Jean-Philippe Lang
REST Api for Groups (#8981)....
r9575 format.api { render :action => 'show', :status => :created, :location => group_url(@group) }
Jean-Philippe Lang
User groups branch merged....
r2755 else
format.html { render :action => "new" }
Jean-Philippe Lang
REST Api for Groups (#8981)....
r9575 format.api { render_validation_errors(@group) }
Jean-Philippe Lang
User groups branch merged....
r2755 end
end
end
Jean-Philippe Lang
Removed auto-generated comments....
r9564 def edit
end
Jean-Philippe Lang
User groups branch merged....
r2755 def update
Jean-Philippe Lang
Use safe_attributes in GroupsController....
r9563 @group.safe_attributes = params[:group]
Jean-Philippe Lang
User groups branch merged....
r2755
respond_to do |format|
Jean-Philippe Lang
Use safe_attributes in GroupsController....
r9563 if @group.save
Jean-Philippe Lang
User groups branch merged....
r2755 flash[:notice] = l(:notice_successful_update)
format.html { redirect_to(groups_path) }
Jean-Philippe Lang
Fixed that 200 API responses have a body containing one space (#11388)....
r9792 format.api { render_api_ok }
Jean-Philippe Lang
User groups branch merged....
r2755 else
format.html { render :action => "edit" }
Jean-Philippe Lang
REST Api for Groups (#8981)....
r9575 format.api { render_validation_errors(@group) }
Jean-Philippe Lang
User groups branch merged....
r2755 end
end
end
def destroy
@group.destroy
respond_to do |format|
Jean-Philippe Lang
Use named routes in controllers....
r10752 format.html { redirect_to(groups_path) }
Jean-Philippe Lang
Fixed that 200 API responses have a body containing one space (#11388)....
r9792 format.api { render_api_ok }
Jean-Philippe Lang
User groups branch merged....
r2755 end
end
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/groups_controller.rb....
r6784
Jean-Philippe Lang
Moved new group user to its own action GroupsController#new_users....
r13220 def new_users
end
Jean-Philippe Lang
User groups branch merged....
r2755 def add_users
Jean-Philippe Lang
Error when adding user to group where he is already assigned (#18665)....
r13403 @users = User.not_in_group(@group).where(:id => (params[:user_id] || params[:user_ids])).to_a
@group.users << @users
Jean-Philippe Lang
User groups branch merged....
r2755 respond_to do |format|
Jean-Philippe Lang
Use named routes in controllers....
r10752 format.html { redirect_to edit_group_path(@group, :tab => 'users') }
Jean-Philippe Lang
Removes RJS from GroupsController....
r9861 format.js
Jean-Philippe Lang
Error when adding user to group where he is already assigned (#18665)....
r13403 format.api {
if @users.any?
render_api_ok
else
render_api_errors "#{l(:label_user)} #{l('activerecord.errors.messages.invalid')}"
end
}
Jean-Philippe Lang
User groups branch merged....
r2755 end
end
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/groups_controller.rb....
r6784
Jean-Philippe Lang
User groups branch merged....
r2755 def remove_user
Jean-Philippe Lang
Adds routes for group users....
r7826 @group.users.delete(User.find(params[:user_id])) if request.delete?
Jean-Philippe Lang
User groups branch merged....
r2755 respond_to do |format|
Jean-Philippe Lang
Use named routes in controllers....
r10752 format.html { redirect_to edit_group_path(@group, :tab => 'users') }
Jean-Philippe Lang
Removes RJS from GroupsController....
r9861 format.js
Jean-Philippe Lang
Fixed that 200 API responses have a body containing one space (#11388)....
r9792 format.api { render_api_ok }
Jean-Philippe Lang
User groups branch merged....
r2755 end
end
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/groups_controller.rb....
r6784
Jean-Philippe Lang
User groups branch merged....
r2755 def autocomplete_for_user
Jean-Philippe Lang
Adds pagination to users list when adding project or group members (#9549)....
r10970 respond_to do |format|
format.js
end
Jean-Philippe Lang
User groups branch merged....
r2755 end
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/groups_controller.rb....
r6784
Jean-Philippe Lang
Adds #find_group filter....
r9565 private
def find_group
@group = Group.find(params[:id])
rescue ActiveRecord::RecordNotFound
render_404
end
Jean-Philippe Lang
Count users with a single query on group list (#16905)....
r12874
def user_count_by_group_id
h = User.joins(:groups).group('group_id').count
h.keys.each do |key|
h[key.to_i] = h.delete(key)
end
h
end
Jean-Philippe Lang
User groups branch merged....
r2755 end