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

Robert Hitt's avatar
Robert Hitt committed
4
<link rel="stylesheet" type="text/css" href="../../static/css/style-link-box.css">
Chris Reffett's avatar
Chris Reffett committed
5

6 7
<div class="container">
  <div class="col-md-8">
David Haynes's avatar
David Haynes committed
8
    <h3>Go Address:</h3>
Robert Hitt's avatar
Robert Hitt committed
9 10 11
    <div id="link-container" class="input-group">
       <a id="link" class="form-control" href="{{url.short}}">{{domain}}{{url.short}}</a>
       <div id="button-container" class="input-group-addon">
12 13
       <button id="btn" type="button" class="button btn btn-default btn-xs fa" role="button"
             data-clipboard-target="#link">
Robert Hitt's avatar
Robert Hitt committed
14 15 16
            <i id="clipboard-icon" class="fa fa-clipboard fa-1g" aria-hidden="true"></i></button>
       </div>
    </div>
David Haynes's avatar
David Haynes committed
17
    <br></br>
Chris Reffett's avatar
Chris Reffett committed
18

David Haynes's avatar
David Haynes committed
19 20 21 22
    <h3>Address Details:</h3>
      <strong>Target URL:</strong>
        <br />
        <a href="{{url.target}}">{{url.target}}</a>
David Haynes's avatar
David Haynes committed
23
        <br />
Chris Reffett's avatar
Chris Reffett committed
24

25
      {% if url.owner == request.user.registereduser and request.user.registereduser.approved == True %}
David Haynes's avatar
David Haynes committed
26 27 28
      <strong>Clicks:</strong>
        {{url.clicks}}
      <br />
Chris Reffett's avatar
Chris Reffett committed
29

David Haynes's avatar
David Haynes committed
30 31
      <strong>QR Code Uses:</strong> {{url.qrclicks}}
      <br />
32
      <strong>Social Media Clicks:</strong> {{url.socialclicks}}
David Haynes's avatar
David Haynes committed
33
      <br />
34

David Haynes's avatar
David Haynes committed
35 36
      <strong>Expires:</strong> {{url.expires|default_if_none:"Never"}}
      <br></br>
37
      <a class="button btn btn-danger btn-sm fa" href="{{domain}}delete/{{url.short}}">
38
        <i class="fa fa-trash-o fa-lg" aria-hidden="true"></i> Delete</a>
39 40 41 42 43 44 45

      <a tabindex="0" class="button btn btn-info btn-sm fa"
        role="button" data-toggle="popover" title="Not Implemented Quite Yet :("
        data-content=
        "We are working on adding this feature in a future
        release of Go. If you'd like to check that progress or potentially
        contribute code, head to git.gmu.edu/srct/go">
46
        <i class="fa fa-cog" aria-hidden="true"></i> Edit</a>
47

David Haynes's avatar
David Haynes committed
48 49
      {% endif %}
      <br></br>
50
  </div>
51

52 53 54 55 56
  <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 %}
57

58 59 60 61
    {% 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>
62

63 64 65
      <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>
66

67 68 69
      <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>
70

71 72 73 74
      <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 %}
75 76 77 78 79 80 81 82 83

    {% 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 %}

84
  {% endwith %}
85
  </div>
86
</div>
87

88 89
<script src="../../static/js/clipboard.min.js"></script>
<script src="../../static/js/copy.js"></script>
90 91 92 93 94 95
<script>
  $(function () {
    var option = {'trigger': 'hover'};
    $('[data-toggle="popover"]').popover( option )
  })
</script>