scinote-web/app/views/shared/comments/_item.html.erb

56 lines
2.4 KiB
Text
Raw Normal View History

<% report = false unless defined?(report) %>
<% readonly = false unless defined?(readonly) %>
<% edit_mode = (!readonly && comment_editable?(comment)) %>
<div
class="comment-container <%= edit_mode ? 'inline-init-handler' : '' %> <%= report ? 'report' : '' %>"
2019-04-25 17:14:55 +08:00
data-field-to-update="message"
data-params-group="comment"
data-path-to-update="<%= comment_action_url(comment) %>"
2019-04-25 17:14:55 +08:00
data-original-name="<%= comment.message %>"
data-response-field="comment"
data-smart-annotation="true"
2019-11-12 18:26:18 +08:00
data-edit-mode="0"
2019-04-25 17:14:55 +08:00
>
<div class="avatar-placehodler">
<span class='global-avatar-container'>
<% if report %>
<% base64_encoded = defined?(export_all) && export_all %>
<%= image_tag user_avatar_absolute_url(comment.user, :icon_small, base64_encoded), class: 'avatar' %>
<% else %>
<%= image_tag avatar_path(comment.user, :icon_small), class: 'avatar' %>
<% end %>
</span>
</div>
<div class="content-placeholder">
2019-04-25 17:14:55 +08:00
<div class="comment-name"><%= comment.user.full_name %></div>
<div class="comment-right">
<div class="comment-datetime"><%= l(comment.created_at, format: :full) %></div>
<% if edit_mode %>
2019-04-25 17:14:55 +08:00
<div class="comment-actions">
<div class="edit-buttons">
<span class="save-button"><i class="fas fa-save"></i><%= t('general.save') %></span>
2023-06-08 23:33:50 +08:00
<span class="cancel-button"><i class="sn-icon sn-icon-close"></i></span>
2019-04-25 17:14:55 +08:00
</div>
<div class="view-buttons">
2023-06-15 21:12:51 +08:00
<span class="edit-button"><i class="sn-icon sn-icon-edit"></i><%= t('general.edit') %></span>
2019-04-25 17:14:55 +08:00
<a href="#"
class="delete-button"
data-url="<%= comment_action_url(comment) %>"
2019-04-25 17:14:55 +08:00
data-confirm-message="<%= t('comments.delete_confirm') %>"
data-turbolinks="false">
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-delete action-icon-delete"></span>
2019-04-25 17:14:55 +08:00
</a>
</div>
</div>
2019-04-25 17:14:55 +08:00
<% end %>
</div>
<div class="comment-message">
<div class="view-mode"><%= custom_auto_link(comment.message, team: current_team, simple_format: true) %></div>
<% if edit_mode %>
<%= text_area_tag 'message', comment.message, disabled: true, class: 'smart-text-area hidden' %>
<% end %>
</div>
2019-04-25 17:14:55 +08:00
<div class="error-block"></div>
</div>
</div>