<commit_before><?php $actual_view = Minz_Request::actionName(); ?>

<div class="nav_menu">
	<?php if ($actual_view === 'normal') { ?>
	<a class="btn toggle_aside" href="#aside_feed"><?php echo _i('category'); ?></a>
	<?php } ?>

	<?php if (FreshRSS_Auth::hasAccess()) { ?>
	<div id="nav_menu_actions" class="stick">
		<?php
			$states = array(
				'read' => FreshRSS_Entry::STATE_READ,
				'unread' => FreshRSS_Entry::STATE_NOT_READ,
				'starred' => FreshRSS_Entry::STATE_FAVORITE,
				'non-starred' => FreshRSS_Entry::STATE_NOT_FAVORITE,
			);

			foreach ($states as $state_str => $state) {
				$state_enabled = FreshRSS_Context::isStateEnabled($state);
				$url_state = Minz_Request::currentRequest();
				$url_state['params']['state'] = FreshRSS_Context::getRevertState($state);
		?>
		<a id="toggle-<?php echo $state_str; ?>"
		   class="btn <?php echo $state_enabled ? 'active' : ''; ?>"
		   aria-checked="<?php echo $state_enabled ? 'true' : 'false'; ?>"
		   title="<?php echo _t($state_str); ?>"
		   href="<?php echo Minz_Url::display($url_state); ?>"><?php echo _i($state_str); ?></a>
		<?php } ?>

		<div class="dropdown">
			<div id="dropdown-query" class="dropdown-target"></div>

			<a class="dropdown-toggle btn" href="#dropdown-query"><?php echo _i('down'); ?></a>
			<ul class="dropdown-menu">
				<li class="dropdown-close"><a href="#close">❌</a></li>

				<li class="dropdown-header">
					<?php echo _t('queries'); ?>
					<a class="no-mobile" href="<?php echo _url('configure', 'queries'); ?>"><?php echo _i('configure'); ?></a>
				</li>

				<?php foreach (FreshRSS_Context::$conf->queries as $query) { ?>
				<li class="item query">
					<a href="<?php echo $query['url']; ?>"><?php echo $query['name']; ?></a>
				</li>
				<?php } ?>

				<?php if (count(FreshRSS_Context::$conf->queries) > 0) { ?>
				<li class="separator no-mobile"></li>
				<?php } ?>

				<?php
					$url_query = Minz_Request::currentRequest();;
					$url_query['c'] = 'configure';
					$url_query['a'] = 'addQuery';
				?>
				<li class="item no-mobile"><a href="<?php echo Minz_Url::display($url_query); ?>"><?php echo _i('bookmark-add'); ?> <?php echo _t('add_query'); ?></a></li>
			</ul>
		</div>
	</div>

	<?php
		$get = FreshRSS_Context::currentGet();
		$string_mark = _t('mark_all_read');
		if ($get[0] == 'f') {
			$string_mark = _t('mark_feed_read');
		} elseif ($get[0] == 'c') {
			$string_mark = _t('mark_cat_read');
		}

		$mark_read_url = array(
			'c' => 'entry',
			'a' => 'read',
			'params' => array(
				'get' => $get,
				'nextGet' => FreshRSS_Context::$next_get,
				'idMax' => FreshRSS_Context::$id_max,
			)
		);
	?>

	<form id="mark-read-menu" method="post" style="display: none"></form>

	<div class="stick" id="nav_menu_read_all">
		<?php $confirm = FreshRSS_Context::$conf->reading_confirm ? 'confirm' : ''; ?>
		<button class="read_all btn <?php echo $confirm; ?>"
		        form="mark-read-menu"
		        formaction="<?php echo Minz_Url::display($mark_read_url); ?>"
		        type="submit"><?php echo _t('mark_read'); ?></button>

		<div class="dropdown">
			<div id="dropdown-read" class="dropdown-target"></div>

			<a class="dropdown-toggle btn" href="#dropdown-read"><?php echo _i('down'); ?></a>
			<ul class="dropdown-menu">
				<li class="dropdown-close"><a href="#close">❌</a></li>

				<li class="item">
					<button class="as-link <?php echo $confirm; ?>"
					        form="mark-read-menu"
					        formaction="<?php echo Minz_Url::display($mark_read_url); ?>"
					        type="submit"><?php echo $string_mark; ?></button>
				</li>
				<li class="separator"></li>
<?php
	$today = @strtotime('today');
	$mark_before_today = $mark_read_url;
	$mark_before_today['params']['idMax'] = $today . '000000';
	$mark_before_one_week = $mark_read_url;
	$mark_before_one_week['params']['idMax'] = ($today - 604800) . '000000';
?>
				<li class="item">
					<button class="as-link <?php echo $confirm; ?>"
					        form="mark-read-menu"
					        formaction="<?php echo Minz_Url::display($mark_before_today); ?>"
					        type="submit"><?php echo _t('before_one_day'); ?></button>
				</li>
				<li class="item">
					<button class="as-link <?php echo $confirm; ?>"
					        form="mark-read-menu"
					        formaction="<?php echo Minz_Url::display($mark_before_one_week); ?>"
					        type="submit"><?php echo _t('before_one_week'); ?></button>
				</li>
			</ul>
		</div>
	</div>
	<?php } ?>

	<?php $url_output = Minz_Request::currentRequest(); ?>
	<div class="stick" id="nav_menu_views">
		<?php $url_output['a'] = 'normal'; ?>
		<a class="view_normal btn <?php echo $actual_view == 'normal'? 'active' : ''; ?>" title="<?php echo _t('normal_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
			<?php echo _i("view-normal"); ?>
		</a>

		<?php $url_output['a'] = 'reader'; ?>
		<a class="view_reader btn <?php echo $actual_view == 'reader'? 'active' : ''; ?>" title="<?php echo _t('global_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
			<?php echo _i("view-reader"); ?>
		</a>

		<?php $url_output['a'] = 'global'; ?>
		<a class="view_global btn <?php echo $actual_view == 'global'? 'active' : ''; ?>" title="<?php echo _t('global_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
			<?php echo _i("view-global"); ?>
		</a><commit_msg>Inverse reader and global buttons in nav_menu<commit_after><?php $actual_view = Minz_Request::actionName(); ?>

