mirror of
https://github.com/moodle/moodle.git
synced 2025-04-24 09:55:33 +02:00
MDL-62746 tag: Make forms in tag modals use proper BS classes
This commit is contained in:
parent
f61ee4e857
commit
d7ae1a92b1
lib/amd
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: 'cancel'},
|
||||
]).done(function(s) {
|
||||
var el = $('<div><form id="combinetags_form" class="form-inline">' +
|
||||
'<p class="description"></p><p class="options"></p>' +
|
||||
'<p class="mdl-align"><input type="submit" class="btn btn-primary" id="combinetags_submit"/>' +
|
||||
'<input type="button" class="btn btn-secondary" id="combinetags_cancel"/></p>' +
|
||||
var el = $('<div><form id="combinetags_form">' +
|
||||
'<div class="description"></div><div class="form-group options"></div>' +
|
||||
'<div class="form-group">' +
|
||||
' <input type="submit" class="btn btn-primary" id="combinetags_submit"/>' +
|
||||
' <input type="button" class="btn btn-secondary" id="combinetags_cancel"/>' +
|
||||
'</div>' +
|
||||
'</form></div>');
|
||||
el.find('.description').html(s[1]);
|
||||
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() {
|
||||
var tagid = $(this).val(),
|
||||
tagname = $('.inplaceeditable[data-itemtype=tagname][data-itemid=' + tagid + ']').attr('data-value');
|
||||
fldset.append($('<input type="radio" name="maintag" id="combinetags_maintag_' + tagid + '" value="' +
|
||||
tagid + '"/><label for="combinetags_maintag_' + tagid + '">' + tagname + '</label><br>'));
|
||||
var option = '<div class="form-check">' +
|
||||
' <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.
|
||||
Y.use('moodle-core-notification-dialogue', function() {
|
||||
@ -218,13 +224,17 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
|
||||
{key: 'continue'},
|
||||
{key: 'cancel'},
|
||||
]).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="sesskey" value="' + M.cfg.sesskey + '"/>' +
|
||||
'<p><label for="id_tagslist">' + s[1] + '</label>' +
|
||||
'<input type="text" id="id_tagslist" name="tagslist"/></p>' +
|
||||
'<p class="mdl-align"><input type="submit" class="btn btn-primary" id="addtags_submit"/>' +
|
||||
'<input type="button" class="btn btn-secondary" id="addtags_cancel"/></p>' +
|
||||
'<div class="form-group">' +
|
||||
' <label for="id_tagslist">' + s[1] + '</label>' +
|
||||
' <input type="text" id="id_tagslist" class="form-control" name="tagslist"/>' +
|
||||
'</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>');
|
||||
el.find('#addtags_form').attr('action', window.location.href);
|
||||
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: 'cancel'},
|
||||
]).done(function(s) {
|
||||
var el = $('<div><form id="addtagcoll_form" class="form-inline">' +
|
||||
'<p><label for="addtagcoll_name"></label>: ' +
|
||||
'<input id="addtagcoll_name" type="text"/></p>' +
|
||||
'<p><label for="addtagcoll_searchable"></label>: ' +
|
||||
'<input id="addtagcoll_searchable" type="checkbox" value="1" checked/></p>' +
|
||||
'<p class="mdl-align"><input type="submit" class="btn btn-primary" id="addtagcoll_submit"/>' +
|
||||
'<input type="button" class="btn btn-secondary" id="addtagcoll_cancel"/></p>' +
|
||||
var el = $('<div><form id="addtagcoll_form">' +
|
||||
'<div class="form-group">' +
|
||||
' <label for="addtagcoll_name"></label> ' +
|
||||
' <input id="addtagcoll_name" type="text" class="form-control"/> ' +
|
||||
'</div>' +
|
||||
'<div class="form-group form-check">' +
|
||||
' <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>');
|
||||
el.find('label[for="addtagcoll_name"]').html(s[1]);
|
||||
el.find('label[for="addtagcoll_searchable"]').html(s[2]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user