Merge branch 'upgrade-sf3' into edit-user-password

This commit is contained in:
2018-08-16 11:31:07 +02:00
99 changed files with 2929 additions and 497 deletions

View File

@@ -27,50 +27,8 @@ window.addEventListener("DOMContentLoaded", function(e) {
query = window.location.search,
container = document.querySelector("#download_container")
;
window.fetch(url+query, { credentials: 'same-origin' })
.then(function(response) {
if (!response.ok) {
throw Error(response.statusText);
}
return response.blob();
}).then(function(blob) {
var content = URL.createObjectURL(blob),
link = document.createElement("a"),
suffix_file;
switch (blob.type) {
case 'application/vnd.oasis.opendocument.spreadsheet':
suffix_file = '.ods';
break;
case 'text/csv':
suffix_file = '.csv';
break;
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
suffix_file = '.xlsx';
break;
default:
suffix_file = '';
}
link.appendChild(document.createTextNode("{{ "Download your report"|trans }}"));
link.classList.add("sc-button", "btn-action");
link.href = content;
link.download = "{{ alias }}"+suffix_file;
let waiting_text = container.querySelector("#waiting_text");
container.removeChild(waiting_text);
container.appendChild(link);
}).catch(function(error) {
var problem_text =
document.createTextNode("{{ "Problem during download"|trans }}");
container
.replaceChild(problem_text, container.firstChild);
})
;
chill.download_report(url+query, container);
});
</script>
{% endblock %}
@@ -79,6 +37,6 @@ window.addEventListener("DOMContentLoaded", function(e) {
<h1>{{ "Download export"|trans }}</h1>
<div id="download_container"><span id="waiting_text">{{ "Waiting for your report"|trans }}...</span></div>
<div id="download_container" data-alias="{{ alias|escape('html_attr') }}" {% if mime_type is defined %}data-mime-type="{{ mime_type|escape('html_attr') }}"{% endif %} data-download-text="{{ "Download your report"|trans|escape('html_attr') }}"><span id="waiting_text">{{ "Waiting for your report"|trans }}...</span></div>
{% endblock %}

View File

@@ -61,7 +61,11 @@
<br/>
{% endfor %}
</div>
<script type="text/javascript">chill.checkNullValuesInChoices("{{ form.vars.full_name }}");</script>
<script type="text/javascript">
document.addEventListener('load', function(e) {
chill.checkNullValuesInChoices("{{ form.vars.full_name }}");
});
</script>
{% endspaceless %}
{% endblock choice_widget_expanded %}
@@ -90,11 +94,20 @@
{%- endif -%}
{% endfor %}
<script type="text/javascript">
chill.checkNullValuesInChoices("{{ form._choices.vars.full_name }}");
document.addEventListener('load', function(e) {
chill.checkNullValuesInChoices("{{ form._choices.vars.full_name }}");
});
</script>
{% endspaceless %}
{% endblock choice_with_other_widget %}
{% block money_widget %}
<div class="chill-form-money">
{{ block('form_widget_simple') }}
<span class="chill-form-money__money">{{ money_pattern|form_encode_currency }}</span>
</div>
{% endblock money_widget %}
{% block date_widget %}
{% spaceless %}
@@ -128,9 +141,9 @@
{% block form_errors %}
{% spaceless %}
{% if errors|length > 0 %}
<ul class="errors">
<ul class="errors chill-form__errors">
{% for error in errors %}
<li>{{ error.message }}</li>
<li class="chill-form_errors__entry {% if 'severity' in error.cause.constraint.payload|keys %}chill-form__errors__entry--{{ error.cause.constraint.payload.severity }}{% endif %}">{{ error.message }}</li>
{% endfor %}
</ul>
{% endif %}
@@ -152,3 +165,21 @@
{{ form_row(form.order) }}
{% endblock %}
{% block chill_collection_widget %}
<div class="chill-collection">
<ul class="chill-collection__list" data-collection-name="{{ form.vars.name|escape('html_attr') }}" data-collection-identifier="{{ form.vars.identifier|escape('html_attr') }}" data-collection-button-remove-label="{{ form.vars.button_remove_label|trans|e }}" data-collection-allow-add="{{ form.vars.allow_add|escape('html_attr') }}" data-collection-allow-delete="{{ form.vars.allow_delete|escape('html_attr') }}" >
{% for entry in form %}
<li class="chill-collection__list__entry" data-collection-is-persisted="1">
<div>
{{ form_widget(entry) }}
</div>
</li>
{% endfor %}
</ul>
{% if form.vars.allow_add == 1 %}
<button class="chill-collection__button--add sc-button" data-collection-add-target="{{ form.vars.name|escape('html_attr') }}" data-form-prototype="{{ ('<div>' ~ form_widget(form.vars.prototype) ~ '</div>')|escape('html_attr') }}" >{{ form.vars.button_add_label|trans }}</button>
</div>
{% endif %}
{% endblock %}

View File

@@ -23,81 +23,16 @@
<title>
{{ 'Login to %installation_name%' | trans({ '%installation_name%' : installation.name } ) }}
</title>
<link rel="shortcut icon" href="/bundles/chillmain/img/favicon.ico" type="image/x-icon">
{% stylesheets output="css/login.css" filter="cssrewrite"
"bundles/chillmain/fonts/OpenSans/OpenSans.css" %}
<link rel="stylesheet" href="{{ asset_url }}"/>
{% endstylesheets %}
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
body {
background-color: #333;
color: white;
text-align: center;
}
#content {
position: relative;
height: 90%;
padding-top: 10%;
}
#content:before {
bottom: 0;
content: "";
left: 0;
opacity: 0.2;
position: absolute;
right: 0;
top: 0;
z-index: -1;
background-image: url("/bundles/chillmain/img/background/desert.jpg");
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}
label {
width : 15em;
text-align: right;
display: inline-block;
font-family: 'Open Sans';
font-weight: 300;
padding-right: 5px;
}
input {
}
form {
}
button {
margin-left: 15em;
margin-top: 1em;
background-color: #df4949;
border: medium none;
border-radius: 0;
box-shadow: none;
color: #fff;
padding: 4px 8px;
font-family: 'Open Sans';
font-weight: 300;
}
</style>
<link rel="shortcut icon" href="{{ asset('build/images/favicon.ico') }}" type="image/x-icon">
<link rel="stylesheet" href="{{ asset('build/login.css') }}"/>
</head>
<body>
<div id="content">
<img class="logo" src="/bundles/chillmain/img/logo-chill-outil-accompagnement_white.png">
<img class="logo" src="{{ asset('build/images/logo-chill-outil-accompagnement_white.png') }}">
<p>{{ error|trans }}</p>
{% if error is not null %}
<p>{{ error.message|trans }}</p>
{% endif %}
<form method="POST" action="{{ path('login_check') }}">
<label for="_username">{{ 'Username'|trans }}</label>