<div class="nav_menu">
	<?php if ($actual_view === 'normal') { ?>
	<a class="btn toggle_aside" href="#aside_feed"><?php echo _i('category'); ?></a>
	<?php } ?>

	<?php if (FreshRSS_Auth::hasAccess()) { ?>
	<div id="nav_menu_actions" class="stick">
		<?php
			$states = array(
				'read' => FreshRSS_Entry::STATE_READ,
				'unread' => FreshRSS_Entry::STATE_NOT_READ,
				'starred' => FreshRSS_Entry::STATE_FAVORITE,
				'non-starred' => FreshRSS_Entry::STATE_NOT_FAVORITE,
			);

			foreach ($states as $state_str => $state) {
				$state_enabled = FreshRSS_Context::isStateEnabled($state);
				$url_state = Minz_Request::currentRequest();
				$url_state['params']['state'] = FreshRSS_Context::getRevertState($state);
		?>
		<a id="toggle-<?php echo $state_str; ?>"
		   class="btn <?php echo $state_enabled ? 'active' : ''; ?>"
		   aria-checked="<?php echo $state_enabled ? 'true' : 'false'; ?>"
		   title="<?php echo _t($state_str); ?>"
		   href="<?php echo Minz_Url::display($url_state); ?>"><?php echo _i($state_str); ?></a>
		<?php } ?>

		<div class="dropdown">
			<div id="dropdown-query" class="dropdown-target"></div>

			<a class="dropdown-toggle btn" href="#dropdown-query"><?php echo _i('down'); ?></a>
			<ul class="dropdown-menu">
				<li class="dropdown-close"><a href="#close">❌</a></li>

				<li class="dropdown-header">
					<?php echo _t('queries'); ?>
					<a class="no-mobile" href="<?php echo _url('configure', 'queries'); ?>"><?php echo _i('configure'); ?></a>
				</li>

				<?php foreach (FreshRSS_Context::$conf->queries as $query) { ?>
				<li class="item query">
					<a href="<?php echo $query['url']; ?>"><?php echo $query['name']; ?></a>
				</li>
				<?php } ?>

				<?php if (count(FreshRSS_Context::$conf->queries) > 0) { ?>
				<li class="separator no-mobile"></li>
				<?php } ?>

				<?php
					$url_query = Minz_Request::currentRequest();;
					$url_query['c'] = 'configure';
					$url_query['a'] = 'addQuery';
				?>
				<li class="item no-mobile"><a href="<?php echo Minz_Url::display($url_query); ?>"><?php echo _i('bookmark-add'); ?> <?php echo _t('add_query'); ?></a></li>
			</ul>
		</div>
	</div>

	<?php
		$get = FreshRSS_Context::currentGet();
		$string_mark = _t('mark_all_read');
		if ($get[0] == 'f') {
			$string_mark = _t('mark_feed_read');
		} elseif ($get[0] == 'c') {
			$string_mark = _t('mark_cat_read');
		}

		$mark_read_url = array(
			'c' => 'entry',
			'a' => 'read',
			'params' => array(
				'get' => $get,
				'nextGet' => FreshRSS_Context::$next_get,
				'idMax' => FreshRSS_Context::$id_max,
			)
		);
	?>

	<form id="mark-read-menu" method="post" style="display: none"></form>

	<div class="stick" id="nav_menu_read_all">
		<?php $confirm = FreshRSS_Context::$conf->reading_confirm ? 'confirm' : ''; ?>
		<button class="read_all btn <?php echo $confirm; ?>"
		        form="mark-read-menu"
		        formaction="<?php echo Minz_Url::display($mark_read_url); ?>"
		        type="submit"><?php echo _t('mark_read'); ?></button>

		<div class="dropdown">
			<div id="dropdown-read" class="dropdown-target"></div>

			<a class="dropdown-toggle btn" href="#dropdown-read"><?php echo _i('down'); ?></a>
			<ul class="dropdown-menu">
				<li class="dropdown-close"><a href="#close">❌</a></li>

				<li class="item">
					<button class="as-link <?php echo $confirm; ?>"
					        form="mark-read-menu"
					        formaction="<?php echo Minz_Url::display($mark_read_url); ?>"
					        type="submit"><?php echo $string_mark; ?></button>
				</li>
				<li class="separator"></li>
<?php
	$today = @strtotime('today');
	$mark_before_today = $mark_read_url;
	$mark_before_today['params']['idMax'] = $today . '000000';
	$mark_before_one_week = $mark_read_url;
	$mark_before_one_week['params']['idMax'] = ($today - 604800) . '000000';
?>
				<li class="item">
					<button class="as-link <?php echo $confirm; ?>"
					        form="mark-read-menu"
					        formaction="<?php echo Minz_Url::display($mark_before_today); ?>"
					        type="submit"><?php echo _t('before_one_day'); ?></button>
				</li>
				<li class="item">
					<button class="as-link <?php echo $confirm; ?>"
					        form="mark-read-menu"
					        formaction="<?php echo Minz_Url::display($mark_before_one_week); ?>"
					        type="submit"><?php echo _t('before_one_week'); ?></button>
				</li>
			</ul>
		</div>
	</div>
	<?php } ?>

	<?php $url_output = Minz_Request::currentRequest(); ?>
	<div class="stick" id="nav_menu_views">
		<?php $url_output['a'] = 'normal'; ?>
		<a class="view_normal btn <?php echo $actual_view == 'normal'? 'active' : ''; ?>" title="<?php echo _t('normal_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
			<?php echo _i("view-normal"); ?>
		</a>

		<?php $url_output['a'] = 'global'; ?>
		<a class="view_global btn <?php echo $actual_view == 'global'? 'active' : ''; ?>" title="<?php echo _t('global_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
			<?php echo _i("view-global"); ?>
		</a>

		<?php $url_output['a'] = 'reader'; ?>
		<a class="view_reader btn <?php echo $actual_view == 'reader'? 'active' : ''; ?>" title="<?php echo _t('global_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
			<?php echo _i("view-reader"); ?>
		</a>
{'fraction_non_alphanumeric': 0.2315004659832246, 'fraction_numerical': 0.00391425908667288, 'mean_word_length': 4.127090301003345, 'pattern_counts': {'":': 0, '<': 267, '<?xml version=': 0, '>': 297, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6478833', 'n_tokens_mistral': 4343, 'n_tokens_neox': 3828, 'n_words': 727}