tickets/app/views/admin/tickets_manage/_response.html.erb

58 lines
2.7 KiB
Plaintext
Raw Normal View History

<div class="ticket-response-item" data-scroll-id="response_<%= response.id.to_s %>" data-response-by="<%= response.response_by %>">
2015-08-18 18:28:47 +00:00
<div class="ticket-response-meta">
<div class="ticket-response-author">
<% user = User.find(response.response_by) rescue nil %>
2017-07-25 07:35:47 +00:00
<% if user.nil? || user.member_profile.avatar.nil? || user.member_profile.avatar.thumb.url == "thumb_person.png"
2015-08-21 07:25:40 +00:00
avatar = "/assets/thumb_person.png"
else
avatar = user.member_profile.avatar.thumb.url
end
%>
<img class="ticket-response-avatar" src="<%= avatar %>" />
2015-08-18 18:28:47 +00:00
<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">
2017-07-25 07:40:09 +00:00
<% if !user.nil? && user.id.to_s == current_user.id.to_s %>
2021-07-15 11:51:44 +00:00
<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>
2015-09-02 10:16:01 +00:00
<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">
2017-07-25 07:42:56 +00:00
<% 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 %>
2017-07-25 07:44:28 +00:00
<img class="t-avatar" src="<%= avatar %>">
2017-07-25 07:42:56 +00:00
<span class="ticket-tag-member-name tool-tip right"><%= user.name rescue "Member was deleted"%></span>
<% end %>
2015-09-02 10:16:01 +00:00
</div>
<% end %>
</div>
2015-08-25 10:49:47 +00:00
</div>
2015-08-18 18:28:47 +00:00
</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 %>">
2015-08-18 18:28:47 +00:00
<%= response.response.html_safe %>
</div>
</div>