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

Search page improvements #1167

Merged
merged 7 commits into from
Mar 17, 2016
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
48 changes: 30 additions & 18 deletions css/editor-style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/editor-style.min.css

Large diffs are not rendered by default.

53 changes: 30 additions & 23 deletions css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/style.min.css

Large diffs are not rendered by default.

114 changes: 50 additions & 64 deletions less/inc/forms.less
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ select:focus:required:invalid {
.box-shadow(inset 0 1px 2px rgba(0,0,0,.025));
}

// Placeholder text gets special styles; can't be bundled together though for some reason
// Placeholder text gets special styles; cannot be bundled together though for some reason
.placeholder();


Expand Down Expand Up @@ -433,20 +433,6 @@ select:focus:required:invalid {
}
}

// SEARCH FORM
// -----------

.search-query {
padding-right: 14px;
padding-left: 14px;
margin-bottom: 0; // remove the default margin on all inputs
}



// HORIZONTAL & VERTICAL FORMS
// ---------------------------

// Common properties
// -----------------

Expand Down Expand Up @@ -530,7 +516,7 @@ legend + .control-group {
// Move over all input controls and content
.controls {
// Super jank IE7 fix to ensure the inputs in .input-append and input-prepend
// don't inherit the margin of the parent, in this case .controls
// do not inherit the margin of the parent, in this case .controls
*display: inline-block;
*padding-left: 20px;
margin-left: 160px;
Expand All @@ -539,7 +525,7 @@ legend + .control-group {
*padding-left: 160px;
}
}
// Remove bottom margin on block level help text since that's accounted for on .control-group
// Remove bottom margin on block level help text since that is accounted for on .control-group
.help-block {
margin-top: @baseLineHeight / 2;
margin-bottom: 0;
Expand All @@ -554,51 +540,51 @@ legend + .control-group {
* Fixes to Google Custom Search
*/
.gcs_container {
//outer wrapper
.gsc-control-cse {
width: auto;
padding: 0;
background-color: transparent;
border: none;
}
.gsc-search-button {
margin-top: 0 !important;
}


.gsc-search-box,
.gsc-results-wrapper-overlay {
.gsc-input {
padding-right: 5px !important;
}
table {
border: 0;
border-collapse: separate;
margin-bottom: 0;
}
td {
border: 0;
padding: 0;
&.gsib_a {
padding: 3px 6px 0 !important;
}
}
td.gsc-search-button {
padding: 0;
line-height: normal;
}
input[type='text'] {
.box-shadow(none);
}
input.gsc-search-button-v2 {
padding: 6px 15px !important;
height: 13px !important;
font-size: 15px;
margin-bottom: 0 !important;
#gradient > .vertical( lighten(@baseColor, 2%), darken(@baseColor, 2%) );
&:hover {
#gradient > .vertical(darken(@baseColor, 2%), lighten(@baseColor, 2%));
}
}
}
//outer wrapper
.gsc-control-cse {
width: auto;
padding: 0;
background-color: transparent;
border: none;
}
.gsc-search-button {
margin-top: 0 !important;
}


.gsc-search-box,
.gsc-results-wrapper-overlay {
.gsc-input {
padding-right: 5px !important;
}
table {
border: 0;
border-collapse: separate;
margin-bottom: 0;
}
td {
border: 0;
padding: 0;
&.gsib_a {
padding: 3px 6px 0 !important;
}
}
td.gsc-search-button {
padding: 0;
line-height: normal;
}
input[type='text'] {
.box-shadow(none);
}
input.gsc-search-button-v2 {
padding: 6px 15px !important;
height: 13px !important;
font-size: 15px;
margin-bottom: 0 !important;
#gradient > .vertical( lighten(@baseColor, 2%), darken(@baseColor, 2%) );
&:hover {
#gradient > .vertical(darken(@baseColor, 2%), lighten(@baseColor, 2%));
}
}
}
}
46 changes: 31 additions & 15 deletions less/inc/search.less
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
/**
* Styles for search forms and search results
*
* Styles for the global nav search are in less/inc/header.less
*/

// Search Results
.search-results {
.archive.search-results {
.input-append {
width: 100%;
position: relative;
}
.form-search {
margin-bottom: 1em;
input {
width: 90%;
box-sizing: border-box;
}
button {
width: 10%;
box-sizing: border-box;
}
}
.search-term {
background-color: @grayLighter;
padding: 1px 5px;
}
h3 .rss-link {
margin-left: 1em;
}
h3 {
margin-bottom: 1em;
padding-bottom: 0.5em;
border-bottom: 1px solid @gray;
}

.stories {
article {
padding-bottom: 12px;
}
h2.entry-title {
font-size: 20px;
margin-bottom: 5px;
}
h5.byline {
font-size: 12px;
margin-bottom: 0;
}
.entry-content,
.entry-content p {
font-size: 14px;
margin-bottom: 5px;
}
}
}
.search-results #content .form-search {
margin-bottom: 16px;
}

/* Google CSE */
Expand Down
25 changes: 7 additions & 18 deletions partials/content-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,23 @@
* @package Largo
*/
$tags = of_get_option( 'tag_display' );
$hero_class = largo_hero_class( $post->ID, FALSE );
$values = get_post_custom( $post->ID );
$entry_classes = 'entry-content';
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>>

<?php
$entry_classes = 'entry-content';
echo '<div class="' . $entry_classes . '">';
<div class="<?php echo $entry_classes; ?>">

if ( largo_has_categories_or_tags() && $tags === 'top' ) {
echo '<h5 class="top-tag">' . largo_top_term( $args = array( 'echo' => FALSE ) ) . '</h5>';
}
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute( array( 'before' => __( 'Permalink to', 'largo' ) . ' ' ) )?>" rel="bookmark"><?php the_title(); ?></a>
</h2>

echo '<div class="has-thumbnail '.$hero_class.'"><a href="' . get_permalink() . '">' . get_the_post_thumbnail() . '</a></div>';
?>

<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute( array( 'before' => __( 'Permalink to', 'largo' ) . ' ' ) )?>" rel="bookmark"><?php the_title(); ?></a>
</h2>

<h5 class="byline"><?php largo_byline(); ?></h5>

<?php largo_excerpt( $post, 5, true, __('Continue&nbsp;Reading', 'largo'), true, false ); ?>
<?php largo_excerpt( $post, 1, true, __('Continue&nbsp;Reading', 'largo'), true, false ); ?>

<?php if ( !is_home() && largo_has_categories_or_tags() && $tags === 'btm' ) { ?>
<h5 class="tag-list"><strong><?php _e('More about:', 'largo'); ?></strong> <?php largo_categories_and_tags( 8 ); ?></h5>
<?php } ?>

</div><!-- .entry-content -->
</div><!-- .entry-content -->

</article><!-- #post-<?php the_ID(); ?> -->
12 changes: 11 additions & 1 deletion partials/nav-sticky.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@
</a>
</li><?php
}
} ?>
}

