##// 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
# Redmine - project management software
# Copyright (C) 2006-2015 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class GroupsController < ApplicationController
layout 'admin'
before_filter :require_admin
before_filter :find_group, :except => [:index, :new, :create]
accept_api_auth :index, :show, :create, :update, :destroy, :add_users, :remove_user
require_sudo_mode :add_users, :remove_user, :create, :update, :destroy, :edit_membership, :destroy_membership
helper :custom_fields
helper :principal_memberships
def index
respond_to do |format|
format.html {
@groups = Group.sorted.to_a
@user_count_by_group_id = user_count_by_group_id
}
format.api {
scope = Group.sorted
scope = scope.givable unless params[:builtin] == '1'
@groups = scope.to_a
}
end
end
def show
respond_to do |format|
format.html
format.api
end
end
def new
@group = Group.new
end
def create
@group = Group.new
@group.safe_attributes = params[:group]
respond_to do |format|
if @group.save
format.html {
flash[:notice] = l(:notice_successful_create)
redirect_to(params[:continue] ? new_group_path : groups_path)
}
format.api { render :action => 'show', :status => :created, :location => group_url(@group) }
else
format.html { render :action => "new" }
format.api { render_validation_errors(@group) }
end
end
end
def edit
end
def update
@group.safe_attributes = params[:group]
respond_to do |format|
if @group.save
flash[:notice] = l(:notice_successful_update)
format.html { redirect_to(groups_path) }
format.api { render_api_ok }
else
format.html { render :action => "edit" }
format.api { render_validation_errors(@group) }
end
end
end
def destroy
@group.destroy
respond_to do |format|
format.html { redirect_to(groups_path) }
format.api { render_api_ok }
end
end
def new_users
end
def add_users
@users = User.not_in_group(@group).where(:id => (params[:user_id] || params[:user_ids])).to_a
@group.users << @users
respond_to do |format|
format.html { redirect_to edit_group_path(@group, :tab => 'users') }
format.js
format.api {
if @users.any?
render_api_ok
else
render_api_errors "#{l(:label_user)} #{l('activerecord.errors.messages.invalid')}"
end
}
end
end
def remove_user
@group.users.delete(User.find(params[:user_id])) if request.delete?
respond_to do |format|
format.html { redirect_to edit_group_path(@group, :tab => 'users') }
format.js
format.api { render_api_ok }
end
end
def autocomplete_for_user
respond_to do |format|
format.js
end
end
private
def find_group
@group = Group.find(params[:id])
rescue ActiveRecord::RecordNotFound
render_404
end
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
end