Compare commits
26 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
2cda2950ee |
|||
| 80b03bcc9e | |||
| e4680d77ab | |||
| 2ed096ce82 | |||
| d7d8974bd2 | |||
| 1dcf735141 | |||
| 78f7bdd5ef | |||
| 5d22dd2b09 | |||
| 8d67ec7f8a | |||
| dfb5fd2f7a | |||
| 5888964a47 | |||
| b519ff8e1b | |||
| 0d583d9375 | |||
| 0792dc8f73 | |||
| 7b2b850f3d | |||
| f81fc6bdcf | |||
|
e4788f0dc0 |
|||
|
266114943b |
|||
|
36abd9b1d5 |
|||
|
fd71b224eb |
|||
|
4fd78d1303 |
|||
|
7e6d230e17 |
|||
|
b86f3096e1 |
|||
|
ecb4ca177e |
|||
|
c8d99da2c2 |
|||
|
22ec3d036e |
101 changed files with 6827 additions and 36150 deletions
|
|
@ -15,7 +15,9 @@ steps:
|
||||||
|
|
||||||
"Create database":
|
"Create database":
|
||||||
image: mariadb:10.3
|
image: mariadb:10.3
|
||||||
secrets: [mysqldump]
|
environment:
|
||||||
|
MYSQLDUMP:
|
||||||
|
from_secret: mysqldump
|
||||||
commands:
|
commands:
|
||||||
- mysql -hdb -uroot -proot -e "CREATE DATABASE app"
|
- mysql -hdb -uroot -proot -e "CREATE DATABASE app"
|
||||||
- eval "$MYSQLDUMP" | mysql -hdb -uroot -proot app
|
- eval "$MYSQLDUMP" | mysql -hdb -uroot -proot app
|
||||||
|
|
@ -34,22 +36,21 @@ steps:
|
||||||
- composer install --no-scripts
|
- composer install --no-scripts
|
||||||
|
|
||||||
"Migrates database":
|
"Migrates database":
|
||||||
image: deblan/php:8.1
|
image: deblan/php:8.3
|
||||||
environment:
|
environment:
|
||||||
- PHP=php
|
PHP: php
|
||||||
commands:
|
commands:
|
||||||
- ./bin/doctrine-migrate
|
- ./bin/doctrine-migrate
|
||||||
|
|
||||||
"Generates JS routes":
|
"Generates JS routes":
|
||||||
image: deblan/php:8.1
|
image: deblan/php:8.3
|
||||||
commands:
|
commands:
|
||||||
- php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
|
- php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
|
||||||
|
|
||||||
"Build assets":
|
"Build assets":
|
||||||
image: node:16-alpine
|
image: node:20-alpine
|
||||||
environment:
|
environment:
|
||||||
- CPU_COUNT=3
|
CPU_COUNT: 3
|
||||||
volumes: *volumes
|
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache git
|
- apk add --no-cache git
|
||||||
- npm install -g svg2ttf ttf2eot ttf2woff2
|
- npm install -g svg2ttf ttf2eot ttf2woff2
|
||||||
|
|
@ -77,7 +78,7 @@ services:
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.3
|
image: mariadb:10.3
|
||||||
environment:
|
environment:
|
||||||
- MARIADB_ROOT_PASSWORD=root
|
MARIADB_ROOT_PASSWORD: root
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
node_cache:
|
node_cache:
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,15 @@ skip_clone: true
|
||||||
steps:
|
steps:
|
||||||
"Deploy":
|
"Deploy":
|
||||||
image: deblan/mage
|
image: deblan/mage
|
||||||
secrets: [ssh_priv_key, ssh_user, ssh_host, app_directory]
|
environment:
|
||||||
|
SSH_PRIV_KEY:
|
||||||
|
from_secret: ssh_priv_key
|
||||||
|
SSH_USER:
|
||||||
|
from_secret: ssh_user
|
||||||
|
SSH_HOST:
|
||||||
|
from_secret: ssh_host
|
||||||
|
APP_DIRECTORY:
|
||||||
|
from_secret: app_directory
|
||||||
volumes: *volumes
|
volumes: *volumes
|
||||||
commands:
|
commands:
|
||||||
- cd "/builds/$CI_COMMIT_SHA"
|
- cd "/builds/$CI_COMMIT_SHA"
|
||||||
|
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
variables:
|
|
||||||
volumes: &volumes
|
|
||||||
- /data/${CI_REPO}:/builds
|
|
||||||
|
|
||||||
steps:
|
|
||||||
"Deploy":
|
|
||||||
image: deblan/mage:test
|
|
||||||
secrets: [ssh_priv_key, ssh_user, ssh_host, app_directory]
|
|
||||||
volumes: *volumes
|
|
||||||
pull: true
|
|
||||||
settings:
|
|
||||||
directory: "/builds/$CI_COMMIT_SHA"
|
|
||||||
ssh_key:
|
|
||||||
content:
|
|
||||||
from_secret: ssh_priv_key
|
|
||||||
file: "$HOME/.ssh/id_ed25519"
|
|
||||||
template: .mage.yml.dist
|
|
||||||
substitutions:
|
|
||||||
- from: ssh_user
|
|
||||||
to:
|
|
||||||
from_secret: ssh_user
|
|
||||||
- from: ssh_host
|
|
||||||
to:
|
|
||||||
from_secret: ssh_host
|
|
||||||
targets: "$CI_PIPELINE_DEPLOY_TARGET"
|
|
||||||
# commands:
|
|
||||||
# - cd "/builds/$CI_COMMIT_SHA"
|
|
||||||
# - mkdir "$HOME/.ssh"
|
|
||||||
# - echo "$SSH_PRIV_KEY" > "$HOME/.ssh/id_ed25519"
|
|
||||||
# - chmod 700 "$HOME/.ssh"
|
|
||||||
# - chmod 600 "$HOME/.ssh/id_ed25519"
|
|
||||||
# - cp .mage.yml.dist .mage.yml
|
|
||||||
# - sed -i "s/ssh_user/$SSH_USER/g" .mage.yml
|
|
||||||
# - sed -i "s/ssh_host/$SSH_HOST/g" .mage.yml
|
|
||||||
# - sed -i "s#app_directory#$APP_DIRECTORY#g" .mage.yml
|
|
||||||
# - mage deploy "$CI_PIPELINE_DEPLOY_TARGET"
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
@import "../../vendor/murph/murph-core/src/core/Resources/assets/css/admin.scss";
|
@import "../../vendor/murph/murph-core/src/core/Resources/assets/css/admin.scss";
|
||||||
@import "~simplemde/dist/simplemde.min.css";
|
@import "@kangc/v-md-editor/lib/style/base-editor.css";
|
||||||
|
@import "@kangc/v-md-editor/lib/theme/style/vuepress.css";
|
||||||
.CodeMirror-fullscreen, .editor-toolbar.fullscreen {
|
|
||||||
z-index: 2000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ejs-link {
|
.ejs-link {
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
|
|
@ -55,3 +52,12 @@
|
||||||
.choices__list--dropdown {
|
.choices__list--dropdown {
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.v-md-editor {
|
||||||
|
border: 1px solid $input-border-color;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-md-editor--fullscreen {
|
||||||
|
z-index: 3000;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,26 @@
|
||||||
@tailwind base;
|
@tailwind base;
|
||||||
|
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
|
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
@import "app/config";
|
@import "app/config";
|
||||||
@import 'app/prism';
|
@import "app/prism";
|
||||||
@import "app/typo";
|
@import "app/typo";
|
||||||
@import "~tingle.js/src/tingle.css";
|
@import "~tingle.js/src/tingle.css";
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "MainFont";
|
font-family: "MainFont";
|
||||||
src:
|
src: url("../fonts/ubuntu/ubuntu-light.woff2?20211108") format("woff2"), url("../fonts/ubuntu/ubuntu-light.woff?20211108") format("woff");
|
||||||
url('../fonts/ubuntu/ubuntu-light.woff2?20211108') format('woff2'),
|
|
||||||
url('../fonts/ubuntu/ubuntu-light.woff?20211108') format('woff');
|
|
||||||
// url('../fonts/atkinson/WOFF2/Atkinson-Hyperlegible-Regular-102a.woff2?20220911') format('woff2'),
|
// url('../fonts/atkinson/WOFF2/Atkinson-Hyperlegible-Regular-102a.woff2?20220911') format('woff2'),
|
||||||
// url('../fonts/atkinson/WOFF/Atkinson-Hyperlegible-Regular-102.woff?20211108w20220911') format('woff');
|
// url('../fonts/atkinson/WOFF/Atkinson-Hyperlegible-Regular-102.woff?20211108w20220911') format('woff');
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "deblan-icon";
|
font-family: "deblan-icon";
|
||||||
src: url('../fonts/deblan/deblan-icon.eot?20211108');
|
src: url("../fonts/deblan/deblan-icon.eot?20211108");
|
||||||
src:
|
src: url("../fonts/deblan/deblan-icon.woff2?20211108") format("woff2"), url("../fonts/deblan/deblan-icon.woff?20211108") format("woff"), url("../fonts/deblan/deblan-icon.ttf?20211108") format("truetype");
|
||||||
url('../fonts/deblan/deblan-icon.woff2?20211108') format('woff2'),
|
|
||||||
url('../fonts/deblan/deblan-icon.woff?20211108') format('woff'),
|
|
||||||
url('../fonts/deblan/deblan-icon.ttf?20211108') format('truetype');
|
|
||||||
|
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
|
|
@ -157,8 +154,9 @@ pre[class*="language-"] {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-bottom: -19px;i
|
margin-bottom: -19px;
|
||||||
|
|
||||||
|
i
|
||||||
&:active, &:focus {
|
&:active, &:focus {
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
|
|
@ -173,6 +171,7 @@ pre[class*="language-"] {
|
||||||
background: url(../images/Refresh_icon.svg);
|
background: url(../images/Refresh_icon.svg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// &-captcha {
|
// &-captcha {
|
||||||
// label {
|
// label {
|
||||||
|
|
@ -304,9 +303,11 @@ pre[class*="language-"] {
|
||||||
0% {
|
0% {
|
||||||
background-position: 0 0%;
|
background-position: 0 0%;
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
background-position: 0 75%;
|
background-position: 0 75%;
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
background-position: 0 0%;
|
background-position: 0 0%;
|
||||||
}
|
}
|
||||||
|
|
@ -352,13 +353,15 @@ pre[class*="language-"] {
|
||||||
|
|
||||||
@keyframes HeaderGradient {
|
@keyframes HeaderGradient {
|
||||||
0% {
|
0% {
|
||||||
background-position: 0 50%
|
background-position: 0 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
background-position: 100% 50%
|
background-position: 100% 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
background-position: 0 50%
|
background-position: 0 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -411,7 +414,7 @@ pre[class*="language-"] {
|
||||||
.h1 {
|
.h1 {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: 40px;
|
font-size: 40px;
|
||||||
font-family: Verdana;
|
font-family: MainFont;
|
||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
color: hsla(0, 0%, 100%, 0.7);
|
color: hsla(0, 0%, 100%, 0.7);
|
||||||
}
|
}
|
||||||
|
|
@ -475,7 +478,7 @@ pre[class*="language-"] {
|
||||||
}
|
}
|
||||||
|
|
||||||
p a:not(.btn), ul:not(.btn-group) a:not(.btn) {
|
p a:not(.btn), ul:not(.btn-group) a:not(.btn) {
|
||||||
background: url('../images/link.svg') bottom left repeat-x;
|
background: url("../images/link.svg") bottom left repeat-x;
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -506,6 +509,35 @@ pre[class*="language-"] {
|
||||||
@include make-pre-code;
|
@include make-pre-code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.mermaid {
|
||||||
|
box-shadow: none;
|
||||||
|
background: #343c53;
|
||||||
|
border: 0;
|
||||||
|
|
||||||
|
text, tspan {
|
||||||
|
fill: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actor, .noteText {
|
||||||
|
text, tspan {
|
||||||
|
fill: #333 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.labelText {
|
||||||
|
fill: #333 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
line, path {
|
||||||
|
stroke: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
display: block;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.with-title {
|
&.with-title {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
|
|
@ -516,11 +548,13 @@ pre[class*="language-"] {
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
border: 1px solid $color-code-border;
|
border: 1px solid $color-code-border;
|
||||||
|
|
||||||
// overflow: hidden;
|
// overflow: hidden;
|
||||||
//
|
//
|
||||||
// &:hover {
|
// &:hover {
|
||||||
// overflow: auto;
|
// overflow: auto;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -608,7 +642,7 @@ pre[class*="language-"] {
|
||||||
@for $i from 1 through 6 {
|
@for $i from 1 through 6 {
|
||||||
.review.offset-#{$i} {
|
.review.offset-#{$i} {
|
||||||
margin-left: 5% * $i - 1%;
|
margin-left: 5% * $i - 1%;
|
||||||
width: 100% - ($i * 5%);
|
width: 100% - $i * 5%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -617,7 +651,6 @@ pre[class*="language-"] {
|
||||||
max-width: calc($content-max-width - 60px - 2rem);
|
max-width: calc($content-max-width - 60px - 2rem);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
|
|
||||||
.review-avatar, .review-avatar img {
|
.review-avatar, .review-avatar img {
|
||||||
width: 60px;
|
width: 60px;
|
||||||
max-width: 60px;
|
max-width: 60px;
|
||||||
|
|
@ -697,7 +730,7 @@ pre[class*="language-"] {
|
||||||
|
|
||||||
.code-window {
|
.code-window {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
background: $color-code-title-background url('../images/window.svg') no-repeat center right;
|
background: $color-code-title-background url("../images/window.svg") no-repeat center right;
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
font-family: Monospace;
|
font-family: Monospace;
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
|
|
@ -731,7 +764,8 @@ pre[class*="language-"] {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 450px;
|
height: 450px;
|
||||||
background-position: center center;
|
background-position: center center;
|
||||||
background: #f2f2f2 url('../images/quick-post-load.png') no-repeat center center;
|
background: #f2f2f2 url("../images/quick-post-load.png") no-repeat center center;
|
||||||
|
|
||||||
// border: 2px solid $color-very-light-grey;
|
// border: 2px solid $color-very-light-grey;
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
@ -870,19 +904,7 @@ pre[class*="language-"] {
|
||||||
border: 1px solid $color-white;
|
border: 1px solid $color-white;
|
||||||
}
|
}
|
||||||
|
|
||||||
$links: (
|
$links: (twitter: #20b8ff, rss: #fd9f13, linkedin: #006699, diaspora: #90b92e, github: #8cc345, code: #51d066, mastodon: #2984d2, pixelfed: #e72151, matrix: #1a588a, gpg: #42a73b, murph: #19b4db);
|
||||||
twitter: #20b8ff,
|
|
||||||
rss: #fd9f13,
|
|
||||||
linkedin: #006699,
|
|
||||||
diaspora: #90b92e,
|
|
||||||
github: #8cc345,
|
|
||||||
code: #51d066,
|
|
||||||
mastodon: #2984d2,
|
|
||||||
pixelfed: #e72151,
|
|
||||||
matrix: #1a588a,
|
|
||||||
gpg: #42a73b,
|
|
||||||
murph: #19b4db
|
|
||||||
);
|
|
||||||
|
|
||||||
@each $site, $bg in $links {
|
@each $site, $bg in $links {
|
||||||
.link-#{$site} {
|
.link-#{$site} {
|
||||||
|
|
@ -988,12 +1010,15 @@ $links: (
|
||||||
0% {
|
0% {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
}
|
}
|
||||||
|
|
||||||
80% {
|
80% {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
@ -1001,8 +1026,9 @@ $links: (
|
||||||
|
|
||||||
@keyframes knmc {
|
@keyframes knmc {
|
||||||
0% {
|
0% {
|
||||||
left: -256px;;
|
left: -256px;
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
left: 150vw;
|
left: 150vw;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ $color-code-text: #f8f8f2;
|
||||||
$color-code-mark-background: $color-light-blue;
|
$color-code-mark-background: $color-light-blue;
|
||||||
$color-code-title-background: #1d2231;
|
$color-code-title-background: #1d2231;
|
||||||
$color-code-title-text: #e0e0e0;
|
$color-code-title-text: #e0e0e0;
|
||||||
|
|
||||||
/* --- */
|
/* --- */
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,9 @@ pre[class*="language-"] {
|
||||||
word-break: normal;
|
word-break: normal;
|
||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
|
|
||||||
-moz-tab-size: 4;
|
-moz-tab-size: 4;
|
||||||
-o-tab-size: 4;
|
-o-tab-size: 4;
|
||||||
tab-size: 4;
|
tab-size: 4;
|
||||||
|
|
||||||
-webkit-hyphens: none;
|
-webkit-hyphens: none;
|
||||||
-moz-hyphens: none;
|
-moz-hyphens: none;
|
||||||
-ms-hyphens: none;
|
-ms-hyphens: none;
|
||||||
|
|
@ -116,6 +114,7 @@ pre[class*="language-"] {
|
||||||
.token.bold {
|
.token.bold {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.token.italic {
|
.token.italic {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
@ -123,4 +122,3 @@ pre[class*="language-"] {
|
||||||
.token.entity {
|
.token.entity {
|
||||||
cursor: help;
|
cursor: help;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,33 +17,34 @@
|
||||||
//
|
//
|
||||||
.h1, h1 {
|
.h1, h1 {
|
||||||
font-size: 3.2rem;
|
font-size: 3.2rem;
|
||||||
line-height: 1.32
|
line-height: 1.32;
|
||||||
}
|
}
|
||||||
|
|
||||||
.h2, h2 {
|
.h2, h2 {
|
||||||
font-size: 2.6rem;
|
font-size: 2.6rem;
|
||||||
line-height: 1.35
|
line-height: 1.35;
|
||||||
}
|
}
|
||||||
|
|
||||||
.h3, h3 {
|
.h3, h3 {
|
||||||
font-size: 2.0rem;
|
font-size: 2.0rem;
|
||||||
line-height: 1.45
|
line-height: 1.45;
|
||||||
}
|
}
|
||||||
|
|
||||||
.h4, h4 {
|
.h4, h4 {
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
line-height: 1.6
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.h5, h5 {
|
.h5, h5 {
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
line-height: 1.75
|
line-height: 1.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
.h6, h6 {
|
.h6, h6 {
|
||||||
font-size: 1.0rem;
|
font-size: 1.0rem;
|
||||||
line-height: 1.9
|
line-height: 1.9;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// p {
|
// p {
|
||||||
// margin-top: 17px;
|
// margin-top: 17px;
|
||||||
|
|
@ -56,7 +57,6 @@
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
.h1,
|
.h1,
|
||||||
.h2,
|
.h2,
|
||||||
.h3,
|
.h3,
|
||||||
|
|
@ -71,6 +71,5 @@ h5,
|
||||||
h6 {
|
h6 {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
margin-top: 0
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import '../../vendor/murph/murph-core/src/core/Resources/assets/js/admin.js'
|
import '../../vendor/murph/murph-core/src/core/Resources/assets/js/admin.js'
|
||||||
|
|
||||||
require('./admin_modules/simplemde')()
|
require('./admin_modules/md-editor')()
|
||||||
|
|
||||||
const $ = require('jquery')
|
const $ = require('jquery')
|
||||||
const Sortable = require('sortablejs').Sortable
|
const Sortable = require('sortablejs').Sortable
|
||||||
|
|
|
||||||
34
assets/js/admin_modules/md-editor.js
Normal file
34
assets/js/admin_modules/md-editor.js
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
const Vue = require('vue').default
|
||||||
|
const VueMarkdownEditor = require('@kangc/v-md-editor')
|
||||||
|
const githubTheme = require('@kangc/v-md-editor/lib/theme/github.js')
|
||||||
|
const fr = require('@kangc/v-md-editor/lib/lang/fr-FR').default
|
||||||
|
const hljs = require('highlight.js')
|
||||||
|
|
||||||
|
VueMarkdownEditor.use(githubTheme, {Hljs: hljs})
|
||||||
|
VueMarkdownEditor.lang.use('fr-FR', fr)
|
||||||
|
Vue.use(VueMarkdownEditor)
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
const components = document.querySelectorAll('.markdown-editor')
|
||||||
|
|
||||||
|
components.forEach((component) => {
|
||||||
|
return new Vue({
|
||||||
|
el: component,
|
||||||
|
template: `
|
||||||
|
<div>
|
||||||
|
<textarea :name="name" v-model="value" class="d-none"></textarea>
|
||||||
|
<v-md-editor v-model="value" mode="edit"></v-md-editor>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
name: component.getAttribute('data-name'),
|
||||||
|
value: JSON.parse(component.getAttribute('data-value')),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
VueMarkdownEditor
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -13,8 +13,7 @@ module.exports = () => {
|
||||||
autoDownloadFontAwesome: false,
|
autoDownloadFontAwesome: false,
|
||||||
spellChecker: false,
|
spellChecker: false,
|
||||||
styleSelectedText: false,
|
styleSelectedText: false,
|
||||||
toolbar: [
|
toolbar: [{
|
||||||
{
|
|
||||||
name: 'bold',
|
name: 'bold',
|
||||||
action: Editor.toggleBold,
|
action: Editor.toggleBold,
|
||||||
className: 'fa fa-bold',
|
className: 'fa fa-bold',
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ require('prismjs/components/prism-shell-session')
|
||||||
require('prismjs/plugins/keep-markup/prism-keep-markup')
|
require('prismjs/plugins/keep-markup/prism-keep-markup')
|
||||||
require('prismjs/plugins/line-highlight/prism-line-highlight')
|
require('prismjs/plugins/line-highlight/prism-line-highlight')
|
||||||
require('prismjs/plugins/line-numbers/prism-line-numbers')
|
require('prismjs/plugins/line-numbers/prism-line-numbers')
|
||||||
|
require('mermaid')
|
||||||
|
|
||||||
class Code {
|
class Code {
|
||||||
constructor(w) {
|
constructor(w) {
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,13 @@ class PxImage {
|
||||||
const loader = new Image()
|
const loader = new Image()
|
||||||
|
|
||||||
loader.onload = () => {
|
loader.onload = () => {
|
||||||
image.style.background = `${color ? color : null} url(${source})`
|
image.style.background = `${color || null} url(${source})`
|
||||||
image.style.backgroundSize = 'cover'
|
image.style.backgroundSize = 'cover'
|
||||||
image.style.backgroundPosition = 'center'
|
image.style.backgroundPosition = 'center'
|
||||||
}
|
}
|
||||||
|
|
||||||
loader.onerror = () => {
|
loader.onerror = () => {
|
||||||
image.style.background = `${color ? color : null} url('${sourceError}') center center`
|
image.style.background = `${color || null} url('${sourceError}') center center`
|
||||||
}
|
}
|
||||||
|
|
||||||
loader.src = source
|
loader.src = source
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,11 @@ import '../css/viewer.scss'
|
||||||
|
|
||||||
const container = document.getElementById('mesh-viewer')
|
const container = document.getElementById('mesh-viewer')
|
||||||
const viewer = new StlViewer(
|
const viewer = new StlViewer(
|
||||||
container,
|
container, {
|
||||||
{
|
|
||||||
auto_rotate: true,
|
auto_rotate: true,
|
||||||
allow_drag_and_drop: true,
|
allow_drag_and_drop: true,
|
||||||
models: [{ filename: container.getAttribute('data-file') }]
|
models: [{
|
||||||
|
filename: container.getAttribute('data-file')
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
twig:
|
twig:
|
||||||
default_path: '%kernel.project_dir%/templates'
|
default_path: '%kernel.project_dir%/templates'
|
||||||
form_themes: ['@Core/form/bootstrap_4_form_theme.html.twig']
|
form_themes: ['form/bootstrap_4_form_theme.html.twig']
|
||||||
auto_reload: true
|
auto_reload: true
|
||||||
paths:
|
paths:
|
||||||
'%kernel.project_dir%/templates/core/': Core
|
'%kernel.project_dir%/templates/core/': Core
|
||||||
|
|
|
||||||
30
nohup.out
30
nohup.out
|
|
@ -1,30 +0,0 @@
|
||||||
|
|
||||||
[OK] Consuming messages from transport "async".
|
|
||||||
|
|
||||||
// The worker will automatically exit once it has received a stop signal via
|
|
||||||
// the messenger:stop-workers command.
|
|
||||||
|
|
||||||
// Quit the worker with CONTROL-C.
|
|
||||||
|
|
||||||
// Re-run the command with a -vv option to see logs about consumed messages.
|
|
||||||
|
|
||||||
|
|
||||||
[OK] Consuming messages from transport "async".
|
|
||||||
|
|
||||||
// The worker will automatically exit once it has received a stop signal via
|
|
||||||
// the messenger:stop-workers command.
|
|
||||||
|
|
||||||
// Quit the worker with CONTROL-C.
|
|
||||||
|
|
||||||
// Re-run the command with a -vv option to see logs about consumed messages.
|
|
||||||
|
|
||||||
|
|
||||||
[OK] Consuming messages from transport "async".
|
|
||||||
|
|
||||||
// The worker will automatically exit once it has received a stop signal via
|
|
||||||
// the messenger:stop-workers command.
|
|
||||||
|
|
||||||
// Quit the worker with CONTROL-C.
|
|
||||||
|
|
||||||
// Re-run the command with a -vv option to see logs about consumed messages.
|
|
||||||
|
|
||||||
29948
package-lock.json
generated
29948
package-lock.json
generated
File diff suppressed because it is too large
Load diff
10
package.json
10
package.json
|
|
@ -8,13 +8,16 @@
|
||||||
"build": "./node_modules/.bin/encore production"
|
"build": "./node_modules/.bin/encore production"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@kangc/v-md-editor": "^1.7.12",
|
||||||
"daisyui": "^2.31.0",
|
"daisyui": "^2.31.0",
|
||||||
|
"editorjs-hyperlink": "^1.0.6",
|
||||||
|
"editorjs-inline-tool": "^0.4.0",
|
||||||
"encore": "^0.0.30-beta",
|
"encore": "^0.0.30-beta",
|
||||||
"lozad": "^1.16.0",
|
"lozad": "^1.16.0",
|
||||||
"murph-project": "^1",
|
"mermaid": "^11.0.2",
|
||||||
|
"murph-project": "^1.9.4",
|
||||||
"particles.js": "^2.0.0",
|
"particles.js": "^2.0.0",
|
||||||
"prismjs": "^1.23.0",
|
"prismjs": "^1.23.0",
|
||||||
"simplemde": "^1.11.2",
|
|
||||||
"tingle.js": "^0.16.0",
|
"tingle.js": "^0.16.0",
|
||||||
"vanillajs-datepicker": "^1.1.4",
|
"vanillajs-datepicker": "^1.1.4",
|
||||||
"vue": "^2.6.14"
|
"vue": "^2.6.14"
|
||||||
|
|
@ -25,5 +28,6 @@
|
||||||
"postcss": "^8.4.16",
|
"postcss": "^8.4.16",
|
||||||
"postcss-loader": "^7.0.1",
|
"postcss-loader": "^7.0.1",
|
||||||
"tailwindcss": "^3.1.8"
|
"tailwindcss": "^3.1.8"
|
||||||
}
|
},
|
||||||
|
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class DateRangeAnalytic extends BaseDateRangeAnalytic
|
||||||
|
|
||||||
foreach ($entities as $key => $entity) {
|
foreach ($entities as $key => $entity) {
|
||||||
if ('view' === $type) {
|
if ('view' === $type) {
|
||||||
if ($this->path === null || str_starts_with($entity->getPath(), $this->path)) {
|
if (null === $this->path || str_starts_with($entity->getPath(), $this->path)) {
|
||||||
$newEntities[] = $entity;
|
$newEntities[] = $entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class InfluxDB
|
||||||
|
|
||||||
public function isAvailable(): bool
|
public function isAvailable(): bool
|
||||||
{
|
{
|
||||||
return $this->getClient() !== null;
|
return null !== $this->getClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getClient(): ?Client
|
public function getClient(): ?Client
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ class TTRssClient
|
||||||
$result = @file_get_contents('https://tiny.deblan.org/deblan_api/?itemsPerPage=10&page='.$page);
|
$result = @file_get_contents('https://tiny.deblan.org/deblan_api/?itemsPerPage=10&page='.$page);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$result = str_replace('\\u0092', "'", $result);
|
$result = str_replace('\u0092', "'", $result);
|
||||||
$result = str_replace(''', "'", $result);
|
$result = str_replace(''', "'", $result);
|
||||||
|
|
||||||
return json_decode($result, true);
|
return json_decode($result, true);
|
||||||
|
|
|
||||||
|
|
@ -2,31 +2,30 @@
|
||||||
|
|
||||||
namespace App\Controller\Blog;
|
namespace App\Controller\Blog;
|
||||||
|
|
||||||
|
use App\Analytic\DateRangeAnalytic;
|
||||||
use App\Core\Controller\Admin\Crud\CrudController;
|
use App\Core\Controller\Admin\Crud\CrudController;
|
||||||
use App\Core\Crud\CrudConfiguration;
|
use App\Core\Crud\CrudConfiguration;
|
||||||
use App\Core\Crud\Field\DatetimeField;
|
use App\Core\Crud\Field\DatetimeField;
|
||||||
use App\Core\Crud\Field\TextField;
|
use App\Core\Crud\Field\TextField;
|
||||||
|
use App\Core\Entity\EntityInterface;
|
||||||
use App\Core\Form\FileUploadHandler;
|
use App\Core\Form\FileUploadHandler;
|
||||||
use App\Core\Manager\EntityManager;
|
use App\Core\Manager\EntityManager;
|
||||||
|
use App\Core\Repository\Site\NodeRepository;
|
||||||
|
use App\Entity\Blog\Post;
|
||||||
use App\Entity\Blog\Post as Entity;
|
use App\Entity\Blog\Post as Entity;
|
||||||
use App\Factory\Blog\PostFactory as EntityFactory;
|
use App\Factory\Blog\PostFactory as EntityFactory;
|
||||||
use App\Form\Blog\Filter\PostFilterType;
|
use App\Form\Blog\Filter\PostFilterType;
|
||||||
use App\Form\Blog\PostType;
|
use App\Form\Blog\PostType;
|
||||||
use App\Form\Blog\PostType as EntityType;
|
|
||||||
use App\Repository\Blog\PostRepositoryQuery as RepositoryQuery;
|
use App\Repository\Blog\PostRepositoryQuery as RepositoryQuery;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
|
||||||
|
use Symfony\Component\Form\Form;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpFoundation\Session\Session;
|
use Symfony\Component\HttpFoundation\Session\Session;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Form\Form;
|
|
||||||
use App\Core\Entity\EntityInterface;
|
|
||||||
use App\Entity\Blog\Post;
|
|
||||||
use App\Analytic\DateRangeAnalytic;
|
|
||||||
use App\Core\Repository\Site\NodeRepository;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
|
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|
||||||
|
|
||||||
#[Route(path: '/admin/blog/post')]
|
#[Route(path: '/admin/blog/post')]
|
||||||
class PostAdminController extends CrudController
|
class PostAdminController extends CrudController
|
||||||
|
|
@ -125,7 +124,7 @@ class PostAdminController extends CrudController
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
])
|
])
|
||||||
->setBatchAction('index', 'delete', 'Delete', function (EntityInterface $entity, EntityManager $manager) {
|
->setBatchAction('index', 'delete', 'Delete', function (EntityInterface $entity, EntityManager $manager) {
|
||||||
$manager->delete($entity);
|
$manager->delete($entity);
|
||||||
|
|
@ -187,7 +186,7 @@ class PostAdminController extends CrudController
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route(path: "/inline_edit/{entity}/{context}/{label}", name: 'admin_blog_post_inline_edit', methods: ['GET', 'POST'])]
|
#[Route(path: '/inline_edit/{entity}/{context}/{label}', name: 'admin_blog_post_inline_edit', methods: ['GET', 'POST'])]
|
||||||
public function inlineEdit(string $context, string $label, Entity $entity, EntityManager $entityManager, Request $request): Response
|
public function inlineEdit(string $context, string $label, Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||||
{
|
{
|
||||||
return $this->doInlineEdit($context, $label, $entity, $entityManager, $request);
|
return $this->doInlineEdit($context, $label, $entity, $entityManager, $request);
|
||||||
|
|
@ -268,8 +267,7 @@ class PostAdminController extends CrudController
|
||||||
DateRangeAnalytic $analytic,
|
DateRangeAnalytic $analytic,
|
||||||
NodeRepository $nodeRepository,
|
NodeRepository $nodeRepository,
|
||||||
string $range = '7days'
|
string $range = '7days'
|
||||||
): Response
|
): Response {
|
||||||
{
|
|
||||||
if (!in_array($range, ['7days', '30days', '90days', '1year'])) {
|
if (!in_array($range, ['7days', '30days', '90days', '1year'])) {
|
||||||
throw $this->createNotFoundException();
|
throw $this->createNotFoundException();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,19 +7,19 @@ use App\Core\Controller\Site\PageController;
|
||||||
use App\Core\Manager\EntityManager;
|
use App\Core\Manager\EntityManager;
|
||||||
use App\Core\Site\SiteRequest;
|
use App\Core\Site\SiteRequest;
|
||||||
use App\Core\Site\SiteStore;
|
use App\Core\Site\SiteStore;
|
||||||
|
use App\Core\Twig\Extension\BuilderExtension;
|
||||||
|
use App\Core\Twig\Extension\EditorJsExtension;
|
||||||
use App\Entity\Blog\Category;
|
use App\Entity\Blog\Category;
|
||||||
use App\Entity\Blog\Post;
|
use App\Entity\Blog\Post;
|
||||||
use App\Factory\Blog\CommentFactory;
|
use App\Factory\Blog\CommentFactory;
|
||||||
use App\Form\Blog\UserCommentType;
|
use App\Form\Blog\UserCommentType;
|
||||||
|
use App\Manager\PostFollowManager;
|
||||||
use App\Markdown\Parser\Post as PostParser;
|
use App\Markdown\Parser\Post as PostParser;
|
||||||
use App\Repository\Blog\PostRepositoryQuery;
|
use App\Repository\Blog\PostRepositoryQuery;
|
||||||
use App\UrlGenerator\PostGenerator;
|
use App\UrlGenerator\PostGenerator;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
use App\Factory\Blog\PostFollowFactory;
|
|
||||||
use App\Manager\PostFollowManager;
|
|
||||||
use App\Core\Twig\Extension\EditorJsExtension;
|
|
||||||
|
|
||||||
class PostController extends PageController
|
class PostController extends PageController
|
||||||
{
|
{
|
||||||
|
|
@ -149,14 +149,13 @@ class PostController extends PageController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tag(string $tag, int $page = 1): Response
|
public function tag(string $tag, int $page = 1): Response {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createQuery(bool $isPreview = false): PostRepositoryQuery
|
public function createQuery(bool $isPreview = false): PostRepositoryQuery
|
||||||
{
|
{
|
||||||
$query = $this->postQuery->create()
|
$query = $this->postQuery->create()
|
||||||
->orderBy('.publishedAt', 'DESC');
|
->orderBy('.publishedAt', 'DESC')
|
||||||
|
;
|
||||||
|
|
||||||
if (!$isPreview) {
|
if (!$isPreview) {
|
||||||
$query->published();
|
$query->published();
|
||||||
|
|
@ -165,14 +164,19 @@ class PostController extends PageController
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rss(PostParser $parser, EditorJsExtension $editorJsExtension): Response
|
public function rss(
|
||||||
{
|
PostParser $parser,
|
||||||
|
EditorJsExtension $editorJsExtension,
|
||||||
|
BuilderExtension $builderExtension
|
||||||
|
): Response {
|
||||||
$entities = $this->createQuery()->paginate(1, 20);
|
$entities = $this->createQuery()->paginate(1, 20);
|
||||||
$items = [];
|
$items = [];
|
||||||
|
|
||||||
foreach ($entities as $entity) {
|
foreach ($entities as $entity) {
|
||||||
if ($entity->getContentFormat() === 'editorjs') {
|
if ('editorjs' === $entity->getContentFormat()) {
|
||||||
$description = $editorJsExtension->buildHtml($entity->getContent());
|
$description = $editorJsExtension->buildHtml($entity->getContent());
|
||||||
|
} elseif ('builder' === $entity->getContentFormat()) {
|
||||||
|
$description = $builderExtension->buildHtml($entity->getContent());
|
||||||
} else {
|
} else {
|
||||||
$description = $parser->transformMarkdown($entity->getContent());
|
$description = $parser->transformMarkdown($entity->getContent());
|
||||||
}
|
}
|
||||||
|
|
@ -193,7 +197,7 @@ class PostController extends PageController
|
||||||
'post' => $entity->getId(),
|
'post' => $entity->getId(),
|
||||||
'slug' => $entity->getSlug(),
|
'slug' => $entity->getSlug(),
|
||||||
], UrlGeneratorInterface::ABSOLUTE_URL),
|
], UrlGeneratorInterface::ABSOLUTE_URL),
|
||||||
'linkGemini' => sprintf('gemini://deblan.io/posts/%d.gmi', $entity->getId()),
|
'linkGemini' => sprintf('gemini://deblan.fr/posts/%d.gmi', $entity->getId()),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ namespace App\Controller;
|
||||||
|
|
||||||
use App\Core\Controller\Site\PageController;
|
use App\Core\Controller\Site\PageController;
|
||||||
use App\Core\Notification\MailNotifier;
|
use App\Core\Notification\MailNotifier;
|
||||||
|
use App\Core\Setting\SettingManager;
|
||||||
use App\Form\ContactType;
|
use App\Form\ContactType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use App\Core\Setting\SettingManager;
|
|
||||||
|
|
||||||
class ContactController extends PageController
|
class ContactController extends PageController
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Core\Controller\Dashboard\DashboardAdminController as Controller;
|
use App\Core\Controller\Dashboard\DashboardAdminController as Controller;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
|
||||||
use App\Repository\Blog\PostRepositoryQuery;
|
use App\Repository\Blog\PostRepositoryQuery;
|
||||||
use App\Repository\ProjectRepositoryQuery;
|
use App\Repository\ProjectRepositoryQuery;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
#[Route(path: '/admin')]
|
#[Route(path: '/admin')]
|
||||||
class DashboardAdminController extends Controller
|
class DashboardAdminController extends Controller
|
||||||
|
|
@ -15,8 +15,7 @@ class DashboardAdminController extends Controller
|
||||||
public function index(
|
public function index(
|
||||||
PostRepositoryQuery $postQuery,
|
PostRepositoryQuery $postQuery,
|
||||||
ProjectRepositoryQuery $projectQuery
|
ProjectRepositoryQuery $projectQuery
|
||||||
): Response
|
): Response {
|
||||||
{
|
|
||||||
$posts = $postQuery->create()
|
$posts = $postQuery->create()
|
||||||
->orderBy('.id', 'DESC')
|
->orderBy('.id', 'DESC')
|
||||||
->paginate(1, 4)
|
->paginate(1, 4)
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ use App\Core\Crud\CrudConfiguration;
|
||||||
use App\Core\Crud\Field;
|
use App\Core\Crud\Field;
|
||||||
use App\Core\Entity\EntityInterface;
|
use App\Core\Entity\EntityInterface;
|
||||||
use App\Core\Manager\EntityManager;
|
use App\Core\Manager\EntityManager;
|
||||||
|
use App\Entity\Project;
|
||||||
use App\Entity\Project as Entity;
|
use App\Entity\Project as Entity;
|
||||||
use App\Factory\ProjectFactory as Factory;
|
use App\Factory\ProjectFactory as Factory;
|
||||||
use App\Form\ProjectType as Type;
|
use App\Form\ProjectType as Type;
|
||||||
|
|
@ -15,7 +16,6 @@ use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpFoundation\Session\Session;
|
use Symfony\Component\HttpFoundation\Session\Session;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use App\Entity\Project;
|
|
||||||
|
|
||||||
class ProjectAdminController extends CrudController
|
class ProjectAdminController extends CrudController
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,11 @@
|
||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Api\TTRssClient;
|
|
||||||
use App\Core\Controller\Site\PageController;
|
use App\Core\Controller\Site\PageController;
|
||||||
use App\Markdown\Parser\Post as PostParser;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use App\Repository\StlMeshRepositoryQuery;
|
|
||||||
use App\Entity\StlMesh;
|
use App\Entity\StlMesh;
|
||||||
|
use App\Repository\StlMeshRepositoryQuery;
|
||||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
|
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
|
|
@ -18,7 +16,8 @@ class StlMeshController extends PageController
|
||||||
{
|
{
|
||||||
$pager = $query->create()
|
$pager = $query->create()
|
||||||
->orderBy('.sortOrder')
|
->orderBy('.sortOrder')
|
||||||
->paginate(1, 200);
|
->paginate(1, 200)
|
||||||
|
;
|
||||||
|
|
||||||
return $this->defaultRender($this->siteRequest->getPage()->getTemplate(), [
|
return $this->defaultRender($this->siteRequest->getPage()->getTemplate(), [
|
||||||
'pager' => $pager,
|
'pager' => $pager,
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Api\TTRssClient;
|
|
||||||
use App\Core\Controller\Site\PageController;
|
use App\Core\Controller\Site\PageController;
|
||||||
use App\Markdown\Parser\Post as PostParser;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class TextController extends PageController
|
class TextController extends PageController
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,6 @@ use Symfony\Component\DependencyInjection\Extension\Extension;
|
||||||
|
|
||||||
class AppExtension extends Extension
|
class AppExtension extends Extension
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function load(array $configs, ContainerBuilder $container)
|
public function load(array $configs, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$configuration = $this->getConfiguration($configs, $container);
|
$configuration = $this->getConfiguration($configs, $container);
|
||||||
|
|
@ -18,9 +15,6 @@ class AppExtension extends Extension
|
||||||
$container->setParameter('app', $config);
|
$container->setParameter('app', $config);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getConfiguration(array $configs, ContainerBuilder $container)
|
public function getConfiguration(array $configs, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
return new Configuration();
|
return new Configuration();
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,16 @@ class Comment implements EntityInterface
|
||||||
$this->postFollows = new ArrayCollection();
|
$this->postFollows = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
return sprintf(
|
||||||
|
'[%s] (%s) %s',
|
||||||
|
$this->getAuthor(),
|
||||||
|
$this->getCreatedAt()->format('d/m/Y'),
|
||||||
|
substr($this->getContent(), 0, 20).'…'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
|
|
@ -189,25 +199,12 @@ class Comment implements EntityInterface
|
||||||
*/
|
*/
|
||||||
public function getAvatar(): string
|
public function getAvatar(): string
|
||||||
{
|
{
|
||||||
$mail = $this->getEmail() ?? sprintf('%d@deblan.io', $this->getId());
|
$mail = $this->getEmail() ?? sprintf('%d@deblan.fr', $this->getId());
|
||||||
$hash = md5($mail);
|
$hash = md5($mail);
|
||||||
|
|
||||||
return 'https://cdn.libravatar.org/avatar/'.$hash.'?s=90&d=retro';
|
return 'https://cdn.libravatar.org/avatar/'.$hash.'?s=90&d=retro';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function __toString()
|
|
||||||
{
|
|
||||||
return sprintf(
|
|
||||||
'[%s] (%s) %s',
|
|
||||||
$this->getAuthor(),
|
|
||||||
$this->getCreatedAt()->format('d/m/Y'),
|
|
||||||
substr($this->getContent(), 0, 20).'…'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Collection|PostFollow[]
|
* @return Collection|PostFollow[]
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ class Post implements EntityInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Collection|Category[]
|
* @return Category[]|Collection
|
||||||
*/
|
*/
|
||||||
public function getCategories(): Collection
|
public function getCategories(): Collection
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,4 @@ namespace App\Entity\Page;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
#[ORM\Entity]
|
#[ORM\Entity]
|
||||||
class CategoriesPage extends TitledPage
|
class CategoriesPage extends TitledPage {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,4 @@ namespace App\Entity\Page;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
#[ORM\Entity]
|
#[ORM\Entity]
|
||||||
class CategoryPage extends TitledPage
|
class CategoryPage extends TitledPage {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,4 @@ namespace App\Entity\Page;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
#[ORM\Entity]
|
#[ORM\Entity]
|
||||||
class ContactPage extends SimplePage
|
class ContactPage extends SimplePage {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,4 @@ namespace App\Entity\Page;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
#[ORM\Entity]
|
#[ORM\Entity]
|
||||||
class LinksPage extends SimplePage
|
class LinksPage extends SimplePage {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,4 @@ namespace App\Entity\Page;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
#[ORM\Entity]
|
#[ORM\Entity]
|
||||||
class MeshPage extends SimplePage
|
class MeshPage extends SimplePage {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,4 @@ namespace App\Entity\Page;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
#[ORM\Entity]
|
#[ORM\Entity]
|
||||||
class PostPage extends TitledPage
|
class PostPage extends TitledPage {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,4 @@ namespace App\Entity\Page;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
#[ORM\Entity]
|
#[ORM\Entity]
|
||||||
class PostsPage extends TitledPage
|
class PostsPage extends TitledPage {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,4 @@ namespace App\Entity\Page;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
#[ORM\Entity]
|
#[ORM\Entity]
|
||||||
class SearchPage extends TitledPage
|
class SearchPage extends TitledPage {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ namespace App\Entity\Page;
|
||||||
|
|
||||||
use App\Core\Entity\Site\Page\Block;
|
use App\Core\Entity\Site\Page\Block;
|
||||||
use App\Core\Entity\Site\Page\FileBlock;
|
use App\Core\Entity\Site\Page\FileBlock;
|
||||||
use App\Form\Type\SimpleMdTextareaBlockType;
|
use App\Form\MarkdownBlockType;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@ class SimplePage extends TitledPage
|
||||||
|
|
||||||
$builder->add(
|
$builder->add(
|
||||||
'content',
|
'content',
|
||||||
SimpleMdTextareaBlockType::class,
|
MarkdownBlockType::class,
|
||||||
[
|
[
|
||||||
'label' => 'Contenu',
|
'label' => 'Contenu',
|
||||||
'options' => [
|
'options' => [
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,10 @@
|
||||||
namespace App\Entity\Page;
|
namespace App\Entity\Page;
|
||||||
|
|
||||||
use App\Core\Entity\Site\Page\Block;
|
use App\Core\Entity\Site\Page\Block;
|
||||||
use App\Core\Entity\Site\Page\FileBlock;
|
use App\Core\Entity\Site\Page\Page;
|
||||||
use App\Core\Form\Site\Page\TextareaBlockType;
|
use App\Core\Form\Site\Page\TextareaBlockType;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use App\Core\Entity\Site\Page\Page;
|
|
||||||
|
|
||||||
#[ORM\Entity]
|
#[ORM\Entity]
|
||||||
class TextPage extends Page
|
class TextPage extends Page
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ class Project implements EntityInterface
|
||||||
{
|
{
|
||||||
use Timestampable;
|
use Timestampable;
|
||||||
|
|
||||||
const DRAFT = 0;
|
public const DRAFT = 0;
|
||||||
const PUBLISHED = 1;
|
public const PUBLISHED = 1;
|
||||||
|
|
||||||
#[ORM\Id]
|
#[ORM\Id]
|
||||||
#[ORM\GeneratedValue]
|
#[ORM\GeneratedValue]
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
namespace App\Entity;
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Core\Entity\EntityInterface;
|
||||||
use App\Repository\StlMeshRepository;
|
use App\Repository\StlMeshRepository;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
use App\Core\Entity\EntityInterface;
|
|
||||||
|
|
||||||
#[ORM\Entity(repositoryClass: StlMeshRepository::class)]
|
#[ORM\Entity(repositoryClass: StlMeshRepository::class)]
|
||||||
class StlMesh implements EntityInterface
|
class StlMesh implements EntityInterface
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,7 @@ class User implements PasswordAuthenticatedUserInterface, UserInterface, TwoFact
|
||||||
#[ORM\Column(type: 'boolean', options: ['default' => 0])]
|
#[ORM\Column(type: 'boolean', options: ['default' => 0])]
|
||||||
private $isWriter;
|
private $isWriter;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,7 @@ use Symfony\Component\Messenger\MessageBusInterface;
|
||||||
*/
|
*/
|
||||||
class StatListener
|
class StatListener
|
||||||
{
|
{
|
||||||
public function __construct(protected MessageBusInterface $bus)
|
public function __construct(protected MessageBusInterface $bus) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onKernelRequest(RequestEvent $event)
|
public function onKernelRequest(RequestEvent $event)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@ namespace App\EventSubscriber;
|
||||||
|
|
||||||
use App\Core\Event\Setting\SettingEvent;
|
use App\Core\Event\Setting\SettingEvent;
|
||||||
use App\Core\EventSubscriber\SettingEventSubscriber as EventSubscriber;
|
use App\Core\EventSubscriber\SettingEventSubscriber as EventSubscriber;
|
||||||
|
use App\Core\Form\FileManager\FilePickerType;
|
||||||
|
use App\Core\Form\Type\TinymceTextareaType;
|
||||||
use App\Core\Setting\SettingManager;
|
use App\Core\Setting\SettingManager;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use App\Core\Form\FileManager\FilePickerType;
|
|
||||||
use App\Core\Form\Type\TinymceTextareaType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class SettingEventSubscriber.
|
* class SettingEventSubscriber.
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,4 @@ use App\Core\Factory\UserFactory as BaseUserFactory;
|
||||||
*
|
*
|
||||||
* @author Simon Vieille <simon@deblan.fr>
|
* @author Simon Vieille <simon@deblan.fr>
|
||||||
*/
|
*/
|
||||||
class UserFactory extends BaseUserFactory
|
class UserFactory extends BaseUserFactory {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
namespace App\Form\Blog;
|
namespace App\Form\Blog;
|
||||||
|
|
||||||
use App\Entity\Blog\Category;
|
use App\Entity\Blog\Category;
|
||||||
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
|
|
@ -10,8 +12,6 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Doctrine\ORM\EntityRepository;
|
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|
||||||
|
|
||||||
class CategoryType extends AbstractType
|
class CategoryType extends AbstractType
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
namespace App\Form\Blog;
|
namespace App\Form\Blog;
|
||||||
|
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,13 @@
|
||||||
|
|
||||||
namespace App\Form\Blog;
|
namespace App\Form\Blog;
|
||||||
|
|
||||||
|
use App\Core\Form\FileManager\FilePickerType;
|
||||||
|
use App\Core\Form\Type\BuilderType;
|
||||||
|
use App\Core\Form\Type\CollectionType as MurphCollectionType;
|
||||||
|
use App\Core\Form\Type\EditorJsTextareaType;
|
||||||
use App\Entity\Blog\Category;
|
use App\Entity\Blog\Category;
|
||||||
use App\Entity\Blog\Post;
|
use App\Entity\Blog\Post;
|
||||||
|
use App\Form\MarkdownType;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
|
@ -21,10 +26,6 @@ use Symfony\Component\Validator\Constraints\Image;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Symfony\Component\Validator\Constraints\Range;
|
use Symfony\Component\Validator\Constraints\Range;
|
||||||
use Symfony\Component\Validator\Constraints\Url;
|
use Symfony\Component\Validator\Constraints\Url;
|
||||||
use App\Form\Type\SimpleMdTextareaType;
|
|
||||||
use App\Core\Form\Type\EditorJsTextareaType;
|
|
||||||
use App\Core\Form\FileManager\FilePickerType;
|
|
||||||
use App\Core\Form\Type\CollectionType as MurphCollectionType;
|
|
||||||
|
|
||||||
class PostType extends AbstractType
|
class PostType extends AbstractType
|
||||||
{
|
{
|
||||||
|
|
@ -51,6 +52,7 @@ class PostType extends AbstractType
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'choices' => [
|
'choices' => [
|
||||||
'Markdown' => 'markdown',
|
'Markdown' => 'markdown',
|
||||||
|
'Builder' => 'builder',
|
||||||
'HTML' => 'html',
|
'HTML' => 'html',
|
||||||
'Editor JS' => 'editorjs',
|
'Editor JS' => 'editorjs',
|
||||||
],
|
],
|
||||||
|
|
@ -61,8 +63,9 @@ class PostType extends AbstractType
|
||||||
);
|
);
|
||||||
|
|
||||||
$types = [
|
$types = [
|
||||||
'markdown' => SimpleMdTextareaType::class,
|
'markdown' => MarkdownType::class,
|
||||||
'html' => SimpleMdTextareaType::class,
|
'builder' => BuilderType::class,
|
||||||
|
'html' => MarkdownType::class,
|
||||||
'editorjs' => EditorJsTextareaType::class,
|
'editorjs' => EditorJsTextareaType::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,9 @@
|
||||||
namespace App\Form\Blog;
|
namespace App\Form\Blog;
|
||||||
|
|
||||||
use App\Entity\Blog\Comment;
|
use App\Entity\Blog\Comment;
|
||||||
|
use Gregwar\CaptchaBundle\Type\CaptchaType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
|
|
@ -14,8 +16,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Validator\Constraints\Email;
|
use Symfony\Component\Validator\Constraints\Email;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Symfony\Component\Validator\Constraints\Url;
|
use Symfony\Component\Validator\Constraints\Url;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
|
||||||
use Gregwar\CaptchaBundle\Type\CaptchaType;
|
|
||||||
|
|
||||||
class UserCommentType extends AbstractType
|
class UserCommentType extends AbstractType
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
|
use Gregwar\CaptchaBundle\Type\CaptchaType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
|
|
@ -10,7 +11,6 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Validator\Constraints\Email;
|
use Symfony\Component\Validator\Constraints\Email;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Gregwar\CaptchaBundle\Type\CaptchaType;
|
|
||||||
|
|
||||||
class ContactType extends AbstractType
|
class ContactType extends AbstractType
|
||||||
{
|
{
|
||||||
|
|
|
||||||
21
src/Form/MarkdownBlockType.php
Normal file
21
src/Form/MarkdownBlockType.php
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Form;
|
||||||
|
|
||||||
|
use App\Core\Form\Site\Page\TextareaBlockType;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
class MarkdownBlockType extends TextareaBlockType
|
||||||
|
{
|
||||||
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
|
{
|
||||||
|
$builder->add(
|
||||||
|
'value',
|
||||||
|
MarkdownType::class,
|
||||||
|
array_merge([
|
||||||
|
'required' => false,
|
||||||
|
'label' => false,
|
||||||
|
], $options['options']),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/Form/MarkdownType.php
Normal file
13
src/Form/MarkdownType.php
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Form;
|
||||||
|
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
|
|
||||||
|
class MarkdownType extends TextareaType
|
||||||
|
{
|
||||||
|
public function getBlockPrefix()
|
||||||
|
{
|
||||||
|
return 'markdown';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,10 +3,10 @@
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
||||||
|
|
||||||
class ProjectLinkType extends AbstractType
|
class ProjectLinkType extends AbstractType
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
|
use App\Core\Form\FileManager\FilePickerType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use App\Core\Form\FileManager\FilePickerType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
||||||
|
|
||||||
class StlFileType extends AbstractType
|
class StlFileType extends AbstractType
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,6 @@ use Symfony\Component\Form\FormView;
|
||||||
|
|
||||||
class SimpleMdTextareaType extends TextareaType
|
class SimpleMdTextareaType extends TextareaType
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
public function buildView(FormView $view, FormInterface $form, array $options)
|
||||||
{
|
{
|
||||||
if (!isset($view->vars['attr']['data-simplemde'])) {
|
if (!isset($view->vars['attr']['data-simplemde'])) {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,4 @@ namespace App\Form;
|
||||||
|
|
||||||
use App\Core\Form\UserType as BaseUserType;
|
use App\Core\Form\UserType as BaseUserType;
|
||||||
|
|
||||||
class UserType extends BaseUserType
|
class UserType extends BaseUserType {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
namespace App;
|
namespace App;
|
||||||
|
|
||||||
|
use App\Core\DependencyInjection\Compiler\BuilderBlockPass;
|
||||||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
||||||
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
||||||
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
||||||
|
|
@ -35,4 +37,9 @@ class Kernel extends BaseKernel
|
||||||
(require $path)($routes->withPath($path), $this);
|
(require $path)($routes->withPath($path), $this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function build(ContainerBuilder $container): void
|
||||||
|
{
|
||||||
|
$container->addCompilerPass(new BuilderBlockPass());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,15 +11,9 @@ use Knp\Bundle\MarkdownBundle\Parser\MarkdownParser;
|
||||||
*/
|
*/
|
||||||
class Post extends MarkdownParser
|
class Post extends MarkdownParser
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
// protected $id_class_attr_catch_re = '\{((?'.'>[ ]*[#.a-z][-_:a-zA-Z0-9="\'\/\*-]+){1,})[ ]*\}';
|
// protected $id_class_attr_catch_re = '\{((?'.'>[ ]*[#.a-z][-_:a-zA-Z0-9="\'\/\*-]+){1,})[ ]*\}';
|
||||||
protected $id_class_attr_catch_re = '\{([^\}]+)\}';
|
protected $id_class_attr_catch_re = '\{([^\}]+)\}';
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function transformMarkdown($text)
|
public function transformMarkdown($text)
|
||||||
{
|
{
|
||||||
$html = parent::transformMarkdown($text);
|
$html = parent::transformMarkdown($text);
|
||||||
|
|
@ -27,9 +21,6 @@ class Post extends MarkdownParser
|
||||||
return str_replace(' role="doc-endnote"', '', $html);
|
return str_replace(' role="doc-endnote"', '', $html);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
protected function doExtraAttributes($tag_name, $attr, $defaultIdValue = null, $classes = [])
|
protected function doExtraAttributes($tag_name, $attr, $defaultIdValue = null, $classes = [])
|
||||||
{
|
{
|
||||||
if (empty($attr) && !$defaultIdValue && empty($classes)) {
|
if (empty($attr) && !$defaultIdValue && empty($classes)) {
|
||||||
|
|
@ -102,8 +93,11 @@ class Post extends MarkdownParser
|
||||||
$codeblock
|
$codeblock
|
||||||
);
|
);
|
||||||
|
|
||||||
$codeblock = preg_replace_callback('/^\n+/',
|
$codeblock = preg_replace_callback(
|
||||||
[$this, '_doFencedCodeBlocks_newlines'], $codeblock);
|
'/^\n+/',
|
||||||
|
[$this, '_doFencedCodeBlocks_newlines'],
|
||||||
|
$codeblock
|
||||||
|
);
|
||||||
|
|
||||||
$classes = [];
|
$classes = [];
|
||||||
if ('' != $classname) {
|
if ('' != $classname) {
|
||||||
|
|
@ -115,7 +109,12 @@ class Post extends MarkdownParser
|
||||||
$attr_str = $this->doExtraAttributes($this->code_attr_on_pre ? 'pre' : 'code', $attrs, null, $classes);
|
$attr_str = $this->doExtraAttributes($this->code_attr_on_pre ? 'pre' : 'code', $attrs, null, $classes);
|
||||||
$pre_attr_str = $this->code_attr_on_pre ? $attr_str : '';
|
$pre_attr_str = $this->code_attr_on_pre ? $attr_str : '';
|
||||||
$code_attr_str = $this->code_attr_on_pre ? '' : $attr_str;
|
$code_attr_str = $this->code_attr_on_pre ? '' : $attr_str;
|
||||||
|
|
||||||
|
if (preg_match('/mermaid/', $code_attr_str)) {
|
||||||
|
$codeblock = "<pre{$code_attr_str}>{$codeblock}</pre>";
|
||||||
|
} else {
|
||||||
$codeblock = "<pre{$pre_attr_str}><code{$code_attr_str}>{$codeblock}</code></pre>";
|
$codeblock = "<pre{$pre_attr_str}><code{$code_attr_str}>{$codeblock}</code></pre>";
|
||||||
|
}
|
||||||
|
|
||||||
return "\n\n".$this->hashBlock($codeblock)."\n\n";
|
return "\n\n".$this->hashBlock($codeblock)."\n\n";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@ namespace App\Message;
|
||||||
|
|
||||||
final class PageViewMessage
|
final class PageViewMessage
|
||||||
{
|
{
|
||||||
public function __construct(public int $time)
|
public function __construct(public int $time) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTime(): int
|
public function getTime(): int
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,15 @@
|
||||||
|
|
||||||
namespace App\MessageHandler;
|
namespace App\MessageHandler;
|
||||||
|
|
||||||
use App\Message\PageViewMessage;
|
|
||||||
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
|
||||||
use App\Api\InfluxDB;
|
use App\Api\InfluxDB;
|
||||||
use InfluxDB2\WriteType;
|
use App\Message\PageViewMessage;
|
||||||
use InfluxDB2\Point;
|
use InfluxDB2\Point;
|
||||||
|
use InfluxDB2\WriteType;
|
||||||
|
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
||||||
|
|
||||||
final class PageViewMessageHandler implements MessageHandlerInterface
|
final class PageViewMessageHandler implements MessageHandlerInterface
|
||||||
{
|
{
|
||||||
public function __construct(protected InfluxDB $influxDB)
|
public function __construct(protected InfluxDB $influxDB) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __invoke(PageViewMessage $message)
|
public function __invoke(PageViewMessage $message)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ use Doctrine\Persistence\ManagerRegistry;
|
||||||
/**
|
/**
|
||||||
* @extends ServiceEntityRepository<AppEntityBlogPost>
|
* @extends ServiceEntityRepository<AppEntityBlogPost>
|
||||||
*
|
*
|
||||||
* @method AppEntityBlogPost|null find($id, $lockMode = null, $lockVersion = null)
|
* @method null|AppEntityBlogPost find($id, $lockMode = null, $lockVersion = null)
|
||||||
* @method AppEntityBlogPost|null findOneBy(array $criteria, array $orderBy = null)
|
* @method null|AppEntityBlogPost findOneBy(array $criteria, array $orderBy = null)
|
||||||
* @method AppEntityBlogPost[] findAll()
|
* @method AppEntityBlogPost[] findAll()
|
||||||
* @method AppEntityBlogPost[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
* @method AppEntityBlogPost[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
use Doctrine\Persistence\ManagerRegistry;
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method Comment|null find($id, $lockMode = null, $lockVersion = null)
|
* @method null|Comment find($id, $lockMode = null, $lockVersion = null)
|
||||||
* @method Comment|null findOneBy(array $criteria, array $orderBy = null)
|
* @method null|Comment findOneBy(array $criteria, array $orderBy = null)
|
||||||
* @method Comment[] findAll()
|
* @method Comment[] findAll()
|
||||||
* @method Comment[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
* @method Comment[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
namespace App\Repository\Blog;
|
namespace App\Repository\Blog;
|
||||||
|
|
||||||
use App\Core\Repository\RepositoryQuery;
|
use App\Core\Repository\RepositoryQuery;
|
||||||
use Knp\Component\Pager\PaginatorInterface;
|
|
||||||
use App\Repository\Blog\PostFollowRepository as Repository;
|
use App\Repository\Blog\PostFollowRepository as Repository;
|
||||||
|
use Knp\Component\Pager\PaginatorInterface;
|
||||||
|
|
||||||
class PostFollowRepositoryQuery extends RepositoryQuery
|
class PostFollowRepositoryQuery extends RepositoryQuery
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\ORMException;
|
||||||
use Doctrine\Persistence\ManagerRegistry;
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method Project|null find($id, $lockMode = null, $lockVersion = null)
|
* @method null|Project find($id, $lockMode = null, $lockVersion = null)
|
||||||
* @method Project|null findOneBy(array $criteria, array $orderBy = null)
|
* @method null|Project findOneBy(array $criteria, array $orderBy = null)
|
||||||
* @method Project[] findAll()
|
* @method Project[] findAll()
|
||||||
* @method Project[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
* @method Project[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
namespace App\Repository;
|
namespace App\Repository;
|
||||||
|
|
||||||
use App\Core\Repository\RepositoryQuery;
|
use App\Core\Repository\RepositoryQuery;
|
||||||
use Knp\Component\Pager\PaginatorInterface;
|
|
||||||
use App\Repository\ProjectRepository as Repository;
|
|
||||||
use App\Entity\Project;
|
use App\Entity\Project;
|
||||||
|
use App\Repository\ProjectRepository as Repository;
|
||||||
|
use Knp\Component\Pager\PaginatorInterface;
|
||||||
|
|
||||||
class ProjectRepositoryQuery extends RepositoryQuery
|
class ProjectRepositoryQuery extends RepositoryQuery
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
use Doctrine\Persistence\ManagerRegistry;
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method StlMesh|null find($id, $lockMode = null, $lockVersion = null)
|
* @method null|StlMesh find($id, $lockMode = null, $lockVersion = null)
|
||||||
* @method StlMesh|null findOneBy(array $criteria, array $orderBy = null)
|
* @method null|StlMesh findOneBy(array $criteria, array $orderBy = null)
|
||||||
* @method StlMesh[] findAll()
|
* @method StlMesh[] findAll()
|
||||||
* @method StlMesh[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
* @method StlMesh[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
namespace App\Repository;
|
namespace App\Repository;
|
||||||
|
|
||||||
use App\Core\Repository\RepositoryQuery;
|
use App\Core\Repository\RepositoryQuery;
|
||||||
use Knp\Component\Pager\PaginatorInterface;
|
|
||||||
use App\Repository\StlMeshRepository as Repository;
|
use App\Repository\StlMeshRepository as Repository;
|
||||||
|
use Knp\Component\Pager\PaginatorInterface;
|
||||||
|
|
||||||
class StlMeshRepositoryQuery extends RepositoryQuery
|
class StlMeshRepositoryQuery extends RepositoryQuery
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,8 @@ use App\Entity\User;
|
||||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
use Doctrine\Persistence\ManagerRegistry;
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
|
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
|
||||||
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
|
|
||||||
use Symfony\Component\Security\Core\User\UserInterface;
|
|
||||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||||
|
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
|
||||||
|
|
||||||
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
|
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,9 @@ class BlogExtension extends AbstractExtension
|
||||||
$text = str_replace('http://upload.deblan.fr', 'https://upload.deblan.org', $text);
|
$text = str_replace('http://upload.deblan.fr', 'https://upload.deblan.org', $text);
|
||||||
$text = str_replace('http://dedi.geneweb.fr', 'http://kim.deblan.fr', $text);
|
$text = str_replace('http://dedi.geneweb.fr', 'http://kim.deblan.fr', $text);
|
||||||
$text = str_replace('http://mediaplayer.deblan.fr', 'https://mediaplayer.deblan.org', $text);
|
$text = str_replace('http://mediaplayer.deblan.fr', 'https://mediaplayer.deblan.org', $text);
|
||||||
$text = str_replace('http://blog.deblan.fr', 'https://www.deblan.io', $text);
|
$text = str_replace('http://blog.deblan.fr', 'https://www.deblan.fr', $text);
|
||||||
$text = str_replace('http://www.deblan.tv', 'https://www.deblan.io', $text);
|
$text = str_replace('http://www.deblan.tv', 'https://www.deblan.fr', $text);
|
||||||
|
$text = str_replace('http://www.deblan.io', 'https://www.deblan.fr', $text);
|
||||||
|
|
||||||
$text = preg_replace_callback(
|
$text = preg_replace_callback(
|
||||||
'`<p([^>]*)>(.*)</p([^>]*)>`isU',
|
'`<p([^>]*)>(.*)</p([^>]*)>`isU',
|
||||||
|
|
@ -134,10 +135,12 @@ class BlogExtension extends AbstractExtension
|
||||||
'#<code langage=\'([^\']*)\'>(.*)</code>#isU',
|
'#<code langage=\'([^\']*)\'>(.*)</code>#isU',
|
||||||
],
|
],
|
||||||
function ($data) {
|
function ($data) {
|
||||||
$lang = strtolower(str_replace(
|
$lang = strtolower(
|
||||||
|
str_replace(
|
||||||
['console', 'texte', 'apache'],
|
['console', 'texte', 'apache'],
|
||||||
['bash', 'text', 'html'],
|
['bash', 'text', 'html'],
|
||||||
$data[1])
|
$data[1]
|
||||||
|
)
|
||||||
);
|
);
|
||||||
$class = 'language-'.$lang;
|
$class = 'language-'.$lang;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,9 @@ class ColorExtension extends AbstractExtension
|
||||||
|
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'#%s%s%s',
|
'#%s%s%s',
|
||||||
strlen($red) != 2 ? '0'.$red : $red,
|
2 != strlen($red) ? '0'.$red : $red,
|
||||||
strlen($green) != 2 ? '0'.$green : $green,
|
2 != strlen($green) ? '0'.$green : $green,
|
||||||
strlen($blue) != 2 ? '0'.$blue : $blue,
|
2 != strlen($blue) ? '0'.$blue : $blue,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class LazyLoadExtension extends AbstractExtension
|
||||||
|
|
||||||
public function lazyLoad($text)
|
public function lazyLoad($text)
|
||||||
{
|
{
|
||||||
$text = preg_replace_callback(
|
return preg_replace_callback(
|
||||||
'`<img src="([^"]+)" alt="([^"]+)" />`isU',
|
'`<img src="([^"]+)" alt="([^"]+)" />`isU',
|
||||||
function ($data) {
|
function ($data) {
|
||||||
$lazy = sprintf('<img class="lazy-img" src="#" data-src="%s" alt="%s" />', $data[1], $data[2]);
|
$lazy = sprintf('<img class="lazy-img" src="#" data-src="%s" alt="%s" />', $data[1], $data[2]);
|
||||||
|
|
@ -31,7 +31,5 @@ class LazyLoadExtension extends AbstractExtension
|
||||||
},
|
},
|
||||||
$text
|
$text
|
||||||
);
|
);
|
||||||
|
|
||||||
return $text;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ namespace App\Twig\Extension;
|
||||||
|
|
||||||
use Twig\Extension\AbstractExtension;
|
use Twig\Extension\AbstractExtension;
|
||||||
use Twig\TwigFilter;
|
use Twig\TwigFilter;
|
||||||
use Twig\TwigFunction;
|
|
||||||
|
|
||||||
class TypoExtension extends AbstractExtension
|
class TypoExtension extends AbstractExtension
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
namespace App\UrlGenerator;
|
namespace App\UrlGenerator;
|
||||||
|
|
||||||
use App\Core\Entity\Site\Node;
|
use App\Core\Entity\Site\Node;
|
||||||
use App\Entity\Blog\Category;
|
|
||||||
use App\Repository\Blog\CategoryRepositoryQuery;
|
use App\Repository\Blog\CategoryRepositoryQuery;
|
||||||
use App\Repository\Blog\PostRepositoryQuery;
|
use App\Repository\Blog\PostRepositoryQuery;
|
||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||||
#}
|
#}
|
||||||
<link rel="icon" href="{{ asset('build/webapp/favicon.svg') }}" >
|
<link rel="icon" href="{{ asset('build/webapp/favicon.svg') }}" >
|
||||||
<link rel="manifest" href="{{ asset('build/webapp/manifest.json') }}">
|
<link rel="manifest" href="{{ asset('build/webapp/manifest.json') }}">
|
||||||
|
|
||||||
|
{% block links_extra %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="flex items-stretch blog">
|
<div class="flex items-stretch blog">
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,8 @@
|
||||||
|
|
||||||
{% if entity.contentFormat == 'html' %}
|
{% if entity.contentFormat == 'html' %}
|
||||||
{{- entity.content|murph_url|file_attributes|post -}}
|
{{- entity.content|murph_url|file_attributes|post -}}
|
||||||
|
{% elseif entity.contentFormat == 'builder' %}
|
||||||
|
{{- entity.content|block_to_html|file_attributes|lazy_load -}}
|
||||||
{% elseif entity.contentFormat == 'markdown' %}
|
{% elseif entity.contentFormat == 'markdown' %}
|
||||||
{{- entity.content|murph_url|file_attributes|markdown('post') -}}
|
{{- entity.content|murph_url|file_attributes|markdown('post') -}}
|
||||||
{% elseif entity.contentFormat == 'editorjs' %}
|
{% elseif entity.contentFormat == 'editorjs' %}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,21 @@
|
||||||
{% extends '@Core/admin/crud/show.html.twig' %}
|
{% extends '@Core/admin/crud/show.html.twig' %}
|
||||||
|
|
||||||
{% block header_actions_after %}
|
{% block header_actions_after %}
|
||||||
<a href="{{ safe_path('blog_menu_post', {post: entity.id, slug: entity.slug}) }}" class="btn btn-light" target="_blank">
|
<a href="{{ safe_path('blog_menu_post', {post: entity.id, slug: entity.slug}) }}" class="btn btn-success" target="_blank">
|
||||||
Voir en ligne
|
Voir en ligne
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
{% if configuration.action(context, 'analytic_stats', true) %}
|
||||||
|
{% set analytics = path(
|
||||||
|
configuration.pageRoute('analytic_stats'),
|
||||||
|
{entity: entity.id}|merge(configuration.pageRouteParams('analytic_stats'))
|
||||||
|
) %}
|
||||||
|
|
||||||
|
<a data-modal="{{ analytics }}" class="btn btn-light">
|
||||||
|
<span data-modal="{{ analytics }}" class="fa fa-chart-bar"></span>
|
||||||
|
Statistiques
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{% block render %}
|
{% block render %}
|
||||||
<div class="ejs-link rounded-2xl shadow-md p-2 md:p-8 flex justify-start bg-box">
|
<div class="ejs-link rounded-2xl shadow-md p-1 flex justify-start bg-box">
|
||||||
<a href="{{ link }}" class="ejs-link--anchor {% if meta.image is defined and meta.image %}ejs-link--anchor--with-image{% endif %}" target="_blank">
|
<a href="{{ link }}" class="ejs-link--anchor {% if meta.image is defined and meta.image %}ejs-link--anchor--with-image{% endif %}" target="_blank">
|
||||||
<div class="ejs-link-content">
|
<div class="ejs-link-content">
|
||||||
{% if meta.title %}
|
{% if meta.title %}
|
||||||
|
|
|
||||||
8
templates/form/bootstrap_4_form_theme.html.twig
Normal file
8
templates/form/bootstrap_4_form_theme.html.twig
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{% extends '@Core/form/bootstrap_4_form_theme.html.twig' %}
|
||||||
|
|
||||||
|
{% block markdown_widget %}
|
||||||
|
<div {% for attr, value in row_attr %}{{ attr }}="{{ value }}" {% endfor %}>
|
||||||
|
<div class="markdown-editor" data-value="{{ value|json_encode }}" data-name="{{ full_name }}" data-id="{{ id }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.9 KiB |
|
|
@ -12,7 +12,6 @@
|
||||||
<div class="grid grid-flow-row-dens grid-cols-12 md:p-8 gap-5">
|
<div class="grid grid-flow-row-dens grid-cols-12 md:p-8 gap-5">
|
||||||
{% for mesh in pager %}
|
{% for mesh in pager %}
|
||||||
<div class="card shadow-md col-span-12 md:col-span-6 lg:col-span-4 m-3 bg-box">
|
<div class="card shadow-md col-span-12 md:col-span-6 lg:col-span-4 m-3 bg-box">
|
||||||
<div class="card">
|
|
||||||
<figure>
|
<figure>
|
||||||
<img src="{{ asset('build/images/px.png') }}" data-color="{{ generate_color_by_string(mesh.id) }}" data-src="{{- asset(mesh.preview)|imagine_filter('mesh_preview_filter') -}}" data-src-error="{{ asset('build/images/post-image-logo.png') }}" alt="{{ mesh.label }}">
|
<img src="{{ asset('build/images/px.png') }}" data-color="{{ generate_color_by_string(mesh.id) }}" data-src="{{- asset(mesh.preview)|imagine_filter('mesh_preview_filter') -}}" data-src-error="{{ asset('build/images/post-image-logo.png') }}" alt="{{ mesh.label }}">
|
||||||
</figure>
|
</figure>
|
||||||
|
|
@ -38,7 +37,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{# for key, item in mesh.files %}
|
{# for key, item in mesh.files %}
|
||||||
<input type="checkbox" id="mesh-{{ mesh.id }}-{{ key }}" class="modal-toggle" />
|
<input type="checkbox" id="mesh-{{ mesh.id }}-{{ key }}" class="modal-toggle" />
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,8 @@
|
||||||
{{- post.content|murph_url|file_attributes|post -}}
|
{{- post.content|murph_url|file_attributes|post -}}
|
||||||
{% elseif post.contentFormat == 'markdown' %}
|
{% elseif post.contentFormat == 'markdown' %}
|
||||||
{{- post.content|murph_url|file_attributes|markdown('post')|lazy_load -}}
|
{{- post.content|murph_url|file_attributes|markdown('post')|lazy_load -}}
|
||||||
|
{% elseif post.contentFormat == 'builder' %}
|
||||||
|
{{- post.content|block_to_html|file_attributes|lazy_load -}}
|
||||||
{% elseif post.contentFormat == 'editorjs' %}
|
{% elseif post.contentFormat == 'editorjs' %}
|
||||||
{{- post.content|murph_url|file_attributes|editorjs_to_html|raw -}}
|
{{- post.content|murph_url|file_attributes|editorjs_to_html|raw -}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
@ -114,7 +116,7 @@
|
||||||
{% form_theme form with "form_div_layout.html.twig" %}
|
{% form_theme form with "form_div_layout.html.twig" %}
|
||||||
|
|
||||||
<div class="rounded-2xl shadow-md p-8 mb-8 bg-box form" id="grid">
|
<div class="rounded-2xl shadow-md p-8 mb-8 bg-box form" id="grid">
|
||||||
<form class="form" method="POST" data-form-bot action="{{ safe_url('blog_tech_form_without_javascript', {page: app.request.uri, _domain: _domain}) }}">
|
<form class="form" id="form" method="POST" data-form-bot action="{{ safe_url('blog_tech_form_without_javascript', {page: app.request.uri, _domain: _domain}) }}">
|
||||||
<div class="h4">Ajouter un commentaire</div>
|
<div class="h4">Ajouter un commentaire</div>
|
||||||
|
|
||||||
<div class="grid grid-flow-row-dens grid-cols-2 gap-5">
|
<div class="grid grid-flow-row-dens grid-cols-2 gap-5">
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
<figure>
|
<figure>
|
||||||
<a href="{{ url }}">
|
<a href="{{ url }}">
|
||||||
<img src="{{ asset('build/images/px.png') }}" data-color="{{ generate_color_by_string(post.id) }}" data-src="{{- image -}}" data-src-error="{{ asset('build/images/post-image-logo.png') }}" alt="{{ post.title }}">
|
<img src="{{ asset('build/images/px.png') }}" data-color="{{ generate_color_by_string(post.id) }}" data-src="{{- image|trim -}}" data-src-error="{{ asset('build/images/post-image-logo.png') }}" alt="{{ post.title }}">
|
||||||
</a>
|
</a>
|
||||||
</figure>
|
</figure>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,27 @@
|
||||||
{% extends "page/titled/default.html.twig" %}
|
{% extends "page/titled/default.html.twig" %}
|
||||||
|
|
||||||
|
{%- block links_extra -%}
|
||||||
|
{{- parent() -}}
|
||||||
|
|
||||||
|
{%- for post in pager -%}
|
||||||
|
{%- set image -%}
|
||||||
|
{%- if post.image2 -%}
|
||||||
|
{{ asset(post.image2)|imagine_filter('post_preview_filter') }}
|
||||||
|
{%- elseif post.image -%}
|
||||||
|
{{ asset(post.image)|imagine_filter('post_preview_filter') }}
|
||||||
|
{%- elseif post.quickImage -%}
|
||||||
|
{{ post.quickImage }}
|
||||||
|
{% else %}
|
||||||
|
{{ asset('build/images/post-image-logo.png') }}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endset -%}
|
||||||
|
|
||||||
|
{%- if image -%}
|
||||||
|
<link rel="preload" fetchpriority="high" as="image" href="{{ image|trim }}">
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- endblock -%}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="grid grid-flow-row-dens grid-cols-12 md:p-8 gap-5">
|
<div class="grid grid-flow-row-dens grid-cols-12 md:p-8 gap-5">
|
||||||
{% for post in pager %}
|
{% for post in pager %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue