A simple ticketing application written in Python/Django
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

login.html 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. {% load staticfiles %}
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <meta name="description" content="">
  9. <meta name="author" content="">
  10. <link rel="shortcut icon" href="{% static 'img/favicon.ico' %}">
  11. <title>Django tickets</title>
  12. <!-- Bootstrap core CSS -->
  13. <link href="{% static 'bootstrap/css/bootstrap.css' %}" rel="stylesheet">
  14. <!-- Custom styles for this site -->
  15. <link href="{% static 'css/frontpage.css' %}" rel="stylesheet">
  16. <!-- Custom tags for the head tag -->
  17. <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  18. <!--[if lt IE 9]>
  19. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  20. <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
  21. <![endif]-->
  22. </head>
  23. <body>
  24. <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  25. <div class="container">
  26. <div class="navbar-header">
  27. </div>
  28. <div class="collapse navbar-collapse">
  29. <ul class="nav navbar-nav">
  30. </ul>
  31. <ul class="nav navbar-nav navbar-right">
  32. <!-- <li><a href="{% url 'inbox' %}">Login</a></li> -->
  33. <li><a href="#" title="Login" data-toggle="modal" data-target="#LoginModal">Login</a></li>
  34. </ul>
  35. </div><!--/.nav-collapse -->
  36. </div>
  37. </div>
  38. <div class="jumbotron jumbotron-carousel corporate-jumbo">
  39. <div class="container">
  40. <div class="row">
  41. <div class="col-md-8 col-sm-12">
  42. <h1 style="color: white;">Tickets</h1>
  43. <p>A simple ticketing application</p>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="container">
  49. <div class="row">
  50. <div class="col-lg-4">
  51. <h2><i class="fa fa-cloud"></i> Web based</h2>
  52. <p>This is a web based ticketing application. So there is no need for local installations on the working stations of the users (besides a web browser).</p>
  53. </div>
  54. <div class="col-lg-4">
  55. <h2><i class="fa fa-users"></i> Multi User</h2>
  56. <p>It is a multi user application. Every user can create tickets, assign tickets to other users, comment tickets, change the ticket status and so on.</p>
  57. </div>
  58. <div class="col-lg-4">
  59. <h2><i class="fa fa-envelope"></i> Email integration</h2>
  60. <p>One of the main features is the ability to create new tickets via email. The app checks an IMAP account for new email regularly and creates a ticket for every email found in the inbox.</p>
  61. </div>
  62. </div>
  63. <div class="row">
  64. <div class="col-lg-4">
  65. <h2><i class="fa fa-lock"></i> Security</h2>
  66. <p>Django is innately a very secure web framework. But there are some best practices of the django community that enhance security. In this application I tried to implement these good security best practices.</p>
  67. </div>
  68. <div class="col-lg-4">
  69. <h2><i class="fa fa-code"></i> Python/Django</h2>
  70. <p>The application is based on the programming language <a href="https://www.python.org/" target="new">Python</a> and the web framework <a href="https://www.djangoproject.com/" target="new">Django</a>.</p>
  71. </div>
  72. <div class="col-lg-4">
  73. <h2><i class="fa fa-dot-circle-o"></i> Minimal Feature Set</h2>
  74. <p>By now, this is just a very simple app with a minimal features set. It is not intended to grow up to a kitchen sink. But I will add some features in the future.</p>
  75. </div>
  76. </div>
  77. </div>
  78. <!-- Site footer -->
  79. <!-- Some social button for contact will do -->
  80. <a name="contact"></a>
  81. <div class="container">
  82. <div class="footer">
  83. <div class="row">
  84. <div class="col-lg-6">
  85. <p>Powered by <a href="https://www.python.org/" target="_new">Python</a>, <a href="https://www.djangoproject.com/" target="_new">Django</a>, and <a href="http://getbootstrap.com/" target="_new">Bootstrap</a></p>
  86. </div>
  87. <div class="col-lg-6 text-right">
  88. <p>License: <a href="https://github.com/suenkler/django-tickets">MIT</a></p>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <!-- Bootstrap Modal -->
  94. <div class="modal fade" id="LoginModal" tabindex="-1" role="dialog" aria-labelledby="LoginModalLabel" aria-hidden="true">
  95. <div class="modal-dialog" style="width: 450px;">
  96. <div class="modal-content">
  97. <div class="modal-header">
  98. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  99. <h4 class="modal-title" id="myModalLabel">Please sign in</h4>
  100. </div>
  101. <div class="modal-body">
  102. <form class="form-signin" role="form" method="post" action="{% url 'django.contrib.auth.views.login' %}">
  103. {% csrf_token %}
  104. <!-- <h2 class="form-signin-heading">Please sign in</h2> -->
  105. <label for="login-username" class="sr-only">User name</label>
  106. <input type="text" id="username" name="username" class="form-control" placeholder="User name" required autofocus>
  107. <label for="login-password" class="sr-only">Password</label>
  108. <input type="password" id="password" name="password" class="form-control" placeholder="Password" required>
  109. <button class="btn btn-lg btn-primary btn-block" value="login" type="submit">Sign in</button>
  110. <input type="hidden" name="next" value="{{ next }}" />
  111. </form>
  112. </div>
  113. <div class="modal-footer" style="text-align: left;">
  114. Forgot your password? Shit happens.
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <!-- Bootstrap Modal -->
  120. <div class="modal fade" id="ErrorModal" tabindex="-1" role="dialog" aria-labelledby="ErrorModalLabel" aria-hidden="true">
  121. <div class="modal-dialog" style="width: 450px;">
  122. <div class="modal-content">
  123. <div class="modal-body">
  124. <div class="alert alert-danger" role="alert" style="background: #f1f1f1;"><i class="fa fa-frown-o" style="float: right; color: red; padding: 10px; margin-left: 10px; font-size: 80px;"></i><b>Ooooops!</b><br/>Your credentials are invalid! Please <a href="#" title="Login" data-toggle="modal" data-target="#LoginModal" id="LinkLogin">try again</a>. If you have any questions, please do not contact me.</div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. <!-- Bootstrap core JavaScript
  130. ================================================== -->
  131. <!-- Placed at the end of the document so the pages load faster -->
  132. <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
  133. <script src="{% static 'bootstrap/js/bootstrap.min.js' %}"></script>
  134. {% if form.errors %}
  135. <script>
  136. /* Modal mit Error-Message beim Laden der Seite öffnen, wenn es Form Errors gibt. */
  137. $('#ErrorModal').modal()
  138. /* Wenn dann im Error-Modal auf "try again" geklickt wird, soll das Error-Modal
  139. geschlossen und das Login-Modal wieder geöffnet werden. */
  140. $('#LinkLogin').click( function() {
  141. $('#ErrorModal').modal('hide');
  142. $('#LoginModal').modal('show');
  143. /* $('#username').focus(); */
  144. return false; } );
  145. </script>
  146. {% endif %}
  147. <script>
  148. /* Autofocus field with 'autofocus' attribute in Bootstrap Modals */
  149. $('.modal').on('shown.bs.modal', function() {
  150. $(this).find('[autofocus]').focus();
  151. });
  152. </script>
  153. </body>
  154. </html>