Minor fixtures

This commit is contained in:
Tony Air 2018-12-21 09:56:42 +07:00
parent b376b94038
commit 6914a47f93
3 changed files with 63 additions and 99 deletions

View File

@ -8,44 +8,45 @@ img {
max-width: 100%;
}
a,
button,
.jqte_tool_icon {
&:hover,
&:focus {
.a {
cursor: pointer;
}
.a:hover,
.a:focus,
a:hover,
a:focus,
[data-toggle]:hover,
[data-toggle]:focus {
opacity: .8;
.fas,
.fab,
.far,
&.fas,
&.fab,
&.far {
transform: scale(-1, 1);
}
&.fab {
transform: rotate(-180deg);
}
}
.jqte_tool_icon {
&:hover,
&:focus {
transform: scale(-1, 1);
[data-toggle="collapse"] {
&[aria-expanded="true"] {
.accordion-icon {
&:before {
content: "\f068";
}
}
}
}
// transactions
.transition,
a, a img,
.jqte_tool_icon,
a .fas, a .fab, a .far,
a.fas, a.fab, a.far,
button .fas, button .fab, button .far,
button.fas, button.fab, button.far,
a, a *,
.a, .a *,
button, input, optgroup, select, textarea,
.btn,
.alert,
.dropdown,
[data-target],
[data-toggle], [data-toggle] *,
.container,
.container-fluid,
.row,
@ -53,73 +54,12 @@ button, input, optgroup, select, textarea,
transition: all 0.4s ease;
}
.alert-fixed-top {
position: fixed;
top: 0;
z-index: 999;
left: 4rem;
right: 4rem;
}
.btn-toolbar {
margin-top: $grid-gutter-height / 2;
}
.field {
position: relative;
margin: 2rem 0;
margin: ($grid-gutter-height / 4) 0;
&:first-child {
margin-top: 0;
}
&.required {
&:after {
display: block;
position: absolute;
top: 2rem;
right: .5rem;
content: "*";
color: $red;
z-index: 2;
}
}
&.holder-error,
&.error {
input, select, textarea {
border-color: $red;
}
label {
color: $red;
}
}
label {
font-weight: bold;
}
.bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) {
width: 100%;
}
}
.message {
@extend .alert;
@extend .alert-info;
display: block;
margin: .5rem 0;
}
.message.required,
.message.error {
@extend .alert;
@extend .alert-danger;
}
// stick navbar to top using mobile layout

View File

@ -16,6 +16,8 @@ use SilverStripe\Forms\TextField;
use SilverStripe\Forms\FormAction;
use SilverStripe\Forms\RequiredFields;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\ORM\ArrayList;
use DNADesign\Elemental\Models\ElementContent;
class PageController extends ContentController
{
@ -68,11 +70,33 @@ class PageController extends ContentController
return false;
}
$results = SiteTree::get()->filterAny([
$results = ArrayList::create();
// get pages by title and content
$pages = SiteTree::get()->filterAny([
'Title:PartialMatch' => $term,
'Content:PartialMatch' => $term,
])->sort('Created DESC');
$results->merge($pages);
// get pages by elements
$elements = ElementContent::get()->filterAny([
'Title:PartialMatch' => $term,
'HTML:PartialMatch' => $term,
])->sort('Created DESC');
foreach ($elements as $element) {
$page = Page::get()->filter('ElementalAreaID', $element->getField('ParentID'))->first();
if(!$page) {
continue;
}
$results->push($page);
}
$results->removeDuplicates();
return ArrayData::create([
'Title' => 'Search query "'.$term.'"',
'Results' => PaginatedList::create($results),

View File

@ -9,16 +9,16 @@
<% loop $Results %>
<div class="card">
<div class="card-header" id="Heading{$ID}{$Up.ID}">
<h5 class="mb-0">
<strong
<h3
class="mb-0 a"
data-toggle="collapse"
data-target="#Collapse{$ID}{$Up.ID}"
aria-expanded="false"
aria-controls="Collapse{$ID}{$Up.ID}"
>
$Title
</strong>
</h5>
<i class="fas fa-plus accordion-icon pull-right"></i>
</h3>
</div>
<div
@ -28,7 +28,7 @@
data-parent="#SearchAccordion{$Up.ID}"
>
<div class="card-body">
<p>$Summary</p>
<p>$Summary(100)</p>
<a href="{$Link}">Learn More</a>
</div>
</div>