Skip to content

Commit

Permalink
RGPD, add article
Browse files Browse the repository at this point in the history
  • Loading branch information
LoghanRamassamy committed Jul 16, 2018
1 parent c04bd8d commit 8880dad
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 42 deletions.
48 changes: 22 additions & 26 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<meta name="author" content="">

<title>IDeal Homepage</title>
<link rel="icon" href="vendor/img/ideal-logo.png" />

<link href="vendor/css/custom.css" rel="stylesheet">
<link href="vendor/bootstrap-4.1.1-dist/css/bootstrap.min.css" rel="stylesheet">
Expand All @@ -27,7 +28,7 @@
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="#" id="goArticle">IDEAL</a>
<a class="navbar-brand" href="#" id="goArticle"><img src="vendor/img/ideal-logo.png"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down Expand Up @@ -134,10 +135,6 @@ <h5 class="modal-title textBold tradLogin" >Login to your account</h5>
<label for="inputPassword" id="inputPasswordLabel" class="tradPassword">Password</label>
<input type="password" class="form-control" id="inputPassword" placeholder="********">
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="rememberMe">
<label class="form-check-label tradRemember" for="rememberMe" id="rememberMeLabel">Remember me</label>
</div>
</div>
<div class="modal-footer">
<small class="form-text text-muted">
Expand Down Expand Up @@ -167,14 +164,6 @@ <h5 class="modal-title textBold tradCreateAccount" id="registerModalLabel">Creat
<label for="inputMailSignUp" class="tradMail">Email</label>
<input type="email" class="form-control" id="inputMailSignUp" value="" placeholder="email@email.com" required>
</div>
<div class="form-group">
<label for="inputUsername" class="tradUsername">Username</label>
<input type="text" class="form-control" id="inputUsername" value="" placeholder="Enter your name">
</div>
<div class="form-group">
<label for="inputBirth" class="tradBirth">Date of birth</label>
<input type="date" class="form-control" id="inputBirth" value="" placeholder="01/01/2000">
</div>
<div class="form-group">
<label for="inputPasswordSignUp" class="tradPassword">Password</label>
<input type="password" class="form-control" id="inputPasswordSignUp" value="" placeholder="********" required>
Expand All @@ -186,6 +175,13 @@ <h5 class="modal-title textBold tradCreateAccount" id="registerModalLabel">Creat
<!-- display if password is not same -->
</div>
</div>
<div class="form-check">
<small> <a>RGPD</a></label></small> <!---->
<small class="form-text text-muted">
<input type="checkbox" class="form-check-input" id="termsOfUse" required>
<label class="form-check-label tradTermsOfUse" for="termsOfUse" id="termsOfUseLabel">By checking this box you accept the<a href="vendor/document/RGPD_FR.pdf" > RGPD</a></label>
</small>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary tradCancel" data-dismiss="modal">Cancel</button>
Expand Down Expand Up @@ -228,8 +224,6 @@ <h5 class="modal-title textBold tradCreateAccount" id="registerModalLabel">Creat
</a>
</div>



<!-- List offer -->
<div class="row" id="listOffer">
</div>
Expand All @@ -243,21 +237,23 @@ <h5 class="modal-title textBold tradCreateAccount" id="registerModalLabel">Creat
<div class="row my-4">
<div class="col-lg-2">
<img class="img-profil" src="vendor/img/profilPicture.png" alt="">
<button type="button" class="btn btn-primary alignCenter tradGetPersoData">Get my personal data</button>
<button type="button" class="btn btn-secondary alignCenter tradDeletePersoData">Delete my account and my personal data</button>
</div>
<div class="col-lg-10">
<div class="form-group">
<label for="inputMailSignUp">Email</label>
<label for="inputMailSetting">Email</label>
<input type="email" class="form-control" id="inputMailSetting" value="" placeholder="loghan.r@gmail.com" required>
</div>
<div class="form-group">
<label class="tradUsername" for="inputUsername">Username</label>
<label class="tradUsername" for="inputUsernameSetting">Username</label>
<input type="text" class="form-control" id="inputUsernameSetting" value="" placeholder="Loghan RAMASSAMY">
</div>
<div class="form-group">
<label class="tradBirth" for="inputBirthSetting">Date of birth</label>
<input type="date" class="form-control" id="inputBirthSetting" value="1994-03-01">
<label class="tradPassword" for="inputPasswordSetting">Password</label>
<input type="text" class="form-control" id="inputPasswordSetting" value="" placeholder="Loghan RAMASSAMY">
</div>
<button type="button" class="btn btn-primary alignRight tradUpdate" id="updateUser">Update</button>
<button type="button" class="btn btn-success alignRight tradUpdate" id="updateUser">Update</button>
<button type="button" class="btn btn-secondary alignRight tradCancel">Reset</button>
</div>
</div>
Expand Down Expand Up @@ -365,7 +361,7 @@ <h5 class="col-lg-12">+33 (0) 768 329 294</h5>
</div>
</div>

