Merge branch 'master' into grunt

This commit is contained in:
Ben Word
2013-04-10 10:15:45 -05:00
10 changed files with 148 additions and 154 deletions

View File

@@ -1,4 +1,17 @@
### HEAD ### HEAD
* Don't warn about unwritable htaccess if that option is disabled
* Add missing collapse class for top navbar
* Add comment template
* Update is_dropdown evaluation in nav walker
* Re-organize archives template
* Add missing comment ID
* hNews consistency with entry-title class
* Add `wp_title()` filter
* Fix missing closing div in comments
* Fix for navbar dropdowns
* Add option for using jQuery on Google CDN
* Correct logic in `roots_enable_root_relative_urls`
* Add Greek translation, update Brazilian Portuguese translation
* Update to Bootstrap 2.3.1 * Update to Bootstrap 2.3.1
* Simplify alerts * Simplify alerts
* Remove disabled post nav links * Remove disabled post nav links

View File

@@ -1,5 +1,21 @@
<?php get_template_part('templates/page', 'header'); ?> <?php get_template_part('templates/page', 'header'); ?>
<?php
$format = have_posts() ? get_post_format() : false; <?php if (!have_posts()) : ?>
get_template_part('templates/content', $format); <div class="alert">
?> <?php _e('Sorry, no results were found.', 'roots'); ?>
</div>
<?php get_search_form(); ?>
<?php endif; ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/content', get_post_format()); ?>
<?php endwhile; ?>
<?php if ($wp_query->max_num_pages > 1) : ?>
<nav class="post-nav">
<ul class="pager">
<li class="previous"><?php next_posts_link(__('&larr; Older posts', 'roots')); ?></li>
<li class="next"><?php previous_posts_link(__('Newer posts &rarr;', 'roots')); ?></li>
</ul>
</nav>
<?php endif; ?>

View File

