link_box.html 7.99 KB
Newer Older
1
{% load go_extras %} {% load qr_tags %}
2

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

5
<div class="container">
6 7
    <div class="col-md-8">
        <h3>Go Address:</h3>
8 9 10 11 12 13 14 15 16 17 18 19
        <div id="link-container" class="input-group">
            <a id="link" class="form-control" href="{{domain}}{{url.short}}">
                {{domain}}{{url.short}}
            </a>
            <div id="button-container" class="input-group-addon">
                <button id="copy-button" type="button" class="button btn btn-default btn-xs fa" role="button"
                data-clipboard-target="#link" title="Copy to Clipboard">
                    <i id="clipboard-icon" class="fa fa-clipboard fa-1g" aria-hidden="true"></i>
                </button>
            </div>
        </div>

20
        <br></br>
Chris Reffett's avatar
Chris Reffett committed
21

22 23
        <h3>Address Details:</h3>
        <strong>Target URL:</strong>
David Haynes's avatar
David Haynes committed
24 25
        <br />
        <a href="{{url.target}}">{{url.target}}</a>
David Haynes's avatar
David Haynes committed
26
        <br />
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
        {% if url.owner == request.user.registereduser and request.user.registereduser.approved == True %}
            <strong>Clicks:</strong> {{url.clicks}}
            <br />
            <strong>QR Code Uses:</strong> {{url.qrclicks}}
            <br />
            <strong>Social Media Clicks:</strong> {{url.socialclicks}}
            <br />

            <strong>Expires:</strong> {{url.expires|default_if_none:"Never"}}

            <br></br>

            <a class="button btn btn-danger btn-sm fa" data-target="#deletionModal" data-toggle="modal">
                <i class="fa fa-trash-o fa-lg"></i> Delete
            </a>
            <!-- <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> -->

            <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>

            <div id="deletionModal" class="modal fade" role="dialog" tabindex="-1">
                <div class="modal-dialog">

54 55 56 57 58 59 60 61 62 63 64 65 66
                  <!-- Modal content-->
                  <div class="modal-content" style="background-color:#f5f5f5; border-radius: 7px">
                      <div class="modal-header" style="text-align:center;">
                          <h4 class="modal-title  text-center" style="font-weight:bold; font-size: 21px !important;">Are you sure you would like to delete this link?</h4>
                          <h6 style="font-weight:500; margin-top: 0px; margin-bottom: 0px;">Deleting a link is permenant and can not be undone!</h6>
                      </div>
                      <div class="modal-body" style="padding-bottom: 80px">
                          <a type="button" class="btn btn-success btn-lg" style="border-width: 0px;float:left; width:49%; background-color: #A9B0AD; color: #ffffff; 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; color: #ffffff; border-radius: 4px;">Delete</a>
                      </div>
                  </div>
              </div>
          </div>
67 68

        {% endif %}
69

70
        <br></br>
Chris Reffett's avatar
Chris Reffett committed
71

72 73 74
    </div>

    <div class="col-md-4">
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
        {% with domain|add:url.short as the_url %}
            {% with the_url|add:"?qr" as qr_url%}
              {% qr_from_text qr_url 's' %}
            {% endwith %}

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

              <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>

              <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>

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

            {% with the_url|add:"?qr" as qr_url %}
              <pre><strong>QR Downloads:</strong>
Michael Bailey's avatar
Michael Bailey committed
100 101 102
        <a href="https://chart.googleapis.com/chart?cht=qr&chs=268x268&chl={{ qr_url }}" target="_blank">Small (268x268)</a>
        <a href="https://chart.googleapis.com/chart?cht=qr&chs=383x383&chl={{ qr_url }}" target="_blank">Medium (383x383)</a>
        <a href="https://chart.googleapis.com/chart?cht=qr&chs=547x547&chl={{ qr_url }}" target="_blank">Large (547x547)</a>
103 104 105
                </pre>
            {% endwith %}
        {% endwith %}
Chris Reffett's avatar
Chris Reffett committed
106

107
      {% if url.owner == request.user.registereduser and request.user.registereduser.approved == True %}
David Haynes's avatar
David Haynes committed
108 109 110
      <strong>Clicks:</strong>
        {{url.clicks}}
      <br />
Chris Reffett's avatar
Chris Reffett committed
111

David Haynes's avatar
David Haynes committed
112 113
      <strong>QR Code Uses:</strong> {{url.qrclicks}}
      <br />
114
      <strong>Social Media Clicks:</strong> {{url.socialclicks}}
David Haynes's avatar
David Haynes committed
115
      <br />
116

David Haynes's avatar
David Haynes committed
117 118
      <strong>Expires:</strong> {{url.expires|default_if_none:"Never"}}
      <br></br>
Robert Hitt's avatar
Robert Hitt committed
119
      <a class="button btn btn-danger btn-sm" href="{{domain}}delete/{{url.short}}">
120
        <i class="fa fa-trash-o fa-lg" aria-hidden="true"></i> Delete</a>
121

Robert Hitt's avatar
Robert Hitt committed
122
      <a tabindex="0" class="button btn btn-info btn-sm"
123 124 125 126 127
        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">
128
        <i class="fa fa-cog" aria-hidden="true"></i> Edit</a>
129

David Haynes's avatar
David Haynes committed
130 131
      {% endif %}
      <br></br>
132
  </div>
133

134 135 136 137 138
  <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 %}
139

140 141 142 143
    {% 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>
144

145 146 147
      <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>
148

149 150 151
      <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>
152

153 154 155 156
      <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 %}
157 158 159 160 161 162 163 164 165

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

166
  {% endwith %}
167
  </div>
168
    </div>
169
</div>
170

171 172

<link rel="stylesheet" type="text/css" href="../../static/css/style-link-box.css">
173 174
<script src="../../static/js/clipboard.min.js"></script>
<script src="../../static/js/copy.js"></script>
175

176
<script>
177 178 179 180 181 182
    $(function() {
        var option = {
            'trigger': 'hover'
        };
        $('[data-toggle="popover"]').popover(option)
    })
183
</script>