Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FINNA-2739] Unify confirm button styles and remove local adjustments #3083

Merged
merged 17 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions themes/finna2/scss/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
@import 'components/finna-multi-level-nav';
@import 'components/finna-navbar';
@import 'components/finna-md-editable';
@import 'components/confirm-button';
24 changes: 24 additions & 0 deletions themes/finna2/scss/components/confirm-button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.vc-confirm-button.btn-group {
position: relative;
display: inline-block;
padding: 0 0 4px 4px;
&.open {
> .dropdown-menu {
position: absolute;
border-radius: $finna-button-radius;
border: 1px solid $gray-lighter;
top: 100%;
> li {
border: none;
border-bottom: 1px solid $gray-lighter;
> a {
margin: initial;
}
> .dropdown-header {
color: inherit;
font-size: $content-font-size-base;
}
}
}
}
}
99 changes: 48 additions & 51 deletions themes/finna2/scss/finna/mylist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,54 @@
}

.mylist-bar, .reservationlist-bar {
> .dropdown-menu {
float: none;
position: relative;
top: initial;
left: initial;
border-left: none;
border-right: none;
@include box-shadow(none);
padding: 0;
.active a {
font-weight: 600;
text-decoration: none;
color: $dropdown-link-color;;
background-color: $gray-ultralight;
}
> li {
max-width: none;
border: none;

> a {
padding: 3px 20px;
&.active {
font-weight: bold;
background-color: $gray-ultralight;
}
}
> a:not(.add-new-list) {
color: $text-color;
}
.favorite-list-holder {
height: 25px;
.favorite-list-title {
max-width: 60%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 5px;
}

.public-favorite-list {
padding: 2px;
&:before {
line-height: 19px;
}
}
}
}
}
h4.visible-xs.visible-sm {
text-transform: none;
}
Expand All @@ -62,46 +110,12 @@
a {
padding: 2px;
}

.list-visibility-hidden {
margin-left: 10px;
margin-bottom: 5px;
}
}

li {
max-width: none;

> a {
padding: 3px 20px;
&.active {
font-weight: bold;
background-color: $gray-ultralight;
}
}
> a:not(.add-new-list) {
color: $text-color;
}
.favorite-list-holder {
height: 25px;

.favorite-list-title {
max-width: 60%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 5px;
}

.public-favorite-list {
padding: 2px;
&:before {
line-height: 19px;
}
}
}
}

.add-new-list-holder {
padding: 0 20px;
margin: 5px 0 10px 0px;
Expand Down Expand Up @@ -541,20 +555,3 @@ span.caret {
margin-top: 10px;
}
}

.delete-list-btn-wrapper {
position: relative;
padding: 0 0 4px 4px;
.btn-group.open {
.dropdown-menu {
position: absolute;
border-radius: 4px;
border: 1px solid $gray-lighter;
top: 100%;
}
.dropdown-header {
color: inherit;
font-size: 14px;
}
}
}
33 changes: 0 additions & 33 deletions themes/finna2/scss/finna/myresearch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -757,49 +757,16 @@ form#renewals, form#update_holds, form#purge_history {
display: block;
z-index: 2;
margin-top: 15px;

.status {
padding-left: 5px;
}
.dropdown-menu {
border-left: none;
border-right: none;
@include box-shadow(none);
padding: 0;
> li {
border: none;
}
.active a {
font-weight: 600;
text-decoration: none;
color: $dropdown-link-color;;
background-color: $gray-ultralight;
}
}
@media (min-width: $screen-md) {
&.move-list {
position: -webkit-sticky;
position: sticky;
top: 30px;
}
}
.subtabs.mylist-nav {
border-top-width: 0px;
li.hidden-xs.hidden-sm, li.mylist-menu-favorites {
max-width: none;
h4 {
text-transform: none;
@media (max-width: $screen-sm-max) {
text-align: center;
}
}
}
li:first-child {
a {
padding-top: 9px;
}
}
}