View File

@@ -21,16 +21,18 @@
<a href="javascript:void(0)" class="more">Sections</a>
</div>
<ul class="submenu width-15-em" style="padding-left: 0; padding-right: 0; background-color:transparent;">
{% for route in routes %}
{% for menu in menus %}
<li style="display:block; background-color: #333333; padding-left:1.5em; border-bottom:1px; border-bottom: 1px solid #FFF;padding-top:0; padding-bottom:0;">
<div style="margin-bottom:2px;">
<div style="font-family: 'Open Sans'; font-weight:300; font-size: 0.75em; text-align:left; height: 46px; display:inline-block; width: calc(100% - 5em - 1px); vertical-align:top;">
<a href="{{ path(route.key, args ) }}">{{ route.label|trans }}</a>
<a href="{{ menu.uri }}">{{ menu.label|trans }}</a>
</div>
<div style="background-color: #333333; text-align:center;width: 2em; margin-left:-0.15em; font-size:1.5em; color:#FFF; height: 46px; display:inline-block; vertical-align:top;float:right">{% spaceless %}
{% for icon in route.icons %}
{% if menu.extras.icons is defined %}
{% for icon in menu.extras.icons %}
<i class="fa fa-{{ icon }}"></i>
{% endfor %}
{% endif %}
{% endspaceless %}</div>
</div>
</li>

View File

@@ -1,5 +1,5 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
@@ -16,16 +16,27 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
<li class="nav-link2">
<li class="nav-link2 user-menu">
<div class="li-content">
<a href="javascript:void(0)" style="font-size: 0.8em; font-family: 'Open Sans'; font-weight:300;">
{{ 'Welcome' | trans }}<br/>
<b>{{ app.user.username }}</b>
<b>{{ app.user.username }}{{ render(controller('ChillMainBundle:UI:showNotificationUserCounter')) }}</b>
</a>
</div>
<ul class="submenu width-11-em">
{% for route in routes %}
<li><a href="{{ path(route.key, args ) }}" style="font-family: 'Open Sans'; font-weight:300; font-size: 0.9em;"><i class="fa fa-{{ route.icon }}"></i> {{ route.label|trans }}</a></li>
<ul class="submenu width-11-em user-menu-list" style="padding-left: 0; padding-right: 0; background-color:transparent;">
{% for menu in menus %}
<li style="display:block; background-color: #333333; padding-left:1.5em; border-bottom:1px; border-bottom: 1px solid #FFF;padding-top:0; padding-bottom:0;">
<div style="margin-bottom:2px;">
<div style="font-family: 'Open Sans'; font-weight:300; font-size: 0.75em; text-align:left; height: 46px; display:inline-block; width: calc(100% - 5em - 1px); vertical-align:top;">
<a href="{{ menu.uri }}">{{ menu.label|trans }}</a>
</div>
<div style="background-color: #333333; text-align:center;width: 2em; margin-left:-0.15em; font-size:1.5em; color:#FFF; height: 46px; display:inline-block; vertical-align:top;float:right">{% spaceless %}
{% if menu.extras.icon is defined %}
<i class="fa fa-{{ menu.extras.icon }}"></i>
{% endif %}
{% endspaceless %}</div>
</div>
</li>
{% endfor %}
</ul>
</li>

