Commit 3d00920c authored by Liam Sharpe's avatar Liam Sharpe Committed by Robert Lyon
Browse files

Made the copy page/collection buttons smaller - Bug #1570680

Note: the buttons are currently not displayed as a button group

behatnotneeded

Change-Id: I5d2e3cfe0bcdd8017885b058ec5cf33c61583846
parent aa8c6760
......@@ -6418,7 +6418,7 @@ function create_view_form($group=null, $institution=null, $template=null, $colle
$form['elements']['submitcollection'] = array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default',
'class' => 'btn-default btn-xs last btn-group-item',
'value' => get_string('copycollection', 'collection'),
);
}
......@@ -6427,8 +6427,8 @@ function create_view_form($group=null, $institution=null, $template=null, $colle
'type' => 'hidden',
'value' => $template,
);
$form['elements']['submit']['value'] = '<span class="icon icon-lg icon-files-o" role="presentation"></span><span class="sr-only">' . get_string('copyview', 'view') . '</span>';
$form['elements']['submit']['class'] = 'btn-default';
$form['elements']['submit']['value'] = get_string('copyview', 'view');
$form['elements']['submit']['class'] = 'btn-default btn-xs btn-group-item';
$form['name'] .= $template;
}
return $form;
......
......@@ -15,31 +15,47 @@
}
}
.btn-group .form-as-button div.last {
display: inline-block;
margin: 0;
padding: 0;
.btn {
border-left:0;
.btn-group .form-as-button {
div:first-child {
display: inline-block;
}
div.last {
display: inline-block;
border-bottom-left-radius: 0;
border-top-left-radius: 0;
margin: 0;
padding: 0;
.action-list-copy & {
margin-left: -4px;
}
.btn {
border-left: 0;
display: inline-block;
border-bottom-left-radius: 0;
border-top-left-radius: 0;
border-top-right-radius: 3px !important;
border-bottom-right-radius: 3px !important;
}
}
}
// Btn-group works when there are multiple elements eg a, form, button
.group-item:not(:first-child),
.btn-group-item:not(:first-child) {
margin-left: -1px;
}
.group-item,
.btn-group-item {
&.btn,
.btn {
border-right-width: 1px !important; // Overriding standard styling above
padding-top: 3px !important; // Override standard btn padding
}
&:only-of-type .btn {
border-radius: 3px !important;
}
}
.btn-group.only-button .btn {
border-bottom-right-radius: 3px !important;
border-right-width: 1px !important;
}
}
\ No newline at end of file
......@@ -151,6 +151,10 @@ td.btn-group {
min-width: 300px;
}
td.action-list-copy {
min-width: 195px;
}
// Often the same template is used to render buttons at the top of the page and
// in a list group. cf. groups table/groups
.list-group,
......
{if $results}
<table class="table fullwidth">
<thead>
<tr>
<th>{str tag=collectiontitle section=collection}</th>
<th>{str tag=viewname section=view}</th>
<th>{str tag=Owner section=view}</th>
<th></th>
</tr>
</thead>
<tbody>
{foreach from=$results item=row}
<tr>
<td>
{if $row.collid}
<h3 class="title"><a class="collectionlink" href="{$WWWROOT}view/view.php?id={$row.id}">{$row.name}</a></h3>
{/if}
</td>
<td>
<h3 class="title"><a class="viewlink" href="{$WWWROOT}view/view.php?id={$row.id}">{$row.title}</a></h3>
</td>
{if $row.institution}
<td class="owner">
{$row.sharedby}
</td>
{elseif $row.group}
<td class="owner">
<a class="grouplink" href="{$row.groupdata->homeurl}">{$row.sharedby}</a>
</td>
{elseif $row.owner}
<td class="ownericon">
<a class="userlink" href="{profile_url($row.user, true, true)}">
<img src="{profile_icon_url user=$row.user maxwidth=20 maxheight=20}" alt="{str tag=profileimagetext arg1=$row.user|display_default_name}" class="profile-icon-container">
{$row.sharedby}
</a>
</td>
{else}
<td class="owner">-</td>
{/if}
<td>
{$row.form|safe}
</td>
</tr>
{/foreach}
</tbody>
</table>
<div class="table-responsive">
<table class="table fullwidth">
<thead>
<tr>
<th>{str tag=collectiontitle section=collection}</th>
<th>{str tag=viewname section=view}</th>
<th>{str tag=Owner section=view}</th>
<th></th>
</tr>
</thead>
<tbody>
{foreach from=$results item=row}
<tr>
<td>
{if $row.collid}
<h3 class="title"><a class="collectionlink" href="{$WWWROOT}view/view.php?id={$row.id}">{$row.name}</a></h3>
{/if}
</td>
<td>
<h3 class="title"><a class="viewlink" href="{$WWWROOT}view/view.php?id={$row.id}">{$row.title}</a></h3>
</td>
{if $row.institution}
<td class="owner">
{$row.sharedby}
</td>
{elseif $row.group}
<td class="owner">
<a class="grouplink" href="{$row.groupdata->homeurl}">{$row.sharedby}</a>
</td>
{elseif $row.owner}
<td class="ownericon">
<a class="userlink" href="{profile_url($row.user, true, true)}">
<img src="{profile_icon_url user=$row.user maxwidth=20 maxheight=20}" alt="{str tag=profileimagetext arg1=$row.user|display_default_name}" class="profile-icon-container">
{$row.sharedby}
</a>
</td>
{else}
<td class="owner">-</td>
{/if}
<td class="action-list-copy">
<div class="btn-group">
{$row.form|safe}
</div>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{else}
<div class="no-results">
{str tag="nocopyableviewsfound" section=view}
......
......@@ -59,6 +59,7 @@ Scenario: Creating a Journal, publishing a draft, using tagged entry block
And I wait "1" seconds
And I follow "Tagged journal entries" in the "div#blog" "css_element"
And I press "Add"
And I wait "1" seconds
And I fill in select2 input "instconf_tagselect" with "george" and select "george"
And I press "Save"
Then I should see "My diary entry two"
......
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