Actualizado plugin Redmine Questions 1.0.0 light

This commit is contained in:
Manuel Cillero 2019-03-21 17:52:05 +01:00
parent 27e60f8ec1
commit 5d7889f1c9
140 changed files with 5342 additions and 1430 deletions

View file

@ -0,0 +1,27 @@
<div class="comment" id="comment_<%= comment.id %>">
<div class="contextual">
<%= link_to(
"",
{: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)))
%>
<%= link_to(
"",
{:controller => 'questions_comments', :action => 'destroy', :source_id => comment.commented, :id => comment, :source_type => comment.commented.class.name.underscore}, :class => 'icon icon-del',
: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)))
%>
</div>
<div class="author">
<%= link_to_user comment.author %>
<%= time_tag(comment.created_on) %>
</div>
<div class="wiki-content">
<%= textilizable(comment.comments) %>
</div>
</div>

View file

@ -0,0 +1,7 @@
<% if question_item.commentable? %>
<%= form_tag({:controller => 'questions_comments', :action => 'create', :id => question_item, :source_id => question_item, :source_type => question_item.class.name.underscore}, :class => "add-comment-form", :remote => true) do %>
<%= text_area 'comment', @comment.respond_to?(:content) ? 'content' : 'comments', :cols => 80, :rows => 5, :id => "comments_for_#{question_item.class.name.underscore}_#{question_item.id}" %>
<%= submit_tag l(:button_add), :class => "button-small" %>
<%= link_to l(:button_cancel), {}, :onclick => "$('#add_#{question_item.class.name.underscore}_comments_#{question_item.id}').hide(); return false;" %>
<% end %>
<% end %>

View file

@ -0,0 +1,12 @@
<% if question_item.comments.any? %>
<div class="question-comments">
<% question_item.comments.each do |comment| %>
<% next if comment.new_record? %>
<%= render :partial => "questions_comments/comment", :locals => {:comment => comment, :comment_source => question_item} %>
<% end %>
</div>
<% end %>
<div class="add_comments" id="add_<%= question_item.class.name.underscore %>_comments_<%= question_item.id %>" style="display:none;">
<%= render :partial => "questions_comments/comment_form", :locals => {:question_item => question_item} %>
</div>

View file

@ -0,0 +1,7 @@
<% if question_item.commentable? %>
<%= link_to l(:label_questions_comment), "#", :onclick => "$('#add_comments_#{question_item.id}').toggle(); showAndScrollTo('add_#{question_item.class.name.underscore}_comments_#{question_item.id}', 'comments_for_#{question_item.class.name.underscore}_#{question_item.id}'); return false;", :class => 'icon icon-comment add-comment-link' %>
<% end %>
<div class="comments_container">
<%= render :partial => 'questions_comments/comment_list', :locals => {:question_item => question_item} %>
</div>

View file

@ -0,0 +1,3 @@
$("#<%= @comment_source.class.name.underscore %>_<%= @comment_source.id %> .comments_container").html('<%= escape_javascript(render :partial => "questions_comments/comment_list", :locals => {:question_item => @comment_source}) %>');
$(".comment#comment_<%= @comment.id %>").effect('highlight', {}, 1000);
$("textarea#comments_for_<%= @comment_source.class.name.underscore %>_<%= @comment_source.id %>").val("");

View file

@ -0,0 +1,12 @@
<h2><%= avatar(@comment.author, :size => "24") %></h2>
<%= form_tag({:controller => 'questions_comments', :action => 'update', :source_id => @comment_source, :source_type => @comment_source.class.name.underscore, :id => @comment, :method => :put}) do %>
<div class="box">
<%= text_area 'comment', 'comments', :cols => 80, :rows => 5%>
</div>
<p><%= submit_tag l(:button_update) %></p>
<% end %>
<div id="preview" class="wiki"></div>