Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve customisation #39

Merged
merged 1 commit into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ def inject_dbconf():
rows = [dict(row) for row in result]
conf = {}
for row in rows:
conf[row.get('key')] = json.loads(row.get('value'))
try:
conf[row.get('key')] = json.loads(row.get('value'))
except Exception as exception:
conf[row.get('key')] = row.get('value')

return dict(dbconf=conf)

if __name__ == "__main__":
Expand Down
11 changes: 7 additions & 4 deletions backend/config.py.tpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
SQLALCHEMY_DATABASE_URI='postgres://<user>:<passwd>@<host>:<port>/<database>'
DATA_IMAGES_PATH='data/images/'# From ./static dir
DATA_NOTICES_PATH='data/notice-photo/'# From ./static dir
BABEL_TRANSLATION_DIRECTORIES='./i18n'# From ./ dir

IGN_KEY='ign_key'
PASS_METHOD='md5'
COOKIE_EXPIRATION = 36000
COOKIE_AUTORENEW = True
SESSION_TYPE = 'filesystem'
SECRET_KEY = 'secret key'
SECRET_KEY = 'secret key'

# Do not edit except in exceptional cases
DATA_IMAGES_PATH='data/images/'# From ./static dir
DATA_NOTICES_PATH='data/notice-photo/'# From ./static dir
BABEL_TRANSLATION_DIRECTORIES='./i18n'# From ./ dir
10 changes: 1 addition & 9 deletions backend/static/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
left: 0;
height: 8px;
width: 8px;
background-color: var(--color-green);
background-color: var(--color-secondary);
transform: translateY(25%);
}

Expand All @@ -95,14 +95,6 @@
font-family: 'Hind', sans-serif;
}

.page-home .discover{
text-align: center;
color: #fff;
font-style: italic;
background-color : rgba(153,214,234,0.5);
z-index: 1;
transition: transform .5s ease;
}
.page-home .discover {
width: 100%;
display: flex;
Expand Down
8 changes: 4 additions & 4 deletions backend/static/css/map.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@
}
.app-map .sidebar .filters .card-body .btn:hover
{
background: #99d6ea61;
color: #FFF;
background: var(--color-map-filter-bg-hover);
color: var(--color-map-filter-txt-hover);
}
.app-map .sidebar .filters .card-body .btn.active,
.app-map .sidebar .btn-site:hover {
background: #99D6EA;
color: #000;
background: var(--color-map-filter-bg-active);
color: var(--color-map-filter-txt-active);
}

.app-map .sidebar .filters .filter-years .btn-group-vertical {
Expand Down
36 changes: 13 additions & 23 deletions backend/static/css/style.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
:root {
--color-primary: #00188F;
--color-primary-light: #303f8a;
--color-blue : #283371;
--color-green : #78BE20;
--color-secondary: #78BE20;
--color-secondary-light: #72d409;

--color-discover: rgba(153, 214, 234, 0.5);

--color-map-filter-txt-hover: #FFF;
--color-map-filter-bg-hover: #99d6ea61;
--color-map-filter-txt-active: #000;
--color-map-filter-bg-active: #99D6EA;
}

.swiper-pagination-bullet-active {
Expand Down Expand Up @@ -73,6 +78,11 @@ button{
border-color: var(--color-primary);
}

.btn-primary:hover {
background-color: var(--color-primary-light);
border-color: var(--color-primary-light);
}

.btn-secondary {
background-color: var(--color-secondary);
border-color: var(--color-secondary);
Expand Down Expand Up @@ -151,26 +161,6 @@ button{
font-size: 1.5em;
}

.blue-btn {
background-color: var(--color-blue);
color: #fff;
border: none;
padding: 5px 30px;
text-transform: uppercase;
font-size: 13px;
width: fit-content;
}

.green-btn{
background-color: var(--color-green);
color: #fff;
border: none;
padding: 5px 30px;
text-transform: uppercase;
font-size: 13px;
width: fit-content;
}

.progress-bar {
background-color: var(--color-primary);
}
Expand All @@ -179,7 +169,7 @@ button{
text-align: center;
color: #fff;
font-style: italic;
background-color : rgba(153,214,234,0.5);
background-color : var(--color-discover);
z-index: 9999;
transition: transform .5s ease;
}
Expand Down
11 changes: 8 additions & 3 deletions backend/static/custom/css/custom-style.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
/* css clors */
:root {
--color-primary: #00188F;
--color-primary-light: #303f8a;
--color-blue : #283371;
--color-green : #78BE20;
--color-primary-light: #0069d9;
--color-secondary: #78BE20;
--color-secondary-light: #72d409;

--color-discover: rgba(153, 214, 234, 0.5);

--color-map-filter-txt-hover: #FFF;
--color-map-filter-bg-hover: #99d6ea61;
--color-map-filter-txt-active: #000;
--color-map-filter-bg-active: #99D6EA;
}

/* css Footer */
Expand Down
4 changes: 3 additions & 1 deletion backend/tpl/comparator.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ <h3 class="text-uppercase">{{ site.name_site }} | {{ site.ville.nom_commune }} <
<a class="btn btn-sm btn-primary text-uppercase mb-2" href="{{ url_for('static', filename='data/notice-photo/' + site.path_file_guide_site) }}" target="_blank">
{{ _('obs_point.buttons.notice') }} <i class="icon ion-md-download ml-2"></i>
</a>
<a class="btn btn-sm btn-primary text-uppercase mb-2" href="mailto:patrick.folliet@vanoise-parcnational.fr?subject=Observation OPPV - réf. : {{ site.ref_site }}">
{% if dbconf.mailto_observation: %}
<a class="btn btn-sm btn-primary text-uppercase mb-2" href="mailto:{{ dbconf.mailto_observation|replace('%ref_site%', site.ref_site) }}">
{{ _('obs_point.buttons.obs') }} <i class="icon ion-ios-eye ml-2"></i>
</a>
{% endif %}
</div>
<div class="col-lg-7 pr-0">
<h5 class="text-uppercase">{{ _('obs_point.description') }}</h5>
Expand Down
6 changes: 4 additions & 2 deletions backend/tpl/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<header class="container-fluid" id="header">
<a href="/">
<img class="header-logo" src="{{ url_for('static', filename='custom/logo/logo_txt_bleu.png') }}" />
<img class="header-logo" src="{{ url_for('static', filename='custom/logo/logo_txt_color.png') }}" />
</a>
<div class="row nav-bar">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
Expand Down Expand Up @@ -82,11 +82,13 @@ <h6>{{ _('footer.internal_title') }}</h6>
{{ _('footer.internal_links.gallery') }}
</a>
</li>
{% if dbconf.mailto_contact: %}
<li>
<a href="mailto:patrick.folliet@vanoise-parcnational.fr?subject=Contact OPPV">
<a href="mailto:{{ dbconf.mailto_contact }}">
{{ _('footer.internal_links.contact') }}
</a>
</li>
{% endif %}
</ul>
</div>

Expand Down