<!-- Offer add page -->
<!-- Page Add Offer -->
<div id="addOfferPage">
<form>
<div class="row my-4">
Expand All @@ -374,18 +370,18 @@ <h5 class="col-lg-12">+33 (0) 768 329 294</h5>
</div>
<div class="col-lg-10">
<div class="form-group">
<label class="tradName">Name</label>
<input type="text" class="form-control" value="" placeholder="" required>
<label class="tradArticleName">Name</label>
<input type="text" class="form-control" id="articleName" required>
</div>
<div class="form-group">
<label>Description</label>
<input type="text" class="form-control" value="" placeholder="" required>
<input type="text" class="form-control" id="articleDescription" required>
</div>
<div class="form-group">
<label class="tradPrice">Price</label>(<span class="tradMoneyLogo"></span>)
<input type="number" class="form-control" value="" required>
<input type="number" class="form-control" id="articlePrice" required>
</div>
<button type="button" class="btn btn-primary alignRight tradAdd" >Add</button>
<button type="button" class="btn btn-primary alignRight tradAdd" id="btnAddOffer">Add</button>
<button type="button" class="btn btn-secondary alignRight tradCancel">Reset</button>
</div>
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/vendor/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/* IDeal */

html,
body { height: 100% }
body {
height: 100%;
background-color: #f5f5f5;
}