/**
* Don't display the search in the header if we're on the search page
*
* @link https://github.com/INN/Largo/pull/1167
* @since 0.5.5
*/
if ( ! is_search() ) {
?>
<li id="sticky-nav-search">
<a href="#" class="toggle">
<i class="icon-search" title="<?php esc_attr_e('Search', 'largo'); ?>" role="button"></i>
Expand All @@ -72,6 +81,7 @@ class="input-medium appendedInputButton search-query" value="" name="s" />
</div>
</form>
</li>
<?php } ?>
<li>
<!-- "hamburger" button (3 bars) to trigger off-canvas navigation -->
<a class="btn btn-navbar toggle-nav-bar" title="<?php esc_attr_e('More', 'largo'); ?>">
Expand Down
4 changes: 2 additions & 2 deletions search.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
get_header();
?>

<div id="content" class="stories search-results span8" role="main">
<div id="content" class="stories archive search-results span8" role="main">
<?php if (of_get_option('use_gcs') && of_get_option('gcs_id')) { ?>
<h1>
<?php
Expand Down Expand Up @@ -80,7 +80,7 @@
get_template_part( 'partials/content', 'not-found' );
}
} ?>
</div><!--#content-->
</div><!-- #content -->

<?php get_sidebar(); ?>
<?php get_footer();
5 changes: 2 additions & 3 deletions searchform.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
*/
?>
<form class="form-search" role="search" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div>
<input type="text" placeholder="<?php _e('Search', 'largo'); ?>" class="searchbox search-query" value="" name="s" />
<input type="submit" value="<?php _e('Go', 'largo'); ?>" name="search submit" class="search-submit btn">
<div class="input-append">
<input type="text" placeholder="<?php _e('Search', 'largo'); ?>" class="searchbox search-query" value="" name="s" /><button type="submit" class="search-submit btn"><?php _e('Go', 'largo'); ?></button>
</div>
</form>