mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-62746 tag: Make forms in tag modals use proper BS classes
This commit is contained in:
parent
f61ee4e857
commit
d7ae1a92b1
2 changed files with 35 additions and 19 deletions
2
lib/amd/build/tag.min.js
vendored
2
lib/amd/build/tag.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -148,10 +148,12 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
|
||||||
{key: 'continue'},
|
{key: 'continue'},
|
||||||
{key: 'cancel'},
|
{key: 'cancel'},
|
||||||
]).done(function(s) {
|
]).done(function(s) {
|
||||||
var el = $('<div><form id="combinetags_form" class="form-inline">' +
|
var el = $('<div><form id="combinetags_form">' +
|
||||||
'<p class="description"></p><p class="options"></p>' +
|
'<div class="description"></div><div class="form-group options"></div>' +
|
||||||
'<p class="mdl-align"><input type="submit" class="btn btn-primary" id="combinetags_submit"/>' +
|
'<div class="form-group">' +
|
||||||
'<input type="button" class="btn btn-secondary" id="combinetags_cancel"/></p>' +
|
' <input type="submit" class="btn btn-primary" id="combinetags_submit"/>' +
|
||||||
|
' <input type="button" class="btn btn-secondary" id="combinetags_cancel"/>' +
|
||||||
|
'</div>' +
|
||||||
'</form></div>');
|
'</form></div>');
|
||||||
el.find('.description').html(s[1]);
|
el.find('.description').html(s[1]);
|
||||||
el.find('#combinetags_submit').attr('value', s[2]);
|
el.find('#combinetags_submit').attr('value', s[2]);
|
||||||
|
@ -160,8 +162,12 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
|
||||||
tags.each(function() {
|
tags.each(function() {
|
||||||
var tagid = $(this).val(),
|
var tagid = $(this).val(),
|
||||||
tagname = $('.inplaceeditable[data-itemtype=tagname][data-itemid=' + tagid + ']').attr('data-value');
|
tagname = $('.inplaceeditable[data-itemtype=tagname][data-itemid=' + tagid + ']').attr('data-value');
|
||||||
fldset.append($('<input type="radio" name="maintag" id="combinetags_maintag_' + tagid + '" value="' +
|
var option = '<div class="form-check">' +
|
||||||
tagid + '"/><label for="combinetags_maintag_' + tagid + '">' + tagname + '</label><br>'));
|
' <input type="radio" class="form-check-input" name="maintag" ' +
|
||||||
|
' id="combinetags_maintag_' + tagid + '" value="' + tagid + '"/>' +
|
||||||
|
' <label class="form-check-label" for="combinetags_maintag_' + tagid + '">' + tagname + '</label>' +
|
||||||
|
'</div>';
|
||||||
|
fldset.append($(option));
|
||||||
});
|
});
|
||||||
// TODO: MDL-57778 Convert to core/modal.
|
// TODO: MDL-57778 Convert to core/modal.
|
||||||
Y.use('moodle-core-notification-dialogue', function() {
|
Y.use('moodle-core-notification-dialogue', function() {
|
||||||
|
@ -218,13 +224,17 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
|
||||||
{key: 'continue'},
|
{key: 'continue'},
|
||||||
{key: 'cancel'},
|
{key: 'cancel'},
|
||||||
]).done(function(s) {
|
]).done(function(s) {
|
||||||
var el = $('<div><form id="addtags_form" class="form-inline" method="POST">' +
|
var el = $('<div><form id="addtags_form" method="POST">' +
|
||||||
'<input type="hidden" name="action" value="addstandardtag"/>' +
|
'<input type="hidden" name="action" value="addstandardtag"/>' +
|
||||||
'<input type="hidden" name="sesskey" value="' + M.cfg.sesskey + '"/>' +
|
'<input type="hidden" name="sesskey" value="' + M.cfg.sesskey + '"/>' +
|
||||||
'<p><label for="id_tagslist">' + s[1] + '</label>' +
|
'<div class="form-group">' +
|
||||||
'<input type="text" id="id_tagslist" name="tagslist"/></p>' +
|
' <label for="id_tagslist">' + s[1] + '</label>' +
|
||||||
'<p class="mdl-align"><input type="submit" class="btn btn-primary" id="addtags_submit"/>' +
|
' <input type="text" id="id_tagslist" class="form-control" name="tagslist"/>' +
|
||||||
'<input type="button" class="btn btn-secondary" id="addtags_cancel"/></p>' +
|
'</div>' +
|
||||||
|
'<div class="form-group">' +
|
||||||
|
' <input type="submit" class="btn btn-primary" id="addtags_submit"/>' +
|
||||||
|
' <input type="button" class="btn btn-secondary" id="addtags_cancel"/>' +
|
||||||
|
'</div>' +
|
||||||
'</form></div>');
|
'</form></div>');
|
||||||
el.find('#addtags_form').attr('action', window.location.href);
|
el.find('#addtags_form').attr('action', window.location.href);
|
||||||
el.find('#addtags_submit').attr('value', s[2]);
|
el.find('#addtags_submit').attr('value', s[2]);
|
||||||
|
@ -290,13 +300,19 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
|
||||||
{key: 'create'},
|
{key: 'create'},
|
||||||
{key: 'cancel'},
|
{key: 'cancel'},
|
||||||
]).done(function(s) {
|
]).done(function(s) {
|
||||||
var el = $('<div><form id="addtagcoll_form" class="form-inline">' +
|
var el = $('<div><form id="addtagcoll_form">' +
|
||||||
'<p><label for="addtagcoll_name"></label>: ' +
|
'<div class="form-group">' +
|
||||||
'<input id="addtagcoll_name" type="text"/></p>' +
|
' <label for="addtagcoll_name"></label> ' +
|
||||||
'<p><label for="addtagcoll_searchable"></label>: ' +
|
' <input id="addtagcoll_name" type="text" class="form-control"/> ' +
|
||||||
'<input id="addtagcoll_searchable" type="checkbox" value="1" checked/></p>' +
|
'</div>' +
|
||||||
'<p class="mdl-align"><input type="submit" class="btn btn-primary" id="addtagcoll_submit"/>' +
|
'<div class="form-group form-check">' +
|
||||||
'<input type="button" class="btn btn-secondary" id="addtagcoll_cancel"/></p>' +
|
' <input id="addtagcoll_searchable" type="checkbox" value="1" checked class="form-check-input"/>' +
|
||||||
|
' <label for="addtagcoll_searchable" class="form-check-label"></label>' +
|
||||||
|
'</div>' +
|
||||||
|
'<div class="form-group">' +
|
||||||
|
' <input type="submit" class="btn btn-primary" id="addtagcoll_submit"/>' +
|
||||||
|
' <input type="button" class="btn btn-secondary" id="addtagcoll_cancel"/>' +
|
||||||
|
'</div>' +
|
||||||
'</form></div>');
|
'</form></div>');
|
||||||
el.find('label[for="addtagcoll_name"]').html(s[1]);
|
el.find('label[for="addtagcoll_name"]').html(s[1]);
|
||||||
el.find('label[for="addtagcoll_searchable"]').html(s[2]);
|
el.find('label[for="addtagcoll_searchable"]').html(s[2]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue