mirror of
https://github.com/docusealco/docuseal.git
synced 2026-06-23 04:10:11 +00:00
fix device icon
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
</p>
|
||||
</li>
|
||||
<% @submission.submission_events.order(:event_timestamp).each do |event| %>
|
||||
<% device = DetectBrowserDevice.call(event.data['ua']) %>
|
||||
<% submitter = @submission.submitters.find { |e| e.id == event.submitter_id } %>
|
||||
<% bg_class = event_colors[submitters_uuids.index(submitter.uuid) % event_colors.length] %>
|
||||
<% submitter_name = event.event_type.include?('sms') || event.event_type.include?('phone') ? (event.data['phone'] || submitter.phone) : (submitter.name || submitter.email || submitter.phone) %>
|
||||
@@ -33,9 +32,11 @@
|
||||
<span class="text-sm leading-none text-base-content/60">
|
||||
<%= l(event.event_timestamp.in_time_zone(current_account.timezone), format: :long, locale: current_account.locale) %>
|
||||
</span>
|
||||
<span class="tooltip tooltip-top" data-tip="<%= t(device) %>">
|
||||
<%= svg_icon("device_#{device}", class: 'w-4 h-4') %>
|
||||
</span>
|
||||
<% if (device = DetectBrowserDevice.call(event.data['ua'])) %>
|
||||
<span class="tooltip tooltip-top" data-tip="<%= t(device) %>">
|
||||
<%= svg_icon("device_#{device}", class: 'w-4 h-4') %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<p class="text-base-content/80 mt-1">
|
||||
<% if event.event_type == 'complete_verification' %>
|
||||
|
||||
@@ -27,17 +27,11 @@ module DetectBrowserDevice
|
||||
/ix
|
||||
|
||||
def call(user_agent)
|
||||
return :mobile if mobile?(user_agent)
|
||||
return :tablet if tablet?(user_agent)
|
||||
return if user_agent.blank?
|
||||
|
||||
:desktop
|
||||
end
|
||||
return 'mobile' if MOBILE_USER_AGENT_REGEXP.match?(user_agent)
|
||||
return 'tablet' if TABLET_USER_AGENT_REGEXP.match?(user_agent)
|
||||
|
||||
def mobile?(user_agent)
|
||||
user_agent.to_s =~ MOBILE_USER_AGENT_REGEXP
|
||||
end
|
||||
|
||||
def tablet?(user_agent)
|
||||
user_agent.to_s =~ TABLET_USER_AGENT_REGEXP
|
||||
'desktop'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user