Import archive redmine_questions-1_0_5-light

This commit is contained in:
Alexandr Antonov 2024-02-20 12:35:41 +03:00
parent 63c96f6a26
commit 86496b2533
67 changed files with 194 additions and 721 deletions

View File

@ -16,14 +16,11 @@ local Pipeline(rubyVer, db, license, redmine, dependents) = {
};
[
Pipeline("3.1.0", "mysql", "pro", "trunk", ""),
Pipeline("3.1.0", "mysql", "light", "trunk", ""),
Pipeline("3.1.0", "pg", "pro", "trunk", ""),
Pipeline("3.1.0", "mysql", "pro", "5.0", ""),
Pipeline("2.7.3", "mysql", "pro", "4.2", ""),
Pipeline("2.7.3", "pg", "light", "4.2", ""),
Pipeline("2.4.1", "pg", "pro", "4.0", ""),
Pipeline("2.4.1", "mysql", "pro", "3.4", ""),
Pipeline("2.2.6", "pg", "pro", "3.4", ""),
Pipeline("2.2.6", "mysql", "light", "3.0", ""),
Pipeline("3.2.2", "mysql", "pro", "trunk", ""),
Pipeline("3.2.2", "pg", "pro", "5.1", ""),
Pipeline("3.0.6", "mysql", "pro", "5.0", "redmineup_tags"),
Pipeline("2.7.8", "mysql", "light", "4.2", ""),
Pipeline("2.7.8", "pg", "pro", "4.2", ""),
Pipeline("2.3.8", "mysql", "pro", "4.0", ""),
Pipeline("2.3.8", "pg", "pro", "4.0", "")
]

View File

@ -1 +1 @@
gem "redmine_crm"
gem "redmineup"

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -18,7 +18,6 @@
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class QuestionsAnswersController < ApplicationController
unloadable
before_action :find_question, :only => [:new, :create]
before_action :find_answer, :only => [:update, :destroy, :edit, :show]

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -18,7 +18,6 @@
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class QuestionsController < ApplicationController
unloadable
before_action :find_question, :only => [:edit, :show, :update, :destroy]
before_action :find_optional_project, :only => [:index, :update_form, :new, :create, :autocomplete_for_subject]
@ -41,7 +40,8 @@ class QuestionsController < ApplicationController
end
def show
@answers = @question_item.answers.by_accepted.by_votes.by_date
@answers = @question_item.answers.
by_accepted.by_votes.by_date
if @answers
@limit = Setting.issues_export_limit.to_i
@answer_count = @answers.count
@ -131,7 +131,7 @@ class QuestionsController < ApplicationController
if params[:id].present? && query = Question.find_by_id(params[:question_id])
@previewed = query
end
@text = (params[:text] ? params[:text] : nil)
@text = (params[:question] ? params[:question][:content] : nil)
render :partial => 'common/preview'
end
@ -168,7 +168,7 @@ class QuestionsController < ApplicationController
end
@limit = per_page_option
scope = scope.tagged_with(params[:tag]) if params[:tag].present?
scope = scope.where(id: scope.tagged_with(params[:tag]).map(&:id)) if params[:tag].present?
@topic_count = scope.count
@topic_pages = Paginator.new(@topic_count, @limit, params[:page])
@ -186,12 +186,9 @@ class QuestionsController < ApplicationController
end
def find_question
if Redmine::VERSION.to_s =~ /^2.6/
@question_item = Question.visible.find(params[:id], readonly: false)
else
@question_item = Question.visible.find(params[:id])
end
return deny_access unless @question_item.visible?
@project = @question_item.project
rescue ActiveRecord::RecordNotFound
render_404

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -85,7 +85,7 @@ class QuestionsSectionsController < ApplicationController
def index
ApplicationController.menu_item :questions
@question_item = Question.new
@sections = QuestionsSection.visible.order(:project_id).sorted.for_project(@project)
@sections = QuestionsSection.visible.preload(:questions).order(:project_id).sorted.for_project(@project)
redirect_to project_questions_path(:section_id => @sections.last, :project_id => @sections.last.project) if @sections.size == 1
@sections = @sections.with_questions_count

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -18,7 +18,6 @@
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class QuestionsStatusesController < ApplicationController
unloadable
layout 'admin'
before_action :require_admin, :except => :index

View File

