From 48668e743369a7d267b0fe14e4a14b550887af01 Mon Sep 17 00:00:00 2001 From: poka Date: Tue, 19 Nov 2019 00:59:03 +0100 Subject: [PATCH 01/13] Add solde status to products when transaction is detected --- public/ajax/readRecords.php | 10 ++++++++-- scripts/check_sold.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100755 scripts/check_sold.sh diff --git a/public/ajax/readRecords.php b/public/ajax/readRecords.php index 8077419..ef7bc22 100644 --- a/public/ajax/readRecords.php +++ b/public/ajax/readRecords.php @@ -17,7 +17,7 @@ Prix en junes'; $params["antenne_slug"] = $antenne_slug; - $requete = "SELECT products.*, users.username, users.pubkey + $requete = "SELECT products.*, users.username, users.pubkey FROM products LEFT JOIN antennes ON antennes.id = products.antenne_id @@ -50,7 +50,13 @@ $number"; $prix = $row['prix']; $vendeur = $row['username']; - $produit = $row['name']; + $status = $row['status']; + if ($status == "solde") { + $produit = "[$status] "; + } else { + $produit = ""; + } + $produit .= $row['name']; $pubkey = $row['pubkey']; $pubkeyShort = substr($pubkey, 0, 8); $vendeur_format = "$vendeur"; diff --git a/scripts/check_sold.sh b/scripts/check_sold.sh new file mode 100755 index 0000000..dfb9953 --- /dev/null +++ b/scripts/check_sold.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#DUNITER="http://192.168.9.54:45000" +DUNITER="https://duniter-g1.p2p.legal" +TXBLOCKS=$(curl -s ${DUNITER}/blockchain/with/tx | jq '.result.blocks[]') +TXBLOCKS=$(echo "$TXBLOCKS" | tail -n 5 | tr '\n' ' ') + +#echo "$TXBLOCKS" + +for i in $TXBLOCKS2; do + result=$(curl -s ${DUNITER}/blockchain/block/$i | jq '.transactions[].comment' | grep -v '""' | tr -d '"') + isSell=$(echo "$result" | grep "Merci") +# [[ ! -z $isSell ]] && echo $isSell +# echo --- + sleep 1 +done + + +isSell="[Achat GMarche] : testCesium" +isSell=$(echo $isSell | cut -d' ' -f4-) + +echo "$isSell est vendu" + +req="UPDATE products SET status = 'solde' WHERE name = '$isSell';" + +mysql --database gmarche -e "$req" +mysql --database gmarche -e "SELECT name,status FROM products;" + +exit 0 From 7da07e5b165b92d9353f3cc8063151119493f18b Mon Sep 17 00:00:00 2001 From: poka Date: Tue, 19 Nov 2019 17:44:36 +0100 Subject: [PATCH 02/13] Change [solde] to [Vendu] --- public/ajax/readRecords.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/ajax/readRecords.php b/public/ajax/readRecords.php index ef7bc22..8ee0cbd 100644 --- a/public/ajax/readRecords.php +++ b/public/ajax/readRecords.php @@ -52,7 +52,7 @@ $vendeur = $row['username']; $status = $row['status']; if ($status == "solde") { - $produit = "[$status] "; + $produit = "[Vendu] "; } else { $produit = ""; } From f73d15220eb748a7e573f74a45530ba5a16d5147 Mon Sep 17 00:00:00 2001 From: poka Date: Sat, 23 Nov 2019 17:24:08 +0100 Subject: [PATCH 03/13] Standard g1 node from config, sudo mysql --- scripts/check_sold.sh | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/scripts/check_sold.sh b/scripts/check_sold.sh index dfb9953..6486d52 100755 --- a/scripts/check_sold.sh +++ b/scripts/check_sold.sh @@ -1,29 +1,28 @@ #!/bin/bash -#DUNITER="http://192.168.9.54:45000" -DUNITER="https://duniter-g1.p2p.legal" -TXBLOCKS=$(curl -s ${DUNITER}/blockchain/with/tx | jq '.result.blocks[]') +DUNITER=$(grep g1_node ../config/config.php | awk '{ print $3}' | tr -d ';' | tr -d "'") +TXBLOCKS=$(curl -s $DUNITER/blockchain/with/tx | jq '.result.blocks[]') TXBLOCKS=$(echo "$TXBLOCKS" | tail -n 5 | tr '\n' ' ') +keyword="merci" -#echo "$TXBLOCKS" +for i in $TXBLOCKS; do + result=$(curl -s $DUNITER/blockchain/block/$i | jq '.transactions[].comment' | grep -v '""' | tr -d '"') -for i in $TXBLOCKS2; do - result=$(curl -s ${DUNITER}/blockchain/block/$i | jq '.transactions[].comment' | grep -v '""' | tr -d '"') - isSell=$(echo "$result" | grep "Merci") -# [[ ! -z $isSell ]] && echo $isSell -# echo --- +### TODO: Finaliser pour cas réel, prendre en compte plusieurs transactions gmarche dans même block, ainsi que transaction déjà passé en Vendu. + isSell=$(echo "$result" | grep "$keyword") + [[ ! -z $isSell ]] && echo $isSell + echo --- sleep 1 done - isSell="[Achat GMarche] : testCesium" isSell=$(echo $isSell | cut -d' ' -f4-) -echo "$isSell est vendu" +#echo "$isSell est vendu" req="UPDATE products SET status = 'solde' WHERE name = '$isSell';" -mysql --database gmarche -e "$req" -mysql --database gmarche -e "SELECT name,status FROM products;" +sudo mysql --database gmarche -e "$req" +sudo mysql --database gmarche -e "SELECT name,status FROM products;" exit 0 From 46a4b5411886ec0a7bb55b706ebfe6ca9fc9b2e6 Mon Sep 17 00:00:00 2001 From: poka Date: Sat, 23 Nov 2019 18:43:13 +0100 Subject: [PATCH 04/13] Add case for several solds --- scripts/check_sold.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/check_sold.sh b/scripts/check_sold.sh index 6486d52..7b743c8 100755 --- a/scripts/check_sold.sh +++ b/scripts/check_sold.sh @@ -3,26 +3,29 @@ DUNITER=$(grep g1_node ../config/config.php | awk '{ print $3}' | tr -d ';' | tr -d "'") TXBLOCKS=$(curl -s $DUNITER/blockchain/with/tx | jq '.result.blocks[]') TXBLOCKS=$(echo "$TXBLOCKS" | tail -n 5 | tr '\n' ' ') -keyword="merci" +keyword="\[Achat GMarche] : " for i in $TXBLOCKS; do result=$(curl -s $DUNITER/blockchain/block/$i | jq '.transactions[].comment' | grep -v '""' | tr -d '"') -### TODO: Finaliser pour cas réel, prendre en compte plusieurs transactions gmarche dans même block, ainsi que transaction déjà passé en Vendu. - isSell=$(echo "$result" | grep "$keyword") - [[ ! -z $isSell ]] && echo $isSell + #result=$(echo "$result" | grep "$keyword") + [[ ! -z $result ]] && isSell+=$(echo -e "$result;") && echo "$result" echo --- sleep 1 done -isSell="[Achat GMarche] : testCesium" -isSell=$(echo $isSell | cut -d' ' -f4-) +# isSell="[Achat GMarche] : testCesium" # Test hors sol +isSell=$(echo $isSell | sed "s/$keyword//g") -#echo "$isSell est vendu" +echo "$isSell est vendu" -req="UPDATE products SET status = 'solde' WHERE name = '$isSell';" +IFS=';'; ADDR=($isSell); unset IFS; +for i in "${ADDR[@]}"; do + req="UPDATE products SET status = 'solde' WHERE name = '$i';" + echo "$req" +# sudo mysql --database gmarche -e "$req" +done -sudo mysql --database gmarche -e "$req" sudo mysql --database gmarche -e "SELECT name,status FROM products;" exit 0 From 1987ca71b3effd0dcb7356ef28c89b8eae837d41 Mon Sep 17 00:00:00 2001 From: poka Date: Sun, 24 Nov 2019 03:48:51 +0100 Subject: [PATCH 05/13] Add piscine scanning. Deincrease quantity rather than status --- public/models/readRecords.php | 16 +++++++-------- scripts/check_sold.sh | 48 ++++++++++++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/public/models/readRecords.php b/public/models/readRecords.php index 74ca4ae..b5a5de5 100644 --- a/public/models/readRecords.php +++ b/public/models/readRecords.php @@ -19,11 +19,11 @@ $params["antenne_slug"] = $antenne_slug; $requete = "SELECT products.*, users.username, users.pubkey - FROM products - LEFT JOIN antennes - ON antennes.id = products.antenne_id - LEFT JOIN users - ON users.id = products.user_id + FROM products + LEFT JOIN antennes + ON antennes.id = products.antenne_id + LEFT JOIN users + ON users.id = products.user_id WHERE antennes.slug = :antenne_slug"; $stmt = $bdd->prepare($requete); $stmt2 = $bdd->prepare($requete); @@ -51,8 +51,8 @@ $number"; $prix = $row['prix']; $vendeur = $row['username']; - $status = $row['status']; - if ($status == "solde") { + $quantite = $row['quantite']; + if ($quantite == "0") { $produit = "[Vendu] "; } else { $produit = ""; @@ -66,7 +66,7 @@ $data .= ''; $data .= ''.$vendeur_format.''; $data .= ''.$cle_pub_format.''; - $data .= ''.$row['quantite'].''; + $data .= ''.$quantite.''; $data .= ''.$prix.''; if ($row['username'] == $nom_connecte ) { $data .= ''; diff --git a/scripts/check_sold.sh b/scripts/check_sold.sh index 7b743c8..d856203 100755 --- a/scripts/check_sold.sh +++ b/scripts/check_sold.sh @@ -1,31 +1,51 @@ #!/bin/bash +## TODO: Prendre en compte les transactions déjà appliqués + +start=`date +%s` +date=$(date +'%d-%m-%y à %H:%M') +echo "### $date ###" + +## Inistialisation DUNITER=$(grep g1_node ../config/config.php | awk '{ print $3}' | tr -d ';' | tr -d "'") TXBLOCKS=$(curl -s $DUNITER/blockchain/with/tx | jq '.result.blocks[]') -TXBLOCKS=$(echo "$TXBLOCKS" | tail -n 5 | tr '\n' ' ') +TXBLOCKS=$(echo "$TXBLOCKS" | tail -n 2 | tr '\n' ' ') keyword="\[Achat GMarche] : " +## Récupération des transactions avec commentaire GMarche for i in $TXBLOCKS; do result=$(curl -s $DUNITER/blockchain/block/$i | jq '.transactions[].comment' | grep -v '""' | tr -d '"') - - #result=$(echo "$result" | grep "$keyword") - [[ ! -z $result ]] && isSell+=$(echo -e "$result;") && echo "$result" - echo --- + result=$(echo "$result" | grep "$keyword") + [[ ! -z $result ]] && isSell+=$(echo -e "$result;") sleep 1 done -# isSell="[Achat GMarche] : testCesium" # Test hors sol -isSell=$(echo $isSell | sed "s/$keyword//g") +## Ajout des transactions en piscine pour les users GMarche -echo "$isSell est vendu" +req="SELECT pubkey FROM users;" +usersPubkeys=$(sudo mysql --database gmarche -e "$req" | grep .) -IFS=';'; ADDR=($isSell); unset IFS; -for i in "${ADDR[@]}"; do - req="UPDATE products SET status = 'solde' WHERE name = '$i';" - echo "$req" -# sudo mysql --database gmarche -e "$req" +for i in $usersPubkeys; do + isSell+=$(curl -s $DUNITER/tx/history/$i/pending | jq '. | select(.history.sending == [])' | jq '.history.pending[].comment' | tr -d '"') + #[ ! -z "$pendingTX" ] && echo "$pendingTX" done -sudo mysql --database gmarche -e "SELECT name,status FROM products;" +## Retrait de l'identifiant gmarche des commentaires +isSell=$(echo $isSell | sed "s/$keyword//g") +[[ ! -z $isSell ]] && echo "$isSell est vendu" + +## Retrait d'un quantité pour les articles vendu +IFS=';'; ADDR=($isSell); unset IFS; +for i in "${ADDR[@]}"; do + #req="UPDATE products SET status = 'solde' WHERE name = '$i';" + req="UPDATE products SET quantite = CASE WHEN quantite = 0 THEN quantite ELSE quantite - 1 END WHERE name = '$i';" + sudo mysql --database gmarche -e "$req" +done + +#sudo mysql --database gmarche -e "SELECT name,status FROM products;" + +end=`date +%s` +runtime=$((end-start)) +echo "Temps d'execution: ${runtime}s" exit 0 From 022cf49eea1b2c84bc27585255b02d4f281ab745 Mon Sep 17 00:00:00 2001 From: poka Date: Sun, 24 Nov 2019 04:44:56 +0100 Subject: [PATCH 06/13] Lock transaction hash ever applied --- .gitignore | 3 ++- scripts/check_sold.sh | 23 +++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 4df4448..c18e309 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ config/config.php +scripts/.loc_hash .idea /public/uploads /tmp vendor composer.json composer.lock -/src/Framework/SwiftMailerFactory.php \ No newline at end of file +/src/Framework/SwiftMailerFactory.php diff --git a/scripts/check_sold.sh b/scripts/check_sold.sh index d856203..1aaba9e 100755 --- a/scripts/check_sold.sh +++ b/scripts/check_sold.sh @@ -6,17 +6,23 @@ start=`date +%s` date=$(date +'%d-%m-%y à %H:%M') echo "### $date ###" -## Inistialisation +## Initialisation DUNITER=$(grep g1_node ../config/config.php | awk '{ print $3}' | tr -d ';' | tr -d "'") TXBLOCKS=$(curl -s $DUNITER/blockchain/with/tx | jq '.result.blocks[]') TXBLOCKS=$(echo "$TXBLOCKS" | tail -n 2 | tr '\n' ' ') keyword="\[Achat GMarche] : " +[ ! -e .loc_hash ] && touch .loc_hash ## Récupération des transactions avec commentaire GMarche + for i in $TXBLOCKS; do - result=$(curl -s $DUNITER/blockchain/block/$i | jq '.transactions[].comment' | grep -v '""' | tr -d '"') - result=$(echo "$result" | grep "$keyword") - [[ ! -z $result ]] && isSell+=$(echo -e "$result;") + result=$(curl -s $DUNITER/blockchain/block/$i | jq '.transactions[].hash, .transactions[].comment' | grep -v '""' | tr -d '"' | grep -B1 "$keyword") + rhash=$(echo "$result" | head -n1) + rcom=$(echo "$result" | tail -n1) + if [[ ! -z $result && -z $(grep $rhash .loc_hash) ]]; then + isSell+=$(echo -e "$rcom;") + echo "$rhash" >> .loc_hash + fi sleep 1 done @@ -26,8 +32,13 @@ req="SELECT pubkey FROM users;" usersPubkeys=$(sudo mysql --database gmarche -e "$req" | grep .) for i in $usersPubkeys; do - isSell+=$(curl -s $DUNITER/tx/history/$i/pending | jq '. | select(.history.sending == [])' | jq '.history.pending[].comment' | tr -d '"') - #[ ! -z "$pendingTX" ] && echo "$pendingTX" + result=$(curl -s $DUNITER/tx/history/$i/pending | jq '. | select(.history.sending == [])' | jq '.history.pending[].hash,.history.pending[].comment' | tr -d '"') + rhash=$(echo "$result" | head -n1) + rcom=$(echo "$result" | tail -n1) + if [[ ! -z $result && -z $(grep $rhash .loc_hash) ]]; then + isSell+=$(echo -e "$rcom;") + echo "$rhash" >> .loc_hash + fi done ## Retrait de l'identifiant gmarche des commentaires From 65fa5347438ddc2dda90e10a363f6c631b855fe2 Mon Sep 17 00:00:00 2001 From: poka Date: Sun, 24 Nov 2019 05:10:39 +0100 Subject: [PATCH 07/13] Fix relative path --- scripts/check_sold.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/scripts/check_sold.sh b/scripts/check_sold.sh index 1aaba9e..a245b45 100755 --- a/scripts/check_sold.sh +++ b/scripts/check_sold.sh @@ -1,17 +1,18 @@ #!/bin/bash -## TODO: Prendre en compte les transactions déjà appliqués +[ "$EUID" -ne 0 ] && sudo="sudo" || sudo="" +SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" start=`date +%s` date=$(date +'%d-%m-%y à %H:%M') echo "### $date ###" ## Initialisation -DUNITER=$(grep g1_node ../config/config.php | awk '{ print $3}' | tr -d ';' | tr -d "'") +DUNITER=$(grep g1_node $SCRIPTPATH/../config/config.php | awk '{ print $3}' | tr -d ';' | tr -d "'") TXBLOCKS=$(curl -s $DUNITER/blockchain/with/tx | jq '.result.blocks[]') TXBLOCKS=$(echo "$TXBLOCKS" | tail -n 2 | tr '\n' ' ') keyword="\[Achat GMarche] : " -[ ! -e .loc_hash ] && touch .loc_hash +[ ! -e $SCRIPTPATH/.loc_hash ] && touch $SCRIPTPATH/.loc_hash ## Récupération des transactions avec commentaire GMarche @@ -19,9 +20,9 @@ for i in $TXBLOCKS; do result=$(curl -s $DUNITER/blockchain/block/$i | jq '.transactions[].hash, .transactions[].comment' | grep -v '""' | tr -d '"' | grep -B1 "$keyword") rhash=$(echo "$result" | head -n1) rcom=$(echo "$result" | tail -n1) - if [[ ! -z $result && -z $(grep $rhash .loc_hash) ]]; then + if [[ ! -z $result && -z $(grep $rhash $SCRIPTPATH/.loc_hash) ]]; then isSell+=$(echo -e "$rcom;") - echo "$rhash" >> .loc_hash + echo "$rhash" >> $SCRIPTPATH/.loc_hash fi sleep 1 done @@ -29,15 +30,15 @@ done ## Ajout des transactions en piscine pour les users GMarche req="SELECT pubkey FROM users;" -usersPubkeys=$(sudo mysql --database gmarche -e "$req" | grep .) +usersPubkeys=$($sudo mysql --database gmarche -e "$req" | grep .) for i in $usersPubkeys; do result=$(curl -s $DUNITER/tx/history/$i/pending | jq '. | select(.history.sending == [])' | jq '.history.pending[].hash,.history.pending[].comment' | tr -d '"') rhash=$(echo "$result" | head -n1) rcom=$(echo "$result" | tail -n1) - if [[ ! -z $result && -z $(grep $rhash .loc_hash) ]]; then + if [[ ! -z $result && -z $(grep $rhash $SCRIPTPATH/.loc_hash) ]]; then isSell+=$(echo -e "$rcom;") - echo "$rhash" >> .loc_hash + echo "$rhash" >> $SCRIPTPATH/.loc_hash fi done @@ -51,10 +52,10 @@ IFS=';'; ADDR=($isSell); unset IFS; for i in "${ADDR[@]}"; do #req="UPDATE products SET status = 'solde' WHERE name = '$i';" req="UPDATE products SET quantite = CASE WHEN quantite = 0 THEN quantite ELSE quantite - 1 END WHERE name = '$i';" - sudo mysql --database gmarche -e "$req" + $sudo mysql --database gmarche -e "$req" done -#sudo mysql --database gmarche -e "SELECT name,status FROM products;" +#$sudo mysql --database gmarche -e "SELECT name,status FROM products;" end=`date +%s` runtime=$((end-start)) From f3728dd93958e56bff711c6de4e665a958a67543 Mon Sep 17 00:00:00 2001 From: poka Date: Mon, 25 Nov 2019 00:51:24 +0100 Subject: [PATCH 08/13] Change button type to submit for Valider connexion --- views/layout.twig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/views/layout.twig b/views/layout.twig index deda089..e43967a 100644 --- a/views/layout.twig +++ b/views/layout.twig @@ -116,14 +116,16 @@ + + - \ No newline at end of file + From 5b3332b798e1e2639e2d61a508c23e5e2f5f46e0 Mon Sep 17 00:00:00 2001 From: poka Date: Mon, 25 Nov 2019 20:17:45 +0100 Subject: [PATCH 09/13] Add default pictures where no image uploaded for products --- .gitignore | 3 ++- public/models/readRecords.php | 7 ++++++- public/models/readRecords2.php | 17 +++++++++++------ public/uploads/default.png | Bin 0 -> 10234 bytes 4 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 public/uploads/default.png diff --git a/.gitignore b/.gitignore index c18e309..6199e3c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ config/config.php scripts/.loc_hash .idea -/public/uploads +public/uploads/* +!public/uploads/default.png /tmp vendor composer.json diff --git a/public/models/readRecords.php b/public/models/readRecords.php index b5a5de5..ebef6c6 100644 --- a/public/models/readRecords.php +++ b/public/models/readRecords.php @@ -63,7 +63,12 @@ $vendeur_format = "$vendeur"; $cle_pub_format = " $pubkeyShort... "; $data .= ''.$produit.''; - $data .= ''; + $imagep = '../uploads/products/'.$antenne_slug.'/'.$row['image'].''; + if (file_exists($imagep) && $row['image']) { + $data .= ''; + } else { + $data .= ''; + } $data .= ''.$vendeur_format.''; $data .= ''.$cle_pub_format.''; $data .= ''.$quantite.''; diff --git a/public/models/readRecords2.php b/public/models/readRecords2.php index f866e88..109ce08 100644 --- a/public/models/readRecords2.php +++ b/public/models/readRecords2.php @@ -19,11 +19,11 @@ $params["antenne_slug"] = $antenne_slug; $requete = "SELECT souhaits.*, users.username, users.pubkey - FROM souhaits - LEFT JOIN antennes - ON antennes.id = souhaits.antenne_id - LEFT JOIN users - ON users.id = souhaits.user_id + FROM souhaits + LEFT JOIN antennes + ON antennes.id = souhaits.antenne_id + LEFT JOIN users + ON users.id = souhaits.user_id WHERE antennes.slug = :antenne_slug"; $stmt = $bdd->prepare($requete); $stmt2 = $bdd->prepare($requete); @@ -55,7 +55,12 @@ $vendeur_format = "$vendeur"; $pubkeyShort = substr($pubkey, 0, 8); $data .= ''.$produit.''; - $data .= ''; + $imagep = '../uploads/recherches/'.$antenne_slug.'/'.$row['image'].''; + if (file_exists($imagep) && $row['image']) { + $data .= ''; + } else { + $data .= ''; + } $data .= ''.$vendeur_format.''; $data .= ''.$pubkeyShort.'...'; $data .= ''.$row['quantite'].''; diff --git a/public/uploads/default.png b/public/uploads/default.png new file mode 100644 index 0000000000000000000000000000000000000000..ee6994bd817b35bf32ccb7d784584d1a52a5e679 GIT binary patch literal 10234 zcmd6NcQl-D*X|Hy5G5iJL6i^@(Si^?qC^PMMGwfv@XqL;)^Z^`IgFbF|}M54FR zOSB=w=yjO!Jx|{EkF(BNXPvd)b=LQt`SZD-XWx78``Xtob4NYXQlq85P7Q%TXw@Gp z>p~!;ArJ`34wMXdVx;?B2Lj=1S66mLdrfOs}$ZpU!@|jTj#z*oE`JsmYV&kQU zkDE%H%CK3bn*nYxMege<5UMaJ^4^_XnPM?&DcH4Jw-hy zr-qiB<2o1PtLD=FqpVh{&%gR!HME+e3Bh$5gB zlmXC;6vC+pfsjEVArKM>11F#_+5fY}|CUWa-T!w>OqHCvU>6`wmt^20LL4OcsS6>M zom<#TR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zhQaW-k_w+j+=W{o`Ay~&jyQFGJ_Hib1TCp}UYox}V9opCEtXsMlE$-XF%=AC6DQyv z=o-A3PfPo91=$n9RT>Y~OMvP1Kg3Hf#wXmU7~W>Owbc?`Rubqi*4|Xz3u3z>uWe20 z;8}7{yw&@n_SbNQ)Dux4z+RHvsXg>jZX8>xr%&6TwUUYVI*5&x>`@EJ7Em17DcA~c zZ@D37`GK7$Szm7Sh+F5U`@@T*8~P;O?-`OWpb-J(goiRQ$hNdU_e-GFV&o2+j^0P9 z3Wf7xbw;m0(hc;x1B|<&Od@oL+T+{)wv3q85wWc#xZhn=8x)&7C2v2JSN1+tfzBsxYlv#EM8P?eYl3XITwhaY-$Vkq|LKpnF1f zm8()4x(sDK#e9-@Vqf6MXpGFYd74-84%jP_e^A)K8y83N<1|MN8| zN$TpTDmlp7lfYTnd7WuU341dwWKDIWF*~nKGxk5aL-s#*P3%9p@D>uaa(+S4Pq@3K SrRXaJ_^GRCDOW04z4 Date: Mon, 25 Nov 2019 21:28:28 +0100 Subject: [PATCH 10/13] Change CSS stuff in home page and products page, remove style= in twig template for style.css --- public/css/products.css | 82 +++++++++++++++++++ public/css/style.css | 111 +++++++++++++++++++++++++- public/models/readRecords.php | 2 +- public/models/readRecords2.php | 2 +- public/uploads/default.png | Bin src/Gmarche/views/index.twig | 34 ++++---- src/Product/views/admin/products/index.twig | 86 +------------------- src/Product/views/admin/recherches/index.twig | 86 +------------------- 8 files changed, 216 insertions(+), 187 deletions(-) create mode 100644 public/css/products.css mode change 100644 => 100755 public/uploads/default.png diff --git a/public/css/products.css b/public/css/products.css new file mode 100644 index 0000000..870b7c9 --- /dev/null +++ b/public/css/products.css @@ -0,0 +1,82 @@ +.container_main { + background-color: #2E2E2E; +} +.tableau { + width:100%; + background-color: white; + table-layout: fixed; + border-collapse: collapse; + /* border-spacing: 1px; // pour contrer les style de base */ +} +/* Entête */ +.tableau th { + border-spacing: 0; + border-collapse: collapse; + padding: 0rem; + text-align: center; + border-left: lightgray 1px solid; + background-color:#999690; + color:#fff; +} +.tableau .colonne_image { + padding: 0; !important; +} +.tableau td { + border-bottom: solid 1px black; + border-left: lightgray 1px solid; + padding-left: 0.7rem; +} +.align_droite { + + text-align: right; + padding-right: 2rem; +} +.breadcrumb { + font-size: 1rem; +} + +.toggle_radio { + position: relative; + background: rgba(0,0,0,.1); + margin: -3px auto 4px 10px; + overflow: hidden; + padding: 0 !important; + border-radius: 50px; + height: 28px; + width: 215px; +} +.toggle_radio > * { + float: left; +} +.toggle_radio input[type=radio]{ + display: none; +} +.toggle_radio label{ + color: rgba(0,0,0,.9); + z-index: 0; + display: block; + width: 100px; + height: 20px; + margin: 3px 3px; + border-radius: 50px; + cursor: pointer; + z-index: 1; + text-align: center; +} +.toggle_option_slider{ + width: 100px; + height: 20px; + position: absolute; + top: 4px; + border-radius: 50px; + transition: all .4s ease; +} + +#first_toggle:checked ~ .toggle_option_slider{ + background: rgba(0,0,0,.3); + left: 3px; +} +#second_toggle:checked ~ .toggle_option_slider{ + background: rgba(0,0,0,.3); + left: 109px; +} diff --git a/public/css/style.css b/public/css/style.css index c6653e5..c53aa18 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -19,10 +19,18 @@ btn-custom { -webkit-font-smoothing: antialiased; } +#logo_home { + width:30rem; + margin: 0 auto; + margin-bottom: 10px; + text-align: center; +} + img { max-width: 100%; height: auto; } + #la_page { text-align: center; width: 1174px; @@ -30,6 +38,7 @@ img { height:auto; margin-left: auto; margin-right: auto; + opacity:0.9; } #la_page a { @@ -58,6 +67,7 @@ li { background-size: 100% auto; font-family: Bree Serif, Arial, sans-serif; font-size: 14px; + opacity:0.97; } header.header { width: 389px; @@ -98,7 +108,20 @@ header.header img { } .container { font-family: Arial, sans-serif; + height:auto; width:28rem; + text-align:center;border: 0px } + +.row { + width:28rem; + margin-left: -5.1rem; +} + +.home_map { + font-size:1.2rem; + font-weight:bold; +} + .profil_user { height: 400px; width: 900px; @@ -169,7 +192,7 @@ header.header img { } body.loading .loadingPubkey { - overflow: hidden; + overflow: hidden; display: block; } @@ -268,3 +291,89 @@ body.loading .loadingPubkey { } } + +/* Fix products.css */ + + +.container_main { + background-color: #2E2E2E; +} +.tableau { + width:100%; + background-color: white; + table-layout: fixed; + border-collapse: collapse; + /* border-spacing: 1px; // pour contrer les style de base */ +} +/* Entête */ +.tableau th { + border-spacing: 0; + border-collapse: collapse; + padding: 0rem; + text-align: center; + border-left: lightgray 1px solid; + background-color:#999690; + color:#fff; +} +.tableau .colonne_image { + padding: 0; !important; +} +.tableau td { + border-bottom: solid 1px black; + border-left: lightgray 1px solid; + padding-left: 0.7rem; +} +.align_droite { + + text-align: right; + padding-right: 2rem; +} +.breadcrumb { + font-size: 1rem; +} + +.toggle_radio { + position: relative; + background: rgba(0,0,0,.1); + margin: -3px auto 4px 10px; + overflow: hidden; + padding: 0 !important; + border-radius: 50px; + height: 28px; + width: 215px; +} +.toggle_radio > * { + float: left; +} +.toggle_radio input[type=radio]{ + display: none; +} +.toggle_radio label{ + color: rgba(0,0,0,.9); + z-index: 0; + display: block; + width: 100px; + height: 20px; + margin: 3px 3px; + border-radius: 50px; + cursor: pointer; + z-index: 1; + text-align: center; +} +.toggle_option_slider{ + width: 100px; + height: 20px; + position: absolute; + top: 4px; + border-radius: 50px; + transition: all .4s ease; +} + +#first_toggle:checked ~ .toggle_option_slider{ + background: rgba(0,0,0,.3); + left: 3px; +} +#second_toggle:checked ~ .toggle_option_slider{ + background: rgba(0,0,0,.3); + left: 109px; +} diff --git a/public/models/readRecords.php b/public/models/readRecords.php index ebef6c6..474c6d1 100644 --- a/public/models/readRecords.php +++ b/public/models/readRecords.php @@ -67,7 +67,7 @@ if (file_exists($imagep) && $row['image']) { $data .= ''; } else { - $data .= ''; + $data .= ''; } $data .= ''.$vendeur_format.''; $data .= ''.$cle_pub_format.''; diff --git a/public/models/readRecords2.php b/public/models/readRecords2.php index 109ce08..c6e9cb8 100644 --- a/public/models/readRecords2.php +++ b/public/models/readRecords2.php @@ -59,7 +59,7 @@ if (file_exists($imagep) && $row['image']) { $data .= ''; } else { - $data .= ''; + $data .= ''; } $data .= ''.$vendeur_format.''; $data .= ''.$pubkeyShort.'...'; diff --git a/public/uploads/default.png b/public/uploads/default.png old mode 100644 new mode 100755 diff --git a/src/Gmarche/views/index.twig b/src/Gmarche/views/index.twig index 37e89a4..86b5299 100644 --- a/src/Gmarche/views/index.twig +++ b/src/Gmarche/views/index.twig @@ -4,9 +4,9 @@ Ğ1-Marché : Régions {% if page > 1 %}, page {{ page }} {% endif %} {% endblock %} {% block body %} -
- -
+
+ +
    @@ -42,69 +42,69 @@ 'region-84': { value: "Auvergne-Rhône-Alpes", href: "france/auvergne-rhone-alpes", - tooltip: {content: "Auvergne-Rhône-Alpes"} + tooltip: {content: " Auvergne-Rhône-Alpes"} }, 'region-53': { value: "Bretagne", href: "france/bretagne", - tooltip: {content: "Bretagne"} + tooltip: {content: "Bretagne"} }, 'region-27': { value: "Bourgogne-Franche-Comté", href: "france/bourgogne-franche-comte", - tooltip: {content: "Bourgogne-Franche-Comté"} + tooltip: {content: "Bourgogne-Franche-Comté"} }, 'region-24': { value: "Centre-Val de Loire", href: "france/centre-val-de-loire", - tooltip: {content: "Centre-Val de Loire"} + tooltip: {content: "Centre-Val de Loire"} }, 'region-94': { value: "Corse", href: "france/corse", - tooltip: {content: "Corse"} + tooltip: {content: "Corse"} }, 'region-44': { value: "Grand-Est", href: "france/grand-est", - tooltip: {content: "Grand-Est"} + tooltip: {content: "Grand-Est"} }, 'region-32': { value: "Hauts-de-France", href: "france/hauts-de-france", - tooltip: {content: "Hauts-de-France"} + tooltip: {content: "Hauts-de-France"} }, 'region-11': { value: "Ile-de-France", href: "france/ile-de-france", - tooltip: {content: "Ile-de-France"} + tooltip: {content: "Ile-de-France"} }, 'region-28': { value: "Normandie", href: "france/normandie", - tooltip: {content: "Normandie"} + tooltip: {content: "Normandie"} }, 'region-75': { value: "Nouvelle-Aquitaine", href: "france/nouvelle-aquitaine", - tooltip: {content: "Nouvelle-Aquitaine"} + tooltip: {content: "Nouvelle-Aquitaine"} }, 'region-76': { value: "Occitanie", href: "france/occitanie", - tooltip: {content: "Occitanie"} + tooltip: {content: "Occitanie"} }, 'region-52': { value: "Pays de la Loire", href: "france/pays-de-la-loire", - tooltip: {content: "Pays de la Loire"} + tooltip: {content: "Pays de la Loire"} }, 'region-93': { value: "Provence-Alpes-Côte d'Azur", href: "france/provence-alpes-cote-d-azur", - tooltip: {content: "Provence-Alpes-Côte d'Azur"} + tooltip: {content: "Provence-Alpes-Côte d'Azur"} } } }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/Product/views/admin/products/index.twig b/src/Product/views/admin/products/index.twig index f418154..0990c7e 100644 --- a/src/Product/views/admin/products/index.twig +++ b/src/Product/views/admin/products/index.twig @@ -2,91 +2,11 @@ {% extends 'layout.twig' %} {% block title "Ğ1-Marché - Produits" %} + {% block body %} - + -
    +