2016-09-12 16:56:45 +08:00
{% extends 'base_AdminLTE.html' %}
{% block title %}Docklet | Beans Application{% endblock %}
{% block panel_title %}Beans Application{% endblock %}
{% block panel_list %}
< ol class = "breadcrumb" >
< li >
< a href = "/dashboard/" > < i class = "fa fa-dashboard" > < / i > Home< / a >
< / li >
< li class = "active" >
< strong > Beans Application< / strong >
< / li >
< / ol >
{% endblock %}
{% block css_src %}
2016-09-15 18:04:12 +08:00
< link href = "//cdn.bootcss.com/datatables/1.10.11/css/dataTables.bootstrap.min.css" rel = "stylesheet" >
< link href = "//cdn.bootcss.com/datatables/1.10.11/css/jquery.dataTables_themeroller.css" rel = "stylesheet" >
< link href = "/static/dist/css/modalconfig.css" rel = "stylesheet" >
2016-09-12 16:56:45 +08:00
{% endblock %}
{% block content %}
< div class = "row" >
< div class = "col-md-12" >
< div class = "box box-info" >
2016-09-15 18:04:12 +08:00
< div class = "box-header with-border" >
2016-09-12 16:56:45 +08:00
< h3 class = "box-title" > All Applications< / h3 >
< div class = "box-tools pull-right" >
< button type = "button" class = "btn btn-box-tool" data-widget = "collapse" > < i class = "fa fa-minus" > < / i >
< / button >
< button type = "button" class = "btn btn-box-tool" data-widget = "remove" > < i class = "fa fa-times" > < / i > < / button >
< / div >
< / div >
2016-09-15 18:04:12 +08:00
< div class = "box-body" >
< p >
2016-09-25 17:17:34 +08:00
< button type = "button" class = "btn btn-primary btn-sm" data-toggle = "modal" data-target = "#AddApplication" > < i class = "fa fa-plus" > < / i > Apply For Beans< / button >
2016-09-15 18:04:12 +08:00
< / p >
< div class = "modal inmodal" id = "AddApplication" tabindex = "-1" role = "dialog" aria-hidden = "true" >
< div class = "modal-dialog" >
< div class = "modal-content animated fadeIn" >
< div class = "modal-header" >
< button type = "button" class = "close" data-dismiss = "modal" > < span aria-hidden = "true" > × < / span > < span class = "sr-only" > Close< / span > < / button >
< i class = "fa fa-plus modal-icon" > < / i >
< h4 class = "modal-title" > Apply for more beans.< / h4 >
< small class = "font-bold" > Application Requirements: < br / > 1.Your beans are less than 1000.< br / > 2.No application is on "processing".< / small >
< / div >
< div class = "modal-body" >
< form action = "/beans/apply/" method = "POST" id = "beansapplyForm" >
< div class = "form-group" >
< label > Number< / label > < small class = "font-bold" > How many beans do you need?< / small >
< input type = "number" class = "form-control" placeholder = "100-5000" name = "number" id = "number" min = "100" max = "5000" / >
< / div >
< div class = "form-group" >
< label > Reason< / label >
< textarea class = "form-control" name = "reason" cols = "28" rows = "5" onKeyDown = "textCounter(reason,remLen,300);" onKeyUp = "textCounter(reason,remLen,300);" placeholder = "Please describe what you will do in your workspace with the beans." > < / textarea >
You could only input < input name = "remLen" type = "text" value = "300" size = "3" readonly = "readonly" > more characters.
< / div >
< div class = "modal-footer" >
< button type = "button" class = "btn btn-white" data-dismiss = "modal" > Close< / button >
< button type = "submit" class = "btn btn-primary" > Submit< / button >
< / div >
< / form >
< / div >
< / div >
< / div >
< / div >
< div class = "table table-responsive" >
2016-09-12 16:56:45 +08:00
< table class = "table table-striped table-bordered table-hover table-image" >
< thead >
< tr >
< th > Application ID< / th >
< th > Username< / th >
< th > Number< / th >
2016-09-25 17:17:34 +08:00
< th > Submission Time< / th >
2016-09-12 16:56:45 +08:00
< th > Reason< / th >
< th > Status< / th >
< / tr >
< / thead >
< tbody >
{% for application in applications %}
< tr >
< td > {{ application.id }}< / td >
< td > {{ application.username }}< / td >
2016-09-25 17:17:34 +08:00
< td > {{ application.number }} < img src = '/static/img/bean.png' > < / td >
< td > {{ application.time }}< / td >
2016-09-12 16:56:45 +08:00
< td > {{ application.reason }}< / td >
< td > {{ application.status }}< / td >
< / tr >
{% endfor %}
< / tbody >
< / table >
2016-09-15 18:04:12 +08:00
< / div >
< / div >
2016-09-12 16:56:45 +08:00
< / div >
2016-09-15 18:04:12 +08:00
< / div >
2016-09-12 16:56:45 +08:00
< / div >
{% endblock %}
{% block script_src %}
< script src = "http://cdn.bootcss.com/datatables/1.10.11/js/jquery.dataTables.js" > < / script >
< script src = "http://cdn.bootcss.com/datatables/1.10.11/js/dataTables.bootstrap.js" > < / script >
< script src = "http://cdn.bootcss.com/datatables-tabletools/2.1.5/js/TableTools.min.js" > < / script >
< script >
$(document).ready(function() {
$(".table-image").DataTable();
});
2016-09-15 18:04:12 +08:00
function textCounter(field,countfield,maxlimit)
{
if(field.value.length > maxlimit)
field.value = field.value.substring(0,maxlimit);
else
countfield.value = maxlimit - field.value.length;
}
2016-09-12 16:56:45 +08:00
< / script >
{% endblock %}