@ -3,7 +3,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -20,9 +20,10 @@
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
module QuestionsHelper
def question_status_tag(status)
def question_status_tag(status, editable=false)
return '' unless status
content_tag(:span, status.name, :class => 'question-status-tag tag-label-color', :style => "background-color: #{status.color}")
content_tag(:span, status.name, class: "status-badge #{'editable' if editable}",
style: "color:#{status.color};border: 1px solid #{status.color};")
end
def allow_voting?(votable, user = User.current)

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -17,8 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class Question < ActiveRecord::Base
unloadable
class Question < ApplicationRecord
include Redmine::SafeAttributes
extend ApplicationHelper
@ -31,12 +30,8 @@ class Question < ActiveRecord::Base
has_many :answers, :class_name => 'QuestionsAnswer', :dependent => :destroy
if ActiveRecord::VERSION::MAJOR >= 4
has_many :comments, lambda { order('created_on') }, :as => :commented, :dependent => :delete_all
else
has_many :comments, :as => :commented, :dependent => :delete_all, :order => "created_on"
end
rcrm_acts_as_viewed
up_acts_as_viewed
acts_as_attachable_questions
acts_as_watchable
@ -47,30 +42,17 @@ class Question < ActiveRecord::Base
:description => :content,
:title => Proc.new {|o| o.subject }
if ActiveRecord::VERSION::MAJOR >= 4
acts_as_activity_provider :type => 'questions',
:permission => :view_questions,
:author_key => :author_id,
:timestamp => "#{table_name}.created_on",
:scope => joins({:section => :project}, :author)
acts_as_searchable :columns => ["#{table_name}.subject",
"#{table_name}.content",
"#{QuestionsAnswer.table_name}.content"],
:scope => eager_load({:section => :project}, :answers),
:project_key => "#{QuestionsSection.table_name}.project_id"
else
acts_as_activity_provider :type => 'questions',
:permission => :view_questions,
:author_key => :author_id,
:timestamp => "#{table_name}.created_on",
:find_options => { :include => [{:section => :project}, :author] }
acts_as_searchable :columns => ["#{table_name}.subject",
"#{table_name}.content",
"#{QuestionsAnswer.table_name}.content"],
:include => [{:section => :project}, :answers],
:project_key => "#{QuestionsSection.table_name}.project_id"
end
scope :solutions, lambda { joins(:section).where(:questions_sections => {:section_type => QuestionsSection::SECTION_TYPE_SOLUTIONS}) }
scope :questions, lambda { joins(:section).where(:questions_sections => {:section_type => QuestionsSection::SECTION_TYPE_QUESTIONS}) }

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -17,8 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class QuestionsAnswer < ActiveRecord::Base
unloadable
class QuestionsAnswer < ApplicationRecord
include Redmine::SafeAttributes
extend ApplicationHelper
@ -26,8 +25,6 @@ class QuestionsAnswer < ActiveRecord::Base
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
belongs_to :question, :counter_cache => 'answers_count', :touch => true
attr_protected :id if ActiveRecord::VERSION::MAJOR <= 4
acts_as_attachable_questions
acts_as_event :datetime => :created_on,
@ -37,19 +34,11 @@ class QuestionsAnswer < ActiveRecord::Base
:description => :content,
:title => Proc.new {|o| o.question.subject }
if ActiveRecord::VERSION::MAJOR >= 4
acts_as_activity_provider :type => 'questions',
:permission => :view_questions,
:author_key => :author_id,
:timestamp => "#{table_name}.created_on",
:scope => joins({ :question => { :section => :project } }, :author)
else
acts_as_activity_provider :type => 'questions',
:permission => :view_questions,
:author_key => :author_id,
:timestamp => "#{table_name}.created_on",
:find_options => { :joins => [{ :question => { :section => :project } }, :author] }
end
scope :visible, lambda {|*args| where(Question.visible_condition(args.shift || User.current)) }
scope :by_votes, lambda { order("#{table_name}.cached_weighted_score DESC") }

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -17,14 +17,13 @@
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class QuestionsSection < ActiveRecord::Base
unloadable
class QuestionsSection < ApplicationRecord
include Redmine::SafeAttributes
belongs_to :project
has_many :questions, :foreign_key => "section_id", :dependent => :destroy
attr_protected :id if ActiveRecord::VERSION::MAJOR <= 4
safe_attributes 'name', 'project', 'position', 'description', 'section_type'
scope :with_questions_count, lambda {
@ -39,7 +38,7 @@ class QuestionsSection < ActiveRecord::Base
}
scope :sorted, lambda { order(:position) }
rcrm_acts_as_list :scope => 'project_id = #{project_id}'
up_acts_as_list :scope => 'project_id = #{project_id}'
acts_as_watchable
SECTION_TYPE_QUESTIONS = 'questions'

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -18,7 +18,6 @@
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class QuestionsSettings
unloadable
IDEA_COLORS = {
:green => 'green',

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -17,20 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class QuestionsStatus < ActiveRecord::Base
unloadable
class QuestionsStatus < ApplicationRecord
include Redmine::SafeAttributes
belongs_to :question
attr_protected :id if ActiveRecord::VERSION::MAJOR <= 4
safe_attributes 'name', 'is_closed', 'position', 'color'
validates :name, presence: true, uniqueness: true
scope :sorted, lambda { order(:position) }
rcrm_acts_as_list
up_acts_as_list
def to_s
name

View File

@ -1,6 +0,0 @@
<%= raw @questions_tags.map { |question_tag| {
'id' => @names_only ? question_tag.name : question_tag.id,
'text' => question_tag.name
}
}.to_json
%>

View File

@ -6,22 +6,22 @@
%>
</div>
<h1 class="question-title"><%=h @question_item.subject %></h1>
<h2 class="question-title"><%=h @question_item.subject %></h2>
<%= render :partial => 'question_item', :object => @question_item %>
<% if @question_item.section.allow_answering? %>
<div id="answers">
<% if @answers.any? %>
<h3><%= l(:label_questions_answer_plural) %> (<%= @answer_count %>)</h3>
<% @answers.each do |answer| %>
<% @answers.find_each do |answer| %>
<%= render :partial => 'questions_answers/answer_item', :locals => { :question_item => answer } %>
<% end %>
<span class="pagination"><%= pagination_links_full @answer_pages, @answer_count %></span>
<% end %>
<% if @question_item.allow_answering? && User.current.allowed_to?(:add_answers, @project) %>
<h3><%= l(:label_questions_your_answer) %></h3>
<div id="reply" >
<p><%= toggle_link l(:button_reply), "reply", :focus => 'answer_content' %></p>
<div id="reply" style="display:none;">
<%= form_for @answer, :as => :answer, :url => question_answers_path(@question_item), :html => {:multipart => true, :id => 'answer-form'} do |f| %>
<%= render :partial => 'questions_answers/form', :locals => {:f => f, :replying => true} %>
<%= submit_tag l(:button_submit) %>

View File

@ -23,7 +23,7 @@
<%= link_to h(question.subject), { :controller => 'questions', :action => 'show', :project_id => question.project, :id => question } %>
<%= question_status_tag(question.status) %>
</h3>
<p><%= truncate(Question.to_text(textilizable(question.content)), :length => 100) %></p>
<p><%= Question.to_text(textilizable(truncate(question.content, :length => 100))) %></p>
<ul class="meta">
<% if question.allow_answering? %>
<li class="answers icon icon-comment"><%= l(:label_questions_answers, :count => question.answers_count) %></li>

View File

@ -8,7 +8,6 @@
<%= render :partial => 'form', :locals => {:f => f} %>
</div>
<%= submit_tag l(:button_save) %>
<%= preview_link({:controller => 'questions', :action => 'preview', :question_id => @question_item}, 'question_form') if Redmine::VERSION.to_s <= '3.4.5' %>
| <%= link_to l(:button_cancel), question_path(@question_item) %>
<% end %>

View File

@ -6,7 +6,6 @@
<%= render partial: 'form', locals: { f: f } %>
</div>
<%= submit_tag l(:button_create) %>
<% preview_link({ controller: 'questions', action: 'preview', id: @question_item }, 'question_form') if Redmine::VERSION.to_s <= '3.4.5' %>
<% end %>
<div id="preview" class="wiki"></div>

View File

@ -5,7 +5,6 @@
<%= back_url_hidden_field_tag %>
<%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_save) %>
<%= preview_link(preview_questions_answers_path(@answer), 'answer-form') if Redmine::VERSION.to_s <= '3.4.5' %>
| <%= link_to l(:button_cancel), question_path(@answer.question, :anchor => "question_item_#{@answer.id}") %>
<% end %>
<div id="preview" class="wiki"></div>

