Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-mlc
kohinos
Commits
8798f1ce
Commit
8798f1ce
authored
Sep 02, 2020
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
personnalisation logo & favicon
parent
87393dda
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
6 deletions
+72
-6
.gitignore
.gitignore
+6
-0
site.webmanifest
public/images/favicon-custom/site.webmanifest
+33
-0
AppExtension.php
src/Twig/AppExtension.php
+23
-1
header.html.twig
templates/common/header.html.twig
+5
-1
layout.html.twig
templates/common/layout.html.twig
+5
-4
No files found.
.gitignore
View file @
8798f1ce
...
...
@@ -39,3 +39,9 @@ yarn-error.log
###> payum ###
/transactions/
###< payum ###
###> ui customization ###
/public/images/logo-custom.png
/public/images/favicon-custom/*.png
/public/images/favicon-custom/*.ico
###< payum ###
public/images/favicon-custom/site.webmanifest
0 → 100755
View file @
8798f1ce
{
"lang" : "fr",
"dir" : "ltr",
"name" : "Kohinos : Outil de gestion de MLCC",
"short_name" : "kohinos",
"icons" : [
{
"src" : "/images/favicon-custom/android-chrome-192x192.png",
"sizes" : "192x192",
"type" : "image/png"
},
{
"src" : "/images/favicon-custom/android-chrome-144x144.png",
"sizes" : "144x144",
"type" : "image/png"
},
{
"src" : "/images/favicon-custom/android-chrome-96x96.png",
"sizes" : "96x96",
"type" : "image/png"
},
{
"src" : "/images/favicon-custom/android-chrome-48x48.png",
"sizes" : "48x48",
"type" : "image/png"
}
],
"theme_color" : "#ffffff",
"background_color" : "#ffffff",
"start_url" : "/",
"display" : "standalone",
"orientation" : "natural"
}
src/Twig/AppExtension.php
View file @
8798f1ce
...
...
@@ -63,10 +63,32 @@ class AppExtension extends AbstractExtension
new
\Twig_SimpleFunction
(
'parameter'
,
function
(
$name
)
{
return
$this
->
container
->
getParameter
(
$name
);
}),
new
\Twig_SimpleFunction
(
'isPayzenEnabled'
,
array
(
$this
,
'isPayzenEnabled'
))
new
\Twig_SimpleFunction
(
'isPayzenEnabled'
,
array
(
$this
,
'isPayzenEnabled'
)),
new
\Twig_SimpleFunction
(
'isCustomLogo'
,
array
(
$this
,
'isCustomLogo'
)),
new
\Twig_SimpleFunction
(
'getFaviconPath'
,
array
(
$this
,
'getFaviconPath'
))
];
}
public
function
getFaviconPath
()
{
$appPath
=
$this
->
container
->
getParameter
(
'kernel.project_dir'
);
$dirPath
=
$appPath
.
'/public/images/favicon-custom/'
;
$filePath
=
$dirPath
.
'/favicon-32x32.png'
;
if
(
is_dir
(
$dirPath
)
&&
file_exists
(
$filePath
))
{
return
"/images/favicon-custom/"
;
}
else
{
return
"/images/favicon/"
;
}
}
public
function
isCustomLogo
()
{
$appPath
=
$this
->
container
->
getParameter
(
'kernel.project_dir'
);
$filename
=
$appPath
.
'/public/images/logo-custom.png'
;
return
file_exists
(
$filename
);
}
public
function
isPayzenEnabled
()
{
return
$this
->
em
->
getRepository
(
GlobalParameter
::
class
)
->
val
(
GlobalParameter
::
USE_PAYZEN
)
===
'true'
?
true
:
false
;
...
...
templates/common/header.html.twig
View file @
8798f1ce
<header
class=
"container header"
>
<nav
class=
"menu navbar navbar-expand-md navbar-light bg-light"
>
<a
class=
"navbar-brand"
href=
"
{{
url
(
'index'
)
}}
"
>
<img
src=
"/images/logo.png"
height=
"45"
class=
"d-inline-block align-top"
alt=
"
{{
KOH_MLC_NAME
|
default
(
''
)
}}
"
>
{%
if
isCustomLogo
()
%}
<img
src=
"/images/logo-custom.png"
height=
"45"
class=
"d-inline-block align-top"
alt=
"
{{
KOH_MLC_NAME
|
default
(
''
)
}}
"
>
{%
else
%}
<img
src=
"/images/logo.png"
height=
"45"
class=
"d-inline-block align-top"
alt=
"
{{
KOH_MLC_NAME
|
default
(
''
)
}}
"
>
{%
endif
%}
</a>
{%
block
menu
%}
...
...
templates/common/layout.html.twig
View file @
8798f1ce
...
...
@@ -16,10 +16,11 @@
{# FAVICON #}
{%
block
favicon
%}
<link
rel=
"apple-touch-icon"
sizes=
"180x180"
href=
"/images/favicon/apple-touch-icon.png"
>
<link
rel=
"icon"
type=
"image/png"
sizes=
"32x32"
href=
"/images/favicon/favicon-32x32.png"
>
<link
rel=
"icon"
type=
"image/png"
sizes=
"16x16"
href=
"/images/favicon/favicon-16x16.png"
>
<link
rel=
"manifest"
href=
"/images/favicon/site.webmanifest"
>
{%
set
favPath
=
getFaviconPath
()
%}
<link
rel=
"apple-touch-icon"
sizes=
"180x180"
href=
"
{{
favPath
}}
apple-touch-icon.png"
>
<link
rel=
"icon"
type=
"image/png"
sizes=
"32x32"
href=
"
{{
favPath
}}
favicon-32x32.png"
>
<link
rel=
"icon"
type=
"image/png"
sizes=
"16x16"
href=
"
{{
favPath
}}
favicon-16x16.png"
>
<link
rel=
"manifest"
href=
"
{{
favPath
}}
site.webmanifest"
>
{%
endblock
favicon
%}
{# POUR AJOUTER DES META ( like og: ) #}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment