Pārlūkot izejas kodu

Add HTML5 tags (#3651)

* use HTML5 tags #3643

added some HTML5 tags: header, main, nav

* <main> into <div>

as dicussed in the PR.
Todo: check side effects (f.e. threepaneview extension)

* fixed whitespace with tabs

* fixed more whitespaces with tabs

it was not my fault, but I fixed it

* added empty lines as wished

* Update app/views/index/global.phtml

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>

* Update app/views/index/global.phtml

* Update app/views/index/global.phtml

* Update app/views/index/global.phtml

* Update app/views/index/global.phtml

* Update app/views/index/global.phtml

* Update app/views/index/global.phtml

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
maTh 4 gadi atpakaļ
vecāks
revīzija
ab0285b0aa

+ 2 - 2
app/layout/aside_feed.phtml

@@ -10,7 +10,7 @@
 	$state_filter = FreshRSS_Context::$user_conf->show_fav_unread ? '&state=3' : '';
 ?>
 
-<div class="aside aside_feed<?= $class ?>" id="aside_feed">
+<nav class="aside aside_feed<?= $class ?>" id="aside_feed">
 	<a class="toggle_aside" href="#close"><?= _i('close') ?></a>
 
 	<?php if (FreshRSS_Auth::hasAccess()) { ?>
@@ -111,7 +111,7 @@
 		<li class="tree-bottom"></li>
 	</ul>
 	</form>
-</div>
+</nav>
 
 <div id="first_load" class="loading"></div>
 <?php flush(); ?>

+ 4 - 4
app/layout/header.phtml

@@ -12,7 +12,7 @@ if (FreshRSS_Auth::accessNeedsAction()) {
 }
 ?>
 
-<div class="header">
+<header class="header">
 	<div class="item title">
 		<h1>
 			<a href="<?= _url('index', 'index') ?>">
@@ -51,7 +51,7 @@ if (FreshRSS_Auth::accessNeedsAction()) {
 	</div>
 
 	<?php if (FreshRSS_Auth::hasAccess()) { ?>
-	<div class="item configure">
+	<nav class="item configure">
 		<div class="dropdown">
 			<div id="dropdown-configure" class="dropdown-target"></div>
 			<a class="btn dropdown-toggle" href="#dropdown-configure"><?= _i('configure') ?></a>
@@ -96,10 +96,10 @@ if (FreshRSS_Auth::accessNeedsAction()) {
 				<?php endif; ?>
 			</ul>
 		</div>
-	</div>
+	</nav>
 	<?php } elseif (FreshRSS_Auth::accessNeedsAction()) { ?>
 	<div class="item configure">
 		<?= _i('login') ?><a class="signin" href="<?= _url('auth', 'login') ?>"><?= _t('gen.auth.login') ?></a>
 	</div>
 	<?php } ?>
-</div>
+</header>

+ 7 - 5
app/layout/nav_entries.phtml

@@ -1,5 +1,7 @@
-<ul id="nav_entries">
-	<li class="item"><a class="previous_entry" href="#"><?= _i('prev') ?></a></li>
-	<li class="item"><a class="up" href="#"><?= _i('up') ?></a></li>
-	<li class="item"><a class="next_entry" href="#"><?= _i('next') ?></a></li>
-</ul>
+<nav>
+	<ul id="nav_entries">
+		<li class="item"><a class="previous_entry" href="#"><?= _i('prev') ?></a></li>
+		<li class="item"><a class="up" href="#"><?= _i('up') ?></a></li>
+		<li class="item"><a class="next_entry" href="#"><?= _i('next') ?></a></li>
+	</ul>
+</nav>

+ 2 - 2
app/layout/nav_menu.phtml

@@ -2,7 +2,7 @@
 	$actual_view = Minz_Request::actionName();
 ?>
 
-<div class="nav_menu">
+<nav class="nav_menu">
 	<?php if ($actual_view === 'normal' || $actual_view === 'reader') { ?>
 	<a class="btn toggle_aside" href="#aside_feed"><?= _i('category') ?></a>
 	<?php } ?>
@@ -225,5 +225,5 @@
 	<?php if (FreshRSS_Auth::hasAccess() || FreshRSS_Context::$system_conf->allow_anonymous_refresh) { ?>
 	<a id="actualize" class="btn" href="<?= _url('feed', 'actualize') ?>" title="<?= _t('gen.action.actualize') ?>"><?= _i('refresh') ?></a>
 	<?php } ?>
-</div>
+</nav>
 <?php flush(); ?>

+ 2 - 2
app/views/index/global.phtml

@@ -9,7 +9,7 @@
 	}
 ?>
 
-<div id="stream" class="global<?= $class ?>">
+<main id="stream" class="global<?= $class ?>">
 <?php
 	$params = Minz_Request::fetchGET();
 	unset($params['c']);
@@ -50,7 +50,7 @@
 		}
 	}
 ?>
-</div>
+</main>
 
 <div id="overlay">
 	<a class="close" href="#"><?= _i('close') ?></a>

+ 4 - 4
app/views/index/normal.phtml

@@ -14,7 +14,7 @@ $content_width = FreshRSS_Context::$user_conf->content_width;
 $today = @strtotime('today');
 ?>
 
-<div id="stream" class="normal<?= $hidePosts ? ' hide_posts' : '' ?>">
+<main id="stream" class="normal<?= $hidePosts ? ' hide_posts' : '' ?>">
 	<div id="new-article">
 		<a href="<?= Minz_Url::display(Minz_Request::currentRequest()) ?>"><?= _t('gen.js.new_article'); /* TODO: move string in JS*/ ?></a>
 	</div><?php
@@ -110,14 +110,14 @@ $today = @strtotime('today');
 	if ($nbEntries > 0):
 		call_user_func($this->callbackBeforePagination, $this, $nbEntries, $lastEntry);
 		$this->renderHelper('pagination');
-?></div><?php
+?></main><?php
 	else:
 		ob_end_clean();	//Discard the articles headers, as we have no articles
 ?>
-<div id="stream" class="prompt alert alert-warn normal">
+<main id="stream" class="prompt alert alert-warn normal">
 	<h2><?= _t('index.feed.empty') ?></h2>
 	<a href="<?= _url('subscription', 'add') ?>"><?= _t('index.feed.add') ?></a><br /><br />
-</div>
+</main>
 <?php endif; ?>
 
 <?php if ($nbEntries > 0 && FreshRSS_Context::$user_conf->show_nav_buttons) $this->partial('nav_entries'); ?>

+ 4 - 4
app/views/index/reader.phtml

@@ -7,8 +7,8 @@ call_user_func($this->callbackBeforeEntries, $this);
 $lazyload = FreshRSS_Context::$user_conf->lazyload;
 $content_width = FreshRSS_Context::$user_conf->content_width;
 ?>
+<main id="stream" class="reader">
 
-<div id="stream" class="reader">
 	<div id="new-article">
 		<a href="<?= Minz_Url::display(Minz_Request::currentRequest()) ?>"><?= _t('gen.js.new_article'); /* TODO: move string in JS*/ ?></a>
 	</div><?php
@@ -76,12 +76,12 @@ $content_width = FreshRSS_Context::$user_conf->content_width;
 	if ($nbEntries > 0):
 		call_user_func($this->callbackBeforePagination, $this, $nbEntries, $lastEntry);
 		$this->renderHelper('pagination');
-?></div><?php
+?></main><?php
 	else:
 		ob_end_clean();	//Discard the articles headers, as we have no articles
 ?>
-<div id="stream" class="prompt alert alert-warn reader">
+<main id="stream" class="prompt alert alert-warn reader">
 	<h2><?= _t('index.feed.empty') ?></h2>
 	<a href="<?= _url('subscription', 'add') ?>"><?= _t('index.feed.add') ?></a><br /><br />
-</div>
+</main>
 <?php endif; ?>