Commit dd18d93c authored by Liam Sharpe's avatar Liam Sharpe Committed by Aaron Wells

Fix buttons in admin area are now fa (bootstrap)

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: Ie12353b9d57fa6ebe53fe387488420fec88f8919
parent 76abfc58
......@@ -71,7 +71,7 @@ function displaymenuitems(data) {
var rows = map(formatrow,itemlist);
var form = FORM({'id':'form','method':'post','enctype':'multipart/form-data',
'encoding':'multipart/form-data'},
TABLE({'class':'nohead'},TBODY(null,[thead,rows,addform()])));
TABLE({'class':'nohead table'},TBODY(null,[thead,rows,addform()])));
replaceChildNodes($('menuitemlist'),form);
if (data.focusid) {
$('item' + data.focusid).focus();
......@@ -80,18 +80,40 @@ function displaymenuitems(data) {
// Creates one table row
function formatrow (item) {
// item has id, type, name, link, linkedto
var edit = INPUT({'id':'item' + item.id,'type':'image','src':config.theme['images/btn_edit.png'],
'title':{$getstring['edit']},'alt':{$getstring['editspecific']}.replace('%s', item.name)});
// item has class, id, type, name, link, linkedto
var edit = BUTTON({
'class':'btn btn-default btn-sm',
'id':'item' + item.id,
'type':'button',
'title':{$getstring['edit']},
'alt':{$getstring['editspecific']}.replace('%s', item.name)},
SPAN({'class':'fa fa-cog'}),
SPAN({'class':'sr-only'}, {$getstring['editspecific']}.replace('%s', item.name))
);
connect(edit, 'onclick', function (e) { e.stop(); edititem(item); });
var del = INPUT({'type':'image','src':config.theme['images/btn_deleteremove.png'],
'title':{$getstring['delete']},'alt':{$getstring['deletespecific']}.replace('%s', item.name)});
var del = BUTTON({
'class':'btn btn-default btn-sm',
'id':'item' + item.id,
'type':'button',
'title':{$getstring['delete']},
'alt':{$getstring['deletespecific']}.replace('%s', item.name)},
SPAN({'class':'fa fa-trash text-danger'}),
SPAN({'class':'sr-only'}, {$getstring['deletespecific']}.replace('%s', item.name))
);
connect(del, 'onclick', function (e) { e.stop(); delitem(item.id); });
var buttongroup = SPAN({'class': 'btn-group'}, edit, del);
var cells = map(
partial(TD,null),
[
item.name,
[edit,' ',del]
[buttongroup]
]
);
return TR({'id':'menuitem_'+item.id},cells);
......
......@@ -28,16 +28,26 @@ $data = build_grouplist_html($query, $limit, $offset);
$searchform = pieform(array(
'name' => 'search',
'renderer' => 'oneline',
'renderer' => 'div',
'class' => 'form-inline',
'elements' => array(
'query' => array(
'type' => 'text',
'defaultvalue' => $query,
),
'submit' => array(
'class' => 'btn btn-success',
'type' => 'submit',
'value' => get_string('search'),
'inputgroup' => array(
'type' => 'fieldset',
'title' => get_string('Query') . ': ',
'class' => 'input-group form-inline',
'elements' => array(
'query' => array(
'type' => 'text',
'class' => 'form-control',
'defaultvalue' => $query,
),
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-success input-group-btn',
'value' => get_string('search'),
)
),
),
),
));
......
......@@ -14,10 +14,10 @@
<td>{$group->visibility}</td>
<td class="right">
<a class="mrl" title="{str tag="groupmanage" section="admin"}" href="{$WWWROOT}admin/groups/manage.php?id={$group->id}">
<span class="fa fa-cog mrs"></span>{str(tag=groupmanagespecific section=admin arg1=$group->name)|escape:html|safe}
<span class="fa fa-cog fa-lg"></span><span class="sr-only">{str(tag=groupmanagespecific section=admin arg1=$group->name)|escape:html|safe}</span>
</a>
<a title="{str tag="delete"}" href="{$WWWROOT}admin/groups/delete.php?id={$group->id}">
<span class="fa fa-trash text-danger prs"></span>{str(tag=deletespecific arg1=$group->name)|escape:html|safe}
<span class="fa fa-trash text-danger fa-lg"></span><span class="sr-only">{str(tag=deletespecific arg1=$group->name)|escape:html|safe}</span>
</a>
</td>
</tr>
......
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