Merge remote-tracking branch 'upstream/pull/3073'

This commit is contained in:
Tom Hughes 2021-01-28 10:36:38 +00:00
commit f981182731
6 changed files with 35 additions and 52 deletions

View file

@ -47,26 +47,28 @@
<% if @note.status == "open" %>
<% if current_user -%>
<form action="#" class="standard-form">
<textarea class="comment" name="text" cols="40" rows="5" maxlength="2000"></textarea>
<div class="buttons clearfix">
<form action="#">
<div class="form-group">
<textarea class="form-control" name="text" cols="40" rows="5" maxlength="2000"></textarea>
</div>
<div>
<% if current_user.moderator? -%>
<input type="submit" name="hide" value="<%= t("javascripts.notes.show.hide") %>" class="deemphasize" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, "json") %>">
<input type="submit" name="hide" value="<%= t("javascripts.notes.show.hide") %>" class="btn btn-light" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, "json") %>">
<% end -%>
<input type="submit" name="close" value="<%= t("javascripts.notes.show.resolve") %>" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= close_note_url(@note, "json") %>">
<input type="submit" name="comment" value="<%= t("javascripts.notes.show.comment") %>" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= comment_note_url(@note, "json") %>" disabled="1">
<input type="submit" name="close" value="<%= t("javascripts.notes.show.resolve") %>" class="btn btn-primary" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= close_note_url(@note, "json") %>">
<input type="submit" name="comment" value="<%= t("javascripts.notes.show.comment") %>" class="btn btn-primary" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= comment_note_url(@note, "json") %>" disabled="1">
</div>
</form>
<% end -%>
<% else %>
<form action="#" class="standard-form">
<form action="#">
<input type="hidden" name="text" value="">
<div class="buttons clearfix">
<div>
<% if current_user and current_user.moderator? -%>
<input type="submit" name="hide" value="<%= t("javascripts.notes.show.hide") %>" class="deemphasize" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, "json") %>">
<input type="submit" name="hide" value="<%= t("javascripts.notes.show.hide") %>" class="btn btn-light" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, "json") %>">
<% end -%>
<% if current_user -%>
<input type="submit" name="reopen" value="<%= t("javascripts.notes.show.reactivate") %>" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= reopen_note_url(@note, "json") %>">
<input type="submit" name="reopen" value="<%= t("javascripts.notes.show.reactivate") %>" class="btn btn-primary" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= reopen_note_url(@note, "json") %>">
<% end -%>
</div>
</form>

View file

@ -1,4 +1,4 @@
<div class="issue-comments">
<div>
<% comments.each do |comment| %>
<div class="comment">
<div class="float-left">
@ -13,13 +13,13 @@
<hr>
<% end %>
</div>
<br />
<div class="comment standard-form">
<%= form_for @new_comment, :url => issue_comments_path(@issue) do |f| %>
<%= richtext_area :issue_comment, :body, :cols => 10, :rows => 8, :required => true %>
<%= label_tag :reassign, t(".reassign_param") %> <%= check_box_tag :reassign, true %>
<br />
<br />
<%= f.submit %>
<div>
<%= bootstrap_form_for @new_comment, :url => issue_comments_path(@issue) do |f| %>
<%= f.richtext_field :body, :cols => 80, :rows => 20, :hide_label => true %>
<%= f.form_group do %>
<%= f.check_box :reassign, { :label => t(".reassign_param"), :id => "reassign", :name => "reassign", :checked => false }, true, false %>
<% end %>
<%= f.primary %>
<% end %>
</div>

View file

@ -4,18 +4,8 @@
<h1><%= t ".heading" %></h1>
<% end %>
<%= form_for(@redaction, :html => { :class => "standard-form" }) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :title, t(".title") %><br />
<%= f.text_field :title %>
</p>
<p>
<%= f.label :description, t(".description") %><br />
<%= richtext_area :redaction, :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>
</p>
<p>
<%= f.submit %>
</p>
<%= bootstrap_form_for(@redaction) do |f| %>
<%= f.text_field :title %>
<%= f.richtext_field :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>
<%= f.primary %>
<% end %>

View file

@ -3,18 +3,8 @@
<h1><%= t ".heading" %></h1>
<% end %>
<%= form_for(@redaction, :html => { :class => "standard-form" }) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :title, t(".title") %><br />
<%= f.text_field :title %>
</p>
<p>
<%= f.label :description, t(".description") %><br />
<%= richtext_area :redaction, :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>
</p>
<p>
<%= f.submit %>
</p>
<%= bootstrap_form_for(@redaction) do |f| %>
<%= f.text_field :title %>
<%= f.richtext_field :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>
<%= f.primary %>
<% end %>

View file

@ -13,12 +13,12 @@
</div>
<% if can?(:edit, Redaction) || can?(:destroy, Redaction) %>
<div class="buttons">
<div>
<% if can?(:edit, Redaction) %>
<%= button_to t(".edit"), edit_redaction_path(@redaction), :method => :get %></td>
<%= link_to t(".edit"), edit_redaction_path(@redaction), :class => "btn btn-outline-primary" %>
<% end %>
<% if can?(:destroy, Redaction) %>
<%= button_to t(".destroy"), @redaction, :method => "delete", :remote => true, :data => { :confirm => t(".confirm") } %>
<%= link_to t(".destroy"), @redaction, :method => "delete", :class => "btn btn-outline-danger", :remote => true, :data => { :confirm => t(".confirm") } %>
<% end %>
</div>
<% end %>