Commit e6e057d1 authored by Holger Just's avatar Holger Just

Merge branch 'release-v3.2.0' into stable

parents d61ad013 bd132c56
......@@ -31,3 +31,4 @@ doc/app
/.rvmrc*
/*.iml
/.idea
.rbx
language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- rbx-18mode
env:
- "RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- "RAILS_ENV=test DB=mysql2 BUNDLE_WITHOUT=rmagick:mysql:postgres:sqlite"
- "RAILS_ENV=test DB=postgres BUNDLE_WITHOUT=rmagick:mysql:mysql2:sqlite"
- "RAILS_ENV=test DB=sqlite BUNDLE_WITHOUT=rmagick:mysql:mysql2:postgres"
matrix:
exclude:
- rvm: 1.9.2
env: "RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- rvm: 1.9.3
env: "RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
- rvm: rbx-18mode
env: "RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
allow_failures:
- rvm: rbx-18mode
before_script:
- "sudo apt-get --no-install-recommends install bzr cvs darcs git mercurial subversion"
- "rake ci:travis:prepare"
branches:
only:
- unstable
- master
- stable
notifications:
email: false
irc: "irc.freenode.org#chiliproject"
......@@ -9,12 +9,15 @@ gem "rubytree", "~> 0.5.2", :require => 'tree'
gem "rdoc", ">= 2.4.2"
gem "liquid", "~> 2.3.0"
gem "acts-as-taggable-on", "= 2.1.0"
gem 'gravatarify', '~> 3.0.0'
# Needed only on RUBY_VERSION = 1.8, ruby 1.9+ compatible interpreters should bring their csv
gem "fastercsv", "~> 1.5.0", :platforms => [:ruby_18, :jruby, :mingw_18]
gem "tzinfo", "~> 0.3.31" # Fixes #903. Not required for Rails >= 3.2
group :test do
gem 'shoulda', '~> 2.10.3'
# Shoulda doesn't work nice on 1.9.3 and seems to need test-unit explicitely…
gem 'test-unit', :platforms => [:mri_19]
gem 'edavis10-object_daddy', :require => 'object_daddy'
gem 'mocha'
gem 'capybara'
......@@ -52,7 +55,7 @@ end
# orders of magnitude compared to their native counterparts. You have been
# warned.
platforms :mri, :mingw do
platforms :mri, :mingw, :rbx do
group :mysql2 do
gem "mysql2", "~> 0.2.7"
end
......@@ -74,7 +77,7 @@ platforms :mri_18, :mingw_18 do
end
end
platforms :mri_19, :mingw_19 do
platforms :mri_19, :mingw_19, :rbx do
group :sqlite do
gem "sqlite3"
end
......
......@@ -77,7 +77,7 @@ class AdminController < ApplicationController
def info
@db_adapter_name = ActiveRecord::Base.connection.adapter_name
@checklist = [
[:text_default_administrator_account_changed, User.find(:first, :conditions => ["login=? and hashed_password=?", 'admin', User.hash_password('admin')]).nil?],
[:text_default_administrator_account_changed, !User.find_by_login("admin").try(:check_password?, "admin")],
[:text_file_repository_writable, File.writable?(Attachment.storage_path)],
[:text_plugin_assets_writable, File.writable?(Engines.public_directory)],
[:text_rmagick_available, Object.const_defined?(:Magick)]
......
......@@ -31,18 +31,6 @@ class ApplicationController < ActionController::Base
cookies.delete(:autologin)
end
# Remove broken cookie after upgrade from 0.8.x (#4292)
# See https://rails.lighthouseapp.com/projects/8994/tickets/3360
# TODO: remove it when Rails is fixed
before_filter :delete_broken_cookies
def delete_broken_cookies
if cookies['_chiliproject_session'] && cookies['_chiliproject_session'] !~ /--/
cookies.delete '_chiliproject_session'
redirect_to home_path
return false
end
end
# FIXME: Remove this when all of Rack and Rails have learned how to
# properly use encodings
before_filter :params_filter
......
......@@ -85,7 +85,7 @@ class DocumentsController < ApplicationController
if attachments.present? && attachments[:files].present? && Setting.notified_events.include?('document_added')
# TODO: refactor
attachments.first.container.recipients.each do |recipient|
@document.recipients.each do |recipient|
Mailer.deliver_attachments_added(attachments[:files], recipient)
end
end
......
......@@ -17,7 +17,7 @@ require 'cgi'
module ApplicationHelper
include Redmine::I18n
include GravatarHelper::PublicMethods
include Gravatarify::Helper
extend Forwardable
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
......@@ -954,6 +954,16 @@ module ApplicationHelper
(@has_content && @has_content[name]) || false
end
# Returns the gravatar image tag for the given email
# +email+ is a string with an email address
def gravatar(email, options={})
gravatarify_options = {}
gravatarify_options[:secure] = options.delete :ssl
[:default, :size, :rating, :filetype].each {|key| gravatarify_options[:key] = options.delete :key}
gravatarify_options[:html] = options
gravatar_tag email, gravatarify_options
end
# Returns the avatar image tag for the given +user+ if avatars are enabled
# +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
def avatar(user, options = { })
......
......@@ -712,7 +712,7 @@ class Issue < ActiveRecord::Base
# The default assumption is that journals have the same permissions
# as the journaled object, issue notes have separate permissions though
def journal_editable_by?(journal, user)
return true if journal.author == user && user.allowed_to?(:edit_own_issue_notes, project)
return true if journal.user == user && user.allowed_to?(:edit_own_issue_notes, project)
user.allowed_to? :edit_issue_notes, project
end
......
......@@ -41,7 +41,6 @@ class Message < ActiveRecord::Base
acts_as_watchable
attr_protected :locked, :sticky
validates_presence_of :board, :subject, :content
validates_length_of :subject, :maximum => 255
......@@ -51,7 +50,7 @@ class Message < ActiveRecord::Base
:conditions => Project.allowed_to_condition(args.first || User.current, :view_messages) } }
safe_attributes 'subject', 'content'
safe_attributes 'locked', 'sticky',
safe_attributes 'locked', 'sticky', 'board_id',
:if => lambda {|message, user|
user.allowed_to?(:edit_messages, message.project)
}
......@@ -81,9 +80,15 @@ class Message < ActiveRecord::Base
end
def after_destroy
parent.reset_last_reply_id! if parent
board.reset_counters!
end
def reset_last_reply_id!
clid = children.present? ? children.last.id : nil
self.update_attribute(:last_reply_id, clid)
end
def sticky=(arg)
write_attribute :sticky, (arg == true || arg.to_s == '1' ? 1 : 0)
end
......
......@@ -27,7 +27,7 @@ class Version < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name, :scope => [:project_id]
validates_length_of :name, :maximum => 60
validates_format_of :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :not_a_date, :allow_nil => true
validates_format_of :start_date, :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :not_a_date, :allow_nil => true
validates_inclusion_of :status, :in => VERSION_STATUSES
validates_inclusion_of :sharing, :in => VERSION_SHARINGS
......@@ -37,6 +37,7 @@ class Version < ActiveRecord::Base
safe_attributes 'name',
'description',
'start_date',
'effective_date',
'due_date',
'wiki_page_title',
......
<h2><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h2>
<% form_tag({:action => 'register'}, :class => "tabular") do %>
<% form_tag({:action => 'register'}, :class => "tabular", :autocomplete => :off) do %>
<%= error_messages_for 'user' %>
<div class="box">
......
......@@ -3,8 +3,7 @@
<div class="autoscroll">
<table class="list issues">
<thead><tr>
<th class="checkbox hide-when-print"><%= link_to image_tag('toggle_check.png'), {}, :onclick => 'toggleIssuesSelection(Element.up(this, "form")); return false;',
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
<th class="checkbox hide-when-print"><%= link_to image_tag('toggle_check.png'), {}, :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
</th>
<%= sort_header_tag('id', :caption => '#', :default_order => 'desc') %>
<% query.columns.each do |column| %>
......
......@@ -3,5 +3,4 @@
<%= call_hook(:view_issues_sidebar_planning_bottom) %>
<%= render_sidebar_queries %>
<%= call_hook(:view_issues_sidebar_queries_bottom) %>
<p><%= l(:mail_body_wiki_content_added, :id => link_to(h(@wiki_content.page.pretty_title), @wiki_content_url),
:author => h(@wiki_content.author)) %><br />
<em><%=h @wiki_content.comments %></em></p>
<em><%=h @wiki_content.last_journal.notes %></em></p>
<%= l(:mail_body_wiki_content_added, :id => h(@wiki_content.page.pretty_title),
:author => h(@wiki_content.author)) %>
<%= @wiki_content.comments %>
<%= @wiki_content.last_journal.notes %>
<%= @wiki_content_url %>
<p><%= l(:mail_body_wiki_content_updated, :id => link_to(h(@wiki_content.page.pretty_title), @wiki_content_url),
:author => h(@wiki_content.author)) %><br />
<em><%=h @wiki_content.comments %></em></p>
<em><%=h @wiki_content.last_journal.notes %></em></p>
<p><%= l(:label_view_diff) %>:<br />
<%= link_to h(@wiki_diff_url), @wiki_diff_url %></p>
<%= l(:mail_body_wiki_content_updated, :id => h(@wiki_content.page.pretty_title),
:author => h(@wiki_content.author)) %>
<%= @wiki_content.comments %>
<%= @wiki_content.last_journal.notes %>
<%= @wiki_content.page.pretty_title %>:
<%= @wiki_content_url %>
......
......@@ -115,4 +115,32 @@ module ActionController
end
end
end
# Backported fix for CVE-2012-2660
# https://groups.google.com/group/rubyonrails-security/browse_thread/thread/f1203e3376acec0f
# TODO: Remove this once we are on Rails >= 3.2.4
require 'action_controller/request'
class Request
protected
# Remove nils from the params hash
def deep_munge(hash)
hash.each_value do |v|
case v
when Array
v.grep(Hash) { |x| deep_munge(x) }
when Hash
deep_munge(v)
end
end
keys = hash.keys.find_all { |k| hash[k] == [nil] }
keys.each { |k| hash[k] = nil }
hash
end
def parse_query(qs)
deep_munge(super)
end
end
end
......@@ -983,22 +983,22 @@ bg:
description_choose_project: Проекти
description_date_from: Въведете начална дата
label_deleted_custom_field: (изтрито потребителско поле)
field_custom_filter: Custom LDAP filter
text_display_subprojects: Display subprojects
text_current_project: Current project
label_toc: Contents
search_input_placeholder: search ...
setting_mail_handler_confirmation_on_success: Send confirmation email on successful incoming email
label_mail_handler_confirmation: "Confirmation of email submission: %{subject}"
label_mail_handler_errors_with_submission: "There were errors with your email submission:"
label_document_watchers: Watchers
setting_mail_handler_confirmation_on_failure: Send confirmation email on failed incoming email
field_custom_filter: Потребителски LDAP филтър
text_display_subprojects: Показване на подпроекти
text_current_project: Текущ проект
label_toc: Съдържание
search_input_placeholder: търсене ...
setting_mail_handler_confirmation_on_success: Изпращане на е-мейл за потвърждение при успешен входен е-мейл
label_mail_handler_confirmation: "Потвърждение на изпратено с е-мейл: %{subject}"
label_mail_handler_errors_with_submission: "Има грешки във вашия е-мейл:"
label_document_watchers: Наблюдатели
setting_mail_handler_confirmation_on_failure: Изпращане на е-мейл за потвърждение при неуспешен входен е-мейл
label_between: between
label_mail_handler_failure: "Failed email submission: %{subject}"
notice_not_authorized_action: You are not authorized to perform this action.
text_mail_handler_confirmation_successful: Your email has been successful added at the following url
field_issue_summary: Issue summary
field_new_saved_query: New saved query
field_issue_view_all_open: View all open issues
label_subtask_add: Add a subtask
label_issue_hierarchy: Issue hierarchy
label_mail_handler_failure: "Пропаднал е-мейл: %{subject}"
notice_not_authorized_action: Вие нямате разрешение да изпълните това действие.
text_mail_handler_confirmation_successful: Вашият е-мейл беше успешно добавен на следващия адрес
field_issue_summary: Заглавие на задачата
field_new_saved_query: Нова записана заявка
field_issue_view_all_open: Разглеждане на всички отворени задачи
label_subtask_add: Добавяне на подзадача
label_issue_hierarchy: Йерархия на задачите
This diff is collapsed.
......@@ -963,28 +963,28 @@ de:
notice_gantt_chart_truncated: Die Grafik ist unvollständig, da das Maximum der anzeigbaren Aufgaben überschritten wurde (%{max})
setting_gantt_items_limit: Maximale Anzahl von Aufgaben die im Gantt-Chart angezeigt werden.
text_powered_by: Powered by %{link}
label_cvs_module: Module
label_filesystem_path: Root directory
label_darcs_path: Root directory
label_bazaar_path: Root directory
label_cvs_module: Modul
label_filesystem_path: Wurzelverzeichnis
label_darcs_path: Wurzelverzeichnis
label_bazaar_path: Wurzelverzeichnis
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries
label_additional_workflow_transitions_for_assignee: Additional transitions allowed when the user is the assignee
text_journal_changed_no_detail: "%{label} updated"
button_expand_all: Expand all
button_collapse_all: Collapse all
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
field_effective_date: Due date
label_news_comment_added: Comment added to a news
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page.
text_default_encoding: "Default: UTF-8"
text_git_repo_example: a bare and local repository (e.g. /gitrepo, c:\gitrepo)
label_notify_member_plural: Email issue updates
label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_git_path: Pfad zum .git Verzeichnis
label_mercurial_path: Wurzelverzeichnis
label_my_queries: Meine benutzerdefinierten Abfragen
label_additional_workflow_transitions_for_assignee: Zusätzliche Workflow-Übergänge wenn das Ticket an den Benutzer zugewiesen ist
text_journal_changed_no_detail: "%{label} aktualisiert"
button_expand_all: Alles ausklappen
button_collapse_all: Alles einklappen
label_additional_workflow_transitions_for_author: Zusätzliche Workflow-Übergänge wenn der Benutzer der Autor ist
field_effective_date: Abshlussdatum
label_news_comment_added: "Kommentar erfolgreich hinzugefügt"
field_warn_on_leaving_unsaved: "Warnen wenn eine Seite mit ungespeichertem Text verlassen wird"
text_warn_on_leaving_unsaved: "Die aktuelle Seite enthält ungespeicherten Text er verloren geht wenn Sie diese Seite verlassen."
text_default_encoding: "Standard: UTF-8"
text_git_repo_example: Ein lokales "bare Repository" (z.B. /gitrepo, c:\gitrepo)
label_notify_member_plural: Benachrichtigungen verschicken
label_path_encoding: Pfadkodierung
text_mercurial_repo_example: Lokales Projektarchiv (z.B. /hgrepo, c:\hgrepo)
label_diff: diff
description_filter: Filter
description_search: Suchfeld
......@@ -1003,19 +1003,19 @@ de:
description_date_range_interval: Zeitraum durch Start- und Enddatum festlegen
description_date_from: Startdatum eintragen
description_date_to: Enddatum eintragen
field_custom_filter: Custom LDAP filter
field_custom_filter: Benutzerdefinierter LDAP-Filter
label_toc: "Inhaltsverzeichnis"
text_display_subprojects: Display subprojects
text_current_project: Current project
setting_mail_handler_confirmation_on_success: Send confirmation email on successful incoming email
label_mail_handler_confirmation: "Confirmation of email submission: %{subject}"
label_mail_handler_errors_with_submission: "There were errors with your email submission:"
label_document_watchers: Watchers
setting_mail_handler_confirmation_on_failure: Send confirmation email on failed incoming email
label_between: between
label_mail_handler_failure: "Failed email submission: %{subject}"
notice_not_authorized_action: You are not authorized to perform this action.
text_mail_handler_confirmation_successful: Your email has been successful added at the following url
field_issue_summary: Issue summary
field_new_saved_query: New saved query
field_issue_view_all_open: View all open issues
text_display_subprojects: Unterprojekte anzeigen
text_current_project: Aktuelles Project
setting_mail_handler_confirmation_on_success: Bestätigungs-E-Mail bei erfolgreich eingegangenen E-Mails versenden
label_mail_handler_confirmation: "Bestätigung der E-Mail-Verarbeitung: %{subject}"
label_mail_handler_errors_with_submission: "Es traten Fehler bei der E-Mail verarbeitung auf:"
label_document_watchers: Beobachter
setting_mail_handler_confirmation_on_failure: Bestätigungs-E-Mail bei fehlgeschlagenen eingehenden E-Mails versenden
label_between: zwischen
label_mail_handler_failure: "E-Mail-Versand fehlgeschlagen: %{subject}"
notice_not_authorized_action: Sie sind für diese Aktion nicht autorisiert.
text_mail_handler_confirmation_successful: Ihre E-Mil wurde erfolgreich zu folgender URL hinzugefügt
field_issue_summary: Ticketübersicht
field_new_saved_query: Neue gespeicherte Abfrage
field_issue_view_all_open: Alle offen Tickets
This diff is collapsed.
......@@ -154,7 +154,7 @@ pt-BR:
general_text_Yes: 'Sim'
general_text_no: 'não'
general_text_yes: 'sim'
general_lang_name: 'Português(Brasil)'
general_lang_name: 'Português (Brasil)'
general_csv_separator: ';'
general_csv_decimal_separator: ','
general_csv_encoding: ISO-8859-1
......@@ -245,7 +245,7 @@ pt-BR:
field_role: Cargo
field_homepage: Página do projeto
field_is_public: Público
field_parent: Sub-projeto de
field_parent: Subprojeto de
field_is_in_roadmap: Exibir no planejamento
field_login: Usuário
field_mail_notification: Notificações por e-mail
......@@ -273,7 +273,7 @@ pt-BR:
field_comments: Comentário
field_url: URL
field_start_page: Página inicial
field_subproject: Sub-projeto
field_subproject: Subprojeto
field_hours: Horas
field_activity: Atividade
field_spent_on: Data
......@@ -411,8 +411,8 @@ pt-BR:
label_auth_source: Modo de autenticação
label_auth_source_new: Novo modo de autenticação
label_auth_source_plural: Modos de autenticação
label_subproject_plural: Sub-projetos
label_and_its_subprojects: "%{value} e seus sub-projetos"
label_subproject_plural: Subprojetos
label_and_its_subprojects: "%{value} e seus subprojetos"
label_min_max_length: Tamanho mín-máx
label_list: Lista
label_date: Data
......@@ -879,7 +879,7 @@ pt-BR:
field_sharing: Compartilhamento
label_version_sharing_hierarchy: Com a hierarquia do projeto
label_version_sharing_system: Com todos os projetos
label_version_sharing_descendants: Com sub-projetos
label_version_sharing_descendants: Com subprojetos
label_version_sharing_tree: Com a árvore do projeto
label_version_sharing_none: Sem compartilhamento
error_can_not_archive_project: Este projeto não pode ser arquivado
......@@ -989,7 +989,7 @@ pt-BR:
label_mercurial_path: Diretório raiz
label_diff: diff
description_search: Searchfield
description_search: Campo de pesquisa
description_user_mail_notification: Configuração de notificações por e-mail
description_date_range_list: Escolha um período a partira da lista
description_date_to: Digite a data final
......@@ -1008,21 +1008,21 @@ pt-BR:
description_date_from: Digita a data inicial
label_deleted_custom_field: (campo personalizado excluído)
field_custom_filter: Custom LDAP filter
text_display_subprojects: Display subprojects
text_current_project: Current project
label_toc: Contents
search_input_placeholder: search ...
setting_mail_handler_confirmation_on_success: Send confirmation email on successful incoming email
label_mail_handler_confirmation: "Confirmation of email submission: %{subject}"
label_mail_handler_errors_with_submission: "There were errors with your email submission:"
label_document_watchers: Watchers
setting_mail_handler_confirmation_on_failure: Send confirmation email on failed incoming email
text_display_subprojects: Exibir subprojetos
text_current_project: Projeto atual
label_toc: Conteúdo
search_input_placeholder: pesquisar ...
setting_mail_handler_confirmation_on_success: Enviar confirmação ao receber um e-mail
label_mail_handler_confirmation: "Confirmação de envio de e-mail: %{subject}"
label_mail_handler_errors_with_submission: "Seu envio de email falhou:"
label_document_watchers: Observadores
setting_mail_handler_confirmation_on_failure: Enviar confirmação ao falhar o recebimento de um e-mail
label_between: between
label_mail_handler_failure: "Failed email submission: %{subject}"
notice_not_authorized_action: You are not authorized to perform this action.
text_mail_handler_confirmation_successful: Your email has been successful added at the following url
field_issue_summary: Issue summary
field_new_saved_query: New saved query
field_issue_view_all_open: View all open issues
label_subtask_add: Add a subtask
label_issue_hierarchy: Issue hierarchy
label_mail_handler_failure: "Envio de e-mail falhou: %{subject}"
notice_not_authorized_action: Você não tem permissão para fazer isto.
text_mail_handler_confirmation_successful: Seu e-mail foi adicionado com sucesso a URL a seguir
field_issue_summary: Relatório
field_new_saved_query: Nova consulta
field_issue_view_all_open: Ver tarefas abertas
label_subtask_add: Adicionar
label_issue_hierarchy: Subtarefas
This diff is collapsed.
......@@ -12,6 +12,8 @@
# See doc/COPYRIGHT.rdoc for more details.
#++
require 'wiki_content'
class MergeWikiVersionsWithJournals < ActiveRecord::Migration
# This is provided here for migrating up after the WikiContent::Version class has been removed
class WikiContent < ActiveRecord::Base
......
= ChiliProject Changelog
== 2012-06-09 v3.2.0
* Bug #844: Set autocomplete=off for some fields in Registration form
* Bug #863: missing journals fixture at test/unit/issue_test.rb
* Bug #950: jQuery AJAX requests don't include CSRF token
* Bug #966: "edit own notes" fails since 3.1.0
* Bug #967: Menu - Missing translations (French)
* Bug #968: Forum threads aren't always displaying "Last Message"
* Bug #969: Forum URLs in the menu are missing the project_id
* Bug #970: Long version titles extend outside the group menu when expanding Roadmap
* Bug #974: menu link broken in duplicate issue mode
* Bug #975: Start Date is not saved for Versions
* Bug #984: Cannot unlock a forum thread
* Bug #986: Notification Mail for Wiki-Changes doesn't contain change comment
* Bug #994: select all in issue list isn't working
* Bug #1007: Right clicking on item in roadmap displays menu at incorrect position
* Bug #1008: error 500 when uploading a new file to an existing document
* Bug #1024: Select multiple issues with shift key in issue list
* Bug #1025: Rails: Unsafe Query Generation Risk in Ruby on Rails (CVE-2012-2660)
* Bug #1033: Replace vendored gravatar lib by gem
* Feature #749: Git Integration: Property Main Branch
* Feature #947: Reformat the CSS files to use a standard
* Feature #983: Bulgarian translation of several strings
* Feature #988: Swedish translation of several strings
* Feature #1016: Limit height of project drop down menu
* Task #982: Updated czech localization for chiliproject 3.1
== 2012-04-04 v3.1.0
* Bug #739: Relative textile links not converted to full URLs in emails
......
.icon-example-works { background-image: url(../images/it_works.png); }
.icon-example-works {
background-image: url(../images/it_works.png);
}
......@@ -18,7 +18,7 @@ module ChiliProject
module VERSION #:nodoc:
MAJOR = 3
MINOR = 1
MINOR = 2
PATCH = 0
TINY = PATCH # Redmine compat
......
......@@ -259,7 +259,7 @@ Redmine::MenuManager.map :project_menu do |menu|
:caption => :label_issue_plural,
:children => issue_query_proc
})
menu.push(:new_issue, { :controller => 'issues', :action => 'new' }, {
menu.push(:new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, {
:param => :project_id,
:caption => :label_issue_new,
:parent => :issues,
......@@ -345,7 +345,7 @@ Redmine::MenuManager.map :project_menu do |menu|
project.boards.collect do |board|
Redmine::MenuManager::MenuItem.new(
"board-#{board.id}".to_sym,
{ :controller => 'boards', :action => 'show', :id => board },
{ :controller => 'boards', :action => 'show', :project_id => project, :id => board },
{
:caption => board.name # is h() in menu_helper.rb
})
......
......@@ -100,6 +100,13 @@ module Redmine
def default_branch
bras = self.branches
return nil if bras.nil?
head = nil
scm_cmd('symbolic-ref', 'HEAD') do |io|
head = io.readline
end
/^refs\/heads\/(.*)$/.match(head)
bras.include?($1) ? $1 : bras.first
rescue ScmCommandAborted, EOFError
bras.include?('master') ? 'master' : bras.first
end
......
......@@ -271,7 +271,8 @@ module Redmine
end
blame
rescue HgCommandAborted
nil # means not found or cannot be annotated
# means not found or cannot be annotated
Annotate.new
end
class Revision < Redmine::Scm::Adapters::Revision
......
......@@ -24,6 +24,41 @@ end
# Tasks can be hooked into by redefining them in a plugin
namespace :ci do
namespace :travis do
desc "Prepare a TRAVIS run"
task :prepare do
ENV['RAILS_ENV'] = 'test'
RAILS_ENV = 'test'
database_yml = {"database" => "chiliproject_test"}
database_yml.merge! case ENV['DB']
when 'mysql'
{"adapter" => "mysql", "username" => "root"}
when 'mysql2'
{"adapter" => "mysql2", "username" => "root"}
when 'postgres'
{"adapter" => "postgresql", "username" => "postgres"}
when 'sqlite'
{"adapter" => "sqlite3", "database" => "db/test.sqlite3"}
end
File.open("config/database.yml", 'w') do |f|
YAML.dump({"test" => database_yml}, f)
end
Rake::Task["generate_session_store"].invoke
# Create and migrate the database
Rake::Task["db:create"].invoke
Rake::Task["db:migrate"].invoke
Rake::Task["db:migrate:plugins"].invoke
Rake::Task["db:schema:dump"].invoke
# Create test repositories
Rake::Task["test:scm:setup:all"].invoke
end
end
desc "Setup Redmine for a new build."
task :setup do
Rake::Task["ci:dump_environment"].invoke
......
......@@ -467,7 +467,15 @@ jQuery.viewportHeight = function() {
// Automatically use format.js for jQuery Ajax
jQuery.ajaxSetup({
'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")}
'beforeSend': function(xhr) {
xhr.setRequestHeader("Accept", "text/javascript");
// TODO: Remove once jquery-rails (Rails 3) has been added a dependency
var csrf_meta_tag = jQuery('meta[name="csrf-token"]');
if (csrf_meta_tag) {
xhr.setRequestHeader('X-CSRF-Token', csrf_meta_tag.attr('content'));
}
}
})
/* TODO: integrate with existing code and/or refactor */
......@@ -563,6 +571,13 @@ jQuery(document).ready(function($) {
// Click on the menu header with a dropdown menu
$('#account-nav .drop-down').live('click', function(event) {
var menuItem = $(this);
var menuUl = menuItem.find('> ul');
menuUl.css('height', 'auto');
if(menuUl.height() > $.viewportHeight()) {
var windowHeight = $.viewportHeight() - 150;
menuUl.css({'height': windowHeight});
}
toggleTopMenu(menuItem);
......
......@@ -3,6 +3,7 @@
var element = el;
var opts = opti