View File

@@ -0,0 +1 @@
{% if nb > 0 %}<span class="notification-counter">{{ nb }}{% endif %}

View File

@@ -8,6 +8,7 @@
{{ form_start(edit_form) }}
{{ form_row(edit_form.username) }}
{{ form_row(edit_form.email) }}
{{ form_row(edit_form.enabled, { 'label': "User'status"}) }}
{{ form_widget(edit_form.submit, { 'attr': { 'class' : 'sc-button green center' } } ) }}

View File

@@ -7,6 +7,7 @@
{{ form_start(form) }}
{{ form_row(form.username) }}
{{ form_row(form.email) }}
{{ form_row(form.plainPassword.password) }}
{{ form_widget(form.submit, { 'attr' : { 'class': 'sc-button blue' } }) }}
{{ form_end(form) }}

View File

@@ -1,5 +1,5 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
@@ -22,19 +22,13 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<head>
<meta charset="UTF-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ installation.name }} - {% block title %}{% endblock %}</title>
<link rel="shortcut icon" href="/bundles/chillmain/img/favicon.ico" type="image/x-icon">
{% stylesheets output="css/all.css" filter="cssrewrite"
"bundles/chillmain/css/scratch.css"
"bundles/chillmain/css/chillmain.css"
"bundles/chillmain/css/select2/select2.css"
"bundles/chillmain/fonts/OpenSans/OpenSans.css"
"bundles/chillmain/css/pikaday.css" %}
<link rel="stylesheet" href="{{ asset_url }}"/>
{% endstylesheets %}
<link rel="shortcut icon" href="{{ asset('build/images/favicon.ico') }}" type="image/x-icon">
<link rel="stylesheet" href="{{ asset('build/chill.css') }}"/>
{% block css%}<!-- nothing added to css -->{% endblock %}
</head>
@@ -43,7 +37,7 @@
<div class="grid-4 hide-tablet hide-mobile parent">
<div class="grid-10 push-2 grid-tablet-12 grid-mobile-12 push-tablet-0 grid-mobile-0 logo-container">
<a href="{{ path('chill_main_homepage') }}">
<img class="logo" src="/bundles/chillmain/img/logo-chill-sans-slogan_white.png">
<img class="logo" src="{{ asset('build/images/logo-chill-sans-slogan_white.png') }}">
</a>
</div>
</div>
@@ -107,7 +101,7 @@
</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('error') %}
<div class="grid-8 centered error flash_message">
<span>
@@ -115,14 +109,14 @@
</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('notice') %}
<div class="grid-8 centered notice flash_message">
<span>
{{ flashMessage|raw }}
</span>
</div>
{% endfor %}
{% endfor %}
{% block content %}
<div class="container">
@@ -137,12 +131,12 @@
</form>
</div>
</div>
<div class="homepage_widget">
{{ chill_widget('homepage', {} ) }}
</div>
{% endblock %}
</div>
</div>
{% endblock %}
</div>
@@ -150,16 +144,8 @@
<p>{{ 'This program is free software: you can redistribute it and/or modify it under the terms of the <strong>GNU Affero General Public License</strong>'|trans|raw }}
<br/> <a href="https://{{ app.request.locale }}.wikibooks.org/wiki/Chill">{{ 'User manual'|trans }}</a></p>
</footer>
{% javascripts output="js/libs.js"
"bundles/chillmain/js/jquery.js"
"bundles/chillmain/js/moment.js"
"bundles/chillmain/js/pikaday/pikaday.js"
"bundles/chillmain/js/select2/select2.js"
"bundles/chillmain/js/pikaday/plugins/pikaday.jquery.js"
"bundles/chillmain/js/chill.js" %}
<script src="{{ asset_url }}" type="text/javascript"></script>
{% endjavascripts %}
<script type="text/javascript" src="{{ asset('build/chill.js') }}"></script>
<script type="text/javascript">
chill.initPikaday('{{ app.request.locale }}');