@@ -3,235 +3,235 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: 404.php:5 #: 404.php:4
msgid "The page you are looking for might have been removed, had its name changed, or is temporarily unavailable." msgid "Sorry, but the page you were trying to view does not exist."
msgstr "" msgstr ""
#: 404.php:8 #: 404.php:7
msgid "Please try the following:" msgid "It looks like this was the result of either:"
msgstr ""
#: 404.php:9
msgid "a mistyped address"
msgstr "" msgstr ""
#: 404.php:10 #: 404.php:10
msgid "Check your spelling" msgid "an out-of-date link"
msgstr "" msgstr ""
#: 404.php:11 #: index.php:5
msgid "Return to the <a href=\"%s\">home page</a>" msgid "Sorry, no results were found."
msgstr "" msgstr ""
#: 404.php:12 #: index.php:17
msgid "Click the <a href=\"javascript:history.back()\">Back</a> button" msgid "&larr; Older posts"
msgstr "" msgstr ""
#: lib/activation.php:31 lib/activation.php:32 #: index.php:18
msgid "Newer posts &rarr;"
msgstr ""
#: lib/activation.php:33 lib/activation.php:34
msgid "Theme Activation" msgid "Theme Activation"
msgstr "" msgstr ""
#: lib/activation.php:68 #: lib/activation.php:70
msgid "%s Theme Activation" msgid "%s Theme Activation"
msgstr "" msgstr ""
#: lib/activation.php:83 lib/activation.php:85 #: lib/activation.php:85 lib/activation.php:87
msgid "Create static front page?" msgid "Create static front page?"
msgstr "" msgstr ""
#: lib/activation.php:87 lib/activation.php:100 lib/activation.php:113 #: lib/activation.php:89 lib/activation.php:102 lib/activation.php:115
#: lib/activation.php:126 lib/activation.php:139 #: lib/activation.php:128 lib/activation.php:141
msgid "Yes" msgid "Yes"
msgstr "" msgstr ""
#: lib/activation.php:88 lib/activation.php:101 lib/activation.php:114 #: lib/activation.php:90 lib/activation.php:103 lib/activation.php:116
#: lib/activation.php:127 lib/activation.php:140 #: lib/activation.php:129 lib/activation.php:142
msgid "No" msgid "No"
msgstr "" msgstr ""
#: lib/activation.php:91 #: lib/activation.php:93
msgid "Create a page called Home and set it to be the static front page" msgid "Create a page called Home and set it to be the static front page"
msgstr "" msgstr ""
#: lib/activation.php:96 #: lib/activation.php:98
msgid "Change permalink structure?" msgid "Change permalink structure?"
msgstr "" msgstr ""
#: lib/activation.php:98 #: lib/activation.php:100
msgid "Update permalink structure?" msgid "Update permalink structure?"
msgstr "" msgstr ""
#: lib/activation.php:104 #: lib/activation.php:106
msgid "Change permalink structure to /&#37;postname&#37;/" msgid "Change permalink structure to /&#37;postname&#37;/"
msgstr "" msgstr ""
#: lib/activation.php:109 #: lib/activation.php:111
msgid "Change uploads folder?" msgid "Change uploads folder?"
msgstr "" msgstr ""
#: lib/activation.php:111 #: lib/activation.php:113
msgid "Update uploads folder?" msgid "Update uploads folder?"
msgstr "" msgstr ""
#: lib/activation.php:117 #: lib/activation.php:119
msgid "Change uploads folder to /assets/ instead of /wp-content/uploads/" msgid "Change uploads folder to /assets/ instead of /wp-content/uploads/"
msgstr "" msgstr ""
#: lib/activation.php:122 lib/activation.php:124 #: lib/activation.php:124 lib/activation.php:126
msgid "Create navigation menu?" msgid "Create navigation menu?"
msgstr "" msgstr ""
#: lib/activation.php:130 #: lib/activation.php:132
msgid "Create the Primary Navigation menu and set the location" msgid "Create the Primary Navigation menu and set the location"
msgstr "" msgstr ""
#: lib/activation.php:135 lib/activation.php:137 #: lib/activation.php:137 lib/activation.php:139
msgid "Add pages to menu?" msgid "Add pages to menu?"
msgstr "" msgstr ""
#: lib/activation.php:143 #: lib/activation.php:145
msgid "Add all current published pages to the Primary Navigation" msgid "Add all current published pages to the Primary Navigation"
msgstr "" msgstr ""
#: lib/cleanup.php:388 #: lib/cleanup.php:382
msgid "Continued" msgid "Continued"
msgstr "" msgstr ""
#: lib/htaccess.php:25 #: lib/init.php:11
msgid "Please make sure your <a href=\"%s\">.htaccess</a> file is writable "
msgstr ""
#: lib/init.php:13
msgid "Primary Navigation" msgid "Primary Navigation"
msgstr "" msgstr ""
#: lib/utils.php:14 #: lib/utils.php:60
msgid "Latest Posts" msgid "Latest Posts"
msgstr "" msgstr ""
#: lib/utils.php:23 #: lib/utils.php:69
msgid "Daily Archives: %s" msgid "Daily Archives: %s"
msgstr "" msgstr ""
#: lib/utils.php:25 #: lib/utils.php:71
msgid "Monthly Archives: %s" msgid "Monthly Archives: %s"
msgstr "" msgstr ""
#: lib/utils.php:27 #: lib/utils.php:73
msgid "Yearly Archives: %s" msgid "Yearly Archives: %s"
msgstr "" msgstr ""
#: lib/utils.php:31 #: lib/utils.php:75
msgid "Author Archives: %s" msgid "Author Archives: %s"
msgstr "" msgstr ""
#: lib/utils.php:36 #: lib/utils.php:80
msgid "Search Results for %s" msgid "Search Results for %s"
msgstr "" msgstr ""
#: lib/utils.php:38 #: lib/utils.php:82
msgid "File Not Found" msgid "Not Found"
msgstr "" msgstr ""
#: lib/widgets.php:6 #: lib/utils.php:94
msgid "Please make sure your <a href=\"%s\">.htaccess</a> file is writable "
msgstr ""
#: lib/widgets.php:8
msgid "Primary Sidebar" msgid "Primary Sidebar"
msgstr "" msgstr ""
#: lib/widgets.php:15 #: lib/widgets.php:17
msgid "Footer" msgid "Footer"
msgstr "" msgstr ""
#: lib/widgets.php:41 #: lib/widgets.php:45
msgid "Use this widget to add a vCard" msgid "Use this widget to add a vCard"
msgstr "" msgstr ""
#: lib/widgets.php:43 #: lib/widgets.php:47
msgid "Roots: vCard" msgid "Roots: vCard"
msgstr "" msgstr ""
#: lib/widgets.php:70 #: lib/widgets.php:74
msgid "vCard" msgid "vCard"
msgstr "" msgstr ""
#: templates/comments.php:7 #: templates/comment.php:4
msgid "<cite class=\"fn\">%s</cite>"
msgstr ""
#: templates/comments.php:8
msgid "%1$s" msgid "%1$s"
msgstr "" msgstr ""
#: templates/comments.php:9 #: templates/comment.php:5
msgid "(Edit)" msgid "(Edit)"
msgstr "" msgstr ""
#: templates/comments.php:15 #: templates/comment.php:9
msgid "Your comment is awaiting moderation." msgid "Your comment is awaiting moderation."
msgstr "" msgstr ""
#: templates/comments.php:32 #: templates/comments.php:8
msgid "This post is password protected. Enter the password to view comments."
msgstr ""
#: templates/comments.php:39
msgid "One Response to &ldquo;%2$s&rdquo;" msgid "One Response to &ldquo;%2$s&rdquo;"
msgid_plural "%1$s Responses to &ldquo;%2$s&rdquo;" msgid_plural "%1$s Responses to &ldquo;%2$s&rdquo;"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: templates/comments.php:49 templates/comments.php:51 #: templates/comments.php:18
msgid "&larr; Older comments" msgid "&larr; Older comments"
msgstr "" msgstr ""
#: templates/comments.php:54 templates/comments.php:56 #: templates/comments.php:21
msgid "Newer comments &rarr;" msgid "Newer comments &rarr;"
msgstr "" msgstr ""
#: templates/comments.php:66 templates/comments.php:76 #: templates/comments.php:29 templates/comments.php:38
msgid "Comments are closed." msgid "Comments are closed."
msgstr "" msgstr ""
#: templates/comments.php:83 #: templates/comments.php:45
msgid "Leave a Reply" msgid "Leave a Reply"
msgstr "" msgstr ""
#: templates/comments.php:83 #: templates/comments.php:45
msgid "Leave a Reply to %s" msgid "Leave a Reply to %s"
msgstr "" msgstr ""
#: templates/comments.php:86 #: templates/comments.php:48
msgid "You must be <a href=\"%s\">logged in</a> to post a comment." msgid "You must be <a href=\"%s\">logged in</a> to post a comment."
msgstr "" msgstr ""
#: templates/comments.php:90 #: templates/comments.php:53
msgid "Logged in as <a href=\"%s/wp-admin/profile.php\">%s</a>." msgid "Logged in as <a href=\"%s/wp-admin/profile.php\">%s</a>."
msgstr "" msgstr ""
#: templates/comments.php:90 #: templates/comments.php:54
msgid "Log out of this account" msgid "Log out of this account"
msgstr "" msgstr ""
#: templates/comments.php:90 #: templates/comments.php:54
msgid "Log out &raquo;" msgid "Log out &raquo;"
msgstr "" msgstr ""
#: templates/comments.php:92 #: templates/comments.php:57
msgid "Name" msgid "Name"
msgstr "" msgstr ""
#: templates/comments.php:92 templates/comments.php:94 #: templates/comments.php:57 templates/comments.php:59
msgid " (required)" msgid " (required)"
msgstr "" msgstr ""
#: templates/comments.php:94 #: templates/comments.php:59
msgid "Email (will not be published)" msgid "Email (will not be published)"
msgstr "" msgstr ""
#: templates/comments.php:96 #: templates/comments.php:61
msgid "Website" msgid "Website"
msgstr "" msgstr ""
#: templates/comments.php:99 #: templates/comments.php:64
msgid "Comment" msgid "Comment"
msgstr "" msgstr ""
#: templates/comments.php:101 #: templates/comments.php:66
msgid "Submit Comment" msgid "Submit Comment"
msgstr "" msgstr ""
@@ -239,24 +239,8 @@ msgstr ""
msgid "Pages:" msgid "Pages:"
msgstr "" msgstr ""
#: templates/content.php:4
msgid "Sorry, no results were found."
msgstr ""
#: templates/content.php:28 templates/content.php:30
msgid "&larr; Older posts"
msgstr ""
#: templates/content.php:33 templates/content.php:35
msgid "Newer posts &rarr;"
msgstr ""
#: templates/entry-meta.php:1
msgid "Posted on %s at %s."
msgstr ""
#: templates/entry-meta.php:2 #: templates/entry-meta.php:2
msgid "Written by" msgid "By"
msgstr "" msgstr ""
#: templates/searchform.php:2 #: templates/searchform.php:2

