link_box.html 2.72 KB
Newer Older
1
{% load go_extras %}
Jean Michel Rouly's avatar
Jean Michel Rouly committed
2
{% load qr_tags %}
3

Chris Reffett's avatar
Chris Reffett committed
4
<style>
5 6 7 8
  a.share:link {color:#000000;}
  a.share:visited {color:#000000;}
  a.share:hover {color:#000000;}
  a.share {text-decoration:none;}
9 10 11
  legend {
    font-size: inherit;
  }
12 13 14
  pre {
    font-family: inherit;
  }
Chris Reffett's avatar
Chris Reffett committed
15 16
</style>

17 18
<div class="container">
  <div class="col-md-8">
David Haynes's avatar
David Haynes committed
19
    <h3>Go Address:</h3>
20
      <a href="{{url.short}}">{{domain}}{{url.short}}</a>
David Haynes's avatar
David Haynes committed
21
    <br></br>
Chris Reffett's avatar
Chris Reffett committed
22

David Haynes's avatar
David Haynes committed
23 24 25 26
    <h3>Address Details:</h3>
      <strong>Target URL:</strong>
        <br />
        <a href="{{url.target}}">{{url.target}}</a>
David Haynes's avatar
David Haynes committed
27
        <br />
Chris Reffett's avatar
Chris Reffett committed
28

29
      {% if url.owner == request.user and request.user|is_registered %}
David Haynes's avatar
David Haynes committed
30 31 32
      <strong>Clicks:</strong>
        {{url.clicks}}
      <br />
Chris Reffett's avatar
Chris Reffett committed
33

David Haynes's avatar
David Haynes committed
34 35 36 37
      <strong>QR Code Uses:</strong> {{url.qrclicks}}
      <br />
      <strong>Social Clicks:</strong> {{url.socialclicks}}
      <br />
38

David Haynes's avatar
David Haynes committed
39 40
      <strong>Expires:</strong> {{url.expires|default_if_none:"Never"}}
      <br></br>
Chris Reffett's avatar
Chris Reffett committed
41

David Haynes's avatar
David Haynes committed
42
      <strong>
43
        <a href="error_404">
David Haynes's avatar
David Haynes committed
44 45 46 47 48 49 50 51 52 53 54 55
          Edit
        </a>
      </strong>
      <br />

      <strong>
        <a href="{%url 'delete' url.short%}" onclick="return confirm('Are you sure you want to delete this link?');">
          Delete
        </a>
      </strong>
      {% endif %}
      <br></br>
56
  </div>
57

58 59 60 61 62
  <div class="col-md-4">
  {% with domain|add:url.short as the_url %}
    {% with the_url|add:"?qr" as qr_url%}
      {% qr_from_text qr_url 's' %}
    {% endwith %}
63

64 65 66 67
    {% with the_url|add:"?social" as social_url %}
      <a class="share" href="http://twitter.com/share?url={{ social_url }}" target="_blank" title="Share via Twitter">
        <i class="fa fa-twitter-square fa-3x"></i>
      </a>
68

69 70 71
      <a class="share" href="http://www.facebook.com/share.php?u={{ social_url }}" target="_blank" title="Share via Facebook">
        <i class="fa fa-facebook-square fa-3x"></i>
      </a>
72

73 74 75
      <a class="share" href="https://plus.google.com/share?url={{ social_url }}" target="_blank" title="Share via Google+">
        <i class="fa fa-google-plus-square fa-3x"></i>
      </a>
76

77 78 79 80
      <a class="share" href="http://www.linkedin.com/shareArticle?mini=true&amp;url={{ social_url }}&amp;ro=false&amp;summary=&amp;source=" target="_blank" title="Share via LinkedIn">
        <i class="fa fa-linkedin-square fa-3x"></i>
      </a>
    {% endwith %}
81 82 83 84 85 86 87 88 89

    {% with the_url|add:"?qr" as qr_url %}
      <pre><strong>QR Downloads:</strong>
        <a href="http://chart.googleapis.com/chart?cht=qr&chs=120x120&chl={{ qr_url }}">Small (120x120)</a>
        <a href="http://chart.googleapis.com/chart?cht=qr&chs=230x230&chl={{ qr_url }}">Medium (230x230)</a>
        <a href="http://chart.googleapis.com/chart?cht=qr&chs=350x350&chl={{ qr_url }}">Large (350x350)</a>
        </pre>
    {% endwith %}

90
  {% endwith %}
91
  </div>
92
</div>