cartads: finish moving style out of cartads template, to .scss file (#35337)

This commit is contained in:
Frédéric Péters 2019-09-17 10:01:16 +02:00
parent 69c826c168
commit f8cce79004
3 changed files with 22 additions and 21 deletions

View File

@ -1,22 +1,23 @@
div.template-pieces-cartads {
div.piece {
button.plus {
margin-top: 60px;
&:disabled {
display: none;
}
@media screen and (max-width: $very-small-limit) {
margin-top: 0;
margin-bottom: 2rem;
}
div.cartads-piece {
div.file-upload-widget {
margin-bottom: 1rem;
}
button.plus {
margin-top: 60px;
&:disabled {
display: none;
}
div.title + div.file-upload-widget + div.file-upload-widget + div.file-upload-widget + div.button-plus {
// special case when there are three file upload
// widgets and the + button goes to a new line
button {
margin-top: 0;
margin-bottom: 2rem;
}
@media screen and (max-width: $very-small-limit) {
margin-top: 0;
margin-bottom: 2rem;
}
}
div.title + div.file-upload-widget + div.file-upload-widget + div.file-upload-widget + div.button-plus {
// special case when there are three file upload
// widgets and the + button goes to a new line
button {
margin-top: 0;
margin-bottom: 2rem;
}
}
}

View File

@ -29,7 +29,7 @@ $('button.plus').on('click', function() {
$file_button.removeClass('has-file').addClass('has-no-file');
$(this).parent().before($file_button);
$file_button.each($.WcsFileUpload.prepare);
if ($(this).parents('.piece').find('.file-upload-widget').length == 6) {
if ($(this).parents('.cartads-piece').find('.file-upload-widget').length == 6) {
$(this).attr('disabled', true);
}
return false;

View File

@ -1,10 +1,10 @@
{% load i18n %}
<div class="piece">
<div class="cartads-piece">
<div class="title grid-1-1 newline">{% if piece.codePiece %}{{ piece.codePiece }} - {% endif %}{{ piece.text }}
{% if piece.reglementaire %}<span class="required">*</span>{% endif %}</div>
{% for file in piece.files %}
<div class="file-upload-widget short {{ grid }} {% if file.token %}has-file{% endif %}" style="margin-bottom: 1rem">
<div class="file-upload-widget short {{ grid }} {% if file.token %}has-file{% endif %}">
<div class="file-button">
<input type="file" data-url="{{ file.url }}"
{% if not piece.codePiece %}accept="application/pdf"{% endif %}>