new_link.html 1.64 KB
Newer Older
Zach Knox's avatar
Zach Knox committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
54
55
56
57
58
59
60
61
62
<!-- include the base html template -->
{% extends 'layouts/base.html' %}

<!-- load django crispy forms' tags -->
{% load crispy_forms_tags %}

<!-- define the page title block -->
{% block title %}
SRCT Go &bull; A University Branded URL Shortener
{% endblock %}

<!-- define the content block for the page -->
{% block content %}

<!-- define the page header div -->
<div class="page-header" id="banner">
  <div class="row">
    <div class="col-md-12">
      <h1><strong>
        <span class="fa-stack fa-lg">
          <i class="fa fa-circle fa-stack-2x"></i>
          <i class="fa fa-link fa-stack-1x fa-inverse"></i>
        </span>
        <i class="fa">Shorten URL</i>
      </strong></h1>
    </div>
  </div>
</div>

<!-- call django crispy forms to render the go link creation form here -->
{% crispy form %}

<!-- load some JS to hide/show the custom date field -->
<script type="text/javascript">
$(function() {
    // hide by default
    $("div_id_expires_custom").hide();

    // if the expires_custom checkbox is checked..
    if ($("#id_expires_5").is(":checked")) {
        // display the field
        $("#div_id_expires_custom").slideDown();
    } else {
        // keep it up
        $("#div_id_expires_custom").slideUp();
    }

    // if the expires_custom checkbox is clicked..
    $("#div_id_expires").click(function() {
        // if the expires_custom checkbox is checked..
        if ($("#id_expires_5").is(":checked")) {
            // display the field
            $("#div_id_expires_custom").slideDown();
        } else {
            // keep it hidden 
            $("#div_id_expires_custom").slideUp();
        }
    })
})
</script>

{% endblock %}