mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
Merge branch 'master' into PHRAS-2989-Prod-detailed-view-basket
This commit is contained in:
@@ -11,7 +11,11 @@
|
||||
<span class="expiredDate">
|
||||
{% if basket.getValidation() %}
|
||||
{% set dateExpired = app['date-formatter'].getPrettyString(basket.getValidation().getExpires()) %}
|
||||
{{ 'workzone:feedback:expiration' | trans }} : {{ dateExpired }}
|
||||
{% if date(dateExpired) < date() %}
|
||||
<span>{{ 'workzone:feedback:expiration-closed' | trans }} :</span>
|
||||
{% else %}
|
||||
<span>{{ 'workzone:feedback:expiration-open' | trans }} :</span>
|
||||
{% endif %} {{ dateExpired }}
|
||||
{% endif %}
|
||||
</span>
|
||||
<div style="margin:5px 0;max-height:160px;overflow:hidden;text-overflow:ellipsis;">
|
||||
|
@@ -1,4 +1,4 @@
|
||||
|
||||
<script src="https://rawgithub.com/trentrichardson/jQuery-Timepicker-Addon/master/jquery-ui-timepicker-addon.js"></script>
|
||||
<div>
|
||||
<button class="tools-accordion">Actions</button>
|
||||
<div class="tools-panel">
|
||||
@@ -99,15 +99,21 @@
|
||||
</p>
|
||||
<div class="record-number"> {% trans with {'%nb_records%' : nb_records} %}%nb_records% records{% endtrans %}</div>
|
||||
|
||||
{% set dateExpired = app['date-formatter'].getPrettyString(basket.getValidation().getExpires()) %}
|
||||
{% set dateExpired = app['date-formatter'].getTranslatedDate(basket.getValidation().getExpires()) %}
|
||||
<div class="expiredDate">
|
||||
<span>{{ 'workzone:feedback:expiration' | trans }} :</span>
|
||||
{% if date(dateExpired) < date() %}
|
||||
<span>{{ 'workzone:feedback:expiration-closed' | trans }} :</span>
|
||||
{% else %}
|
||||
<span>{{ 'workzone:feedback:expiration-open' | trans }} :</span>
|
||||
{% endif %}
|
||||
|
||||
<form class="update-feed-validation">
|
||||
<input type="hidden" name="feedback-id" value={{ basket.getValidation().getId}} />
|
||||
<input type="hidden" name="feedback-deadline-format" class="alternate" />
|
||||
<input type="text" class="btn datepicker" name="feedback-deadline" value="{{ dateExpired }}">
|
||||
<button type="submit" class="submit" title="{{ 'workzone:feedback:update' | trans }}"><i class="fa fa-save"></i></button>
|
||||
<input type="hidden" name="feedbackId" value={{ basket.getId}} />
|
||||
<input type="hidden" name="feedbackDate" class="alternate" />
|
||||
<input type="text" class="btn feed-datepicker" name="feedback-deadline" value="{{ dateExpired }}">
|
||||
<button type="submit" class="submit hidden submit-validation" title="{{ 'workzone:feedback:update' | trans }}"><i class="fa fa-save"></i></button>
|
||||
</form>
|
||||
<p class="message text-right" style="opacity: 0;transition: all 0.2s; color: green; display: block; ">{{ 'prod:workzone:basket:updated-message' | trans }}</p>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
@@ -135,7 +141,25 @@
|
||||
<script type="text/javascript">
|
||||
$( ".update-feed-validation" ).on( "submit", function( event ) {
|
||||
event.preventDefault();
|
||||
console.log( $( this ).serialize() );
|
||||
var formData = $(this).serializeArray();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/prod/push/update-expiration/',
|
||||
data: {
|
||||
basket_id: formData[0].value,
|
||||
date: formData[1].value
|
||||
},
|
||||
beforeSend: function() {
|
||||
console.log(formData[0].value);
|
||||
console.log(formData[1].value);
|
||||
},
|
||||
success: function (data) {
|
||||
$('.message').css('opacity',1);
|
||||
$('.submit-validation').addClass('hidden');
|
||||
setTimeout(function(){ $('.message').css('opacity',0); }, 2000);
|
||||
},
|
||||
});
|
||||
});
|
||||
$( function() {
|
||||
$.datepicker.regional['default'] = {
|
||||
@@ -149,11 +173,15 @@
|
||||
dayNamesMin: [ "D","L","M","M","J","V","S" ],
|
||||
dateFormat: "d MM yy",
|
||||
altField: ".alternate",
|
||||
altFormat: "yy-mm-dd"
|
||||
altFormat: "yy-mm-dd",
|
||||
minDate: 0
|
||||
|
||||
};
|
||||
|
||||
$( ".datepicker" ).datepicker( $.datepicker.regional[ 'default' ]);
|
||||
$(".feed-datepicker" ).datepicker( $.datepicker.regional[ 'default' ]);
|
||||
$(".feed-datepicker" ).change(function() {
|
||||
$('.submit-validation').removeClass('hidden');
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user