View File

@ -1,3 +1,4 @@
<% allowed_to_edit = User.current.allowed_to?(:edit_question_comments, comment.commented.project) || (comment.author == User.current && User.current.allowed_to?(:edit_own_question_comments, comment.commented.project)) %>
<div class="comment" id="comment_<%= comment.id %>">
<div class="contextual">
<%= link_to(
@ -5,7 +6,7 @@
{:controller => 'questions_comments', :action => 'edit', :source_id => comment.commented, :source_type => comment.commented.class.name.underscore, :id => comment.id},
:class => 'icon icon-edit',
:method => :get
) if (User.current.allowed_to?(:edit_question_comments, comment.commented.project) || (comment.author == User.current && User.current.allowed_to?(:edit_own_question_comments, comment.commented.project)))
) if allowed_to_edit
%>
<%= link_to(
"",
@ -13,7 +14,7 @@
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:title => l(:button_delete)
) if (User.current.allowed_to?(:edit_question_comments, comment.commented.project) || (comment.author == User.current && User.current.allowed_to?(:edit_own_question_comments, comment.commented.project)))
) if allowed_to_edit
%>
</div>
<div class="author">
@ -24,4 +25,3 @@
<%= textilizable(comment.comments) %>
</div>
</div>

View File

@ -1,6 +1,6 @@
<% if question_item.comments.any? %>
<div class="question-comments">
<% question_item.comments.each do |comment| %>
<% question_item.comments.find_each do |comment| %>
<% next if comment.new_record? %>
<%= render :partial => "questions_comments/comment", :locals => {:comment => comment, :comment_source => question_item} %>
<% end %>

View File

@ -68,6 +68,13 @@
border: 1px solid #222; /* @gray-dark */
}
.simplecolorpicker span.color[data-selected]:after {
/*font-family: 'FontAwesome';*/
-webkit-font-smoothing: antialiased;
content: '\2714'; /* Ok/check mark */
margin-right: 2px;
margin-left: 2px;
color: #fff;
}
@ -76,13 +83,3 @@
border-left: 1px solid #222; /* @gray-dark */
}
.simplecolorpicker span.color[data-selected]:after {
/*font-family: 'FontAwesome';*/
-webkit-font-smoothing: antialiased;
content: '\2714'; /* Ok/check mark */
margin-right: 2px;
margin-left: 2px;
}

