Commit 3b4d0490 authored by Floréal Cabanettes's avatar Floréal Cabanettes

Add add new subtr function + fix mobile behavior

parent 746a1950
This diff is collapsed.
{"version":3,"sources":["less/datepicker3.less","build/build3.less"],"names":[],"mappings":"AAAA,YACC,cAAA,IAIA,UAAA,IAHC,mBACA,MAAA,MAGC,2BACD,UAAA,IACY,4CACX,MAAA,MAGD,qBACA,IAAA,EACA,KAAA,EACA,QAAA,IACC,4BACA,QAAA,GACA,QAAA,aACA,YAAA,IAAA,MAAA,YACA,aAAA,IAAA,MAAA,YACA,cAAA,IAAA,MAAA,gBACA,WAAA,EACA,oBAAA,eACA,SAAA,SAEA,2BACA,QAAA,GACA,QAAA,aACA,YAAA,IAAA,MAAA,YACA,aAAA,IAAA,MAAA,YACA,cAAA,IAAA,MAAA,KACA,WAAA,EACA,SAAA,SAEuB,mDAAY,KAAA,IACZ,kDAAY,KAAA,IACX,oDAAW,MAAA,IACX,mDAAW,MAAA,IACV,qDAAU,IAAA,KACV,oDAAU,IAAA,KACb,kDACtB,OAAA,KACA,cAAA,EACA,WAAA,IAAA,MAAA,gBAEsB,iDACtB,OAAA,KACA,cAAA,EACA,WAAA,IAAA,MAAA,KAGF,kBACC,OAAA,EACA,sBAAA,KACA,oBAAA,KACA,mBAAA,KACA,iBAAA,KACA,gBAAA,KACA,YAAA,KAEC,wBAAI,wBACH,WAAA,OACA,MAAA,KACA,OAAA,KACA,cAAA,IACA,OAAA,KAOF,uCAAI,uCACH,iBAAA,YAKA,4BADA,4BAEA,MAAA,KAEI,kCACJ,gCACA,WAAA,KACA,OAAA,QAEA,iCACS,uCACT,WAAA,IACA,MAAA,KACA,OAAA,QAEA,oCC3DD,MAAA,KACA,iBAAA,QACA,aAAA,QD4DC,cAAA,ECzDA,0CADA,0CAEC,MAAA,KACA,iBAAA,QACI,aAAA,QAEL,0CACC,MAAA,KACA,iBAAA,QACI,aAAA,QAGL,2CADA,2CAEC,MAAA,KACA,iBAAA,QACI,aAAA,QAIH,iDADA,iDADA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ADA,kDAAA,sCAEC,MAAA,KACA,iBAAA,QACI,aAAA,QAIH,4CADA,4CADA,4CAEA,wDADA,wDADA,wDAEA,wDADA,wDADA,wDAEA,4CADA,4CADA,4CAGC,MAAA,KACA,iBAAA,QACI,aAAA,QAQL,8CADA,8CADA,8CAEA,0DADA,0DADA,0DAEA,2DADA,2DADA,2DAEA,+CADA,+CADA,+CAEA,wDAAA,oEADA,oEADA,oEACA,wDADA,wDAGC,iBAAA,QACI,aAAA,QDqGR,6BACC,QAAA,MACA,MAAA,IACA,OAAA,KACA,YAAA,KACA,MAAA,KACA,OAAA,GACA,OAAA,QACA,cAAA,IAEC,qCADA,mCAEA,WAAA,KAEA,sCACS,4CACT,WAAA,IACA,MAAA,KACA,OAAA,QAEA,oCAEO,6CACS,mDAFT,0CC7JT,MAAA,KACA,iBAAA,QACA,aAAA,QD+JE,YAAA,EAAA,KAAA,EAAA,gBC5JD,mDADA,mDACA,yDADA,yDACA,0CADA,0CACA,gDADA,gDAEC,MAAA,KACA,iBAAA,QACI,aAAA,QAEL,mDAAA,yDAAA,0CAAA,gDACC,MAAA,KACA,iBAAA,QACI,aAAA,QAGL,2CAAA,oDADA,oDACA,0DADA,0DAAA,2CACA,iDADA,iDAEC,MAAA,KACA,iBAAA,QACI,aAAA,QAIH,iDADA,iDADA,iDAEA,0DADA,0DADA,0DAEA,0DADA,0DADA,0DAEA,gEADA,gEADA,gEAEA,gEADA,gEADA,gEAEA,iDADA,iDADA,iDAEA,uDADA,uDADA,uDAEA,uDADA,uDADA,uDAGC,MAAA,KACA,iBAAA,QACI,aAAA,QAQL,4DADA,4DADA,4DAEA,mDADA,mDADA,mDAEA,kEADA,kEADA,kEAEA,mEADA,mEADA,mEAEA,6DADA,6DADA,6DAEA,yDADA,yDADA,yDAEA,0DADA,0DADA,0DAEA,oDADA,oDADA,oDAEA,sEADA,sEADA,sEAEA,4EADA,4EADA,4EAEA,6DADA,6DADA,6DAEA,mEADA,mEADA,mEAGC,iBAAA,QACI,aAAA,QDgIN,iCADA,iCAEA,MAAA,KAKH,+BACC,MAAA,MAGD,+BAEA,kBADA,kBAES,wBACR,OAAA,QACC,qCAAA,wBAAA,wBAAA,8BACA,WAAA,KAKF,gBACC,UAAA,KACA,MAAA,KACA,QAAA,EAAA,IAAA,EAAA,IACA,eAAA,OAGgB,qCACjB,OAAA,QAED,iBACC,MAAA,KACA,uBACC,WAAA,OAEI,mCACJ,cAAA,IAAA,EAAA,EAAA,IAEI,kCACJ,cAAA,EAAA,IAAA,IAAA,EAED,oCACC,MAAA,KACA,UAAA,KACA,QAAA,IAAA,IACA,YAAA,WACA,YAAA,EAAA,IAAA,EAAA,KACA,aAAA,IAAA,EACA,YAAA,KACA,aAAA"}
\ No newline at end of file
......@@ -5,10 +5,16 @@
body {
background: #200444;
margin-top: 60px;
}
h1, label {
color: #fff;
}
h1 {
position: fixed;
width: 100%;
display: block;
height: 60px;
background: #000 url("../img/trackmybank.png") no-repeat 5px 5px;
......@@ -16,19 +22,16 @@ h1 {
font-family: signatra;
font-size: 30pt;
line-height: 60px;
margin-top: 0;
margin-top: -60px;
margin-bottom: 0;
text-align: center;
z-index: 1000;
}
form {
padding: 0 20px 20px;
}
select, input, button {
color: #000;
}
form label, form input, form select {
width: 100%;
font-size: 18pt;
......@@ -38,6 +41,10 @@ form label {
margin-top: 20px;
}
form label.first {
margin-top: 0;
}
form select {
height: 40px;
}
......@@ -88,4 +95,17 @@ form button {
#notify.warn {
background: #bb842e;
}
div.transaction {
margin-top: 10px;
padding-bottom: 10px;
}
div.transaction:first-of-type {
margin-top: 0;
}
div.date-div {
position: relative;
}
\ No newline at end of file
......@@ -6,12 +6,13 @@
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap-datetimepicker.min.css"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap-datepicker3.min.css"/>
<link rel="stylesheet" type="text/css" href="css/trackmybank.css"/>
<script type="application/javascript" src="js/jquery-3.2.1.min.js"></script>
<script type="application/javascript" src="js/moment-with-locales.min.js"></script>
<script type="application/javascript" src="js/bootstrap.min.js"></script>
<script type="application/javascript" src="js/bootstrap-datetimepicker.min.js"></script>
<script type="application/javascript" src="js/bootstrap-datepicker.min.js"></script>
<script type="application/javascript" src="js/bootstrap-datepicker.fr.min.js"></script>
<script type="application/javascript" src="js/credentials.js"></script>
<script type="application/javascript" src="js/trackmybank.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
......@@ -34,14 +35,21 @@
<div id="logged" style="display: none;">
<form action="#" id="add-form">
<label for="date_t">Date de la transaction</label>
<input id="date_t" class="datemask datepicker" autocomplete="off"/>
<label for="amount">Montant</label>
<input class="money decimal" id="amount"/>
<label for="category">Catégorie</label>
<select id="category" class="select2">
<option></option>
</select>
<div class="date-div">
<label for="date_t">Date de la transaction</label>
<input id="date_t" class="datepicker" autocomplete="off"/>
</div>
<div id="transactions">
<div class="transaction">
<hr width="50%">
<label for="amount" class="first">Montant</label>
<input class="money" id="amount" type="number" step="0.01"/>
<label for="category">Catégorie</label>
<select id="category" class="select2">
<option></option>
</select>
</div>
</div>
<button id="send">Envoyer</button>
<button id="add-subtr">+ item</button>
<button id="reset">Annuler</button>
......
!function(a){a.fn.datepicker.dates.fr={days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],daysShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],daysMin:["d","l","ma","me","j","v","s"],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthsShort:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","déc."],today:"Aujourd'hui",monthsTitle:"Mois",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"}}(jQuery);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
trackmybank = {};
trackmybank.timeout = null;
trackmybank.transaction_html = null;
trackmybank.init = function() {
$("#dologin").on("click touch", trackmybank.login);
......@@ -11,6 +12,24 @@ trackmybank.init = function() {
$("form#add-form").on("submit", function(e) {
e.preventDefault();
});
$("#add-subtr").on("click touch", trackmybank.add_transaction);
trackmybank.transaction_html = $("#transactions .transaction:first");
$("#reset").on("click touch", trackmybank.cancel);
};
trackmybank.init_special_fields = function () {
trackmybank.set_datemask();
};
trackmybank.set_datemask = function (element) {
// Datetime picker:
$(element ? element : '.datepicker').datepicker({
format: "dd/mm/yyyy",
weekStart: 1,
todayBtn: "linked",
language: "fr",
autoclose: true
}).attr("readonly", "readonly");
};
trackmybank.login = function() {
......@@ -33,11 +52,21 @@ trackmybank.login = function() {
$("#category").append(new Option(cat["name"], cat["id"]));
});
}
trackmybank.init_special_fields();
credentials.token = data["token"];
}
});
};
trackmybank.add_transaction = function () {
$("#transactions").append(trackmybank.transaction_html.clone());
};
trackmybank.cancel = function() {
$("#transactions .transaction").remove();
trackmybank.add_transaction();
};
trackmybank.hide_notify = function() {
$("#notify").html("").attr("class", "").hide();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment