Merge lp:~mthaddon/wordpress/wp-theme-xubuntu-website into lp:~canonical-sysadmins/wordpress/wp-theme-xubuntu-website
- wp-theme-xubuntu-website
- Merge into wp-theme-xubuntu-website
Proposed by
Tom Haddon
Status: | Merged |
---|---|
Merged at revision: | 108 |
Proposed branch: | lp:~mthaddon/wordpress/wp-theme-xubuntu-website |
Merge into: | lp:~canonical-sysadmins/wordpress/wp-theme-xubuntu-website |
Diff against target: |
770 lines (+468/-51) 13 files modified
xubuntu-fifteen/content-release.php (+49/-34) xubuntu-fifteen/content-releases-landing.php (+40/-0) xubuntu-fifteen/functions-features-release-links.php (+6/-3) xubuntu-fifteen/functions-features-release-mirrors.php (+216/-0) xubuntu-fifteen/functions-features-releases.php (+103/-10) xubuntu-fifteen/functions.php (+1/-0) xubuntu-fifteen/header.php (+1/-1) xubuntu-fifteen/index.php (+3/-1) xubuntu-fifteen/script-releases.js (+10/-1) xubuntu-fifteen/style-admin.css (+8/-0) xubuntu-fifteen/style-common.css (+2/-0) xubuntu-fifteen/style.css (+27/-1) xubuntu-fifteen/template-releases-landing.php (+2/-0) |
To merge this branch: | bzr merge lp:~mthaddon/wordpress/wp-theme-xubuntu-website |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gareth Woolridge | Approve | ||
Review via email: mp+313430@code.launchpad.net |
Commit message
Description of the change
Merge per u#29426: Update Xubuntu.org themes
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'xubuntu-fifteen/content-release.php' | |||
2 | --- xubuntu-fifteen/content-release.php 2016-12-14 23:41:34 +0000 | |||
3 | +++ xubuntu-fifteen/content-release.php 2016-12-16 13:23:31 +0000 | |||
4 | @@ -1,58 +1,71 @@ | |||
5 | 1 | <?php | 1 | <?php |
6 | 2 | // Get release information | ||
7 | 2 | $release = get_term_by( 'slug', get_query_var( 'release' ), 'release', OBJECT ); | 3 | $release = get_term_by( 'slug', get_query_var( 'release' ), 'release', OBJECT ); |
8 | 3 | $release_meta = get_option( 'taxonomy_term_' . $release->term_id ); | 4 | $release_meta = get_option( 'taxonomy_term_' . $release->term_id ); |
9 | 4 | 5 | ||
10 | 6 | // Get release timestamp | ||
11 | 5 | if( isset( $release_meta['release_date'] ) && $release_meta['release_date'] > 0 ) { | 7 | if( isset( $release_meta['release_date'] ) && $release_meta['release_date'] > 0 ) { |
12 | 6 | list( $year, $month, $day ) = explode( '-', $release_meta['release_date'] ); | 8 | list( $year, $month, $day ) = explode( '-', $release_meta['release_date'] ); |
13 | 7 | $release_time = gmmktime( 0, 0, 0, $month, $day, $year ); | 9 | $release_time = gmmktime( 0, 0, 0, $month, $day, $year ); |
14 | 8 | } | 10 | } |
15 | 11 | // Get EOL timestamp | ||
16 | 9 | if( isset( $release_meta['release_eol'] ) && $release_meta['release_eol'] > 0 ) { | 12 | if( isset( $release_meta['release_eol'] ) && $release_meta['release_eol'] > 0 ) { |
17 | 10 | list( $year, $month, $day ) = explode( '-', $release_meta['release_eol'] ); | 13 | list( $year, $month, $day ) = explode( '-', $release_meta['release_eol'] ); |
18 | 11 | $eol_time = gmmktime( 0, 0, 1, $month, $day, $year ); | 14 | $eol_time = gmmktime( 0, 0, 1, $month, $day, $year ); |
19 | 12 | } | 15 | } |
23 | 13 | 16 | ?> | |
24 | 14 | echo '<h1 class="post-title">Xubuntu ' . single_term_title( '', false ) . '</h1>'; | 17 | |
25 | 15 | if( strlen( $release_meta['release_codename'] ) > 0 || isset( $release_time ) || isset( $eol_time ) ) { | 18 | <h1 class="post-title">Xubuntu <?php echo single_term_title( '', false ); ?></h1> |
26 | 19 | <?php echo wpautop( $release->description ); ?> | ||
27 | 20 | |||
28 | 21 | <?php | ||
29 | 22 | // Release information | ||
30 | 23 | $info = ''; | ||
31 | 24 | if( strlen( $release_meta['release_codename'] ) > 0 ) { | ||
32 | 25 | $info .= '<dt>' . __( 'Codename', 'xubuntu' ) . '</dt><dd>' . $release_meta['release_codename'] . '</dd>'; | ||
33 | 26 | } | ||
34 | 27 | if( isset( $release_time ) ) { | ||
35 | 28 | $info .= '<dt>' . __( 'Release Date', 'xubuntu' ) . '</dt><dd>' . gmdate( 'F j, Y', $release_time ) . '</dd>'; | ||
36 | 29 | } | ||
37 | 30 | if( isset( $eol_time ) ) { | ||
38 | 31 | $info .= '<dt>' . __( 'End of Life', 'xubuntu' ) . '</dt><dd>' . gmdate( 'F j, Y', $eol_time ) . '</dd>'; | ||
39 | 32 | } | ||
40 | 33 | |||
41 | 34 | // Release links | ||
42 | 35 | if( isset( $release_meta['release_torrent_64bit'] ) ) { | ||
43 | 36 | $info_links[] = '<strong><a href="' . $release_meta['release_torrent_64bit'] . '">' . __( 'Torrent download for 64-bit systems', 'xubuntu' ) . '</a></strong>'; | ||
44 | 37 | } | ||
45 | 38 | if( isset( $release_meta['release_torrent_32bit'] ) ) { | ||
46 | 39 | $info_links[] = '<strong><a href="' . $release_meta['release_torrent_32bit'] . '">' . __( 'Torrent download for 32-bit systems', 'xubuntu' ) . '</a></strong>'; | ||
47 | 40 | } | ||
48 | 41 | if( isset( $release_meta['release_documentation_link'] ) ) { | ||
49 | 42 | $info_links[] = '<a href="' . $release_meta['release_documentation_link'] . '">' . __( 'Online Documentation', 'xubuntu' ) . '</a>'; | ||
50 | 43 | } | ||
51 | 44 | if( isset( $info_links ) ) { | ||
52 | 45 | $info .= '<dt>' . __( 'Release Links', 'xubuntu' ) . '</dt><dd>' . implode( $info_links, '<br />' ) . '</dd>'; | ||
53 | 46 | } | ||
54 | 47 | |||
55 | 48 | if( strlen( $info ) > 0 ) { | ||
56 | 16 | echo '<dl class="release-info group">'; | 49 | echo '<dl class="release-info group">'; |
66 | 17 | if( strlen( $release_meta['release_codename'] ) > 0 ) { | 50 | echo $info; |
58 | 18 | echo '<dt>' . __( 'Codename', 'xubuntu' ) . '</dt><dd>' . $release_meta['release_codename'] . '</dd>'; | ||
59 | 19 | } | ||
60 | 20 | if( isset( $release_time ) ) { | ||
61 | 21 | echo '<dt>' . __( 'Release Date', 'xubuntu' ) . '</dt><dd>' . gmdate( 'F j, Y', $release_time ) . '</dd>'; | ||
62 | 22 | } | ||
63 | 23 | if( isset( $eol_time ) ) { | ||
64 | 24 | echo '<dt>' . __( 'End of Life', 'xubuntu' ) . '</dt><dd>' . gmdate( 'F j, Y', $eol_time ) . '</dd>'; | ||
65 | 25 | } | ||
67 | 26 | echo '</dl>'; | 51 | echo '</dl>'; |
68 | 27 | } | 52 | } |
69 | 28 | |||
70 | 29 | echo wpautop( $release->description ); | ||
71 | 30 | ?> | 53 | ?> |
72 | 31 | 54 | ||
73 | 32 | <?php | 55 | <?php |
93 | 33 | $official_links = release_link_list( array( 'official', 'official-expiring' ), $release->term_id ); | 56 | // Direct download links |
94 | 34 | 57 | if( $eol_time > time( ) ) { | |
95 | 35 | if( $official_links ) { | 58 | if( shortcode_exists( 'mirrors' ) ) { |
96 | 36 | $output_links = array( ); | 59 | $mirrors = do_shortcode( '[mirrors release=' . $release->name . ']' ); |
97 | 37 | 60 | if( isset( $mirrors ) ) { | |
98 | 38 | foreach( $official_links as $official_link ) { | 61 | echo '<h2>' . __( 'Direct Downloads', 'xubuntu' ) . '</h2>'; |
99 | 39 | $meta = get_post_meta( $official_link->ID ); | 62 | echo $mirrors; |
100 | 40 | if( ( $meta['link_type'][0] == 'official-expiring' && time( ) <= $eol_time ) || $meta['link_type'][0] == 'official' ) { | 63 | } |
82 | 41 | $output_links[] = '<li><strong><a href="' . $meta['link_url'][0] . '">' . $official_link->post_title . '</a></strong></li>'; | ||
83 | 42 | } | ||
84 | 43 | } | ||
85 | 44 | |||
86 | 45 | if( count( $output_links ) > 0 ) { | ||
87 | 46 | echo '<h2>' . __( 'Official Links', 'xubuntu' ) . '</h2>'; | ||
88 | 47 | echo '<ul class="link-list">'; | ||
89 | 48 | foreach( $output_links as $link ) { | ||
90 | 49 | echo $link; | ||
91 | 50 | } | ||
92 | 51 | echo '</ul>'; | ||
101 | 52 | } | 64 | } |
102 | 53 | } | 65 | } |
103 | 54 | ?> | 66 | ?> |
104 | 55 | 67 | ||
105 | 68 | <?php // Articles ?> | ||
106 | 56 | <?php if( have_posts( ) ) { ?> | 69 | <?php if( have_posts( ) ) { ?> |
107 | 57 | <h2><?php _e( 'Articles', 'xubuntu' ); ?></h2> | 70 | <h2><?php _e( 'Articles', 'xubuntu' ); ?></h2> |
108 | 58 | <ul class="posts-list"> | 71 | <ul class="posts-list"> |
109 | @@ -69,6 +82,7 @@ | |||
110 | 69 | <?php } ?> | 82 | <?php } ?> |
111 | 70 | 83 | ||
112 | 71 | <?php | 84 | <?php |
113 | 85 | // Press links | ||
114 | 72 | $press_links = release_link_list( 'press', $release->term_id ); | 86 | $press_links = release_link_list( 'press', $release->term_id ); |
115 | 73 | if( $press_links ) { | 87 | if( $press_links ) { |
116 | 74 | echo '<h2>' . __( 'In the Press', 'xubuntu' ) . '</h2>'; | 88 | echo '<h2>' . __( 'In the Press', 'xubuntu' ) . '</h2>'; |
117 | @@ -77,6 +91,7 @@ | |||
118 | 77 | ?> | 91 | ?> |
119 | 78 | 92 | ||
120 | 79 | <?php | 93 | <?php |
121 | 94 | // Attachments, usually screenshots | ||
122 | 80 | $attachments = get_posts( array( | 95 | $attachments = get_posts( array( |
123 | 81 | 'post_type' => 'attachment', | 96 | 'post_type' => 'attachment', |
124 | 82 | 'posts_per_page' => -1, | 97 | 'posts_per_page' => -1, |
125 | @@ -99,4 +114,4 @@ | |||
126 | 99 | echo '<h2>' . __( 'Screenshots', 'xubuntu' ) . '</h2>'; | 114 | echo '<h2>' . __( 'Screenshots', 'xubuntu' ) . '</h2>'; |
127 | 100 | echo do_shortcode( '[gallery size="xubuntu_split_to_3" link="file" ids="' . $gallery_ids . '"]' ); | 115 | echo do_shortcode( '[gallery size="xubuntu_split_to_3" link="file" ids="' . $gallery_ids . '"]' ); |
128 | 101 | } | 116 | } |
130 | 102 | ?> | 117 | ?> |
131 | 103 | \ No newline at end of file | 118 | \ No newline at end of file |
132 | 104 | 119 | ||
133 | === added file 'xubuntu-fifteen/content-releases-landing.php' | |||
134 | --- xubuntu-fifteen/content-releases-landing.php 1970-01-01 00:00:00 +0000 | |||
135 | +++ xubuntu-fifteen/content-releases-landing.php 2016-12-16 13:23:31 +0000 | |||
136 | @@ -0,0 +1,40 @@ | |||
137 | 1 | <?php while( have_posts( ) ) { ?> | ||
138 | 2 | <?php the_post( ); ?> | ||
139 | 3 | <div <?php post_class( 'group' ) ?> id="post-<?php the_ID( ); ?>"> | ||
140 | 4 | <?php if( !is_front_page( ) ) { ?> | ||
141 | 5 | <?php if( !is_page( ) ) { ?> | ||
142 | 6 | <h1 class="post-title"><a href="<?php the_permalink( ); ?>"><?php the_title( ); ?></a></h1> | ||
143 | 7 | <?php } else { ?> | ||
144 | 8 | <h1 class="post-title"><?php the_title( ); ?></h1> | ||
145 | 9 | <?php } ?> | ||
146 | 10 | <?php } ?> | ||
147 | 11 | |||
148 | 12 | <div class="post-post"> | ||
149 | 13 | <div class="post-entry entry"> | ||
150 | 14 | <?php the_content( __( 'Read the rest of this entry ยป', 'xubuntu' ) ); ?> | ||
151 | 15 | </div> | ||
152 | 16 | </div> | ||
153 | 17 | </div> | ||
154 | 18 | <?php } ?> | ||
155 | 19 | |||
156 | 20 | <?php | ||
157 | 21 | $releases = release_taxonomy_get_releases_sorted( ); | ||
158 | 22 | |||
159 | 23 | if( is_array( $releases ) ) { | ||
160 | 24 | $date_now = new DateTime( 'now' ); | ||
161 | 25 | foreach( $releases as $release ) { | ||
162 | 26 | $release_meta = get_option( 'taxonomy_term_' . $release->term_id ); | ||
163 | 27 | $date_release = new DateTime( $release_meta['release_date'] ); | ||
164 | 28 | |||
165 | 29 | if( strlen( $release_meta['release_codename'] ) > 0 ) { | ||
166 | 30 | $release->name .= ' (' . $release_meta['release_codename'] . ')'; | ||
167 | 31 | } | ||
168 | 32 | if( $release->release_is_eol == 0 && $date_release->format( 'Ymd' ) <= $date_now->format( 'Ymd' ) ) { | ||
169 | 33 | $date_eol = new DateTime( $release_meta['release_eol'] ); | ||
170 | 34 | echo '<h2>Xubuntu ' . $release->name . '</h2>'; | ||
171 | 35 | echo wpautop( $release->description ); | ||
172 | 36 | echo '<p><a class="button primary" href="' . get_term_link( $release ) . '">' . __( 'Visit the release page', 'xubuntu' ) . '</a></p>'; | ||
173 | 37 | } | ||
174 | 38 | } | ||
175 | 39 | } | ||
176 | 40 | ?> | ||
177 | 0 | \ No newline at end of file | 41 | \ No newline at end of file |
178 | 1 | 42 | ||
179 | === modified file 'xubuntu-fifteen/functions-features-release-links.php' | |||
180 | --- xubuntu-fifteen/functions-features-release-links.php 2016-12-14 23:41:34 +0000 | |||
181 | +++ xubuntu-fifteen/functions-features-release-links.php 2016-12-16 13:23:31 +0000 | |||
182 | @@ -49,7 +49,6 @@ | |||
183 | 49 | add_meta_box( 'release_link_type', _x( 'Link Type', 'meta box title', 'xubuntu' ), 'release_link_meta_box_link_type', 'release_link', 'normal', 'high' ); | 49 | add_meta_box( 'release_link_type', _x( 'Link Type', 'meta box title', 'xubuntu' ), 'release_link_meta_box_link_type', 'release_link', 'normal', 'high' ); |
184 | 50 | add_meta_box( 'release_link_link', _x( 'Link', 'meta box title', 'xubuntu' ), 'release_link_meta_box_link', 'release_link', 'normal', 'high' ); | 50 | add_meta_box( 'release_link_link', _x( 'Link', 'meta box title', 'xubuntu' ), 'release_link_meta_box_link', 'release_link', 'normal', 'high' ); |
185 | 51 | add_meta_box( 'release_link_author', _x( 'Author', 'meta box title', 'xubuntu' ), 'release_link_meta_box_author', 'release_link', 'normal' ); | 51 | add_meta_box( 'release_link_author', _x( 'Author', 'meta box title', 'xubuntu' ), 'release_link_meta_box_author', 'release_link', 'normal' ); |
186 | 52 | |||
187 | 53 | } | 52 | } |
188 | 54 | 53 | ||
189 | 55 | function release_link_meta_box_link_type( $post, $box ) { | 54 | function release_link_meta_box_link_type( $post, $box ) { |
190 | @@ -74,7 +73,6 @@ | |||
191 | 74 | 73 | ||
192 | 75 | echo '<p><input type="text" class="widefat" name="link_title" placeholder="' . _x( 'Review of the latest Xubuntu release โ awesome!', 'placeholder text', 'xubuntu' ) . '" value="' . $link_title . '" /></p>'; | 74 | echo '<p><input type="text" class="widefat" name="link_title" placeholder="' . _x( 'Review of the latest Xubuntu release โ awesome!', 'placeholder text', 'xubuntu' ) . '" value="' . $link_title . '" /></p>'; |
193 | 76 | echo '<p><input type="text" class="widefat" name="link_url" placeholder="' . _x( 'http://example.com/xubuntu-review/', 'placeholder text', 'xubuntu' ) . '" value="' . $link_url . '" /></p>'; | 75 | echo '<p><input type="text" class="widefat" name="link_url" placeholder="' . _x( 'http://example.com/xubuntu-review/', 'placeholder text', 'xubuntu' ) . '" value="' . $link_url . '" /></p>'; |
194 | 77 | echo '</label></p>'; | ||
195 | 78 | } | 76 | } |
196 | 79 | 77 | ||
197 | 80 | function release_link_meta_box_author( $post, $box ) { | 78 | function release_link_meta_box_author( $post, $box ) { |
198 | @@ -237,6 +235,7 @@ | |||
199 | 237 | } | 235 | } |
200 | 238 | 236 | ||
201 | 239 | $releases = get_terms( 'release', $args ); | 237 | $releases = get_terms( 'release', $args ); |
202 | 238 | usort( $releases, 'release_taxonomy_release_usort' ); | ||
203 | 240 | $navi = ''; | 239 | $navi = ''; |
204 | 241 | $links_out = ''; | 240 | $links_out = ''; |
205 | 242 | 241 | ||
206 | @@ -245,7 +244,11 @@ | |||
207 | 245 | if( count( $links ) > 0 ) { | 244 | if( count( $links ) > 0 ) { |
208 | 246 | $release_meta = get_option( 'taxonomy_term_' . $release->term_id ); | 245 | $release_meta = get_option( 'taxonomy_term_' . $release->term_id ); |
209 | 247 | $navi .= '<a class="button" href="#' . $release->slug . '">' . $release->name . '</a>'; | 246 | $navi .= '<a class="button" href="#' . $release->slug . '">' . $release->name . '</a>'; |
211 | 248 | $links_out .= '<h2 id="' . $release->slug . '">' . $release->name . ' (' . $release_meta['release_codename'] . ')</h2>' . release_link_press_output( $links ); | 247 | $links_out .= '<h2 id="' . $release->slug . '">' . $release->name; |
212 | 248 | if( strlen( $release_meta['release_codename'] ) > 0 ) { | ||
213 | 249 | $links_out .= ' (' . $release_meta['release_codename'] . ')'; | ||
214 | 250 | } | ||
215 | 251 | $links_out .= '</h2>' . release_link_press_output( $links ); | ||
216 | 249 | } | 252 | } |
217 | 250 | } | 253 | } |
218 | 251 | 254 | ||
219 | 252 | 255 | ||
220 | === added file 'xubuntu-fifteen/functions-features-release-mirrors.php' | |||
221 | --- xubuntu-fifteen/functions-features-release-mirrors.php 1970-01-01 00:00:00 +0000 | |||
222 | +++ xubuntu-fifteen/functions-features-release-mirrors.php 2016-12-16 13:23:31 +0000 | |||
223 | @@ -0,0 +1,216 @@ | |||
224 | 1 | <?php | ||
225 | 2 | |||
226 | 3 | /* | ||
227 | 4 | * Register the release download mirror post type | ||
228 | 5 | * | ||
229 | 6 | */ | ||
230 | 7 | |||
231 | 8 | add_action( 'init', 'release_download_mirror_register' ); | ||
232 | 9 | |||
233 | 10 | function release_download_mirror_register( ) { | ||
234 | 11 | register_post_type( | ||
235 | 12 | 'download_mirror', | ||
236 | 13 | array( | ||
237 | 14 | 'label' => _x( 'Download Mirrors', 'post type label', 'xubuntu' ), | ||
238 | 15 | 'labels' => array( | ||
239 | 16 | 'name' => _x( 'Download Mirrors', 'post type label: name', 'xubuntu' ), | ||
240 | 17 | 'singular_name' => _x( 'Download Mirror', 'post type label: singular_name', 'xubuntu' ), | ||
241 | 18 | 'add_new_item' => _x( 'Add New Download Mirror', 'post type label: add_new_item', 'xubuntu' ), | ||
242 | 19 | 'edit_item' => _x( 'Edit Download Mirror', 'post type label: edit_item', 'xubuntu' ), | ||
243 | 20 | 'view_item' => _x( 'View Download Mirror', 'post type label: view_item', 'xubuntu' ), | ||
244 | 21 | 'search_items' => _x( 'Search Download Mirrors', 'post type label: search_items', 'xubuntu' ), | ||
245 | 22 | 'not_found' => _x( 'No download mirrors found.', 'post type label: not_found', 'xubuntu' ), | ||
246 | 23 | 'all_items' => _x( 'All Download Mirrors', 'post type label: all_items', 'xubuntu' ), | ||
247 | 24 | 'menu_name' => _x( 'DL Mirrors', 'post type label: menu_name', 'xubuntu' ), | ||
248 | 25 | ), | ||
249 | 26 | 'description' => _x( 'Xubuntu Download Mirrors', 'post type description', 'xubuntu' ), | ||
250 | 27 | 'public' => false, | ||
251 | 28 | 'show_ui' => true, | ||
252 | 29 | 'show_in_menu' => true, | ||
253 | 30 | 'menu_position' => 21, | ||
254 | 31 | 'menu_icon' => 'dashicons-download', | ||
255 | 32 | 'supports' => false, | ||
256 | 33 | /* 'taxonomies' => array( | ||
257 | 34 | 'release' | ||
258 | 35 | ), */ | ||
259 | 36 | 'rewrite' => false, | ||
260 | 37 | 'query_var' => false | ||
261 | 38 | ) | ||
262 | 39 | ); | ||
263 | 40 | } | ||
264 | 41 | |||
265 | 42 | /* | ||
266 | 43 | * Add meta boxes for the post type | ||
267 | 44 | * | ||
268 | 45 | */ | ||
269 | 46 | |||
270 | 47 | add_action( 'add_meta_boxes', 'release_download_mirror_add_meta_boxes' ); | ||
271 | 48 | |||
272 | 49 | function release_download_mirror_add_meta_boxes( ) { | ||
273 | 50 | add_meta_box( 'release_download_mirror_info', _x( 'Mirror Information', 'meta box title', 'xubuntu' ), 'release_download_mirror_meta_box_info', 'download_mirror', 'normal', 'high' ); | ||
274 | 51 | add_meta_box( 'release_download_mirror_location', _x( 'Mirror Location', 'meta box title', 'xubuntu' ), 'release_download_mirror_meta_box_location', 'download_mirror', 'normal' ); | ||
275 | 52 | add_meta_box( 'release_download_mirror_link_template', _x( 'Mirror Link Template', 'meta box title', 'xubuntu' ), 'release_download_mirror_meta_box_link_template', 'download_mirror', 'normal' ); | ||
276 | 53 | add_meta_box( 'release_download_mirror_activity', _x( 'Activity', 'meta box title', 'xubuntu' ), 'release_download_mirror_meta_box_activity', 'download_mirror', 'side' ); | ||
277 | 54 | } | ||
278 | 55 | |||
279 | 56 | function release_download_mirror_meta_box_info( $post, $box ) { | ||
280 | 57 | $mirror_name = get_post_meta( $post->ID, 'mirror_name', true ); | ||
281 | 58 | $mirror_lp_url = get_post_meta( $post->ID, 'mirror_lp_url', true ); | ||
282 | 59 | |||
283 | 60 | echo '<p><input type="text" class="widefat" name="mirror_name" placeholder="' . _x( 'University of Mirrors', 'placeholder text', 'xubuntu' ) . '" value="' . $mirror_name . '" /></p>'; | ||
284 | 61 | echo '<p><input type="text" class="widefat" name="mirror_lp_url" placeholder="' . _x( 'https://launchpad.net/ubuntu/+mirror/ubuntu.mirror.university-release', 'placeholder text', 'xubuntu' ) . '" value="' . $mirror_lp_url . '" /></p>'; | ||
285 | 62 | } | ||
286 | 63 | |||
287 | 64 | function release_download_mirror_meta_box_location( $post, $box ) { | ||
288 | 65 | $mirror_area = get_post_meta( $post->ID, 'mirror_area', true ); | ||
289 | 66 | $mirror_country = get_post_meta( $post->ID, 'mirror_country', true ); | ||
290 | 67 | |||
291 | 68 | $mirror_areas = array( | ||
292 | 69 | 'unknown' => __( 'Unknown or Other', 'xubuntu' ), | ||
293 | 70 | 'africa' => __( 'Africa', 'xubuntu' ), | ||
294 | 71 | 'americas' => __( 'Americas', 'xubuntu' ), | ||
295 | 72 | 'asia' => __( 'Asia', 'xubuntu' ), | ||
296 | 73 | 'europe' => __( 'Europe', 'xubuntu' ), | ||
297 | 74 | 'oceania' => __( 'Oceania', 'xubuntu' ), | ||
298 | 75 | ); | ||
299 | 76 | |||
300 | 77 | echo '<select class="widefat" name="mirror_area">'; | ||
301 | 78 | foreach( $mirror_areas as $value => $name ) { | ||
302 | 79 | echo '<option value="' . $value . '" ' . selected( $mirror_area, $value, false ) . '>' . $name . '</option>'; | ||
303 | 80 | } | ||
304 | 81 | echo '</select>'; | ||
305 | 82 | |||
306 | 83 | echo '<p><input type="text" class="widefat" name="mirror_country" placeholder="' . _x( 'Finland', 'placeholder text', 'xubuntu' ) . '" value="' . $mirror_country . '" /></p>'; | ||
307 | 84 | } | ||
308 | 85 | |||
309 | 86 | function release_download_mirror_meta_box_link_template( $post, $box ) { | ||
310 | 87 | $mirror_http_template = get_post_meta( $post->ID, 'mirror_http_template', true ); | ||
311 | 88 | |||
312 | 89 | echo '<p><input type="text" class="widefat" name="mirror_http_template" placeholder="' . _x( 'http://ubuntu.mirror.university/releases/VERSION/', 'placeholder text', 'xubuntu' ) . '" value="' . $mirror_http_template . '" /></p>'; | ||
313 | 90 | echo '<p>' . __( 'The tag <code>VERSION</code> in the mirror template will be replaced by the appropriate version number (eg. <em>16.04</em>)', 'xubuntu' ) . '</p>'; | ||
314 | 91 | } | ||
315 | 92 | |||
316 | 93 | function release_download_mirror_meta_box_activity( $post, $box ) { | ||
317 | 94 | $mirror_main = get_post_meta( $post->ID, 'mirror_main', true ); | ||
318 | 95 | $mirror_active = get_post_meta( $post->ID, 'mirror_active', true ); | ||
319 | 96 | |||
320 | 97 | echo '<ul>'; | ||
321 | 98 | echo '<li><label class="selectit">'; | ||
322 | 99 | echo '<input type="checkbox" name="mirror_active" ' . checked( $mirror_active, 1, false ) . '/>'; | ||
323 | 100 | echo _x( 'Is active?', 'release mirror activity', 'xubuntu' ); | ||
324 | 101 | echo '</label></li>'; | ||
325 | 102 | echo '<li><label class="selectit">'; | ||
326 | 103 | echo '<input type="checkbox" name="mirror_main" ' . checked( $mirror_main, 1, false ) . '/>'; | ||
327 | 104 | echo __( 'Is a main download mirror?', 'release mirror status', 'xubuntu' ); | ||
328 | 105 | echo '</label></li>'; | ||
329 | 106 | echo '</ul>'; | ||
330 | 107 | } | ||
331 | 108 | |||
332 | 109 | /* | ||
333 | 110 | * Handle saving the link data | ||
334 | 111 | * | ||
335 | 112 | */ | ||
336 | 113 | |||
337 | 114 | add_action( 'save_post_download_mirror', 'release_download_mirror_save_post' ); | ||
338 | 115 | |||
339 | 116 | function release_download_mirror_save_post( $post_id ) { | ||
340 | 117 | global $wpdb; | ||
341 | 118 | |||
342 | 119 | $fields_to_save = array( | ||
343 | 120 | 'mirror_name', | ||
344 | 121 | 'mirror_lp_url', | ||
345 | 122 | 'mirror_area', | ||
346 | 123 | 'mirror_country', | ||
347 | 124 | 'mirror_http_template', | ||
348 | 125 | ); | ||
349 | 126 | |||
350 | 127 | foreach( $fields_to_save as $field ) { | ||
351 | 128 | if( isset( $_POST[$field] ) ) { | ||
352 | 129 | update_post_meta( $post_id, $field, sanitize_text_field( $_POST[$field] ) ); | ||
353 | 130 | } | ||
354 | 131 | } | ||
355 | 132 | |||
356 | 133 | $bool_fields_to_save = array( | ||
357 | 134 | 'mirror_active', | ||
358 | 135 | 'mirror_main', | ||
359 | 136 | ); | ||
360 | 137 | |||
361 | 138 | foreach( $bool_fields_to_save as $field ) { | ||
362 | 139 | if( $_POST[$field] != 'on' ) { // TODO | ||
363 | 140 | update_post_meta( $post_id, $field, 0 ); | ||
364 | 141 | } else { | ||
365 | 142 | update_post_meta( $post_id, $field, 1 ); | ||
366 | 143 | } | ||
367 | 144 | } | ||
368 | 145 | |||
369 | 146 | if( isset( $_POST['mirror_name'] ) ) { | ||
370 | 147 | $wpdb->update( $wpdb->posts, array( 'post_title' => $_POST['mirror_name'] ), array( 'ID' => $post_id ) ); | ||
371 | 148 | } | ||
372 | 149 | } | ||
373 | 150 | |||
374 | 151 | /* | ||
375 | 152 | * Add a shortcode to print the list of mirrors | ||
376 | 153 | * | ||
377 | 154 | */ | ||
378 | 155 | |||
379 | 156 | add_shortcode( 'mirrors', 'release_download_mirror_shortcode_downloads' ); | ||
380 | 157 | |||
381 | 158 | function release_download_mirror_shortcode_downloads( $atts ) { | ||
382 | 159 | $atts = shortcode_atts( | ||
383 | 160 | array( | ||
384 | 161 | 'release' => false, | ||
385 | 162 | ), | ||
386 | 163 | $atts, | ||
387 | 164 | 'mirrors' | ||
388 | 165 | ); | ||
389 | 166 | |||
390 | 167 | if( strlen( $atts['release'] ) < 1 ) { | ||
391 | 168 | return; | ||
392 | 169 | } | ||
393 | 170 | |||
394 | 171 | $args = array( | ||
395 | 172 | 'post_type' => 'download_mirror', | ||
396 | 173 | 'posts_per_page' => -1, | ||
397 | 174 | 'orderby' => 'meta_value', | ||
398 | 175 | 'order' => 'ASC', | ||
399 | 176 | 'meta_key' => 'mirror_country', | ||
400 | 177 | 'meta_query' => array( | ||
401 | 178 | array( | ||
402 | 179 | 'key' => 'mirror_active', | ||
403 | 180 | 'value' => 1, | ||
404 | 181 | 'compare' => '=' | ||
405 | 182 | ), | ||
406 | 183 | ), | ||
407 | 184 | ); | ||
408 | 185 | $mirrors = get_posts( $args ); | ||
409 | 186 | |||
410 | 187 | if( count( $mirrors ) > 0 ) { | ||
411 | 188 | $out = '<ul class="columnlist mirrors">'; | ||
412 | 189 | foreach( $mirrors as $mirror ) { | ||
413 | 190 | $mirror_meta = get_post_meta( $mirror->ID ); | ||
414 | 191 | if( $mirror_meta['mirror_main'][0] == 1 ) { | ||
415 | 192 | $class = 'main'; | ||
416 | 193 | } else { | ||
417 | 194 | $class = 'secondary'; | ||
418 | 195 | } | ||
419 | 196 | |||
420 | 197 | $out .= '<li class="' . $class . '"><a href="' . release_download_url( $mirror_meta['mirror_http_template'][0], $atts['release'] ) . '" title="' . $mirror->post_title . ', ' . $mirror_meta['mirror_country'][0] . '">' . $mirror_meta['mirror_country'][0] . '</a>'; | ||
421 | 198 | if( strlen( $mirror_meta['mirror_lp_url'][0] ) > 0 ) { | ||
422 | 199 | $out .= '<span class="mirror-lp-url"><a href="' . $mirror_meta['mirror_lp_url'][0] . '">' . _x( 'Info', 'Link to download mirror information on Launchpad', 'xubuntu' ) . '</a></span>'; | ||
423 | 200 | } | ||
424 | 201 | $out .= '</li>'; | ||
425 | 202 | } | ||
426 | 203 | $out .= '<li class="nobullet show-on-js"><a class="show-all" href="#show-all">' . __( 'Show all mirrors with full information', 'xubuntu' ) . '</a></li>'; | ||
427 | 204 | $out .= '</ul>'; | ||
428 | 205 | |||
429 | 206 | return $out; | ||
430 | 207 | } | ||
431 | 208 | } | ||
432 | 209 | |||
433 | 210 | function release_download_url( $template, $release_slug ) { | ||
434 | 211 | $release = get_term_by( 'slug', $release_slug, 'release' ); | ||
435 | 212 | |||
436 | 213 | return str_replace( 'VERSION', $release->name, $template ); | ||
437 | 214 | } | ||
438 | 215 | |||
439 | 216 | ?> | ||
440 | 0 | \ No newline at end of file | 217 | \ No newline at end of file |
441 | 1 | 218 | ||
442 | === modified file 'xubuntu-fifteen/functions-features-releases.php' | |||
443 | --- xubuntu-fifteen/functions-features-releases.php 2016-08-29 12:39:20 +0000 | |||
444 | +++ xubuntu-fifteen/functions-features-releases.php 2016-12-16 13:23:31 +0000 | |||
445 | @@ -58,12 +58,29 @@ | |||
446 | 58 | ), | 58 | ), |
447 | 59 | 'release_date' => array( | 59 | 'release_date' => array( |
448 | 60 | 'label' => __( 'Release Date', 'xubuntu' ), | 60 | 'label' => __( 'Release Date', 'xubuntu' ), |
450 | 61 | 'type' => 'date' | 61 | 'type' => 'date', |
451 | 62 | 'description' => __( 'Date in YYYY-MM-DD format.', 'xubuntu' ) | ||
452 | 62 | ), | 63 | ), |
453 | 63 | 'release_eol' => array( | 64 | 'release_eol' => array( |
454 | 64 | 'label' => __( 'Release End of Life', 'xubuntu' ), | 65 | 'label' => __( 'Release End of Life', 'xubuntu' ), |
457 | 65 | 'type' => 'date' | 66 | 'type' => 'date', |
458 | 66 | ) | 67 | 'description' => __( 'Date in YYYY-MM-DD format.', 'xubuntu' ) |
459 | 68 | ), | ||
460 | 69 | 'release_torrent_32bit' => array( | ||
461 | 70 | 'label' => __( 'Torrent download link (32-bit)', 'xubuntu' ), | ||
462 | 71 | 'type' => 'url', | ||
463 | 72 | 'description' => __( 'The download link for the 32-bit image; for LTS, always use the latest point release link. Will be hidden after the release goes EOL.', 'xubuntu' ) | ||
464 | 73 | ), | ||
465 | 74 | 'release_torrent_64bit' => array( | ||
466 | 75 | 'label' => __( 'Torrent download link (64-bit)', 'xubuntu' ), | ||
467 | 76 | 'type' => 'url', | ||
468 | 77 | 'description' => __( 'The download link for the 64-bit image; for LTS, always use the latest point release link. Will be hidden after the release goes EOL.', 'xubuntu' ) | ||
469 | 78 | ), | ||
470 | 79 | 'release_documentation_link' => array( | ||
471 | 80 | 'label' => __( 'Online Documentation', 'xubuntu' ), | ||
472 | 81 | 'type' => 'url', | ||
473 | 82 | 'description' => __( 'URL for the online documentation for the release. Will be hidden after the release goes EOL.', 'xubuntu' ) | ||
474 | 83 | ), | ||
475 | 67 | ); | 84 | ); |
476 | 68 | 85 | ||
477 | 69 | add_action( 'release_edit_form_fields', 'release_taxonomy_custom_fields_edit', 10, 2 ); | 86 | add_action( 'release_edit_form_fields', 'release_taxonomy_custom_fields_edit', 10, 2 ); |
478 | @@ -81,9 +98,13 @@ | |||
479 | 81 | echo '<label for="' . $id . '">' . $field['label'] . '</label>'; | 98 | echo '<label for="' . $id . '">' . $field['label'] . '</label>'; |
480 | 82 | echo '</th>'; | 99 | echo '</th>'; |
481 | 83 | echo '<td>'; | 100 | echo '<td>'; |
485 | 84 | echo '<input name="term_meta[' . $id . ']" id="' . $id . '" value="' . $term_meta[$id] . '" type="' . $field['type'] . '" />'; | 101 | if( isset( $term_meta[$id] ) ) { |
486 | 85 | if( 'date' == $field['type'] ) { | 102 | echo '<input name="term_meta[' . $id . ']" id="' . $id . '" value="' . $term_meta[$id] . '" type="' . $field['type'] . '" />'; |
487 | 86 | echo '<p class="description">Date in YYYY-MM-DD format.</p>'; | 103 | } else { |
488 | 104 | echo '<input name="term_meta[' . $id . ']" id="' . $id . '" value="" type="' . $field['type'] . '" />'; | ||
489 | 105 | } | ||
490 | 106 | if( isset( $field['description'] ) ) { | ||
491 | 107 | echo '<p class="description">' . $field['description'] . '</p>'; | ||
492 | 87 | } | 108 | } |
493 | 88 | echo '</td>'; | 109 | echo '</td>'; |
494 | 89 | echo '</tr>'; | 110 | echo '</tr>'; |
495 | @@ -130,7 +151,7 @@ | |||
496 | 130 | } | 151 | } |
497 | 131 | 152 | ||
498 | 132 | update_option( 'taxonomy_term_' . $term_id, $term_meta ); | 153 | update_option( 'taxonomy_term_' . $term_id, $term_meta ); |
500 | 133 | } | 154 | } |
501 | 134 | } | 155 | } |
502 | 135 | 156 | ||
503 | 136 | /* | 157 | /* |
504 | @@ -147,7 +168,7 @@ | |||
505 | 147 | foreach( $releases as $release ) { | 168 | foreach( $releases as $release ) { |
506 | 148 | $release_meta = get_option( 'taxonomy_term_' . $release->term_id ); | 169 | $release_meta = get_option( 'taxonomy_term_' . $release->term_id ); |
507 | 149 | if( $class != 'eol' && $release->release_is_eol == 1 ) { | 170 | if( $class != 'eol' && $release->release_is_eol == 1 ) { |
509 | 150 | echo '<li class="nobullet show-on-js"><a class="show-eol" href="#show-eol">Show EOL releases</a></li>'; | 171 | echo '<li class="nobullet show-on-js"><a class="show-eol" href="#show-eol">' . __( 'Show EOL releases', 'xubuntu' ) . '</a></li>'; |
510 | 151 | $class = 'eol'; | 172 | $class = 'eol'; |
511 | 152 | } | 173 | } |
512 | 153 | 174 | ||
513 | @@ -293,11 +314,11 @@ | |||
514 | 293 | } | 314 | } |
515 | 294 | } | 315 | } |
516 | 295 | 316 | ||
518 | 296 | usort( $releases, 'release_taxonomy_release_usort' ); | 317 | usort( $releases, 'release_taxonomy_release_usort_eol_last' ); |
519 | 297 | return $releases; | 318 | return $releases; |
520 | 298 | } | 319 | } |
521 | 299 | 320 | ||
523 | 300 | function release_taxonomy_release_usort( $a, $b ) { | 321 | function release_taxonomy_release_usort_eol_last( $a, $b ) { |
524 | 301 | $eolcmp = strnatcmp( $a->release_is_eol, $b->release_is_eol ); | 322 | $eolcmp = strnatcmp( $a->release_is_eol, $b->release_is_eol ); |
525 | 302 | 323 | ||
526 | 303 | if( $eolcmp != 0 ) { | 324 | if( $eolcmp != 0 ) { |
527 | @@ -307,4 +328,76 @@ | |||
528 | 307 | } | 328 | } |
529 | 308 | } | 329 | } |
530 | 309 | 330 | ||
531 | 331 | function release_taxonomy_release_usort( $a, $b ) { | ||
532 | 332 | return strnatcmp( $b->name, $a->name ); | ||
533 | 333 | } | ||
534 | 334 | |||
535 | 335 | /* | ||
536 | 336 | * Add a shortcode to print the torrent link buttons | ||
537 | 337 | * | ||
538 | 338 | */ | ||
539 | 339 | |||
540 | 340 | add_shortcode( 'torrents', 'release_torrent_links' ); | ||
541 | 341 | |||
542 | 342 | function release_torrent_links( $atts ) { | ||
543 | 343 | $atts = shortcode_atts( | ||
544 | 344 | array( | ||
545 | 345 | 'release' => false, | ||
546 | 346 | ), | ||
547 | 347 | $atts, | ||
548 | 348 | 'torrents' | ||
549 | 349 | ); | ||
550 | 350 | |||
551 | 351 | if( strlen( $atts['release'] ) < 1 ) { | ||
552 | 352 | return; | ||
553 | 353 | } | ||
554 | 354 | |||
555 | 355 | $release = get_term_by( 'slug', $atts['release'], 'release' ); | ||
556 | 356 | $release_meta = get_option( 'taxonomy_term_' . $release->term_id ); | ||
557 | 357 | $out = ''; | ||
558 | 358 | |||
559 | 359 | if( isset( $release_meta['release_torrent_64bit'] ) ) { | ||
560 | 360 | $out .= '<a class="button primary" href="' . $release_meta['release_torrent_64bit'] . '">' . _x( '<strong>64-bit</strong> systems', 'torrent download link', 'xubuntu' ) . '</a>'; | ||
561 | 361 | } | ||
562 | 362 | if( isset( $release_meta['release_torrent_32bit'] ) ) { | ||
563 | 363 | $out .= '<a class="button" href="' . $release_meta['release_torrent_32bit'] . '">' . __( '<strong>32-bit</strong> systems', 'torrent download link', 'xubuntu' ) . '</a>'; | ||
564 | 364 | } | ||
565 | 365 | |||
566 | 366 | if( strlen( $out ) > 0 ) { | ||
567 | 367 | return '<p>' . $out . '</p>'; | ||
568 | 368 | } | ||
569 | 369 | } | ||
570 | 370 | |||
571 | 371 | /* | ||
572 | 372 | * Add a shortcode to list all online documentation links for released, non-EOL releases | ||
573 | 373 | * | ||
574 | 374 | */ | ||
575 | 375 | |||
576 | 376 | add_shortcode( 'documentation_links', 'release_documentation_links' ); | ||
577 | 377 | |||
578 | 378 | function release_documentation_links( $atts ) { | ||
579 | 379 | $releases = release_taxonomy_get_releases_sorted( ); | ||
580 | 380 | |||
581 | 381 | if( is_array( $releases ) ) { | ||
582 | 382 | $date_now = new DateTime( 'now' ); | ||
583 | 383 | $out = '<ul>'; | ||
584 | 384 | foreach( $releases as $release ) { | ||
585 | 385 | $release_meta = get_option( 'taxonomy_term_' . $release->term_id ); | ||
586 | 386 | $date_release = new DateTime( $release_meta['release_date'] ); | ||
587 | 387 | |||
588 | 388 | if( strlen( $release_meta['release_codename'] ) > 0 ) { | ||
589 | 389 | $release->name .= ' (' . $release_meta['release_codename'] . ')'; | ||
590 | 390 | } | ||
591 | 391 | if( $release->release_is_eol == 0 && $date_release->format( 'Ymd' ) <= $date_now->format( 'Ymd' ) ) { | ||
592 | 392 | $date_eol = new DateTime( $release_meta['release_eol'] ); | ||
593 | 393 | $out .= '<li><strong><a href="' . $release_meta['release_documentation_link'] . '">Xubuntu ' . $release->name . '</a></strong>, supported until ' . $date_eol->format( 'F Y' ) . '</li>'; | ||
594 | 394 | } | ||
595 | 395 | } | ||
596 | 396 | $out .= '</ul>'; | ||
597 | 397 | |||
598 | 398 | return $out; | ||
599 | 399 | } | ||
600 | 400 | } | ||
601 | 401 | |||
602 | 402 | |||
603 | 310 | ?> | 403 | ?> |
604 | 311 | \ No newline at end of file | 404 | \ No newline at end of file |
605 | 312 | 405 | ||
606 | === modified file 'xubuntu-fifteen/functions.php' | |||
607 | --- xubuntu-fifteen/functions.php 2016-09-02 20:08:49 +0000 | |||
608 | +++ xubuntu-fifteen/functions.php 2016-12-16 13:23:31 +0000 | |||
609 | @@ -15,6 +15,7 @@ | |||
610 | 15 | include 'functions-features-articles.php'; | 15 | include 'functions-features-articles.php'; |
611 | 16 | include 'functions-features-releases.php'; | 16 | include 'functions-features-releases.php'; |
612 | 17 | include 'functions-features-release-links.php'; | 17 | include 'functions-features-release-links.php'; |
613 | 18 | include 'functions-features-release-mirrors.php'; | ||
614 | 18 | 19 | ||
615 | 19 | /* | 20 | /* |
616 | 20 | * Configuration options | 21 | * Configuration options |
617 | 21 | 22 | ||
618 | === modified file 'xubuntu-fifteen/header.php' | |||
619 | --- xubuntu-fifteen/header.php 2016-09-02 20:08:49 +0000 | |||
620 | +++ xubuntu-fifteen/header.php 2016-12-16 13:23:31 +0000 | |||
621 | @@ -18,7 +18,7 @@ | |||
622 | 18 | 18 | ||
623 | 19 | <header> | 19 | <header> |
624 | 20 | <div id="logo"> | 20 | <div id="logo"> |
626 | 21 | <a href="<?php echo home_url( '/' ); ?>"><img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/xubuntu-logo-45.png" alt="Xubuntu" /></a> | 21 | <a href="<?php echo home_url( '/' ); ?>"><img src="<?php echo get_stylesheet_directory_uri( ); ?>/images/xubuntu-logo-45.png" alt="Xubuntu" /></a> |
627 | 22 | </div> | 22 | </div> |
628 | 23 | 23 | ||
629 | 24 | <div id="navi"> | 24 | <div id="navi"> |
630 | 25 | 25 | ||
631 | === modified file 'xubuntu-fifteen/index.php' | |||
632 | --- xubuntu-fifteen/index.php 2016-09-02 20:08:49 +0000 | |||
633 | +++ xubuntu-fifteen/index.php 2016-12-16 13:23:31 +0000 | |||
634 | @@ -10,6 +10,8 @@ | |||
635 | 10 | get_template_part( 'content', 'release' ); | 10 | get_template_part( 'content', 'release' ); |
636 | 11 | } elseif( is_attachment( ) ) { | 11 | } elseif( is_attachment( ) ) { |
637 | 12 | get_template_part( 'content', 'attachment' ); | 12 | get_template_part( 'content', 'attachment' ); |
638 | 13 | } elseif( is_page_template( 'template-releases-landing.php' ) ) { | ||
639 | 14 | get_template_part( 'content', 'releases-landing' ); | ||
640 | 13 | } elseif( have_posts( ) && !is_404( ) ) { | 15 | } elseif( have_posts( ) && !is_404( ) ) { |
641 | 14 | if( is_archive( ) ) { | 16 | if( is_archive( ) ) { |
642 | 15 | get_template_part( 'content', 'archive' ); | 17 | get_template_part( 'content', 'archive' ); |
643 | @@ -27,7 +29,7 @@ | |||
644 | 27 | ?> | 29 | ?> |
645 | 28 | </main> | 30 | </main> |
646 | 29 | <?php | 31 | <?php |
648 | 30 | if( is_tax( 'release' ) ) { | 32 | if( is_tax( 'release' ) || is_page_template( 'template-releases-landing.php' ) ) { |
649 | 31 | get_template_part( 'widgets', 'release' ); | 33 | get_template_part( 'widgets', 'release' ); |
650 | 32 | } elseif( is_blog( ) || is_search( ) ) { | 34 | } elseif( is_blog( ) || is_search( ) ) { |
651 | 33 | get_template_part( 'widgets', 'blog' ); | 35 | get_template_part( 'widgets', 'blog' ); |
652 | 34 | 36 | ||
653 | === modified file 'xubuntu-fifteen/script-releases.js' | |||
654 | --- xubuntu-fifteen/script-releases.js 2016-08-29 12:39:20 +0000 | |||
655 | +++ xubuntu-fifteen/script-releases.js 2016-12-16 13:23:31 +0000 | |||
656 | @@ -1,12 +1,21 @@ | |||
657 | 1 | jQuery( function( ) { | 1 | jQuery( function( ) { |
658 | 2 | jQuery( '.show-on-js' ).show( ); | 2 | jQuery( '.show-on-js' ).show( ); |
659 | 3 | 3 | ||
660 | 4 | /* Release list */ | ||
661 | 4 | jQuery( '.releases .eol' ).hide( ); | 5 | jQuery( '.releases .eol' ).hide( ); |
662 | 5 | jQuery( '.releases .show-eol' ).click( function( ) { | 6 | jQuery( '.releases .show-eol' ).click( function( ) { |
663 | 6 | jQuery( this ).hide( ); | 7 | jQuery( this ).hide( ); |
664 | 7 | jQuery( '.releases .eol' ).fadeIn( ); | 8 | jQuery( '.releases .eol' ).fadeIn( ); |
665 | 8 | } ); | 9 | } ); |
666 | 9 | 10 | ||
668 | 10 | /* Admin */ | 11 | /* Release list (admin) */ |
669 | 11 | jQuery( '.releases .eol input:checked' ).closest( '.eol' ).show( ); | 12 | jQuery( '.releases .eol input:checked' ).closest( '.eol' ).show( ); |
670 | 13 | |||
671 | 14 | /* Mirror list */ | ||
672 | 15 | jQuery( '.mirrors .secondary' ).hide( ); | ||
673 | 16 | jQuery( '.mirrors .show-all' ).click( function( ) { | ||
674 | 17 | jQuery( this ).hide( ); | ||
675 | 18 | jQuery( this ).closest( '.mirrors' ).addClass( 'expanded' ); | ||
676 | 19 | jQuery( this ).closest( '.mirrors' ).children( '.secondary' ).fadeIn( ); | ||
677 | 20 | } ); | ||
678 | 12 | } ); | 21 | } ); |
679 | 13 | \ No newline at end of file | 22 | \ No newline at end of file |
680 | 14 | 23 | ||
681 | === modified file 'xubuntu-fifteen/style-admin.css' | |||
682 | --- xubuntu-fifteen/style-admin.css 2016-08-28 23:39:44 +0000 | |||
683 | +++ xubuntu-fifteen/style-admin.css 2016-12-16 13:23:31 +0000 | |||
684 | @@ -8,4 +8,12 @@ | |||
685 | 8 | body.post-type-release_link .misc-pub-post-status, | 8 | body.post-type-release_link .misc-pub-post-status, |
686 | 9 | body.post-type-release_link .misc-pub-visibility { | 9 | body.post-type-release_link .misc-pub-visibility { |
687 | 10 | display: none; | 10 | display: none; |
688 | 11 | } | ||
689 | 12 | |||
690 | 13 | body.post-type-download_mirror #post-body-content, | ||
691 | 14 | body.post-type-download_mirror #save-action, | ||
692 | 15 | body.post-type-download_mirror #preview-action, | ||
693 | 16 | body.post-type-download_mirror .misc-pub-post-status, | ||
694 | 17 | body.post-type-download_mirror .misc-pub-visibility { | ||
695 | 18 | display: none; | ||
696 | 11 | } | 19 | } |
697 | 12 | \ No newline at end of file | 20 | \ No newline at end of file |
698 | 13 | 21 | ||
699 | === modified file 'xubuntu-fifteen/style-common.css' | |||
700 | --- xubuntu-fifteen/style-common.css 2016-09-02 20:08:49 +0000 | |||
701 | +++ xubuntu-fifteen/style-common.css 2016-12-16 13:23:31 +0000 | |||
702 | @@ -146,12 +146,14 @@ | |||
703 | 146 | li { list-style-position: inside; } | 146 | li { list-style-position: inside; } |
704 | 147 | main li { margin-bottom: 0.2em; list-style-position: outside; margin-left: 1.2em; } | 147 | main li { margin-bottom: 0.2em; list-style-position: outside; margin-left: 1.2em; } |
705 | 148 | main ul li { list-style-type: disc; } | 148 | main ul li { list-style-type: disc; } |
706 | 149 | main ul.mirrors li, | ||
707 | 149 | main ul.link-list li, | 150 | main ul.link-list li, |
708 | 150 | main .post-list ul li, | 151 | main .post-list ul li, |
709 | 151 | main .post-post ul li { | 152 | main .post-post ul li { |
710 | 152 | list-style-type: none; | 153 | list-style-type: none; |
711 | 153 | margin-left: 1em; | 154 | margin-left: 1em; |
712 | 154 | } | 155 | } |
713 | 156 | main ul.mirrors li:before, | ||
714 | 155 | main ul.link-list li:before, | 157 | main ul.link-list li:before, |
715 | 156 | main .post-list ul li:before, | 158 | main .post-list ul li:before, |
716 | 157 | main .post-post ul li:before { | 159 | main .post-post ul li:before { |
717 | 158 | 160 | ||
718 | === modified file 'xubuntu-fifteen/style.css' | |||
719 | --- xubuntu-fifteen/style.css 2016-09-02 20:26:40 +0000 | |||
720 | +++ xubuntu-fifteen/style.css 2016-12-16 13:23:31 +0000 | |||
721 | @@ -6,7 +6,7 @@ | |||
722 | 6 | * Author: Pasi Lallinaho | 6 | * Author: Pasi Lallinaho |
723 | 7 | * Author URI: http://open.knome.fi/ | 7 | * Author URI: http://open.knome.fi/ |
724 | 8 | * | 8 | * |
726 | 9 | * Version: 2016-sept (r118) | 9 | * Version: 2016-dec (r120) |
727 | 10 | * | 10 | * |
728 | 11 | */ | 11 | */ |
729 | 12 | 12 | ||
730 | @@ -542,6 +542,32 @@ | |||
731 | 542 | color: rgba( 0, 0, 0, 0.5 ); | 542 | color: rgba( 0, 0, 0, 0.5 ); |
732 | 543 | } | 543 | } |
733 | 544 | 544 | ||
734 | 545 | /* Mirror lists (code) */ | ||
735 | 546 | |||
736 | 547 | .mirrors .main { | ||
737 | 548 | font-weight: 600; | ||
738 | 549 | } | ||
739 | 550 | |||
740 | 551 | .mirrors .mirror-lp-url { | ||
741 | 552 | display: none; | ||
742 | 553 | margin-right: 1em; | ||
743 | 554 | float: right; | ||
744 | 555 | } | ||
745 | 556 | .mirrors.expanded .mirror-lp-url { | ||
746 | 557 | display: inline-block; | ||
747 | 558 | } | ||
748 | 559 | .mirrors .mirror-lp-url a { | ||
749 | 560 | font-size: 80%; | ||
750 | 561 | color: rgba( 0, 0, 0, 0.5 ); | ||
751 | 562 | } | ||
752 | 563 | |||
753 | 564 | .mirrors .nobullet a { | ||
754 | 565 | font-size: 90%; | ||
755 | 566 | } | ||
756 | 567 | .mirrors .nobullet::before { | ||
757 | 568 | content: " " !important; | ||
758 | 569 | } | ||
759 | 570 | |||
760 | 545 | /* Search form */ | 571 | /* Search form */ |
761 | 546 | 572 | ||
762 | 547 | .search-form { | 573 | .search-form { |
763 | 548 | 574 | ||
764 | === added file 'xubuntu-fifteen/template-releases-landing.php' | |||
765 | --- xubuntu-fifteen/template-releases-landing.php 1970-01-01 00:00:00 +0000 | |||
766 | +++ xubuntu-fifteen/template-releases-landing.php 2016-12-16 13:23:31 +0000 | |||
767 | @@ -0,0 +1,2 @@ | |||
768 | 1 | <?php /* Template Name: Releases landing page */ ?> | ||
769 | 2 | <?php include get_stylesheet_directory( ) . '/index.php'; ?> | ||
770 | 0 | \ No newline at end of file | 3 | \ No newline at end of file |
+1