Skip to content

Commit

Permalink
Move QR link to new table column
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-hank committed Aug 18, 2023
1 parent 6b56fd5 commit 5ab4880
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
18 changes: 12 additions & 6 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,20 @@ table{
width: 100%;
}

tr {
&:hover {
background-color: #fff;
}
}

td{
padding: 2px;
padding: 5px;
word-break: break-all;

img {
max-height: 15px;
vertical-align: middle;
}
}

.shortened{
Expand All @@ -177,11 +188,6 @@ td{

.to{
width: 45%;

img {
max-height: 15px;
vertical-align: middle;
}
}

.clicks{
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/urls_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def qr
size: 400,
)

send_data png, type: 'image/png', disposition: 'inline'
send_data png, type: 'image/png', disposition: 'inline', filename: "brkmn-qr-#{url.shortened}.png"
end

private
Expand Down
1 change: 1 addition & 0 deletions app/views/shared/_url_list.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
%th{class: @shortened_header}= sortable 'shortened', 'Shortened URL'
%th{class: "arrow"}
%th{class: @to_header}= sortable '"to"', 'Full URL'
%th{class: "qr"}= 'QR'
%th{class: @clicks_header}= sortable 'clicks', 'Clicks'
= render :partial => 'urls/url_list', :collection => urls
%tr
Expand Down
8 changes: 3 additions & 5 deletions app/views/urls/_url_list.haml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
= '('
= image_tag('delete.svg')
= 'delete)'
- if can?(:qr, url_list)
= link_to(qr_url_path(url_list), target: '_blank') do
= '('
= image_tag('qr.svg')
= 'qr code)'
%td
= link_to(qr_url_path(url_list), target: '_blank') do
= image_tag('qr.svg')
%td{class: 'clicks'}
= url_list.clicks

0 comments on commit 5ab4880

Please sign in to comment.