Commit 6a6d1e8a authored by Liam Sharpe's avatar Liam Sharpe Committed by Robert Lyon
Browse files

Rearranged the button layout of the secretURL page - Bug #1543337

Also added the chevron icon spin so to indicate if item is expanded or
not

behatnotneeded

Change-Id: I3eaa5d1fa22730abbb4c8ce1dab6a1b1b0bccb9c
parent 04190483
......@@ -357,3 +357,19 @@
#needprotocols {
padding-left: 10px;
}
.secreturls.table .list-group {
.btn-group.btn-group-top {
margin-top: -8px;
}
.collapse-indicator.open .icon-chevron-down {
transform: rotate(-180deg);
transition-duration: 0.3s;
padding: 0 5px 0 0;
}
.collapse-indicator.closed .icon-chevron-down {
transform: rotate(0deg);
transition-duration: 0.3s;
padding: 0 0 0 5px;
}
}
......@@ -20,24 +20,26 @@
<table class="secreturls table">
<tbody>
{foreach from=$editurls item=item name=urls}
<tr class="{cycle values='r0,r1' advance=false}">
<tr class="{cycle values='r0,r1' advance=false} list-group">
<td>
{$item.deleteform|safe}
</td>
<td>
<a id="copytoclipboard-{$item.id}" data-clipboard-text="{$item.url}" class="url-copytoclipboardbutton btn btn-default" title="{str tag=copytoclipboard}" href="#">
<span class="icon icon-files-o icon-lg" role="presentation" aria-hidden="true"></span>
<span class="sr-only">{str tag=copytoclipboard}</span>
</a>
<strong>{$item.url}</strong>
</td>
<td class="control-buttons">
<a id="edit-{$item.id}" class="url-open-editform nojs-hidden-inline btn btn-default" title="{str tag=edit}" href="">
<span class="icon icon-pencil icon-lg" role="presentation" aria-hidden="true"></span>
<span class="icon icon-chevron-down right" role="presentation" aria-hidden="true"></span>
<span class="sr-only">{str tag=edit}</span>
</a>
<td>
<div class="btn-top-right btn-group btn-group-top">
<a id="copytoclipboard-{$item.id}" data-clipboard-text="{$item.url}" class="url-copytoclipboardbutton btn btn-default btn-xs" title="{str tag=copytoclipboard}" href="#">
<span class="icon icon-files-o icon-lg" role="presentation" aria-hidden="true"></span>
<span class="sr-only">{str tag=copytoclipboard}</span>
</a>
<a id="edit-{$item.id}" class="url-open-editform nojs-hidden-inline btn btn-default btn-xs closed" title="{str tag=edit}" href="">
<span class="icon icon-pencil icon-lg" role="presentation" aria-hidden="true"></span>
<span class="icon icon-chevron-down right" role="presentation" aria-hidden="true"></span>
<span class="sr-only">{str tag=edit}</span>
</a>
{$item.deleteform|safe}
</div>
</td>
</tr>
<tr class="editrow {cycle} url-editform js-hidden" id="edit-{$item.id}-form">
<td colspan=3>
......
......@@ -127,7 +127,7 @@ for ($i = 0; $i < count($records); $i++) {
'name' => 'deleteurl_' . $i,
'successcallback' => 'deleteurl_submit',
'renderer' => 'div',
'class' => 'form-as-button form-inline pull-left',
'class' => 'form-as-button btn-group form-inline pull-left',
'renderelementsonly' => true,
'elements' => array(
'token' => array(
......@@ -137,10 +137,10 @@ for ($i = 0; $i < count($records); $i++) {
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default',
'class' => 'btn-default btn-xs',
'elementtitle' => get_string('delete'),
'confirm' => get_string('reallydeletesecreturl', 'view'),
'value' => '<span class="icon icon-trash icon-lg text-danger" role="presentation" aria-hidden="true"></span><span class="sr-only">' . get_string('delete') . '</span>',
'value' => '<span class="icon icon-trash text-danger icon-lg" role="presentation" aria-hidden="true"></span><span class="sr-only">' . get_string('delete') . '</span>',
),
),
)),
......@@ -280,6 +280,9 @@ $js .= <<<EOF
jQuery(function($) {
$('.url-open-editform').click(function(e) {
e.preventDefault();
$('#' + this.id).addClass('collapse-indicator');
$('#' + this.id).toggleClass('open');
$('#' + this.id).toggleClass('closed');
$('#' + this.id + '-form').toggleClass('js-hidden');
});
});
......
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