Gitlab CSE Unil

Commit 5712b7c3 authored by M. Chardon's avatar M. Chardon
Browse files

correction bug affichage

parent 71c2cc3b
This diff is collapsed.
......@@ -361,6 +361,7 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$("#message_import_axis").addClass("alert-success");
$("#message_import_axis").removeClass("alert-danger");
$("#message_import_axis").removeClass("alert-warning");
$("#message_import_axis").fadeOut(5000);
//maj axe
var divAxis = "<div id='editpdlplus_toolbar_"
+ toolbar[0].axeid
......@@ -368,10 +369,14 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$('#editpdlplus_toolbars').append(divAxis);
var option = new Option(toolbar[0].axelabel, toolbar[0].axeid, true, true);
$("#editpdlplus_axes").append(option);
var axeOption = $("#editpdlplus_axes option[value='" + toolbar[0].axeid + "']");
axeOption.data('delete', 1);
var btr = $("#assignfeedback_editpdfplus_widget_admin_button_delaxis");
btr.addClass("disabled");
$('#editpdlplus_tool_item').html("");
//maj toolbar
for (var i = 0; i < toolbar.length; i++) {
if (toolbar[i].toolid && toolbar[i].toolid > 0) {
if (toolbar[0].toolid && toolbar[0].toolid > 0) {
for (var i = 0; i < toolbar.length; i++) {
var classButton = "btn-default";
if (toolbar[i].enable !== 1) {
classButton = "";
......@@ -400,16 +405,23 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
+ "</button>";
$("#editpdlplus_toolbar_" + toolbar[0].axeid).append(buttonTmp);
}
} else {
var axeid = toolbar[0].axeid;
var axeOption = $("#editpdlplus_axes option[value='" + axeid + "']");
axeOption.data('delete', 0);
var btr = $("#assignfeedback_editpdfplus_widget_admin_button_delaxis");
btr.removeClass("disabled");
}
$(".editpdlplus_tool").on("click", refreshToolView);
//maj visu
$("#editpdlplus_axes").change();
$("a[href^='#collapseadmin2'").click();
$("a[href^='#collapseadmin1'").click();
} else {
$("#message_import_axis").show();
$("#message_import_axis").html(toolbar[0].message);
$("#message_import_axis").addClass("alert-danger");
$("#message_import_axis").removeClass("alert-success");
$("#message_import_axis").fadeOut(5000);
}
}).fail(notification.exception);
}
......
......@@ -5,123 +5,121 @@
<div class="assignfeedback_editpdfplus_widget_admin">
<h5>{{# str }} adminsubtitle, assignfeedback_editpdfplus {{/ str }}</h5>
<div class="panel-group" id="adminAccordion">
<div class="panel panel-default">
<div class="panel-heading">
<a data-toggle="collapse" href="#collapseadmin1" data-parent="#adminAccordion">Importation axe</a>
</div>
<div id="collapseadmin1" class="panel-collapse collapse">
<div class="panel-body">
Axes disponibles à l'importation
{{{ axisimportform.render }}}
<input type="hidden" id="courseid" value="{{courseid}}" />
<table class='table table-bordered table-striped'>
<thead>
<tr>
<!--th>Cours / activité</th-->
<th>Nom</th>
<th>Outils</th>
<th>Importer</th>
</tr>
</thead>
<tbody>
{{# toolbarsDispo }}
<tr>
<!--td></td-->
<td>{{axis.label}}</td>
<td>
{{# tools }}
<button class="btn btn-default" style="{{style}}">
{{label}}
</button>
{{/ tools }}
</td>
<td><button class='btn btn-primary btn-sm btnimport' data-axis='{{axis.id}}'><i class='fa fa-download'></i></button></td>
</tr>
{{/ toolbarsDispo }}
</tbody>
</table>
</div>
<!--div class="panel-group" id="adminAccordion"-->
<div class="panel panel-default">
<div class="panel-heading">
<a data-toggle="collapse" href="#collapseadmin1" >Importation axe</a>
</div>
<div id="collapseadmin1" class="panel-collapse collapse">
<div class="panel-body">
Axes disponibles à l'importation
{{{ axisimportform.render }}}
<input type="hidden" id="courseid" value="{{courseid}}" />
<table class='table table-bordered table-striped'>
<thead>
<tr>
<!--th>Cours / activité</th-->
<th>Nom</th>
<th>Outils</th>
<th>Importer</th>
</tr>
</thead>
<tbody>
{{# toolbarsDispo }}
<tr>
<!--td></td-->
<td>{{axis.label}}</td>
<td>
{{# tools }}
<button class="btn btn-default" style="{{style}}">
{{label}}
</button>
{{/ tools }}
</td>
<td><button class='btn btn-primary btn-sm btnimport' data-axis='{{axis.id}}'><i class='fa fa-download'></i></button></td>
</tr>
{{/ toolbarsDispo }}
</tbody>
</table>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<a data-toggle="collapse" href="#collapseadmin2" data-parent="#adminAccordion">{{# str }} admincurrenttoolbar, assignfeedback_editpdfplus {{/ str }}</a>
<div class="panel panel-default">
<div class="panel-heading">
<a data-toggle="collapse" href="#collapseadmin2">{{# str }} admincurrenttoolbar, assignfeedback_editpdfplus {{/ str }}</a>
</div>
<div class="panel-body">
<div id="message_import_axis" class="alert" style="display:none;"></div>
<div class='row'>
<div class='col-sm-2'>
<h6>
{{# str }} adminaxis, assignfeedback_editpdfplus {{/ str }}
<button type="button" class="btn btn-default" id="assignfeedback_editpdfplus_widget_admin_button_addaxis">
<i class="fa fa-plus" aria-hidden="true"></i>
</button>
</h6>
</div>
<div class='col-sm-10' id='assignfeedback_editpdfplus_widget_admin_toolheader'>
<h6>
{{# str }} admintools, assignfeedback_editpdfplus {{/ str }}
<button type="button" class="btn btn-default" id="assignfeedback_editpdfplus_widget_admin_button_addtool">
<i class="fa fa-plus" aria-hidden="true"></i>
</button>
</h6>
</div>
</div>
<div id="collapseadmin2" class="panel-collapse collapse in">
<div class="panel-body">
<div id="message_import_axis" class="alert" style="display:none;"></div>
<div class='row'>
<div class='col-sm-2'>
<h6>
{{# str }} adminaxis, assignfeedback_editpdfplus {{/ str }}
<button type="button" class="btn btn-default" id="assignfeedback_editpdfplus_widget_admin_button_addaxis">
<i class="fa fa-plus" aria-hidden="true"></i>
</button>
</h6>
</div>
<div class='col-sm-10' id='assignfeedback_editpdfplus_widget_admin_toolheader'>
<h6>
{{# str }} admintools, assignfeedback_editpdfplus {{/ str }}
<button type="button" class="btn btn-default" id="assignfeedback_editpdfplus_widget_admin_button_addtool">
<i class="fa fa-plus" aria-hidden="true"></i>
</button>
</h6>
<div class='row' id='assignfeedback_editpdfplus_widget_admin_workspace'>
<div class='col-sm-2'>
<select id='editpdlplus_axes' class='form-control'>
{{# axis }}
<option value="{{id}}" data-delete="{{children}}">{{label}}</option>
{{/ axis }}
</select>
<div class="panel panel-default" id="axistool">
<div class="panel-body" style="text-align: center;">
<button type="button" class="btn btn-default" id="assignfeedback_editpdfplus_widget_admin_button_editaxis">
<i class="fa fa-pencil" aria-hidden="true"></i>
</button>
<button type="button" class="btn btn-default" id="assignfeedback_editpdfplus_widget_admin_button_delaxis">
<i class="fa fa-remove" aria-hidden="true"></i>
</button>
</div>
</div>
<div class='row' id='assignfeedback_editpdfplus_widget_admin_workspace'>
<div class='col-sm-2'>
<select id='editpdlplus_axes' class='form-control'>
{{# axis }}
<option value="{{id}}" data-delete="{{children}}">{{label}}</option>
{{/ axis }}
</select>
<div class="panel panel-default" id="axistool">
<div class="panel-body" style="text-align: center;">
<button type="button" class="btn btn-default" id="assignfeedback_editpdfplus_widget_admin_button_editaxis">
<i class="fa fa-pencil" aria-hidden="true"></i>
</button>
<button type="button" class="btn btn-default" id="assignfeedback_editpdfplus_widget_admin_button_delaxis">
<i class="fa fa-remove" aria-hidden="true"></i>
</button>
</div>
</div>
</div>
<div class='col-sm-10' id='assignfeedback_editpdfplus_widget_admin_toolworkspace'>
<div id='editpdlplus_toolbars'>
{{# toolbars }}
<div id="editpdlplus_toolbar_{{axis.id}}" class="btn-group toolbar" style="display: none;">
{{# tools }}
<button class="btn {{button}} editpdlplus_tool" id="editpdlplus_tool_{{id}}" value="{{id}}" style="{{style}}" data-enable="{{enabled}}">
{{label}}
</button>
{{/ tools }}
</div>
<div class='col-sm-10' id='assignfeedback_editpdfplus_widget_admin_toolworkspace'>
<div id='editpdlplus_toolbars'>
{{# toolbars }}
<div id="editpdlplus_toolbar_{{axis.id}}" class="btn-group toolbar" style="display: none;">
{{# tools }}
<button class="btn {{button}} editpdlplus_tool" id="editpdlplus_tool_{{id}}" value="{{id}}" style="{{style}}" data-enable="{{enabled}}">
{{label}}
</button>
{{/ tools }}
</div>
{{/ toolbars }}
</div>
{{/ toolbars }}
</div>
<div class="alert col-sm-5" id="message_edit_tool" style="margin-top: 10px;margin-bottom: 0px;display: none;"></div>
<div class="alert col-sm-5" id="message_edit_tool" style="margin-top: 10px;margin-bottom: 0px;display: none;"></div>
<div id="editpdlplus_tool_item" class="alert col-sm-12" style="margin-top: 0px;"></div>
<div id="editpdlplus_tool_item" class="alert col-sm-12" style="margin-top: 0px;"></div>
</div>
<div class='col-sm-10'>
<div id="assignfeedback_editpdfplus_widget_admin_div_addaxis" style="display:none;">
<div class="panel-body"></div>
</div>
<div id="assignfeedback_editpdfplus_widget_admin_div_editaxis" style="display:none;">
<div class="panel-body"></div>
</div>
<div id="assignfeedback_editpdfplus_widget_admin_div_delaxis" style="display:none;">
<div class="panel-body"></div>
</div>
</div>
</div>
<div class='col-sm-10'>
<div id="assignfeedback_editpdfplus_widget_admin_div_addaxis" style="display:none;">
<div class="panel-body"></div>
</div>
<div id="assignfeedback_editpdfplus_widget_admin_div_editaxis" style="display:none;">
<div class="panel-body"></div>
</div>
<div id="assignfeedback_editpdfplus_widget_admin_div_delaxis" style="display:none;">
<div class="panel-body"></div>
</div>
</div>
</div>
</div>
</div>
<!--/div-->
</div>
{{# js }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment