link_box.html 5.03 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 12 13

  a.button:link {color:#FFF;}
  a.button:visited {color:#FFF;}
  a.button:hover {color:#FFF;}

14 15 16
  legend {
    font-size: inherit;
  }
17 18 19
  pre {
    font-family: inherit;
  }
Chris Reffett's avatar
Chris Reffett committed
20 21
</style>

22 23
<div class="container">
  <div class="col-md-8">
David Haynes's avatar
David Haynes committed
24
    <h3>Go Address:</h3>
Zosman's avatar
Zosman committed
25
      <a href="{{domain}}{{url.short}}">{{domain}}{{url.short}}</a>
David Haynes's avatar
David Haynes committed
26
    <br></br>
Chris Reffett's avatar
Chris Reffett committed
27

David Haynes's avatar
David Haynes committed
28 29 30 31
    <h3>Address Details:</h3>
      <strong>Target URL:</strong>
        <br />
        <a href="{{url.target}}">{{url.target}}</a>
David Haynes's avatar
David Haynes committed
32
        <br />
Chris Reffett's avatar
Chris Reffett committed
33

34
      {% if url.owner == request.user.registereduser and request.user.registereduser.approved == True %}
David Haynes's avatar
David Haynes committed
35 36 37
      <strong>Clicks:</strong>
        {{url.clicks}}
      <br />
Chris Reffett's avatar
Chris Reffett committed
38

David Haynes's avatar
David Haynes committed
39 40
      <strong>QR Code Uses:</strong> {{url.qrclicks}}
      <br />
41
      <strong>Social Media Clicks:</strong> {{url.socialclicks}}
David Haynes's avatar
David Haynes committed
42
      <br />
43

David Haynes's avatar
David Haynes committed
44 45
      <strong>Expires:</strong> {{url.expires|default_if_none:"Never"}}
      <br></br>
Zosman's avatar
Zosman committed
46
      <a class="button btn btn-danger btn-sm fa" data-target="#deletionModal" data-toggle="modal">
47
        <i class="fa fa-trash-o fa-lg"></i> Delete</a>
Zosman's avatar
Zosman committed
48 49
      <!-- <a class="button btn btn-danger btn-sm fa" href="{{domain}}delete/{{url.short}}">
        <i class="fa fa-trash-o fa-lg"></i> Delete</a> -->
50 51 52 53 54 55 56 57 58

      <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">
        <i class="fa fa-cog"></i> Edit</a>

59
      <div id="deletionModal" class="modal fade" role="dialog" tabindex="-1">
Zosman's avatar
Zosman committed
60 61 62
          <div class="modal-dialog">

              <!-- Modal content-->
63 64
              <div class="modal-content" style="background-color:#f5f5f5;border-radius: 7px" >
                  <div class="modal-header" style="text-align:center;">
65
                      <!-- <button type="button" class="close" data-dismiss="modal">&times;</button> -->
66 67 68 69 70 71
                      <span class="fa-stack fa-fw">
                        <i class="fa fa-circle fa-stack-2x"></i>
                        <i class="fa fa-times fa-stack-1x fa-inverse"></i>
                      </span>
                        <h4 class="modal-title fa text-center" style="font-weight:bold; font-size: 21px !important;"><i class="fa">Are you sure you would like to <color style="color:red">delete</color> this link? </i></h4>
                      <h5 class="fa" style="color:red;font-weight:600;margin-top: 0px;margin-bottom: 0px;">Deleting a link is permenant and can not be undone!</h5>
Zosman's avatar
Zosman committed
72 73
                  </div>
                  <div class="modal-body" style="padding-bottom: 80px">
74 75
                    <a type="button" class="btn btn-success btn-lg" style="border-width: 0px;float:left; width:49%; background-color: #A9B0AD; border-radius: 4px;" data-dismiss="modal">Cancel</a>
                    <a type="button" class="btn btn-danger btn-lg" href="{{domain}}delete/{{url.short}}" style="border-width: 0px; float:right; width:49%;background-color: #AC1D37; border-radius: 4px;">Delete</a>
Zosman's avatar
Zosman committed
76 77 78 79 80 81
                  </div>
              </div>

          </div>
      </div>

David Haynes's avatar
David Haynes committed
82 83
      {% endif %}
      <br></br>
84
  </div>
85

86 87 88 89 90
  <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 %}
91

92 93 94 95
    {% 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>
96

97 98 99
      <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>
100

101 102 103
      <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>
104

105 106 107 108
      <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 %}
109 110

    {% with the_url|add:"?qr" as qr_url %}
David Haynes's avatar
David Haynes committed
111
      <pre><strong>QR Downloads:</strong>
112 113 114
        <a href="http://chart.googleapis.com/chart?cht=qr&chs=268x268&chl={{ qr_url }}" target="_blank">Small (268x268)</a>
        <a href="http://chart.googleapis.com/chart?cht=qr&chs=383x383&chl={{ qr_url }}" target="_blank">Medium (383x383)</a>
        <a href="http://chart.googleapis.com/chart?cht=qr&chs=547x547&chl={{ qr_url }}" target="_blank">Large (547x547)</a>
115 116 117
        </pre>
    {% endwith %}

118
  {% endwith %}
119
  </div>
120
</div>
121 122 123 124 125 126 127

<script>
  $(function () {
    var option = {'trigger': 'hover'};
    $('[data-toggle="popover"]').popover( option )
  })
</script>