View File

@@ -138,9 +138,9 @@ add_filter('body_class', 'roots_body_class');
* @author Scott Walkinshaw <scott.walkinshaw@gmail.com> * @author Scott Walkinshaw <scott.walkinshaw@gmail.com>
*/ */
function roots_root_relative_url($input) { function roots_root_relative_url($input) {
// fix for site_url != home_url() // Fix for site_url() != home_url()
if(!is_admin() && site_url() != home_url() && stristr($input, 'wp-includes') === false) { if (!is_admin() && site_url() != home_url() && stristr($input, 'wp-includes') === false) {
$input = str_replace(site_url(), "", $input); $input = str_replace(site_url(), '', $input);
} }
$output = preg_replace_callback( $output = preg_replace_callback(
@@ -158,10 +158,10 @@ function roots_root_relative_url($input) {
); );
// detect and correct for subdir installs // detect and correct for subdir installs
if($subdir = parse_url(home_url(), PHP_URL_PATH)) { if ($subdir = parse_url(home_url(), PHP_URL_PATH)) {
if(substr($output, 0, strlen($subdir)) == (substr($output, strlen($subdir), strlen($subdir)))) { if (substr($output, 0, strlen($subdir)) == (substr($output, strlen($subdir), strlen($subdir)))) {
$output = substr($output, strlen($subdir)); $output = substr($output, strlen($subdir));
} }
} }
return $output; return $output;
@@ -191,8 +191,8 @@ if (roots_enable_root_relative_urls()) {
'year_link', 'year_link',
'tag_link', 'tag_link',
'the_author_posts_link', 'the_author_posts_link',
'script_loader_src', 'script_loader_src',
'style_loader_src' 'style_loader_src'
); );
add_filters($root_rel_filters, 'roots_root_relative_url'); add_filters($root_rel_filters, 'roots_root_relative_url');

View File

@@ -29,20 +29,7 @@ class Roots_Walker_Comment extends Walker_Comment {
extract($args, EXTR_SKIP); ?> extract($args, EXTR_SKIP); ?>
<li <?php comment_class('media comment-' . get_comment_ID()); ?>> <li <?php comment_class('media comment-' . get_comment_ID()); ?>>
<?php echo get_avatar($comment, $size = '64'); ?> <?php include(locate_template('templates/comment.php')); ?>
<div class="media-body">
<h4 class="media-heading"><?php echo get_comment_author_link(); ?></h4>
<time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo htmlspecialchars(get_comment_link($comment->comment_ID)); ?>"><?php printf(__('%1$s', 'roots'), get_comment_date(), get_comment_time()); ?></a></time>
<?php edit_comment_link(__('(Edit)', 'roots'), '', ''); ?>
<?php if ($comment->comment_approved == '0') : ?>
<div class="alert">
<?php _e('Your comment is awaiting moderation.', 'roots'); ?>
</div>
<?php endif; ?>
<?php comment_text(); ?>
<?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
<?php <?php
} }
@@ -51,7 +38,7 @@ class Roots_Walker_Comment extends Walker_Comment {
call_user_func($args['end-callback'], $comment, $args, $depth); call_user_func($args['end-callback'], $comment, $args, $depth);
return; return;
} }
echo "</li>\n"; echo "</div></li>\n";
} }
} }

