# HG changeset patch # User Chris Cannam # Date 1307367664 -3600 # Node ID 753f1380d6bc90f40491887b22cec81ced7343f6 # Parent adc8466df40458678340faa4159a998ee1b03e75# Parent cbce1fd3b1b7f90920f8fcabb8a04f0696e20022 Merge from branch "redmine-1.2" diff -r cbce1fd3b1b7 -r 753f1380d6bc app/controllers/account_controller.rb --- a/app/controllers/account_controller.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/controllers/account_controller.rb Mon Jun 06 14:41:04 2011 +0100 @@ -77,13 +77,19 @@ # User self-registration def register redirect_to(home_url) && return unless Setting.self_registration? || session[:auth_source_registration] + if request.get? session[:auth_source_registration] = nil @user = User.new(:language => Setting.default_language) + + @ssamr_user_details = SsamrUserDetail.new + else @user = User.new(params[:user]) @user.admin = false + @user.register + if session[:auth_source_registration] @user.activate @user.login = session[:auth_source_registration][:login] @@ -98,6 +104,13 @@ @user.login = params[:user][:login] @user.password, @user.password_confirmation = params[:password], params[:password_confirmation] + @ssamr_user_details = SsamrUserDetail.new(params[:ssamr_user_details]) + + # associates the 2 objects + @user.ssamr_user_detail = @ssamr_user_details + @selected_institution_id = params[:ssamr_user_details][:institution_id].to_i + + case Setting.self_registration when '1' register_by_email_activation(@user) @@ -269,6 +282,9 @@ # Pass a block for behavior when a user fails to save def register_manually_by_administrator(user, &block) if user.save + + @ssamr_user_details.save! + # Sends an email to the administrators Mailer.deliver_account_activation_request(user) account_pending diff -r cbce1fd3b1b7 -r 753f1380d6bc app/controllers/application_controller.rb --- a/app/controllers/application_controller.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/controllers/application_controller.rb Mon Jun 06 14:41:04 2011 +0100 @@ -267,6 +267,12 @@ uri = URI.parse(back_url) # do not redirect user to another host or to the login or register page if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)}) + # soundsoftware: if login page is https but back_url http, + # switch back_url to https to ensure cookie validity (#83) + if (uri.scheme == "http") && (URI.parse(request.url).scheme == "https") + uri.scheme = "https" + back_url = uri.to_s + end redirect_to(back_url) return end @@ -319,7 +325,7 @@ if api_request? logger.error "Form authenticity token is missing or is invalid. API calls must include a proper Content-type header (text/xml or text/json)." end - render_error "Invalid form authenticity token." + render_error "Invalid form authenticity token. Perhaps your session has timed out; try reloading the form and entering your details again." end def render_feed(items, options={}) diff -r cbce1fd3b1b7 -r 753f1380d6bc app/controllers/issues_controller.rb --- a/app/controllers/issues_controller.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/controllers/issues_controller.rb Mon Jun 06 14:41:04 2011 +0100 @@ -140,7 +140,16 @@ attachments = Attachment.attach_files(@issue, params[:attachments]) render_attachment_warning_if_needed(@issue) flash[:notice] = l(:notice_successful_create) + call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue}) + + # Also adds the assignee to the watcher's list + if params[:issue][:assigned_to_id] && !params[:issue][:assigned_to_id].empty?: + unless @issue.watcher_ids.include?(params[:issue][:assigned_to_id]): + @issue.add_watcher(User.find(params[:issue][:assigned_to_id])) + end + end + respond_to do |format| format.html { redirect_to(params[:continue] ? { :action => 'new', :project_id => @project, :issue => {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?} } : @@ -287,6 +296,18 @@ @notes = params[:notes] || (params[:issue].present? ? params[:issue][:notes] : nil) @issue.init_journal(User.current, @notes) @issue.safe_attributes = params[:issue] + + # tests if the the user assigned_to_id + # is in this issues watcher's list + # if not, adds it. + + if params[:issue][:assigned_to_id] && !params[:issue][:assigned_to_id].empty?: + unless @issue.watched_by?(User.find(params[:issue][:assigned_to_id])): + @issue.add_watcher(User.find(params[:issue][:assigned_to_id])) + end + end + + end # TODO: Refactor, lots of extra code in here diff -r cbce1fd3b1b7 -r 753f1380d6bc app/controllers/members_controller.rb --- a/app/controllers/members_controller.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/controllers/members_controller.rb Mon Jun 06 14:41:04 2011 +0100 @@ -94,6 +94,7 @@ def autocomplete_for_member @principals = Principal.active.like(params[:q]).find(:all, :limit => 100) - @project.principals + logger.debug "Query for #{params[:q]} returned #{@principals.size} results" render :layout => false end diff -r cbce1fd3b1b7 -r 753f1380d6bc app/controllers/my_controller.rb --- a/app/controllers/my_controller.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/controllers/my_controller.rb Mon Jun 06 14:41:04 2011 +0100 @@ -53,10 +53,39 @@ def account @user = User.current @pref = @user.pref + @ssamr_user_details = @user.ssamr_user_detail + + + if @user.ssamr_user_detail == nil + @selected_institution_id = nil + else + @selected_institution_id = @ssamr_user_details.institution_id.to_i + end + if request.post? @user.safe_attributes = params[:user] @user.pref.attributes = params[:pref] @user.pref[:no_self_notified] = (params[:no_self_notified] == '1') + + if @user.ssamr_user_detail == nil + @ssamr_user_details = SsamrUserDetail.new() + @user.ssamr_user_detail = @ssamr_user_details + else + @ssamr_user_details = @user.ssamr_user_detail + end + + if params[:ssamr_user_details].nil? or params[:ssamr_user_details].empty? + @ssamr_user_details.description = @user.ssamr_user_detail.description + @ssamr_user_details.institution_id = @user.ssamr_user_detail.institution_id + @institution_type = @ssamr_user_details.institution_type + @other_institution = @ssamr_user_details.other_institution + else + @ssamr_user_details.description = params[:ssamr_user_details][:description] + @ssamr_user_details.institution_id = params[:ssamr_user_details][:institution_id] + @ssamr_user_details.institution_type = params[:ssamr_user_details][:institution_type] + @ssamr_user_details.other_institution = params[:ssamr_user_details][:other_institution] + end + if @user.save @user.pref.save @user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : []) diff -r cbce1fd3b1b7 -r 753f1380d6bc app/controllers/projects_controller.rb --- a/app/controllers/projects_controller.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/controllers/projects_controller.rb Mon Jun 06 14:41:04 2011 +0100 @@ -42,12 +42,23 @@ helper :repositories include RepositoriesHelper include ProjectsHelper - - # Lists visible projects + + # Lists visible projects. Paginator is for top-level projects only + # (subprojects belong to them) def index respond_to do |format| format.html { - @projects = Project.visible.find(:all, :order => 'lft') + sort_init 'name' + sort_update %w(name lft created_on updated_on) + @limit = per_page_option + @project_count = Project.visible_roots.count + @project_pages = Paginator.new self, @project_count, @limit, params['page'] + @offset ||= @project_pages.current.offset + @projects = Project.visible_roots.all(:offset => @offset, :limit => @limit, :order => sort_clause) + if User.current.logged? + @user_projects = User.current.projects.sort_by(&:name) + end + render :template => 'projects/index.rhtml', :layout => !request.xhr? } format.api { @offset, @limit = api_offset_and_limit diff -r cbce1fd3b1b7 -r 753f1380d6bc app/controllers/sys_controller.rb --- a/app/controllers/sys_controller.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/controllers/sys_controller.rb Mon Jun 06 14:41:04 2011 +0100 @@ -55,6 +55,31 @@ render :nothing => true, :status => 404 end + def set_embedded_active + project = Project.find(params[:id]) + mods = project.enabled_modules + enable = (params[:enable] == "1") + if mods.detect {|m| m.name == "embedded"} + logger.info "Project #{project.name} currently has Embedded enabled" + if !enable + logger.info "Disabling Embedded" + modnames = mods.all(:select => :name).collect{|m| m.name}.reject{|n| n == "embedded"} + project.enabled_module_names = modnames + end + else + logger.info "Project #{project.name} currently has Embedded disabled" + if enable + logger.info "Enabling Embedded" + modnames = mods.all(:select => :name).collect{|m| m.name} + modnames << "embedded" + project.enabled_module_names = modnames + end + end + render :nothing => true, :status => 200 + rescue ActiveRecord::RecordNotFound + render :nothing => true, :status => 404 + end + protected def check_enabled diff -r cbce1fd3b1b7 -r 753f1380d6bc app/controllers/users_controller.rb --- a/app/controllers/users_controller.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/controllers/users_controller.rb Mon Jun 06 14:41:04 2011 +0100 @@ -68,6 +68,20 @@ end def show + + if @user.ssamr_user_detail != nil + @description = @user.ssamr_user_detail.description + + if @user.ssamr_user_detail.institution_type != nil + # institution_type is true for listed institutions + if (@user.ssamr_user_detail.institution_type) + @institution_name = Institution.find(@user.ssamr_user_detail.institution_id).name + else + @institution_name = @user.ssamr_user_detail.other_institution + end + end + end + # show projects based on current user visibility @memberships = @user.memberships.all(:conditions => Project.visible_condition(User.current)) @@ -87,15 +101,18 @@ end end - def new + def new @user = User.new(:language => Setting.default_language, :mail_notification => Setting.default_notification_option) @auth_sources = AuthSource.find(:all) + + @ssamr_user_details = SsamrUserDetail.new end verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed } def create @user = User.new(:language => Setting.default_language, :mail_notification => Setting.default_notification_option) @user.safe_attributes = params[:user] + @user = User.new(params[:user]) @user.admin = params[:user][:admin] || false @user.login = params[:user][:login] @user.password, @user.password_confirmation = params[:user][:password], params[:user][:password_confirmation] unless @user.auth_source_id @@ -104,9 +121,16 @@ @user.pref.attributes = params[:pref] @user.pref[:no_self_notified] = (params[:no_self_notified] == '1') + @ssamr_user_details = SsamrUserDetail.new(params[:ssamr_user_details]) + + # associates the 2 objects + @user.ssamr_user_detail = @ssamr_user_details + if @user.save @user.pref.save - @user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : []) + + @ssamr_user_details.save! + Mailer.deliver_account_information(@user, params[:user][:password]) if params[:send_information] @@ -133,6 +157,15 @@ end def edit + + @ssamr_user_details = @user.ssamr_user_detail + + if @user.ssamr_user_detail == nil + @selected_institution_id = nil + else + @selected_institution_id = @user.ssamr_user_detail.institution_id.to_i + end + @auth_sources = AuthSource.find(:all) @membership ||= Member.new end @@ -151,6 +184,26 @@ @user.pref.attributes = params[:pref] @user.pref[:no_self_notified] = (params[:no_self_notified] == '1') + if @user.ssamr_user_detail == nil + @ssamr_user_details = SsamrUserDetail.new() + @user.ssamr_user_detail = @ssamr_user_details + else + @ssamr_user_details = @user.ssamr_user_detail + end + + if params[:ssamr_user_details].nil? or params[:ssamr_user_details].empty? + @ssamr_user_details.description = @user.ssamr_user_detail.description + @ssamr_user_details.institution_id = @user.ssamr_user_detail.institution_id + @ssamr_user_details.other_institution = @user.ssamr_user_detail.other_institution + @ssamr_user_details.institution_type = @user.ssamr_user_detail.institution_type + + else + @ssamr_user_details.description = params[:ssamr_user_details][:description] + @ssamr_user_details.institution_id = params[:ssamr_user_details][:institution_id] + @ssamr_user_details.other_institution = params[:ssamr_user_details][:other_institution] + @ssamr_user_details.institution_type = params[:ssamr_user_details][:institution_type] + end + if @user.save @user.pref.save @user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : []) diff -r cbce1fd3b1b7 -r 753f1380d6bc app/controllers/welcome_controller.rb --- a/app/controllers/welcome_controller.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/controllers/welcome_controller.rb Mon Jun 06 14:41:04 2011 +0100 @@ -21,6 +21,14 @@ def index @news = News.latest User.current @projects = Project.latest User.current + + # tests if user is logged in to gfenerate the tips of the day list + if User.current.logged? + @tipsoftheday = Setting.tipoftheday_text + else + @tipsoftheday = '' + end + end def robots diff -r cbce1fd3b1b7 -r 753f1380d6bc app/helpers/application_helper.rb --- a/app/helpers/application_helper.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/helpers/application_helper.rb Mon Jun 06 14:41:04 2011 +0100 @@ -52,7 +52,7 @@ if user.is_a?(User) name = h(user.name(options[:format])) if user.active? - link_to name, :controller => 'users', :action => 'show', :id => user + link_to(name, :controller => 'users', :action => 'show', :id => user) else name end @@ -287,7 +287,7 @@ def principals_check_box_tags(name, principals) s = '' principals.sort.each do |principal| - s << "\n" + s << "\n" end s end @@ -387,21 +387,28 @@ def page_header_title if @project.nil? || @project.new_record? - h(Setting.app_title) + a = [h(Setting.app_title), ''] + else + pname = [] b = [] ancestors = (@project.root? ? [] : @project.ancestors.visible.all) if ancestors.any? root = ancestors.shift b << link_to_project(root, {:jump => current_menu_item}, :class => 'root') if ancestors.size > 2 - b << '…' + b << '…' ancestors = ancestors[-2, 2] end b += ancestors.collect {|p| link_to_project(p, {:jump => current_menu_item}, :class => 'ancestor') } + b = b.join(' » ') + b << (' »') end - b << h(@project) - b.join(' » ') + + pname << h(@project) + + a = [pname, b] + end end diff -r cbce1fd3b1b7 -r 753f1380d6bc app/helpers/projects_helper.rb --- a/app/helpers/projects_helper.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/helpers/projects_helper.rb Mon Jun 06 14:41:04 2011 +0100 @@ -83,6 +83,160 @@ s end + + # Renders a tree of projects where the current user belongs + # as a nested set of unordered lists + # The given collection may be a subset of the whole project tree + # (eg. some intermediate nodes are private and can not be seen) + def render_my_project_hierarchy(projects) + s = '' + + a = '' + + # Flag to tell if user has any projects + t = FALSE + + if projects.any? + ancestors = [] + original_project = @project + projects.each do |project| + # set the project environment to please macros. + + @project = project + + if User.current.member_of?(project): + + t = TRUE + + if (ancestors.empty? || project.is_descendant_of?(ancestors.last)) + s << "\n" + end + end + + classes = (ancestors.empty? ? 'root' : 'child') + s << "
  • " + + link_to_project(project, {}, :class => "project my-project") + if project.is_public? + s << " " << l("field_is_public") << "" + else + s << " " << l("field_is_private") << "" + end + s << "
    #{textilizable(project.short_description, :project => project)}
    " unless project.description.blank? + s << "
    \n" + ancestors << project + end + end + s << ("
  • \n" * ancestors.size) + @project = original_project + end + + if t == TRUE + a << "

    " + a << l("label_my_project_plural") + a << "

    " + a << s + else + a = s + end + + a + end + + # Renders a tree of projects that the current user does not belong + # to, or of all projects if the current user is not logged in. The + # given collection may be a subset of the whole project tree + # (eg. some intermediate nodes are private and can not be seen). We + # are potentially interested in various things: the project name, + # description, manager(s), creation date, last activity date, + # general activity level, whether there is anything actually hosted + # here for the project, etc. + def render_project_table(projects) + + s = "" + s << "
    " + s << "" + s << "" + + s << sort_header_tag('name', :caption => l("field_name")) + s << "" + s << sort_header_tag('created_on', :default_order => 'desc') + s << sort_header_tag('updated_on', :default_order => 'desc') + + s << "" + + original_project = @project + + projects.each do |project| + s << render_project_in_table(project, cycle('odd', 'even'), 0) + end + + s << "
    " << l("label_managers") << "
    " + + @project = original_project + + s + end + + + def render_project_in_table(project, oddeven, level) + + # set the project environment to please macros. + @project = project + + classes = (level == 0 ? 'root' : 'child') + + s = "" + + s << "" + s << "
    " << link_to_project(project, {}, :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}"); + s << "
    " + unless project.description.blank? + s << "
    " + s << textilizable(project.short_description, :project => project) + s << "
    " + end + + s << "" + + u = project.users_by_role + if u + u.keys.each do |r| + if r.allowed_to?(:edit_project) + mgrs = [] + u[r].sort.each do |m| + mgrs << link_to_user(m) + end + if mgrs.size < 3 + s << '' << mgrs.join(', ') << '' + else + s << mgrs.join(', ') + end + end + end + end + + s << "" + s << "" << format_date(project.created_on) << "" + s << "" << format_date(project.updated_on) << "" + + s << "" + + project.children.each do |child| + s << render_project_in_table(child, oddeven, level + 1) + end + + s + end + + # Returns a set of options for a select field, grouped by project. def version_options_for_select(versions, selected=nil) grouped = Hash.new {|h,k| h[k] = []} diff -r cbce1fd3b1b7 -r 753f1380d6bc app/models/institution.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/models/institution.rb Mon Jun 06 14:41:04 2011 +0100 @@ -0,0 +1,2 @@ +class Institution < ActiveRecord::Base +end diff -r cbce1fd3b1b7 -r 753f1380d6bc app/models/issue.rb --- a/app/models/issue.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/models/issue.rb Mon Jun 06 14:41:04 2011 +0100 @@ -564,7 +564,8 @@ # Returns a string of css classes that apply to the issue def css_classes - s = "issue status-#{status.position} priority-#{priority.position}" + s = "issue status-#{status.position} " + s << "priority-#{priority.position}" s << ' closed' if closed? s << ' overdue' if overdue? s << ' child' if child? diff -r cbce1fd3b1b7 -r 753f1380d6bc app/models/project.rb --- a/app/models/project.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/models/project.rb Mon Jun 06 14:41:04 2011 +0100 @@ -85,6 +85,7 @@ named_scope :active, { :conditions => "#{Project.table_name}.status = #{STATUS_ACTIVE}"} named_scope :all_public, { :conditions => { :is_public => true } } named_scope :visible, lambda {|*args| {:conditions => Project.visible_condition(args.shift || User.current, *args) }} + named_scope :visible_roots, lambda { { :conditions => Project.root_visible_by(User.current) } } def initialize(attributes = nil) super @@ -133,6 +134,10 @@ allowed_to_condition(user, :view_project, options) end + def self.root_visible_by(user=nil) + return "#{Project.table_name}.parent_id IS NULL AND " + visible_by(user) + end + # Returns a SQL conditions string used to find all projects for which +user+ has the given +permission+ # # Valid options: @@ -463,7 +468,14 @@ # Returns a short description of the projects (first lines) def short_description(length = 255) - description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description + ## Original Redmine code: this truncates to the CR that is more + ## than "length" characters from the start. + # description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description + ## That's too much for us, and also we want to omit images and the + ## like. Truncate instead to the first CR that follows _any_ + ## non-blank text, and to the next word break beyond "length" + ## characters if the result is still longer than that. + description.gsub(/![^\s]+!/, '').gsub(/^(\s*[^\n\r]*).*$/m, '\1').gsub(/^(.{#{length}}\b).*$/m, '\1 ...').strip if description end def css_classes diff -r cbce1fd3b1b7 -r 753f1380d6bc app/models/repository/.svn/all-wcprops --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/models/repository/.svn/all-wcprops Mon Jun 06 14:41:04 2011 +0100 @@ -0,0 +1,47 @@ +K 25 +svn:wc:ra_dav:version-url +V 46 +/svn/!svn/ver/4982/trunk/app/models/repository +END +subversion.rb +K 25 +svn:wc:ra_dav:version-url +V 60 +/svn/!svn/ver/4962/trunk/app/models/repository/subversion.rb +END +bazaar.rb +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/!svn/ver/4982/trunk/app/models/repository/bazaar.rb +END +git.rb +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/!svn/ver/4975/trunk/app/models/repository/git.rb +END +mercurial.rb +K 25 +svn:wc:ra_dav:version-url +V 59 +/svn/!svn/ver/4975/trunk/app/models/repository/mercurial.rb +END +filesystem.rb +K 25 +svn:wc:ra_dav:version-url +V 60 +/svn/!svn/ver/4975/trunk/app/models/repository/filesystem.rb +END +cvs.rb +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/!svn/ver/4982/trunk/app/models/repository/cvs.rb +END +darcs.rb +K 25 +svn:wc:ra_dav:version-url +V 55 +/svn/!svn/ver/4982/trunk/app/models/repository/darcs.rb +END diff -r cbce1fd3b1b7 -r 753f1380d6bc app/models/ssamr_user_detail.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/models/ssamr_user_detail.rb Mon Jun 06 14:41:04 2011 +0100 @@ -0,0 +1,14 @@ +class SsamrUserDetail < ActiveRecord::Base + belongs_to :user + + validates_presence_of :description + + validate :check_institution + + def check_institution() + errors.add(:institution_id, "Please insert an institution") if + institution_id.blank? and other_institution.blank? + end + + +end diff -r cbce1fd3b1b7 -r 753f1380d6bc app/models/user.rb --- a/app/models/user.rb Mon Jun 06 14:24:13 2011 +0100 +++ b/app/models/user.rb Mon Jun 06 14:41:04 2011 +0100 @@ -52,6 +52,9 @@ has_one :api_token, :class_name => 'Token', :conditions => "action='api'" belongs_to :auth_source + has_one :ssamr_user_detail, :dependent => :destroy, :class_name => 'SsamrUserDetail' + accepts_nested_attributes_for :ssamr_user_detail + # Active non-anonymous users scope named_scope :active, :conditions => "#{User.table_name}.status = #{STATUS_ACTIVE}" @@ -63,6 +66,9 @@ attr_protected :login, :admin, :password, :password_confirmation, :hashed_password validates_presence_of :login, :firstname, :lastname, :mail, :if => Proc.new { |user| !user.is_a?(AnonymousUser) } + + # TODO: is this validation correct validates_presence_of :ssamr_user_detail + validates_uniqueness_of :login, :if => Proc.new { |user| !user.login.blank? }, :case_sensitive => false validates_uniqueness_of :mail, :if => Proc.new { |user| !user.mail.blank? }, :case_sensitive => false # Login must contain lettres, numbers, underscores only @@ -76,6 +82,8 @@ before_destroy :remove_references_before_destroy + validates_acceptance_of :terms_and_conditions, :on => :create, :message => :must_accept_terms_and_conditions + named_scope :in_group, lambda {|group| group_id = group.is_a?(Group) ? group.id : group.to_i { :conditions => ["#{User.table_name}.id IN (SELECT gu.user_id FROM #{table_name_prefix}groups_users#{table_name_suffix} gu WHERE gu.group_id = ?)", group_id] } @@ -107,6 +115,10 @@ write_attribute(:mail, arg.to_s.strip) end + def description=(arg) + write_attribute(:description, arg.to_s.strip) + end + def identity_url=(url) if url.blank? write_attribute(:identity_url, '') diff -r cbce1fd3b1b7 -r 753f1380d6bc app/views/account/register.rhtml --- a/app/views/account/register.rhtml Mon Jun 06 14:24:13 2011 +0100 +++ b/app/views/account/register.rhtml Mon Jun 06 14:41:04 2011 +0100 @@ -1,3 +1,6 @@ +<%= javascript_include_tag "ssamr_institutions" %> +<%= javascript_include_tag "ssamr_registration" %> +

    <%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %>

    <% form_tag({:action => 'register'}, :class => "tabular") do %> @@ -29,6 +32,26 @@

    <%= select("user", "language", lang_options_for_select) %>

    + +

    <%=l(:label_ssamr_details)%>

    + + <% fields_for :ssamr_user_details, :builder => TabularFormBuilder, :lang => current_language do |ssamr_user_detail| %> +

    + <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %> + <%=l(:text_user_ssamr_description_info)%> +

    + +

    + <%= ssamr_user_detail.radio_button :institution_type, true %> + <%= ssamr_user_detail.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true}).gsub('&', '&') %> +

    + +

    + <%= ssamr_user_detail.radio_button :institution_type, false %> Other: + <%= ssamr_user_detail.text_field(:other_institution) %> +

    + <% end %> + <% if Setting.openid? %>

    <%= text_field 'user', 'identity_url' %>

    @@ -40,5 +63,9 @@
    +<%= check_box :user, :terms_and_conditions %> <%= l(:accept_terms_and_conditions) %> <%= link_to("Terms and Conditions", "https://code.soundsoftware.ac.uk/projects/soundsoftware-site/wiki/TandCs", {:target => "_blank"}) %>. +
    +
    + <%= submit_tag l(:button_submit) %> <% end %> diff -r cbce1fd3b1b7 -r 753f1380d6bc app/views/gantts/.svn/all-wcprops --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/views/gantts/.svn/all-wcprops Mon Jun 06 14:41:04 2011 +0100 @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 41 +/svn/!svn/ver/4913/trunk/app/views/gantts +END +show.html.erb +K 25 +svn:wc:ra_dav:version-url +V 55 +/svn/!svn/ver/4913/trunk/app/views/gantts/show.html.erb +END diff -r cbce1fd3b1b7 -r 753f1380d6bc app/views/issue_moves/.svn/all-wcprops --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/views/issue_moves/.svn/all-wcprops Mon Jun 06 14:41:04 2011 +0100 @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 46 +/svn/!svn/ver/4583/trunk/app/views/issue_moves +END +new.rhtml +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/!svn/ver/4583/trunk/app/views/issue_moves/new.rhtml +END diff -r cbce1fd3b1b7 -r 753f1380d6bc app/views/issue_relations/.svn/all-wcprops --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/views/issue_relations/.svn/all-wcprops Mon Jun 06 14:41:04 2011 +0100 @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 50 +/svn/!svn/ver/4502/trunk/app/views/issue_relations +END +_form.rhtml +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/!svn/ver/4502/trunk/app/views/issue_relations/_form.rhtml +END diff -r cbce1fd3b1b7 -r 753f1380d6bc app/views/issues/_attributes.rhtml --- a/app/views/issues/_attributes.rhtml Mon Jun 06 14:24:13 2011 +0100 +++ b/app/views/issues/_attributes.rhtml Mon Jun 06 14:41:04 2011 +0100 @@ -8,7 +8,7 @@ <% end %>

    <%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), {:required => true}, :disabled => !@issue.leaf? %>

    -

    <%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %>

    +

    <%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), {:include_blank => true} %>

    <% unless @project.issue_categories.empty? %>

    <%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %> <%= prompt_to_remote(image_tag('add.png', :style => 'vertical-align: middle;'), diff -r cbce1fd3b1b7 -r 753f1380d6bc app/views/issues/_form.rhtml --- a/app/views/issues/_form.rhtml Mon Jun 06 14:24:13 2011 +0100 +++ b/app/views/issues/_form.rhtml Mon Jun 06 14:41:04 2011 +0100 @@ -12,6 +12,7 @@ :with => "Form.serialize('issue-form')" %>

    <%= f.text_field :subject, :size => 80, :required => true %>

    +

    <%= f.text_area :description, :cols => 60, :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), @@ -30,7 +31,7 @@ <% if @issue.new_record? && User.current.allowed_to?(:add_issue_watchers, @project) -%>

    <% @issue.project.users.sort.each do |user| -%> - + <% end -%>

    <% end %> diff -r cbce1fd3b1b7 -r 753f1380d6bc app/views/layouts/base.rhtml --- a/app/views/layouts/base.rhtml Mon Jun 06 14:24:13 2011 +0100 +++ b/app/views/layouts/base.rhtml Mon Jun 06 14:41:04 2011 +0100 @@ -3,8 +3,8 @@ <%=h html_title %> - - + + <%= csrf_meta_tag %> <%= favicon %> <%= stylesheet_link_tag 'application', :media => 'all' %> @@ -32,19 +32,33 @@ <%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%> -