View File

@ -137,7 +137,6 @@ div.topic ul.meta li a {
#topics_container.votable .topic-vote {float: left; width: 60px; text-align: center;}
#topics_container.votable .topic-content {padding-left: 60px;}
#topics_container.votable .topic-vote .vote-score {display: block; font-size: 24px;}
#topics_container.votable .topic-vote .vote-score {display: block; font-size: 24px;}
#topics_container.votable .topic-vote label {color: #999; line-height: 1; font-size: 12px; margin-bottom: 3px; display: block;}
#topics_container.votable .topic-vote .status-answered {
height: 30px;
@ -197,19 +196,39 @@ div.question p.author {
margin-top: 0px;
}
.question-status-tag {
font-family: Verdana, sans-serif;
background-color: #759FCF;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 3px;
padding: 2px 4px;
/***** Badges *****/
.question-status-badge {
position:relative;
font-weight:bold;
font-size: 10px;
display: inline-block;
vertical-align: middle;
color: white;
font-weight: normal;
bottom: 2px;
padding: 1px 3px;
margin-right: 2px;
margin-left: 2px;
border-radius: 2px;
text-transform: uppercase;
text-decoration: none;
border: 1px solid #aaa;
line-height: 20px;
white-space: nowrap;
}
.question-status-badge a {
color: inherit;
text-decoration: none;
}
.question-status-badge.editable {
background: #fff url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOSIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgOSA5IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTAsMi4xNjJsNC41LDQuNDY5bDQuNSwtNC40NjkiIHN0cm9rZT0iI0E2QTZBNiIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+") no-repeat 50%;
padding-right: 15px;
padding-right: 14px;
background-position-x: right 2px;
}
.question-status-badge:hover a {
opacity: 0.5;
}
/* Question vote*/
div.question {display: table; width: 100%;}

View File

@ -2,7 +2,7 @@
# Czech strings go here for Rails i18n
cs:
label_questions: 'Pomoc & Podpora'
label_questions_search: 'Vyhledejte otázku, odpoveď nebo téma...'
label_questions_search: 'Vyhledejte otázku nebo téma...'
label_questions_new: Nová otázka
label_questions_message: Zpráva
label_questions_added_time: "Přidaná %{value} před"

View File

@ -2,7 +2,7 @@
# german strings go here for Rails i18n
de:
label_questions: 'Hilfe & Unterstützung'
label_questions_search: 'Suche nach einer bestimmten Frage, Antwort oder Thema...'
label_questions_search: 'Suche nach einer bestimmten Frage oder Thema...'
label_questions_new: Neue Frage
label_questions_message: Nachricht
label_questions_added_time: "Hinzugefügt vor %{value}"

View File

@ -2,7 +2,7 @@
# English strings go here for Rails i18n
en:
label_questions: 'Help & Support'
label_questions_search: 'Search for a specific question, answer or topic ...'
label_questions_search: 'Search for a specific question or topic ...'
label_questions_new: New question
label_questions_message: Message
label_questions_added_time: "Added %{value} ago"

View File

@ -1,6 +1,6 @@
es:
label_questions: 'Ayuda y Soporte'
label_questions_search: 'Buscar una pregunta, respuesta o tópico...'
label_questions_search: 'Buscar una pregunta o tópico...'
label_questions_new: Nueva pregunta
label_questions_message: Mensaje
label_questions_added_time: "Agregado hace %{value}"

View File

@ -2,7 +2,7 @@
# Hungrian strings go here for Rails i18n
hu:
label_questions: 'Segítség és Támogatás'
label_questions_search: 'Egy adott kérdés, válasz vagy téma keresése ...'
label_questions_search: 'Egy adott kérdés vagy téma keresése ...'
label_questions_new: Új kérdés
label_questions_message: Üzenet
label_questions_added_time: "Hozzáadva %{value} ezelőtt"

View File

@ -2,7 +2,7 @@
# Italian strings go here for Rails i18n
it:
label_questions: Aiuto e supporto
label_questions_search: "Ricerca di una domanda, una risposta o un argomento specifico ...."
label_questions_search: "Ricerca di una domanda o un argomento specifico ...."
label_questions_new: Nuova domanda
label_questions_message: Messaggio
label_questions_added_time: "Aggiunto %{value} fa."

View File

@ -2,7 +2,7 @@
# English strings go here for Rails i18n
pt-BR:
label_questions: 'Ajuda & Suporte'
label_questions_search: 'Buscar por uma pergunta específica, resposta ou tópico ...'
label_questions_search: 'Buscar por uma pergunta específica ou tópico ...'
label_questions_new: Nova pergunta
label_questions_message: Mensagem
label_questions_added_time: "Adicionada %{value} atrás"

View File

@ -3,7 +3,7 @@
# English strings go here for Rails i18n
ru:
label_questions: 'Вопросы/Ответы'
label_questions_search: 'Поиск вопросов и ответов ...'
label_questions_search: 'Поиск вопросов или тем ...'
label_questions_new: Новая тема
label_questions_message: Сообщение
label_questions_added_time: "Добавлена %{value} назад"

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -59,10 +59,7 @@ resources :projects do
resources :questions_sections
resources :questions
end
match "projects/:project_id/questions/:question_id" => "questions#preview",:via => [:post]
match "questions/:question_id/edit" => "questions#preview",:via => [:post]
match "questions/:question_id" => "questions#preview",:via => [:post]
match "questions_answers/:question_id/edit" => "questions#preview",:via => [:post]
match "projects/:project_id/questions/questions_sections/:section_id" => "questions#index", :via => [:get]
match "questions/questions_sections/:section_id" => "questions#index", :via => [:get]
match 'auto_completes/questions_tags' => 'auto_completes#questions_tags', :via => :get, :as => 'auto_complete_questions_tags'

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class ActsAsVotableMigration < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
class ActsAsVotableMigration < ActiveRecord::Migration[4.2]
def self.up
ActiveRecord::Base.create_votable_table
end

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class AddViewingMigration < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
class AddViewingMigration < ActiveRecord::Migration[4.2]
def self.up
unless table_exists?(:viewings)
ActiveRecord::Base.create_viewings_table

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class AddTaggingMigration < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
class AddTaggingMigration < ActiveRecord::Migration[4.2]
def up
ActiveRecord::Base.create_taggable_table
end

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class CreateQuestions < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
class CreateQuestions < ActiveRecord::Migration[4.2]
def change
create_table :questions do |t|
t.string :subject

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class CreateQuestionsSections < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
class CreateQuestionsSections < ActiveRecord::Migration[4.2]
def change
create_table :questions_sections do |t|
t.string :name

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class CreateQuestionsAnswers < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
class CreateQuestionsAnswers < ActiveRecord::Migration[4.2]
def change
create_table :questions_answers do |t|
t.text :content

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
class CreateQuestionsStatuses < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
class CreateQuestionsStatuses < ActiveRecord::Migration[4.2]
def change
create_table :questions_statuses do |t|
t.string :name

View File

@ -1,10 +1,18 @@
== Redmine Q&A plugin changelog
Redmine Q&A plugin
Copyright (C) 2011-2023 RedmineUP
Copyright (C) 2011-2024 Kirill Bezrukov (RedmineUP)
https://www.redmineup.com/
== 2022-01-17 v1.0.4
== 2024-02-15 v1.0.5
* Dropped Redmine 3 support
* Fixed tag filter
* Fixed textilize performance issue
* Fixed select2 for Redmine 5.1+
* Fixed voting bugs
== 2023-01-17 v1.0.4
* Added Hungarian locale (Krisztian Engi, Lilla Basilides)
* Updated Czech locale (Petr Stefan)

10
init.rb
View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -17,9 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
requires_redmine_crm version_or_higher: '0.0.56'
requires_redmineup version_or_higher: '1.0.5' rescue raise "\n\033[31mRedmine requires newer redmineup gem version.\nPlease update with 'bundle update redmineup'.\033[0m"
QA_VERSION_NUMBER = '1.0.4'
QA_VERSION_NUMBER = '1.0.5'
QA_VERSION_TYPE = "Light version"
Redmine::Plugin.register :redmine_questions do
@ -30,7 +30,7 @@ Redmine::Plugin.register :redmine_questions do
url 'https://www.redmineup.com/pages/plugins/questions'
author_url 'mailto:support@redmineup.com'
requires_redmine :version_or_higher => '3.0'
requires_redmine :version_or_higher => '4.0'
delete_menu_item(:top_menu, :help)
@ -66,7 +66,7 @@ Redmine::Plugin.register :redmine_questions do
end
end
if Rails.configuration.respond_to?(:autoloader) && Rails.configuration.autoloader == :zeitwerk
if Rails.configuration.respond_to?(:autoloader) && Rails.configuration.autoloader == :zeitwerk || Rails.version > '7.0'
Rails.autoloaders.each { |loader| loader.ignore(File.dirname(__FILE__) + '/lib') }
end
require File.dirname(__FILE__) + '/lib/redmine_questions'

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -26,13 +26,8 @@ module Redmine
module ClassMethods
def acts_as_attachable_questions(options = {})
if Redmine::VERSION.to_s >= '3.0'
has_many :attachments, lambda { order("#{Attachment.table_name}.created_on") }, as: :container, dependent: :destroy
else
has_many :attachments, options.merge(:as => :container,
:order => "#{Attachment.table_name}.created_on",
:dependent => :destroy)
end
send :include, Redmine::Acts::AttachableQuestions::InstanceMethods
before_save :attach_saved_attachments

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -24,9 +24,6 @@ module RedmineQuestions
module AutoCompletesControllerPatch
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
end
end
module InstanceMethods
@ -36,7 +33,18 @@ module RedmineQuestions
q = (params[:q] || params[:term]).to_s.strip
scope = Question.tags_cloud(:name_like => q, :limit => params[:limit] || 10)
@questions_tags = scope.to_a.sort! { |x, y| x.name <=> y.name }
render :layout => false, :partial => 'questions_tags'
render json: format_questions_tags_json(@questions_tags, @names_only)
end
private
def format_questions_tags_json(questions_tags, names_only)
questions_tags.map do |question_tag|
{
id: names_only ? question_tag.name : question_tag.id,
text: question_tag.name
}
end
end
end
end

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -23,7 +23,6 @@ module RedmineQuestions
def self.included(base) # :nodoc:
base.send(:include, InstanceMethods)
base.class_eval do
unloadable
if method_defined?(:send_notification)
alias_method :send_notification_without_questions, :send_notification
alias_method :send_notification, :send_notification_with_questions

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -82,9 +82,6 @@ module RedmineQuestions
def self.included(receiver)
receiver.send :extend, ClassMethods
receiver.send :include, InstanceMethods
receiver.class_eval do
unloadable
end
end
end
end

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -23,7 +23,6 @@ module RedmineQuestions
def self.included(base)
base.extend(ClassMethods)
base.class_eval do
unloadable
class << self
alias_method :all_without_questions, :all
alias_method :all, :all_with_questions

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -22,7 +22,6 @@ module RedmineQuestions
module ProjectPatch
def self.included(base) # :nodoc:
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development
has_many :questions_sections, :dependent => :delete_all
has_many :questions, :through => :questions_sections
end

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -26,7 +26,6 @@ module RedmineQuestions
base.send(:include, InstanceMethods)
base.class_eval do
unloadable
alias_method :project_settings_tabs_without_questions, :project_settings_tabs
alias_method :project_settings_tabs, :project_settings_tabs_with_questions
end

View File

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -22,8 +22,7 @@ module RedmineQuestions
module UserPatch
def self.included(base) # :nodoc:
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development
rcrm_acts_as_voter
up_acts_as_voter
end
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 533 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,39 +0,0 @@
var oldToggleFilter = window.toggleFilter;
window.toggleFilter = function (field) {
oldToggleFilter(field);
return transform_to_select2(field);
};
function formatStateWithAvatar(opt) {
return $('<span>' + opt.avatar + '&nbsp;' + opt.text + '</span>');
};
var select2Filters = {};
function transform_to_select2(field) {
field = field.replace('.', '_');
var filter = select2Filters[field];
if (filter !== undefined && $('#tr_' + field + ' .values .select2').size() == 0) {
$('#tr_' + field + ' .toggle-multiselect').hide();
$('#tr_' + field + ' .values .value').attr('multiple', 'multiple');
$('#tr_' + field + ' .values .value').select2({
ajax: {
url: filter['url'],
dataType: 'json',
delay: 250,
data: function (params) {
return {q: params.term};
},
processResults: function (data, params) {
return {results: data};
},
cache: true
},
placeholder: ' ',
minimumInputLength: filter['minimumInputLength'],
width: filter['width'],
templateResult: filter['formatState']
});
}
};

View File

@ -1,413 +0,0 @@
.select2-container {
box-sizing: border-box;
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle;
}
.select2-container .select2-selection--single {
box-sizing: border-box;
cursor: pointer;
display: block;
height: 28px;
user-select: none;
-webkit-user-select: none;
}
.select2-container .select2-selection--single .select2-selection__rendered {
display: block;
padding-left: 8px;
padding-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.select2-container .select2-selection--single .select2-selection__clear {
position: relative;
}
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
padding-right: 8px;
padding-left: 20px;
}
.select2-container .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 24px;
user-select: none;
-webkit-user-select: none;
}
.select2-container .select2-selection--multiple .select2-selection__rendered {
/*display: inline-block;*/
overflow: hidden;
padding-left: 8px;
text-overflow: ellipsis;
white-space: nowrap;
}
.select2-container .select2-search--inline {
float: left;
}
.select2-container .select2-search--inline .select2-search__field {
box-sizing: border-box;
border: none;
font-size: 100%;
margin-top: 2px;
padding: 0;
}
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none;
}
.select2-dropdown {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
box-sizing: border-box;
display: block;
position: absolute;
left: -100000px;
width: 100%;
z-index: 1051;
}
.select2-results {
display: block;
}
.select2-results__options {
list-style: none;
margin: 0;
padding: 0;
}
.select2-results__option {
padding: 6px;
user-select: none;
-webkit-user-select: none;
}
.select2-results__option[aria-selected] {
cursor: pointer;
}
.select2-container--open .select2-dropdown {
left: 0;
}
.select2-container--open .select2-dropdown--above {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.select2-container--open .select2-dropdown--below {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.select2-search--dropdown {
display: block;
padding: 4px;
}
.select2-search--dropdown .select2-search__field {
padding: 4px;
width: 100%;
box-sizing: border-box;
}
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none;
}
.select2-search--dropdown.select2-search--hide {
display: none;
}
.select2-close-mask {
border: 0;
margin: 0;
padding: 0;
display: block;
position: fixed;
left: 0;
top: 0;
min-height: 100%;
min-width: 100%;
height: auto;
width: auto;
opacity: 0;
z-index: 99;
background-color: #fff;
filter: alpha(opacity=0);
}
.select2-hidden-accessible {
border: 0 !important;
clip: rect(0 0 0 0) !important;
height: 1px !important;
margin: -1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important;
}
.select2-container--default .select2-selection--single {
background: #fff url(../images/vcard.png) no-repeat 2px 50%;
border: 1px solid #9EB1C2;
border-radius: 2px;
height: 21px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
padding-left: 21px;
line-height: 18px;
font-size: 11px;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: normal;
color: #888;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
color: #999;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 20px;
position: absolute;
top: 0px;
right: 1px;
width: 20px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0;
}
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left;
}
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
left: 1px;
right: auto;
}
.select2-container--default.select2-container--disabled .select2-selection--single {
background-color: #eee;
cursor: default;
}
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
display: none;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px;
}
.select2-container--default .select2-selection--multiple {
background-color: white;
border: 1px solid #9EB1C2;
border-radius: 2px;
cursor: text;
}
#sidebar .select2-container--default .select2-selection--multiple .select2-selection__rendered,
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 2px 2px 2px;
width: 100%;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
list-style: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
color: #999;
margin-top: 5px;
float: left;
}
.select2-container--default .select2-selection--multiple .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-top: 5px;
margin-right: 10px;
}
#sidebar .select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #efefef;
border-radius: 2px;
cursor: default;
float: left;
margin-right: 3px;
margin-top: 3px;
padding: 0 3px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #aaa;
cursor: pointer;
display: inline-block;
font-weight: normal;
margin-right: 2px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333;
}
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right;
}
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto;
}
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: solid #aaa 1px;
outline: 0;
}
.select2-container--default.select2-container--disabled .select2-selection--multiple {
background-color: #eee;
cursor: default;
}
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
display: none;
}
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa;
}
.select2-container--default .select2-search--inline .select2-search__field {
background: transparent;
border: none;
outline: 0;
box-shadow: none;
-webkit-appearance: textfield;
}
.select2-container--default .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto;
}
.select2-container--default .select2-results__option[role=group] {
padding: 0;
}
.select2-container--default .select2-results__option[aria-disabled=true] {
color: #999;
}
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #eee;
}
.select2-container--default .select2-results__option .select2-results__option {
padding-left: 1em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
padding-left: 0;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
margin-left: -1em;
padding-left: 2em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -2em;
padding-left: 3em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -3em;
padding-left: 4em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -4em;
padding-left: 5em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #eef5fd;
}
.select2-container--default .select2-results__group {
cursor: default;
display: block;
padding: 6px;
}
.filter .select2 {
margin: 1px;
}
.filter .select2-selection--multiple .select2-search--inline .select2-search__field {
border: 0px !important;
height: inherit !important;
padding: 0px !important;
}
.filter .select2-container--default .select2-selection--multiple .select2-selection__choice {
border: 0px;
padding: 2px 5px;
}
/* == Theming ===
.select2-container--default .select2-selection--single {
background: #fff url(../images/vcard.png) no-repeat 2px 50%;
border: 1px solid #9EB1C2;
border-radius: 2px;
height: 21px;
}
.select2-container--default .select2-selection--single:focus {
border-color: #2996cc;
outline: none;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
padding-left: 21px;
line-height: 18px;
font-size: 11px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 20px;
top: 0px;
right: 1px;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
font-weight: normal;
color: #888;
}
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #eee;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #eef5fd;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: #afafaf transparent transparent transparent;
}
.select2-dropdown {
border: 1px solid #e0e2e3;
border-radius: 3px;
}
*/

