58 lines
2.7 KiB
Plaintext
58 lines
2.7 KiB
Plaintext
<div class="ticket-response-item" data-scroll-id="response_<%= response.id.to_s %>" data-response-by="<%= response.response_by %>">
|
|
<div class="ticket-response-meta">
|
|
<div class="ticket-response-author">
|
|
<% user = User.find(response.response_by) rescue nil %>
|
|
<% if user.nil? || user.member_profile.avatar.nil? || user.member_profile.avatar.thumb.url == "thumb_person.png"
|
|
avatar = "/assets/thumb_person.png"
|
|
else
|
|
avatar = user.member_profile.avatar.thumb.url
|
|
end
|
|
%>
|
|
<img class="ticket-response-avatar" src="<%= avatar %>" />
|
|
<span class="ticket-response-name"><%= user.name if !user.nil? %></span>
|
|
</div>
|
|
<div class="ticket-response-created-date">
|
|
<% dt = DateTime.parse(response.created_at.to_s) %> <%= dt.strftime("%d %B %Y - %H:%M") %>
|
|
</div>
|
|
<div class="ticket-response-delete-wrap">
|
|
<% if !user.nil? && user.id.to_s == current_user.id.to_s %>
|
|
<a class="ticket-response-delete" href="/admin/tickets_manage/delete_response" data-response-id="<%= response.id.to_s %>">
|
|
<i class="ticket-response-delete-icon fa fa-trash"></i>
|
|
Delete
|
|
</a>
|
|
<% end %>
|
|
<% if response.user_tags.include?(current_user.id.to_s) %>
|
|
<a href="" class="reply-response" data-response-id="<%= response.id.to_s %>">
|
|
<i class="fa fa-share"></i>
|
|
Reply
|
|
</a>
|
|
<% end %>
|
|
</div>
|
|
<div class="ticket-internal-comment-wrap">
|
|
<div class="ticket-internal-wrap">
|
|
<% response.user_tags.each do |u|
|
|
user = User.find(u) rescue nil
|
|
if !user.nil?
|
|
if user.member_profile.avatar.nil? || user.member_profile.avatar.thumb.url == "thumb_person.png"
|
|
avatar = "/assets/thumb_person.png"
|
|
else
|
|
avatar = user.member_profile.avatar.thumb.url
|
|
end
|
|
end %>
|
|
<div class="ticket-tag-member tool-tip-parent">
|
|
<% if !user.nil? %>
|
|
<img class="t-avatar <%= response.read_by.include?(user.id.to_s) ? "read" : "" %>" src="<%= avatar %>" data-avatar-id="<%= user.id.to_s %>">
|
|
<span class="ticket-tag-member-name tool-tip right"><%= user.name rescue ""%></span>
|
|
<% else %>
|
|
<img class="t-avatar" src="<%= avatar %>">
|
|
<span class="ticket-tag-member-name tool-tip right"><%= user.name rescue "Member was deleted"%></span>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="ticket-response-content <%= response.internal_response ? "in-house" : "" %>" data-user-tags="<%= response.user_tags.to_s %>" data-response-id="<%= response.id.to_s %>">
|
|
<%= response.response.html_safe %>
|
|
</div>
|
|
</div> |