&.list-group {
border-radius: 4px;
Expand Down
9 changes: 1 addition & 8 deletions themes/finna2/scss/finna/tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
.useraccount-nav.nav-tabs {
border-bottom: none;
// style 5 tabs to make sure they stay as tabs
li:first-child:nth-last-child(5), li:first-child:nth-last-child(5) ~ li {
> li:first-child:nth-last-child(5), li:first-child:nth-last-child(5) ~ li {
@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
max-width: 100%;
}
Expand Down Expand Up @@ -238,13 +238,6 @@
visibility: hidden;
}

.useraccount-nav.nav-tabs .dropdown-menu {
float: none;
position: relative;
top: initial;
left: initial;
}

.recordTabs.nav {
margin-top: 20px;
.staff-view-icon {
Expand Down
26 changes: 14 additions & 12 deletions themes/finna2/templates/librarycards/home.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,20 @@
<?php if ($this->auth()->getManager()->allowsUserIlsLogin()): ?>
<a class="btn-link edit-library-card" href="<?=$this->url('editLibraryCard') . $this->escapeHtmlAttr($record['id']) ?>" title="<?=$this->transEsc('Edit Library Card')?>"><?=$this->icon('library-card-edit') ?> <?=$this->transEsc('Update Card Details')?></a>
<?php endif; ?>
<div class="dropdown delete-library-card">
<a class="btn-link dropdown-toggle" data-toggle="dropdown" href="<?=$this->escapeHtmlAttr($this->url('librarycards-deletecard', [], ['query' => ['cardID' => $record['id']]]))?>">
<?=$this->icon('library-card-disconnect') ?> <?=$this->transEsc('Disconnect Library Card')?>
</a>
<ul class="dropdown-menu useraccount-confirm">
<li class="disabled"><a><?=$this->transEsc('Disconnect Library Card')?>?</a></li>
<li>
<a href="<?=$this->escapeHtmlAttr($this->url('librarycards-deletecard', [], ['query' => ['cardID' => $record['id'], 'confirm' => 1]]))?>" data-clear-account-cache><?=$this->transEsc('confirm_dialog_yes')?></a>
<a href="#"><?=$this->transEsc('confirm_dialog_no')?></a>
</li>
</ul>
</div>
<?=
$this->component(
'confirm-button',
[
'buttonLink' => $this->url('librarycards-deletecard', [], ['query' => ['cardID' => $record['id']]]),
'buttonLabelHtml' => $this->icon('library-card-disconnect') . ' ' . $this->translate('Disconnect Library Card'),
'buttonClass' => 'btn-link',
'confirmLink' => $this->url('librarycards-deletecard', [], ['query' => ['cardID' => $record['id'], 'confirm' => 1]]),
'header' => 'confirm_delete_library_card_brief',
'clearAccountCache' => true,
'align' => 'right',
]
);
?>
</div>
</td>
</tr>
Expand Down
26 changes: 12 additions & 14 deletions themes/finna2/templates/myresearch/mylist-navi.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,18 @@
<?php if ($active): ?>
<?php $url = $this->url('list-page', ['lid' => $list->getId()], ['force_canonical' => true]) ?>
<?= $this->partial('myresearch/list-visibility.phtml', ['listUrl' => $url, 'public' => $list->isPublic()]); ?>
<span class="delete-list-btn-wrapper">
<?=
$this->component(
'confirm-button',
[
'buttonLink' => $this->url('myresearch-deletelist', [], ['query' => ['listID' => $list->getId()]]),
'buttonLabel' => 'delete_list',
'buttonClass' => 'btn btn-link',
'confirmLink' => $this->url('myresearch-deletelist', [], ['query' => ['listID' => $list->getId(), 'confirm' => 1]]),
'header' => 'confirm_delete_list_text',
]
)
?>
</span>
<?=
$this->component(
'confirm-button',
[
'buttonLink' => $this->url('myresearch-deletelist', [], ['query' => ['listID' => $list->getId()]]),
'buttonLabel' => 'delete_list',
'buttonClass' => 'btn btn-link',
'confirmLink' => $this->url('myresearch-deletelist', [], ['query' => ['listID' => $list->getId(), 'confirm' => 1]]),
'header' => 'confirm_delete_list_text',
]
)
?>
<?php endif; ?>
</li>
<?php endforeach; ?>
Expand Down
24 changes: 11 additions & 13 deletions themes/finna2/templates/reservationlist/displaylist.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,18 @@
<!-- Add order buttons if the list has not been ordered yet. -->
<a href="<?=$this->escapeHtmlAttr($this->url('reservationlist-placeorder', ['id' => $this->list->getId()]))?>" class="btn btn-primary" data-lightbox><?=$this->transEsc('ReservationList::Order List')?></a>
<?php endif; ?>
<span class="delete-list-btn-wrapper">
<?=
$this->component(
'confirm-button',
[
'buttonLink' => $this->url('reservationlist-deletelist', [], ['query' => ['listID' => $list->getId()]]),
'buttonLabel' => 'delete_list',
'buttonClass' => 'btn btn-primary',
'confirmLink' => $this->url('reservationlist-deletelist', [], ['query' => ['listID' => $list->getId(), 'confirm' => 1]]),
'header' => 'confirm_delete_list_text',
<?=
$this->component(
'confirm-button',
[
'buttonLink' => $this->url('reservationlist-deletelist', [], ['query' => ['listID' => $list->getId()]]),
'buttonLabel' => 'delete_list',
'buttonClass' => 'btn btn-primary',
'confirmLink' => $this->url('reservationlist-deletelist', [], ['query' => ['listID' => $list->getId(), 'confirm' => 1]]),
'header' => 'confirm_delete_list_text',
]
)
?>
</span>
);
?>
</div>
<div class="mylist-header">
<?php if ($recordTotal > 0): ?>
Expand Down
18 changes: 8 additions & 10 deletions themes/finna2/templates/reservationlist/displaylists.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,18 @@
<a href="<?= $this->url('reservationlist-displaylist', ['id' => $list->getId()])?>"><?= $this->escapeHtml($list->getTitle()) ?></a>
</div>
<div class="pull-right">
<span class="delete-list-btn-wrapper">
<?=
<?=
$this->component(
'confirm-button',
[
'buttonLink' => $this->url('reservationlist-deletelist', [], ['query' => ['listID' => $list->getId()]]),
'buttonLabel' => 'delete_list',
'confirmLink' => $this->url('reservationlist-deletelist', [], ['query' => ['listID' => $list->getId(), 'confirm' => 1]]),
'header' => 'confirm_delete_list_text',
'align' => 'right',
'buttonLink' => $this->url('reservationlist-deletelist', [], ['query' => ['listID' => $list->getId()]]),
'buttonLabel' => 'delete_list',
'confirmLink' => $this->url('reservationlist-deletelist', [], ['query' => ['listID' => $list->getId(), 'confirm' => 1]]),
'header' => 'confirm_delete_list_text',
'align' => 'right',
]
)
?>
</span>
);
?>
</div>
</div>
<div class="reservation-list-info">
Expand Down
Loading