mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Fix #993 Add send basket validation report in mobile view
This commit is contained in:
@@ -5,12 +5,12 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
<title>{{ app['phraseanet.registry'].get('GV_homeTitle') }} - {{ module_name }} </title>
|
||||
<link rel="stylesheet" href="{{ path('minifier', { 'f' : 'include/jslibs/jquery.mobile-1.0a4/jquery.mobile-1.0a4.min.css' }) }}" />
|
||||
<link rel="stylesheet" href="{{ path('minifier', { 'f' : 'include/jslibs/jquery.mobile-1.2.1/jquery.mobile-1.2.1.css' }) }}" />
|
||||
<script src="{{ path('minifier', { 'f' : 'assets/jquery/jquery.js' }) }}"></script>
|
||||
<script src="{{ path('minifier', { 'f' : 'nclude/jslibs/jquery.mobile-1.2.1/jquery.mobile-1.2.1.js' }) }}"></script>
|
||||
{% block stylesheet %}{% endblock %}
|
||||
{% block icon %}{% endblock %}
|
||||
{% block javascript %}{% endblock %}
|
||||
<script src="{{ path('minifier', { 'f' : 'include/jslibs/jquery.mobile-1.0a4/jquery.mobile-1.0a4.js' }) }}"></script>
|
||||
</head>
|
||||
<body>
|
||||
{% block content %}{% endblock %}
|
||||
|
@@ -2,6 +2,11 @@
|
||||
{% extends "common/index.html.twig" %}
|
||||
|
||||
{% block javascript %}
|
||||
<script type="text/javascript">
|
||||
{% if basket.getValidation() %}
|
||||
var releasable = {% if basket.getValidation().getParticipant(app['authentication'].getUser(), app).isReleasable() %}"{% trans 'Do you want to send your report ?' %}"{% else %}false{% endif %}
|
||||
{% endif %}
|
||||
</script>
|
||||
<script type="text/javascript" src="{{ path('minifier', { 'f' : 'skins/lightbox/jquery.validator.mobile.js' }) }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -17,6 +22,7 @@
|
||||
<a rel="external" href="{{ path('lightbox') }}" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">{% trans 'Home' %}</a>
|
||||
</div>
|
||||
<div data-role="content">
|
||||
<input type="hidden" id="basket_validation_id" value="{{ basket.getId() }}">
|
||||
<p>
|
||||
{% set basket_length = basket.getElements().count() %}
|
||||
{% trans %}{{basket_length}} documents{% endtrans %}
|
||||
@@ -37,7 +43,12 @@
|
||||
</ul>
|
||||
</div>
|
||||
<div data-role="footer">
|
||||
|
||||
{% if basket.getValidation() and basket.getValidation().getParticipant(app['authentication'].getUser(), app).getCanAgree() %}
|
||||
<button class="confirm_report" style="width:100%;" title="{% trans 'validation::envoyer mon rapport'%}">
|
||||
{% trans 'validation::envoyer mon rapport'%}
|
||||
<img src="/skins/icons/loader1F1E1B.gif" style="visibility:hidden;" class="loader"/>
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@@ -2,11 +2,50 @@ $(document).ready(function(){
|
||||
if(typeof validator_loaded === 'boolean')
|
||||
return;
|
||||
|
||||
|
||||
|
||||
$('.confirm_report').live('click',function(){
|
||||
var $this = $(this);
|
||||
|
||||
$('.loader', $this).css({
|
||||
visibility:'visible'
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/lightbox/ajax/SET_RELEASE/" + $('#basket_validation_id').val() + "/",
|
||||
dataType: 'json',
|
||||
error: function(data) {
|
||||
$('.loader', $this).css({
|
||||
visibility: 'hidden'
|
||||
});
|
||||
},
|
||||
timeout: function(data) {
|
||||
$('.loader', $this).css({
|
||||
visibility: 'hidden'
|
||||
});
|
||||
},
|
||||
success: function(data) {
|
||||
$('.loader', $this).css({
|
||||
visibility: 'hidden'
|
||||
});
|
||||
if (data.datas) {
|
||||
alert(data.datas);
|
||||
}
|
||||
if (!data.error) {
|
||||
releasable = false;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.agreement_radio').live('vmousedown', function(){
|
||||
var sselcont_id = $(this).attr('for').split('_').pop();
|
||||
var agreement = $('#' + $(this).attr('for')).val() == 'yes' ? '1' : '-1';
|
||||
|
||||
$.mobile.pageLoading();
|
||||
$.mobile.loading();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@@ -17,11 +56,11 @@ $(document).ready(function(){
|
||||
},
|
||||
error: function(datas){
|
||||
alert('error');
|
||||
$.mobile.pageLoading(true);
|
||||
$.mobile.loading();
|
||||
},
|
||||
timeout: function(datas){
|
||||
alert('error');
|
||||
$.mobile.pageLoading(true);
|
||||
$.mobile.loading();
|
||||
},
|
||||
success: function(datas){
|
||||
if(!datas.error)
|
||||
@@ -30,12 +69,14 @@ $(document).ready(function(){
|
||||
$('.valid_choice_'+sselcont_id).removeClass('disagree').addClass('agree');
|
||||
else
|
||||
$('.valid_choice_'+sselcont_id).removeClass('agree').addClass('disagree');
|
||||
$.mobile.pageLoading(true);
|
||||
$.mobile.loading();
|
||||
if(datas.error)
|
||||
{
|
||||
alert(datas.datas);
|
||||
return;
|
||||
}
|
||||
|
||||
releasable = datas.release;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -50,7 +91,7 @@ $(document).ready(function(){
|
||||
$('.note_area_validate').live('click', function(){
|
||||
var sselcont_id = $(this).closest('form').find('input[name="sselcont_id"]').val();
|
||||
|
||||
$.mobile.pageLoading();
|
||||
$.mobile.loading();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/lightbox/ajax/SET_NOTE/"+sselcont_id+"/",
|
||||
@@ -60,14 +101,14 @@ $(document).ready(function(){
|
||||
},
|
||||
error: function(datas){
|
||||
alert('error');
|
||||
$.mobile.pageLoading(true);
|
||||
$.mobile.loading();
|
||||
},
|
||||
timeout: function(datas){
|
||||
alert('error');
|
||||
$.mobile.pageLoading(true);
|
||||
$.mobile.loading();
|
||||
},
|
||||
success: function(datas){
|
||||
$.mobile.pageLoading(true);
|
||||
$.mobile.loading();
|
||||
if(datas.error)
|
||||
{
|
||||
alert(datas.datas);
|
||||
|
Reference in New Issue
Block a user