View File

@ -3,7 +3,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -31,9 +31,8 @@ class QuestionsAnswersControllerTest < ActionController::TestCase
:projects_trackers,
:questions,
:questions_answers,
:questions_sections
fixtures :email_addresses if ActiveRecord::VERSION::MAJOR >= 4
:questions_sections,
:email_addresses
RedmineQuestions::TestCase.create_fixtures(Redmine::Plugin.find(:redmine_questions).directory + '/test/fixtures/', [:questions, :questions_answers, :questions_sections])

View File

@ -3,7 +3,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -40,9 +40,8 @@ class QuestionsCommentsControllerTest < ActionController::TestCase
:workflows,
:questions,
:questions_answers,
:questions_sections
fixtures :email_addresses if ActiveRecord::VERSION::MAJOR >= 4
:questions_sections,
:email_addresses
RedmineQuestions::TestCase.create_fixtures(Redmine::Plugin.find(:redmine_questions).directory + '/test/fixtures/', [:questions, :questions_answers, :questions_sections])

View File

@ -3,7 +3,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -42,9 +42,8 @@ class QuestionsControllerTest < ActionController::TestCase
:time_entries,
:questions,
:questions_answers,
:questions_sections
fixtures :email_addresses if ActiveRecord::VERSION::MAJOR >= 4
:questions_sections,
:email_addresses
RedmineQuestions::TestCase.create_fixtures(Redmine::Plugin.find(:redmine_questions).directory + '/test/fixtures/',
[:questions, :questions_answers, :questions_sections, :tags, :taggings, :comments])
@ -147,21 +146,11 @@ class QuestionsControllerTest < ActionController::TestCase
assert_mail_body_match 'Body of text', mail
end
def test_post_create_failed
@request.session[:user_id] = 1
compatible_request :post, :create, :project_id => @project,
:question => {
:content => "Body of text"
}
assert_response :success
end
def test_get_show
@request.session[:user_id] = 1
compatible_request :get, :show, :id => 1
assert_response :success
assert_select 'div h1', {:text => questions(:question_001).subject}
assert_select 'div h2', {:text => questions(:question_001).subject}
assert_match questions(:question_001).content, @response.body
assert_select 'div.add_comments .add-comment-form textarea'
assert_select 'div#reply'
@ -173,7 +162,7 @@ class QuestionsControllerTest < ActionController::TestCase
@request.session[:user_id] = 3
compatible_request :get, :show, :id => 1
assert_response :success
assert_select 'div h1', :text => questions(:question_001).subject
assert_select 'div h2', :text => questions(:question_001).subject
assert_match questions(:question_001).content, @response.body
assert_select 'div.add_comments .add-comment-form textarea', :count => 0
assert_select 'div#reply'
@ -184,7 +173,7 @@ class QuestionsControllerTest < ActionController::TestCase
@request.session[:user_id] = 3
compatible_request :get, :show, :id => 1
assert_response :success
assert_select 'div h1', :text => questions(:question_001).subject
assert_select 'div h2', :text => questions(:question_001).subject
assert_match questions(:question_001).content, @response.body
assert_select 'div.add_comments .add-comment-form textarea', :count => 0
assert_select 'div#reply'
@ -195,7 +184,7 @@ class QuestionsControllerTest < ActionController::TestCase
@request.session[:user_id] = 3
compatible_request :get, :show, :id => 1
assert_response :success
assert_select 'div h1', :text => questions(:question_001).subject
assert_select 'div h2', :text => questions(:question_001).subject
assert_match questions(:question_001).content, @response.body
assert_select 'div.add_comments .add-comment-form textarea', :count => 1
assert_select 'div#reply'

