settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings
git-svn-id: http://redmine.rubyforge.org/svn/trunk@167 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2007 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
|
||||
@@ -95,7 +95,7 @@ class AccountController < ApplicationController
|
||||
|
||||
# User self-registration
|
||||
def register
|
||||
redirect_to :controller => '' and return if $RDM_SELF_REGISTRATION == false
|
||||
redirect_to :controller => '' and return unless Setting.self_registration?
|
||||
if params[:token]
|
||||
token = Token.find_by_action_and_value("register", params[:token])
|
||||
redirect_to :controller => '' and return unless token and !token.expired?
|
||||
@@ -110,7 +110,7 @@ class AccountController < ApplicationController
|
||||
end
|
||||
else
|
||||
if request.get?
|
||||
@user = User.new(:language => $RDM_DEFAULT_LANG)
|
||||
@user = User.new(:language => Setting.default_language)
|
||||
@custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user) }
|
||||
else
|
||||
@user = User.new(params[:user])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2007 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
|
||||
@@ -33,7 +33,7 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
# check if login is globally required to access the application
|
||||
def check_if_login_required
|
||||
require_login if $RDM_LOGIN_REQUIRED
|
||||
require_login if Setting.login_required?
|
||||
end
|
||||
|
||||
def set_localization
|
||||
@@ -48,7 +48,7 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
rescue
|
||||
nil
|
||||
end || $RDM_DEFAULT_LANG
|
||||
end || Setting.default_language
|
||||
set_language_if_valid(lang)
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 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 SettingsController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :require_admin
|
||||
|
||||
def index
|
||||
edit
|
||||
render :action => 'edit'
|
||||
end
|
||||
|
||||
def edit
|
||||
if request.post? and params[:settings] and params[:settings].is_a? Hash
|
||||
params[:settings].each { |name, value| Setting[name] = value }
|
||||
redirect_to :action => 'edit' and return
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2007 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
|
||||
@@ -45,7 +45,7 @@ class UsersController < ApplicationController
|
||||
|
||||
def add
|
||||
if request.get?
|
||||
@user = User.new(:language => $RDM_DEFAULT_LANG)
|
||||
@user = User.new(:language => Setting.default_language)
|
||||
@custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user) }
|
||||
else
|
||||
@user = User.new(params[:user])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2007 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
|
||||
@@ -93,7 +93,7 @@ module ApplicationHelper
|
||||
end
|
||||
|
||||
def textilizable(text)
|
||||
$RDM_TEXTILE_DISABLED ? simple_format(auto_link(h(text))) : RedCloth.new(h(text)).to_html
|
||||
(Setting.text_formatting == 'textile') && (ActionView::Helpers::TextHelper.method_defined? "textilize") ? RedCloth.new(h(text)).to_html : simple_format(auto_link(h(text)))
|
||||
end
|
||||
|
||||
def error_messages_for(object_name, options = {})
|
||||
@@ -131,8 +131,9 @@ module ApplicationHelper
|
||||
end
|
||||
end
|
||||
|
||||
def lang_options_for_select
|
||||
[["(auto)", ""]] + (GLoc.valid_languages.sort {|x,y| x.to_s <=> y.to_s }).collect {|lang| [ l_lang_name(lang.to_s, lang), lang.to_s]}
|
||||
def lang_options_for_select(blank=true)
|
||||
(blank ? [["(auto)", ""]] : []) +
|
||||
(GLoc.valid_languages.sort {|x,y| x.to_s <=> y.to_s }).collect {|lang| [ l_lang_name(lang.to_s, lang), lang.to_s]}
|
||||
end
|
||||
|
||||
def label_tag_for(name, option_tags = nil, options = {})
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 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.
|
||||
|
||||
module SettingsHelper
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2007 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
|
||||
@@ -21,12 +21,15 @@ class Attachment < ActiveRecord::Base
|
||||
belongs_to :container, :polymorphic => true
|
||||
belongs_to :author, :class_name => "User", :foreign_key => "author_id"
|
||||
|
||||
@@max_size = $RDM_ATTACHMENT_MAX_SIZE || 5*1024*1024
|
||||
cattr_reader :max_size
|
||||
|
||||
validates_presence_of :container, :filename
|
||||
validates_inclusion_of :filesize, :in => 1..@@max_size
|
||||
|
||||
cattr_accessor :storage_path
|
||||
@@storage_path = "#{RAILS_ROOT}/files"
|
||||
|
||||
def validate
|
||||
errors.add_to_base :too_long if self.filesize > Setting.attachment_max_size.to_i.kilobytes
|
||||
end
|
||||
|
||||
def file=(incomming_file)
|
||||
unless incomming_file.nil?
|
||||
@temp_file = incomming_file
|
||||
@@ -63,7 +66,7 @@ class Attachment < ActiveRecord::Base
|
||||
|
||||
# Returns file's location on disk
|
||||
def diskfile
|
||||
"#{$RDM_STORAGE_PATH}/#{self.disk_filename}"
|
||||
"#{@@storage_path}/#{self.disk_filename}"
|
||||
end
|
||||
|
||||
def increment_download
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2007 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
|
||||
@@ -16,13 +16,12 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class Mailer < ActionMailer::Base
|
||||
|
||||
helper IssuesHelper
|
||||
|
||||
def issue_add(issue)
|
||||
# Sends to all project members
|
||||
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
|
||||
@from = $RDM_MAIL_FROM
|
||||
@from = Setting.mail_from
|
||||
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
|
||||
@body['issue'] = issue
|
||||
end
|
||||
@@ -31,7 +30,7 @@ class Mailer < ActionMailer::Base
|
||||
# Sends to all project members
|
||||
issue = journal.journalized
|
||||
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
|
||||
@from = $RDM_MAIL_FROM
|
||||
@from = Setting.mail_from
|
||||
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
|
||||
@body['issue'] = issue
|
||||
@body['journal']= journal
|
||||
@@ -39,14 +38,14 @@ class Mailer < ActionMailer::Base
|
||||
|
||||
def lost_password(token)
|
||||
@recipients = token.user.mail
|
||||
@from = $RDM_MAIL_FROM
|
||||
@from = Setting.mail_from
|
||||
@subject = l(:mail_subject_lost_password)
|
||||
@body['token'] = token
|
||||
end
|
||||
|
||||
def register(token)
|
||||
@recipients = token.user.mail
|
||||
@from = $RDM_MAIL_FROM
|
||||
@from = Setting.mail_from
|
||||
@subject = l(:mail_subject_register)
|
||||
@body['token'] = token
|
||||
end
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 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 Setting < ActiveRecord::Base
|
||||
|
||||
cattr_accessor :available_settings
|
||||
@@available_settings = YAML::load(File.open("#{RAILS_ROOT}/config/settings.yml"))
|
||||
|
||||
validates_uniqueness_of :name
|
||||
validates_inclusion_of :name, :in => @@available_settings.keys
|
||||
validates_numericality_of :value, :only_integer => true, :if => Proc.new { |setting| @@available_settings[setting.name]['format'] == 'int' }
|
||||
|
||||
def self.get(name)
|
||||
name = name.to_s
|
||||
setting = find_by_name(name)
|
||||
setting ||= new(:name => name, :value => @@available_settings[name]['default']) if @@available_settings.has_key? name
|
||||
setting
|
||||
end
|
||||
|
||||
def self.[](name)
|
||||
get(name).value
|
||||
end
|
||||
|
||||
def self.[]=(name, value)
|
||||
setting = get(name)
|
||||
setting.value = value
|
||||
setting.save
|
||||
setting.value
|
||||
end
|
||||
|
||||
@@available_settings.each do |name, params|
|
||||
src = <<-END_SRC
|
||||
def self.#{name}
|
||||
self[:#{name}]
|
||||
end
|
||||
|
||||
def self.#{name}?
|
||||
self[:#{name}].to_s == "1"
|
||||
end
|
||||
|
||||
def self.#{name}=(value)
|
||||
self[:#{name}] = values
|
||||
end
|
||||
END_SRC
|
||||
class_eval src, __FILE__, __LINE__
|
||||
end
|
||||
end
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2007 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
|
||||
@@ -69,7 +69,7 @@ class User < ActiveRecord::Base
|
||||
if attrs
|
||||
onthefly = new(*attrs)
|
||||
onthefly.login = login
|
||||
onthefly.language = $RDM_DEFAULT_LANG
|
||||
onthefly.language = Setting.default_language
|
||||
if onthefly.save
|
||||
user = find(:first, :conditions => ["login=?", login])
|
||||
logger.info("User '#{user.login}' created on the fly.") if logger
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<p><center><input type="submit" name="login" value="<%=l(:button_login)%> »" class="primary" /></center>
|
||||
<%= end_form_tag %>
|
||||
|
||||
<br><% unless $RDM_SELF_REGISTRATION == false %><%= link_to l(:label_register), :action => 'register' %> |<% end %>
|
||||
<br><% if Setting.self_registration? %><%= link_to l(:label_register), :action => 'register' %> |<% end %>
|
||||
<%= link_to l(:label_password_lost), :action => 'lost_password' %></p>
|
||||
</div>
|
||||
</center>
|
||||
@@ -36,6 +36,10 @@
|
||||
<%= link_to l(:label_authentication), :controller => 'auth_sources' %>
|
||||
</p>
|
||||
|
||||
<p class="icon22 icon22-settings">
|
||||
<%= link_to l(:label_settings), :controller => 'settings' %>
|
||||
</p>
|
||||
|
||||
<p class="icon22 icon22-info">
|
||||
<%= link_to l(:label_information_plural), :controller => 'admin', :action => 'info' %>
|
||||
</p>
|
||||
@@ -14,7 +14,7 @@
|
||||
<!--[eoform:document]-->
|
||||
</div>
|
||||
|
||||
<% unless $RDM_TEXTILE_DISABLED %>
|
||||
<% if Setting.text_formatting == 'textile' %>
|
||||
<%= javascript_include_tag 'jstoolbar' %>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<%= start_form_tag ({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :class => "tabular") %>
|
||||
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
|
||||
<%= image_to_function "add.png", "addFileField();return false" %></label>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Attachment.max_size) %>)</em></p>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<%= end_form_tag %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
xml.instruct!
|
||||
xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
|
||||
xml.channel do
|
||||
xml.title "#{$RDM_HEADER_TITLE}: #{l(:label_news_latest)}"
|
||||
xml.title "#{Setting.header_title}: #{l(:label_news_latest)}"
|
||||
xml.link url_for(:controller => '', :only_path => false)
|
||||
xml.pubDate CGI.rfc1123_date(@news.first.created_on)
|
||||
xml.description "#{$RDM_HEADER_TITLE}: #{l(:label_news_latest)}"
|
||||
xml.description l(:label_news_latest)
|
||||
@news.each do |news|
|
||||
xml.item do
|
||||
xml.title "#{news.project.name}: #{news.title}"
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
|
||||
<% unless $RDM_TEXTILE_DISABLED %>
|
||||
<% if Setting.text_formatting == 'textile' %>
|
||||
<%= javascript_include_tag 'jstoolbar' %>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
@@ -93,7 +93,7 @@ end %>
|
||||
<%= start_form_tag ({ :controller => 'issues', :action => 'add_attachment', :id => @issue }, :multipart => true, :class => "tabular") %>
|
||||
<p id="attachments_p"><label><%=l(:label_attachment_new)%>
|
||||
<%= image_to_function "add.png", "addFileField();return false" %></label>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Attachment.max_size) %>)</em></p>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<%= end_form_tag %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title><%= $RDM_HEADER_TITLE + (@html_title ? ": #{@html_title}" : "") %></title>
|
||||
<title><%= Setting.header_title + (@html_title ? ": #{@html_title}" : "") %></title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta name="description" content="redMine" />
|
||||
<meta name="keywords" content="issue,bug,tracker" />
|
||||
@@ -23,8 +23,8 @@
|
||||
|
||||
<div id="header">
|
||||
<div style="float: left;">
|
||||
<h1><%= $RDM_HEADER_TITLE %></h1>
|
||||
<h2><%= $RDM_HEADER_SUBTITLE %></h2>
|
||||
<h1><%= Setting.header_title %></h1>
|
||||
<h2><%= Setting.header_subtitle %></h2>
|
||||
</div>
|
||||
<div style="float: right; padding-right: 1em; padding-top: 0.2em;">
|
||||
<% if loggedin? %><small><%=l(:label_logged_as)%> <b><%= @logged_in_user.login %></b></small><% end %>
|
||||
@@ -69,6 +69,7 @@
|
||||
<a class="menuItem" href="/enumerations"><%=l(:label_enumerations)%></a>
|
||||
<a class="menuItem" href="/admin/mail_options"><%=l(:field_mail_notification)%></a>
|
||||
<a class="menuItem" href="/auth_sources"><%=l(:label_authentication)%></a>
|
||||
<a class="menuItem" href="/settings"><%=l(:label_settings)%></a>
|
||||
<a class="menuItem" href="/admin/info"><%=l(:label_information_plural)%></a>
|
||||
</div>
|
||||
<div id="menuTrackers" class="menu">
|
||||
@@ -134,10 +135,7 @@
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<p>
|
||||
<%= auto_link $RDM_FOOTER_SIG %> |
|
||||
<a href="http://redmine.rubyforge.org/"><%= RDM_APP_NAME %></a> <%= RDM_APP_VERSION %>
|
||||
</p>
|
||||
<p><a href="http://redmine.rubyforge.org/"><%= RDM_APP_NAME %></a> <%= RDM_APP_VERSION %></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
|
||||
<%= issue.description %>
|
||||
|
||||
http://<%= $RDM_HOST_NAME %>/issues/show/<%= issue.id %>
|
||||
http://<%= Setting.host_name %>/issues/show/<%= issue.id %>
|
||||
@@ -1,3 +1,3 @@
|
||||
To change your password, use the following link:
|
||||
|
||||
http://<%= $RDM_HOST_NAME %>/account/lost_password?token=<%= @token.value %>
|
||||
http://<%= Setting.host_name %>/account/lost_password?token=<%= @token.value %>
|
||||
@@ -1,3 +1,3 @@
|
||||
To change your password, use the following link:
|
||||
|
||||
http://<%= $RDM_HOST_NAME %>/account/lost_password?token=<%= @token.value %>
|
||||
http://<%= Setting.host_name %>/account/lost_password?token=<%= @token.value %>
|
||||
@@ -1,3 +1,3 @@
|
||||
To change your password, use the following link:
|
||||
|
||||
http://<%= $RDM_HOST_NAME %>/account/lost_password?token=<%= @token.value %>
|
||||
http://<%= Setting.host_name %>/account/lost_password?token=<%= @token.value %>
|
||||
@@ -1,3 +1,3 @@
|
||||
Pour changer votre mot de passe, utilisez le lien suivant:
|
||||
|
||||
http://<%= $RDM_HOST_NAME %>/account/lost_password?token=<%= @token.value %>
|
||||
http://<%= Setting.host_name %>/account/lost_password?token=<%= @token.value %>
|
||||
@@ -1,3 +1,3 @@
|
||||
To activate your redMine account, use the following link:
|
||||
|
||||
http://<%= $RDM_HOST_NAME %>/account/register?token=<%= @token.value %>
|
||||
http://<%= Setting.host_name %>/account/register?token=<%= @token.value %>
|
||||
@@ -1,3 +1,3 @@
|
||||
To activate your redMine account, use the following link:
|
||||
|
||||
http://<%= $RDM_HOST_NAME %>/account/register?token=<%= @token.value %>
|
||||
http://<%= Setting.host_name %>/account/register?token=<%= @token.value %>
|
||||
@@ -1,3 +1,3 @@
|
||||
To activate your redMine account, use the following link:
|
||||
|
||||
http://<%= $RDM_HOST_NAME %>/account/register?token=<%= @token.value %>
|
||||
http://<%= Setting.host_name %>/account/register?token=<%= @token.value %>
|
||||
@@ -1,3 +1,3 @@
|
||||
Pour activer votre compte sur redMine, utilisez le lien suivant:
|
||||
|
||||
http://<%= $RDM_HOST_NAME %>/account/register?token=<%= @token.value %>
|
||||
http://<%= Setting.host_name %>/account/register?token=<%= @token.value %>
|
||||
@@ -5,7 +5,7 @@
|
||||
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 15 %></p>
|
||||
</div>
|
||||
|
||||
<% unless $RDM_TEXTILE_DISABLED %>
|
||||
<% if Setting.text_formatting == 'textile' %>
|
||||
<%= javascript_include_tag 'jstoolbar' %>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="box">
|
||||
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
|
||||
<%= image_to_function "add.png", "addFileField();return false" %></label>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Attachment.max_size) %>)</em></p>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_create) %>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
|
||||
<%= image_to_function "add.png", "addFileField();return false" %></label>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Attachment.max_size) %>)</em></p>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
|
||||
</div>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<%= end_form_tag %>
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
|
||||
<%= image_to_function "add.png", "addFileField();return false" %></label>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Attachment.max_size) %>)</em></p>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
|
||||
|
||||
</div>
|
||||
<!--[eoform:issue]-->
|
||||
@@ -35,7 +35,7 @@
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
||||
|
||||
<% unless $RDM_TEXTILE_DISABLED %>
|
||||
<% if Setting.text_formatting == 'textile' %>
|
||||
<%= javascript_include_tag 'jstoolbar' %>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<h2><%= l(:label_settings) %></h2>
|
||||
|
||||
<%= start_form_tag({:action => 'edit'}, :class => "tabular") %>
|
||||
<div class="box">
|
||||
<p><label>header_title</label>
|
||||
<%= text_field_tag 'settings[header_title]', Setting.header_title, :size => 30 %></p>
|
||||
|
||||
<p><label>header_subtitle</label>
|
||||
<%= text_field_tag 'settings[header_subtitle]', Setting.header_subtitle, :size => 60 %></p>
|
||||
|
||||
<p><label>welcome_text</label>
|
||||
<%= text_area_tag 'settings[welcome_text]', Setting.welcome_text, :cols => 60, :rows => 5 %></p>
|
||||
|
||||
<p><label>default_language</label>
|
||||
<%= select_tag 'settings[default_language]', options_for_select( lang_options_for_select(false), Setting.default_language) %></p>
|
||||
|
||||
<p><label>login_required</label>
|
||||
<%= check_box_tag 'settings[login_required]', 1, Setting.login_required? %><%= hidden_field_tag 'settings[login_required]', 0 %></p>
|
||||
|
||||
<p><label>self_registration</label>
|
||||
<%= check_box_tag 'settings[self_registration]', 1, Setting.self_registration? %><%= hidden_field_tag 'settings[self_registration]', 0 %></p>
|
||||
|
||||
<p><label>attachment_max_size</label>
|
||||
<%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %></p>
|
||||
|
||||
<p><label>mail_from</label>
|
||||
<%= text_field_tag 'settings[mail_from]', Setting.mail_from, :size => 60 %></p>
|
||||
|
||||
<p><label>host_name</label>
|
||||
<%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p>
|
||||
|
||||
<p><label>text_formatting</label>
|
||||
<%= select_tag 'settings[text_formatting]', options_for_select( [[l(:label_none), 0], ["textile", "textile"]], Setting.text_formatting) %></p>
|
||||
|
||||
</div>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<%= end_form_tag %>
|
||||
@@ -1,7 +1,7 @@
|
||||
<h2><%= $RDM_WELCOME_TITLE || l(:label_home) %></h2>
|
||||
<h2><%= l(:label_home) %></h2>
|
||||
|
||||
<div class="splitcontentleft">
|
||||
<% if $RDM_WELCOME_TEXT %><p><%= $RDM_WELCOME_TEXT %></p><br /><% end %>
|
||||
<p><%= Setting.welcome_text %></p>
|
||||
<div class="box">
|
||||
<h3><%=l(:label_news_latest)%></h3>
|
||||
<%= render :partial => 'news/news', :collection => @news %>
|
||||
|
||||
Reference in New Issue
Block a user