Merge lp:~barry-mcgee/ubuntu-brand-guidelines/search-tidyup-proper into lp:ubuntu-brand-guidelines

Proposed by Barry McGee
Status: Merged
Approved by: Anthony Dillon
Approved revision: 51
Merged at revision: 51
Proposed branch: lp:~barry-mcgee/ubuntu-brand-guidelines/search-tidyup-proper
Merge into: lp:ubuntu-brand-guidelines
Diff against target: 139 lines (+43/-41)
4 files modified
css/scratch.css (+39/-1)
loop-search-downloads.php (+4/-2)
loop-search-examples.php (+0/-31)
template-search.php (+0/-7)
To merge this branch: bzr merge lp:~barry-mcgee/ubuntu-brand-guidelines/search-tidyup-proper
Reviewer Review Type Date Requested Status
Anthony Dillon Approve
Review via email: mp+287300@code.launchpad.net

Description of the change

## Done

- Tidied up search results for "Download" section
- Removed "Examples" sections from search results entirely as it's obsolete (Yaili's request)

## QA
Pull down code, run site,search for "Ubuntu" and see the downloads section nicely formatted

## Card
https://trello.com/c/STFiXCHJ

To post a comment you must log in.
Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

Looks good, thanks +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'css/scratch.css'
2--- css/scratch.css 2016-02-05 17:46:26 +0000
3+++ css/scratch.css 2016-02-26 12:01:09 +0000
4@@ -329,7 +329,7 @@
5
6 .loop-error {
7 font-size: .825rem;
8- color: #888;
9+ color: #888;
10 }
11
12 /* END loop results */
13@@ -449,6 +449,44 @@
14 margin-bottom: 2rem;
15 }
16
17+.search-flex-container {
18+ display: flex;
19+ flex-wrap: wrap;
20+}
21+
22+.search-downloads .search-result {
23+ width: 100%;
24+}
25+
26+.search-downloads .search-result a {
27+ display: block;
28+}
29+
30+.search-downloads .search-result p,
31+.search-downloads .search-result a {
32+ width: 75%;
33+ text-align: center;
34+ margin: 0 auto 1rem;
35+}
36+
37+.search-downloads .search-result img {
38+ margin: auto;
39+ display: block;
40+ text-align: center;
41+}
42+
43+@media screen and (min-width: 600px) {
44+ .search-downloads .search-result {
45+ width: 50%;
46+ }
47+}
48+
49+@media screen and (min-width: 768px) {
50+ .search-downloads .search-result {
51+ width: 33.333%;
52+ }
53+}
54+
55
56 /* END search styles */
57
58
59=== modified file 'loop-search-downloads.php'
60--- loop-search-downloads.php 2016-02-05 17:46:26 +0000
61+++ loop-search-downloads.php 2016-02-26 12:01:09 +0000
62@@ -1,5 +1,7 @@
63-<ul class="loop-results search-downloads clearfix">
64 <h2 class="search-result-subtitle">Results in Downloads:</h2>
65+
66+<ul class="loop-results search-downloads clearfix search-flex-container">
67+
68 <?php
69
70 $args['post_type'] = 'downloads';
71@@ -28,7 +30,7 @@
72 <?php endif; ?>
73 <?php endif; ?>
74 </a>
75- <?php echo $attachment->post_excerpt; ?><br/>
76+ <p><?php echo $attachment->post_excerpt; ?></p>
77 <a href="<?php echo wp_get_attachment_url($attachment->ID, false); ?>">
78 Download <?php echo getPostAttachmentExtension($attachment->post_mime_type) . ' (' . getPostAttachmentFilesize(get_attached_file($attachment->ID)) . ')'; ?>
79 </a>
80
81=== removed file 'loop-search-examples.php'
82--- loop-search-examples.php 2016-02-05 17:46:26 +0000
83+++ loop-search-examples.php 1970-01-01 00:00:00 +0000
84@@ -1,31 +0,0 @@
85-<h2 class="search-result-subtitle">Results in Examples:</h2>
86-<ul class="loop-results search-examples clearfix">
87-<?php
88-
89-$args['post_type'] = 'examples';
90-$query = new WP_Query($args);
91-
92-if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post();
93-// Get post attachments
94-$args = array();
95-$args['post_type'] = 'attachment';
96-$args['post_parent'] = $post->ID;
97-$attachments = get_posts($args);
98-foreach ($attachments as $attachment) :
99-?>
100- <div class="search-result">
101- <a class="pretty-photo" href="<?php echo wp_get_attachment_url($attachment->ID, false); ?>">
102- <img src="<?php echo wp_get_attachment_thumb_url($attachment->ID); ?>" width="66" height="66" title="<?php echo $attachment->post_excerpt; ?>" alt="<?php echo $attachment->post_excerpt; ?>" />
103- </a>
104- <?php echo $attachment->post_excerpt; ?>
105- </div>
106-<?php
107-endforeach;
108-endwhile;
109-else :
110-?>
111- <span class="loop-error">Sorry, no results in examples have been found.</span>
112-<?php
113-endif;
114-?>
115-</ul>
116
117=== modified file 'template-search.php'
118--- template-search.php 2016-02-05 17:46:26 +0000
119+++ template-search.php 2016-02-26 12:01:09 +0000
120@@ -16,19 +16,12 @@
121 <h1>Your search for: "<?php echo $search ?>"</h1>
122 </div>
123
124-
125 <section class="search-section twelve-col">
126 <?php
127 get_template_part('loop', 'search-guidelines');
128 ?>
129 </section>
130
131- <section class="search-section twelve-col">
132- <?php
133- get_template_part('loop', 'search-examples');
134- ?>
135- </section>
136-
137 <section class="search-section last-col">
138 <?php
139 get_template_part('loop', 'search-downloads');

Subscribers

People subscribed via source and target branches