body { padding-top: 54px }
body { background-color: #f5f5f5 }
@media (min-width: 992px) {
body { padding-top: 56px }
}
Expand Down Expand Up @@ -39,6 +41,8 @@ img {
.textBold { font-weight: bold }
.cursorAsPointer { cursor:pointer }



#userPage { display: none; }
#partnerPage { display: none; }
#favoritePage { display: none; }
Expand Down
Binary file added src/vendor/document/RGPD_EN.docx
Binary file not shown.
Binary file added src/vendor/document/RGPD_EN.pdf
Binary file not shown.
Binary file added src/vendor/document/RGPD_FR.docx
Binary file not shown.
Binary file added src/vendor/document/RGPD_FR.pdf
Binary file not shown.
Binary file added src/vendor/img/background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/vendor/img/ideal-logo-HD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/vendor/img/ideal-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/vendor/js/authentification.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function oauthSignIn() {
}

function checkLoginPwd (mail, pwd){
var url = "http://localhost:8888/user"
var url = urlServer + "user"
var checkLogin = false;

$.support.cors = true;
Expand Down Expand Up @@ -67,7 +67,7 @@ function checkLoginPwd (mail, pwd){
function getToken(id, mail, pwd){
//var signin = function() {

var tokenUrl = "http://localhost:8888/oauth2/token";
var tokenUrl = urlServer + "oauth2/token";

var params = {"grant_type":"password",
"client_id":id,
Expand Down
47 changes: 38 additions & 9 deletions src/vendor/js/custom.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
var divArray = ['#articlePage', '#userPage', '#favoritePage', '#partnerPage', '#administrationPage', '#addOfferPage']; //Don't forget add DIV in custom.css
var urlServer = "http://78.192.12.79:18080";
var urlArticle = urlServer + "/article";
var urlUser = urlServer + "/user";

$(function(){
/*$('#inputConfirmPasswordSignUp').change(function() {
var aBool = isValidatePassword();
});*/

initArticleJson("http://localhost:8888/article");
initTableUserJson("http://localhost:8888/user");
initTableArticleJson("http://localhost:8888/article");
initArticleJson();
initTableUserJson();
initTableArticleJson();


$('#goUser').click(function() {
Expand Down Expand Up @@ -47,9 +50,35 @@ $(function(){
alert("J'ai terminé la function");
});

$('#btnAddOffer').click(function() {
alert("Je lance la function");
//alert($("#articleName").val(), $("#articleDescription").val(), $("#articlePrice").val());
addArticle($("#articleName").val(), $("#articleDescription").val(), $("#articlePrice").val());
alert("J'ai terminé la function");
});


});

function addArticle(articleName, description, price) {
console.log(articleName);
console.log(description);
console.log(parseFloat(price));
price = parseFloat(price);
$.support.cors = true;
$.ajax(
{
contentType: 'application/json',
type: 'post',
dataType: 'json',
data: JSON.stringify ({name : 'Test', img : 0, description : 'Testons', price : 100.5}),
url: urlArticle,
error: (xhr, status, error) => { alert("ERROR");/* var errorMessage = xhr.responseJSON.message */ }

}).done((json) => { alert("OKK");/*S'exécute en cas de succès de la requête*/ });
}
//application/json
//contentType: 'application/json',
function showDiv(arrayOfDiv, idDiv) {
for (var id in arrayOfDiv) {
if (arrayOfDiv[id] === idDiv) { $(arrayOfDiv[id]).show(); }
Expand Down Expand Up @@ -85,10 +114,10 @@ function isValidPassword() {
return false;
}

function initArticleJson(url){
function initArticleJson(){
$.support.cors = true;
$.getJSON(
url,
urlArticle,
function(data){
if (data.length > 1) {
$.each(data, function (key, val) {
Expand All @@ -99,10 +128,10 @@ function initArticleJson(url){
);
}

function initTableUserJson(url){
function initTableUserJson(){
$.support.cors = true;
$.getJSON(
url,
urlUser,
function(data){
if (data.length > 1) {
//alert(data.length);
Expand All @@ -115,10 +144,10 @@ function initTableUserJson(url){
);
}

function initTableArticleJson(url){
function initTableArticleJson(){
$.support.cors = true;
$.getJSON(
url,
urlArticle,
function(data){
if (data.length > 1) {
$.each(data, function (key, val) {
Expand Down
17 changes: 14 additions & 3 deletions src/vendor/js/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ i18next.init({
"tradAddOffer" : "Add offer",
"tradAdministration" : "Administration",
"tradAdd" : "Add",
"tradUpdate" : "Update"
"tradUpdate" : "Update",
"tradArticleName" : "Article name",
"tradTermsOfUse" : "By checking this box you accept the",
"tradGetPersoData" : "Get my personal data",
"tradDeletePersoData" : "Delete my account and my personal data"
}
},
"fr-FR": {
Expand Down Expand Up @@ -92,7 +96,11 @@ i18next.init({
"tradAddOffer" : "Ajouter une offre",
"tradAdministration" : "Administration",
"tradAdd" : "Ajouter",
"tradUpdate" : "Mise à jour"
"tradUpdate" : "Mise à jour",
"tradArticleName" : "Nom de l'article",
"tradTermsOfUse" : "En cochant cette case vous acceptez le",
"tradGetPersoData" : "Récupérer mes données personnels",
"tradDeletePersoData" : "Supprimer mon compte ainsi que mes données personnels"
}
}
}
Expand Down Expand Up @@ -133,7 +141,10 @@ function updateContent() {
$('.tradAdministration').text(i18next.t('tradAdministration'));
$('.tradAdd').text(i18next.t('tradAdd'));
$('.tradUpdate').text(i18next.t('tradUpdate'));

$('.tradArticleName').text(i18next.t('tradArticleName'));
$('.tradTermsOfUse').text(i18next.t('tradTermsOfUse'));
$('.tradGetPersoData').text(i18next.t('tradGetPersoData'));
$('.tradDeletePersoData').text(i18next.t('tradDeletePersoData'));
}

function changeLng(lng) {
Expand Down

0 comments on commit 8880dad

Please sign in to comment.