View File

@ -3,7 +3,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -40,9 +40,8 @@ class QuestionsSectionsControllerTest < ActionController::TestCase
:workflows,
:questions,
:questions_answers,
:questions_sections
fixtures :email_addresses if ActiveRecord::VERSION::MAJOR >= 4
:questions_sections,
:email_addresses
RedmineQuestions::TestCase.create_fixtures(Redmine::Plugin.find(:redmine_questions).directory + '/test/fixtures/', [:questions, :questions_answers, :questions_sections])

View File

@ -3,7 +3,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -40,9 +40,8 @@ class QuestionsStatusesControllerTest < ActionController::TestCase
:workflows,
:questions,
:questions_answers,
:questions_sections
fixtures :email_addresses if ActiveRecord::VERSION::MAJOR >= 4
:questions_sections,
:email_addresses
RedmineQuestions::TestCase.create_fixtures(Redmine::Plugin.find(:redmine_questions).directory + '/test/fixtures/', [:questions,
:questions_answers,

View File

@ -3,7 +3,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -41,9 +41,8 @@ class RedmineQuestions::CommonViewsTest < ActionDispatch::IntegrationTest
:workflows,
:questions,
:questions_answers,
:questions_sections
fixtures :email_addresses if ActiveRecord::VERSION::MAJOR >= 4
:questions_sections,
:email_addresses
RedmineQuestions::TestCase.create_fixtures(Redmine::Plugin.find(:redmine_questions).directory + '/test/fixtures/', [:questions, :questions_answers, :questions_sections])

View File

@ -3,7 +3,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -25,12 +25,10 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')
module RedmineQuestions
module TestHelper
def compatible_request(type, action, parameters = {})
return send(type, action, parameters) if Redmine::VERSION.to_s < '3.5' && Redmine::VERSION::BRANCH == 'stable'
send(type, action, :params => parameters)
end
def compatible_xhr_request(type, action, parameters = {})
return xhr type, action, parameters if Redmine::VERSION.to_s < '3.5' && Redmine::VERSION::BRANCH == 'stable'
send(type, action, :params => parameters, :xhr => true)
end
@ -61,16 +59,12 @@ class RedmineQuestions::TestCase
end
def self.create_fixtures(fixtures_directory, table_names, class_names = {})
if ActiveRecord::VERSION::MAJOR >= 4
if Comment.column_names.include?('content')
table_names.map!{ |x| x.to_s.gsub('comments', 'comments-3.4.6').to_sym }
ActiveRecord::FixtureSet.create_fixtures(fixtures_directory, table_names, class_names = {})
else
ActiveRecord::FixtureSet.create_fixtures(fixtures_directory, table_names, class_names = {})
end
else
ActiveRecord::Fixtures.create_fixtures(fixtures_directory, table_names, class_names = {})
end
end
def self.prepare

View File

@ -3,7 +3,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -40,9 +40,8 @@ class QuestionTest < ActiveSupport::TestCase
:workflows,
:questions,
:questions_answers,
:questions_sections
fixtures :email_addresses if ActiveRecord::VERSION::MAJOR >= 4
:questions_sections,
:email_addresses
RedmineQuestions::TestCase.create_fixtures(Redmine::Plugin.find(:redmine_questions).directory + '/test/fixtures/',
[:comments, :tags, :taggings])

View File

@ -3,7 +3,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify

View File

@ -3,7 +3,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2023 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify