Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
5fac4d54
Commit
5fac4d54
authored
Jan 11, 2014
by
Daniel W Bond
Browse files
began adding qrcode to link page
parent
c015691f
Changes
2
Hide whitespace changes
Inline
Side-by-side
go/go/views.py
View file @
5fac4d54
...
@@ -29,6 +29,10 @@ def error_500(request):
...
@@ -29,6 +29,10 @@ def error_500(request):
},
},
)
)
def
qrcode
(
url
):
img
=
qrcode
.
make
(
url
)
return
img
# Homepage view.
# Homepage view.
@
login_required
@
login_required
def
index
(
request
):
def
index
(
request
):
...
@@ -75,8 +79,12 @@ def index(request):
...
@@ -75,8 +79,12 @@ def index(request):
# Preview a link.
# Preview a link.
def
view
(
request
,
short
):
def
view
(
request
,
short
):
url
=
get_object_or_404
(
URL
,
short__iexact
=
short
)
url
=
get_object_or_404
(
URL
,
short__iexact
=
short
)
qrcode
=
qrcode
(
url
)
return
render
(
request
,
'view.html'
,
{
return
render
(
request
,
'view.html'
,
{
'url'
:
url
,
'url'
:
url
,
'qrcode'
:
qrcode
,
},
},
)
)
...
...
go/templates/link_box.html
View file @
5fac4d54
...
@@ -15,6 +15,9 @@
...
@@ -15,6 +15,9 @@
<strong>
Expires:
</strong>
{{url.expires|default_if_none:"Never"}}
<strong>
Expires:
</strong>
{{url.expires|default_if_none:"Never"}}
<br
/>
<br
/>
<strong>
QR Code:
</strong>
{{qrcode}}
<br
/>
<strong>
<strong>
<a
href=
"{%url 'delete' url.short%}"
<a
href=
"{%url 'delete' url.short%}"
onclick=
"return confirm('Are you sure you want to delete this link?');"
>
onclick=
"return confirm('Are you sure you want to delete this link?');"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment