cebdfb35d7
- store and redirect urls without protocol - update README - increment counter with SQL COALESCE - add linksHelper - update tests
39 lines
1.6 KiB
Plaintext
39 lines
1.6 KiB
Plaintext
<div class="bg-white shadow overflow-hidden sm:rounded-lg m-3">
|
|
<div class="border-t border-gray-200">
|
|
<dl>
|
|
<div class="bg-gray-50 px-4 py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">
|
|
Website
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
<a href="<%= link.parsed_url %>" class="mt-1 text-sm text-gray-600 underline" target="_blank" rel="noreferrer"><%= link.url %></a>
|
|
</dd>
|
|
</div>
|
|
<div class="bg-white px-4 py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">
|
|
Shortened URL
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
<button data-action="click->links#openLink" class="mt-1 text-sm text-gray-600 underline"><%= short_url(slug: link.slug) %></button>
|
|
</dd>
|
|
</div>
|
|
<div class="bg-gray-50 px-4 py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">
|
|
Click counter
|
|
</dt>
|
|
<dd class="counter mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
<%= link.click_counter %>
|
|
</dd>
|
|
</div>
|
|
<div class="bg-white px-4 py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">
|
|
Created by
|
|
</dt>
|
|
<dd class="counter mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
<%= link.user ? link.user.username : 'Guest user' %>
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|