View File

@@ -38,7 +38,7 @@ class Roots_Nav_Walker extends Walker_Nav_Menu {
} }
function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) { function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) {
$element->is_dropdown = ((!empty($children_elements[$element->ID]) && (($depth + 1) < $max_depth))); $element->is_dropdown = ((!empty($children_elements[$element->ID]) && (($depth + 1) < $max_depth || ($max_depth === 0))));
if ($element->is_dropdown) { if ($element->is_dropdown) {
if ($depth === 0) { if ($depth === 0) {

View File

@@ -95,7 +95,9 @@ function roots_htaccess_writable() {
} }
} }
} }
add_action('admin_init', 'roots_htaccess_writable'); if (current_theme_supports('h5bp-htaccess')) {
add_action('admin_init', 'roots_htaccess_writable');
}
/** /**
* Return WordPress subdirectory if applicable * Return WordPress subdirectory if applicable

14
templates/comment.php Normal file
View File

@@ -0,0 +1,14 @@
<?php echo get_avatar($comment, $size = '64'); ?>
<div class="media-body">
<h4 class="media-heading"><?php echo get_comment_author_link(); ?></h4>
<time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo htmlspecialchars(get_comment_link($comment->comment_ID)); ?>"><?php printf(__('%1$s', 'roots'), get_comment_date(), get_comment_time()); ?></a></time>
<?php edit_comment_link(__('(Edit)', 'roots'), '', ''); ?>
<?php if ($comment->comment_approved == '0') : ?>
<div class="alert">
<?php _e('Your comment is awaiting moderation.', 'roots'); ?>
</div>
<?php endif; ?>
<?php comment_text(); ?>
<?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?>

View File

@@ -1,34 +1,12 @@
<?php if (!have_posts()) : ?> <article <?php post_class(); ?>>
<div class="alert"> <header>
<?php _e('Sorry, no results were found.', 'roots'); ?> <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php get_template_part('templates/entry-meta'); ?>
</header>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div> </div>
<?php get_search_form(); ?> <footer>
<?php endif; ?> <?php the_tags('<ul class="entry-tags"><li>','</li><li>','</li></ul>'); ?>
</footer>
<?php while (have_posts()) : the_post(); ?> </article>
<article <?php post_class(); ?>>
<header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php get_template_part('templates/entry-meta'); ?>
</header>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div>
<footer>
<?php the_tags('<ul class="entry-tags"><li>','</li><li>','</li></ul>'); ?>
</footer>
</article>
<?php endwhile; ?>
<?php if ($wp_query->max_num_pages > 1) : ?>
<nav class="post-nav">
<ul class="pager">
<?php if (get_next_posts_link()) : ?>
<li class="previous"><?php next_posts_link(__('&larr; Older posts', 'roots')); ?></li>
<?php endif; ?>
<?php if (get_previous_posts_link()) : ?>
<li class="next"><?php previous_posts_link(__('Newer posts &rarr;', 'roots')); ?></li>
<?php endif; ?>
</ul>
</nav>
<?php endif; ?>

View File

@@ -9,7 +9,7 @@
<a class="brand" href="<?php echo home_url(); ?>/"> <a class="brand" href="<?php echo home_url(); ?>/">
<?php bloginfo('name'); ?> <?php bloginfo('name'); ?>
</a> </a>
<nav class="nav-main nav-collapse" role="navigation"> <nav class="nav-main nav-collapse collapse" role="navigation">
<?php <?php
if (has_nav_menu('primary_navigation')) : if (has_nav_menu('primary_navigation')) :
wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav')); wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav'));