diff options
| author | 2014-01-19 22:25:49 +0100 | |
|---|---|---|
| committer | 2014-01-19 22:25:49 +0100 | |
| commit | 4e4b0f717fe0a8378e2b751393a8c19d1ada6eb2 (patch) | |
| tree | 6b268cfe46eb3eee8ebaddcd1e17067eaca0214f /app/views | |
| parent | 12e0b6b094041fc22937520b3218e4f61915fd50 (diff) | |
| parent | 79d4893fc792119c390d2f744246df210b74f637 (diff) | |
Merge remote-tracking branch 'origin/dev' into beta
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/configure/display.phtml | 13 | ||||
| -rw-r--r-- | app/views/configure/feed.phtml | 2 | ||||
| -rw-r--r-- | app/views/configure/users.phtml | 44 | ||||
| -rwxr-xr-x | app/views/entry/bookmark.phtml | 2 | ||||
| -rwxr-xr-x | app/views/entry/read.phtml | 2 | ||||
| -rw-r--r-- | app/views/helpers/javascript_vars.phtml | 89 | ||||
| -rw-r--r-- | app/views/helpers/view/global_view.phtml | 13 | ||||
| -rw-r--r-- | app/views/helpers/view/normal_view.phtml | 127 | ||||
| -rw-r--r-- | app/views/helpers/view/reader_view.phtml | 5 | ||||
| -rw-r--r-- | app/views/index/about.phtml | 2 | ||||
| -rw-r--r-- | app/views/index/formLogin.phtml | 43 | ||||
| -rw-r--r-- | app/views/index/index.phtml | 14 | ||||
| -rw-r--r-- | app/views/javascript/nbUnreadsPerFeed.phtml | 8 | ||||
| -rw-r--r-- | app/views/javascript/nonce.phtml | 2 |
14 files changed, 220 insertions, 146 deletions
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 11a987610..725356c8d 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -21,10 +21,11 @@ <div class="form-group"> <label class="group-name" for="theme"><?php echo Minz_Translate::t ('theme'); ?></label> <div class="group-controls"> - <select name="theme" id="theme"> + <select name="theme" id="theme" required=""> + <option></option> <?php foreach ($this->themes as $theme) { ?> - <option value="<?php echo $theme['path']; ?>"<?php echo $this->conf->theme === $theme['path'] ? ' selected="selected"' : ''; ?>> - <?php echo $theme['name'] . ' ' . Minz_Translate::t ('by') . ' ' . $theme['author']; ?> + <option value="<?php echo $theme['id']; ?>"<?php echo $this->conf->theme === $theme['id'] ? ' selected="selected"' : ''; ?>> + <?php echo $theme['name'] . ' — ' . Minz_Translate::t ('by') . ' ' . $theme['author']; ?> </option> <?php } ?> </select> @@ -81,7 +82,7 @@ <label class="checkbox" for="auto_load_more"> <input type="checkbox" name="auto_load_more" id="auto_load_more" value="1"<?php echo $this->conf->auto_load_more ? ' checked="checked"' : ''; ?> /> <?php echo Minz_Translate::t ('auto_load_more'); ?> - <noscript> - <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> </label> </div> </div> @@ -91,7 +92,7 @@ <label class="checkbox" for="display_posts"> <input type="checkbox" name="display_posts" id="display_posts" value="1"<?php echo $this->conf->display_posts ? ' checked="checked"' : ''; ?> /> <?php echo Minz_Translate::t ('display_articles_unfolded'); ?> - <noscript> - <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> </label> </div> </div> @@ -101,7 +102,7 @@ <label class="checkbox" for="lazyload"> <input type="checkbox" name="lazyload" id="lazyload" value="1"<?php echo $this->conf->lazyload ? ' checked="checked"' : ''; ?> /> <?php echo Minz_Translate::t ('img_with_lazyload'); ?> - <noscript> - <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> </label> </div> </div> diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml index a0fe39f8a..fc26ab58b 100644 --- a/app/views/configure/feed.phtml +++ b/app/views/configure/feed.phtml @@ -11,7 +11,7 @@ <p class="alert alert-error"><span class="alert-head"><?php echo Minz_Translate::t ('damn'); ?></span> <?php echo Minz_Translate::t ('feed_in_error'); ?></p> <?php } ?> - <form method="post" action="<?php echo _url ('configure', 'feed', 'id', $this->flux->id ()); ?>"> + <form method="post" action="<?php echo _url ('configure', 'feed', 'id', $this->flux->id ()); ?>" autocomplete="off"> <legend><?php echo Minz_Translate::t ('informations'); ?></legend> <div class="form-group"> <label class="group-name" for="name"><?php echo Minz_Translate::t ('title'); ?></label> diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml index d40a3ad5b..990c80acc 100644 --- a/app/views/configure/users.phtml +++ b/app/views/configure/users.phtml @@ -18,6 +18,14 @@ </div> <div class="form-group"> + <label class="group-name" for="passwordPlain"><?php echo Minz_Translate::t('password_form'); ?></label> + <div class="group-controls"> + <input type="password" id="passwordPlain" name="passwordPlain" pattern=".{7,}" /> + <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> + </div> + </div> + + <div class="form-group"> <label class="group-name" for="mail_login"><?php echo Minz_Translate::t('persona_connection_email'); ?></label> <?php $mail = $this->conf->mail_login; ?> <div class="group-controls"> @@ -26,14 +34,12 @@ </div> </div> - <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?> <div class="form-group form-actions"> <div class="group-controls"> <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> </div> </div> - <?php } ?> <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?> @@ -44,41 +50,35 @@ <div class="group-controls"> <select id="auth_type" name="auth_type" required="required"> <option value=""></option> + <option value="form"<?php echo Minz_Configuration::authType() === 'form' ? ' selected="selected"' : '', version_compare(PHP_VERSION, '5.3', '<') ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('auth_form'); ?></option> + <option value="persona"<?php echo Minz_Configuration::authType() === 'persona' ? ' selected="selected"' : '', $this->conf->mail_login == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('auth_persona'); ?></option> + <option value="http_auth"<?php echo Minz_Configuration::authType() === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('http_auth'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> <option value="none"<?php echo Minz_Configuration::authType() === 'none' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t('auth_none'); ?></option> - <option value="http_auth"<?php echo Minz_Configuration::authType() === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>>HTTP Auth</option> - <option value="persona"<?php echo Minz_Configuration::authType() === 'persona' ? ' selected="selected"' : '', $this->conf->mail_login == '' ? ' disabled="disabled"' : ''; ?>>Mozilla Persona</option> </select> - <code>$_SERVER['REMOTE_USER'] = `<?php echo httpAuthUser(); ?>`</code> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> </div> </div> - <?php if (Minz_Configuration::authType() === 'persona') { ?> - - <legend>Mozilla Persona</legend> <div class="form-group"> <div class="group-controls"> <label class="checkbox" for="anon_access"> - <input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo Minz_Configuration::allowAnonymous() ? ' checked="checked"' : ''; ?> /> + <input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo Minz_Configuration::allowAnonymous() ? ' checked="checked"' : '', + Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> <?php echo Minz_Translate::t('allow_anonymous', Minz_Configuration::defaultUser()); ?> </label> </div> </div> + <?php if (Minz_Configuration::canLogIn()) { ?> <div class="form-group"> <label class="group-name" for="token"><?php echo Minz_Translate::t('auth_token'); ?></label> <?php $token = $this->conf->token; ?> <div class="group-controls"> - <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"/> + <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"<?php + echo Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?> </div> </div> + <?php } ?> <div class="form-group form-actions"> <div class="group-controls"> @@ -86,8 +86,6 @@ <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> </div> </div> - - <?php } ?> </form> <form method="post" action="<?php echo _url('users', 'delete'); ?>"> @@ -134,6 +132,14 @@ </div> <div class="form-group"> + <label class="group-name" for="new_user_passwordPlain"><?php echo Minz_Translate::t('password_form'); ?></label> + <div class="group-controls"> + <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" pattern=".{7,}" /> + <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> + </div> + </div> + + <div class="form-group"> <label class="group-name" for="new_user_email"><?php echo Minz_Translate::t('persona_connection_email'); ?></label> <?php $mail = $this->conf->mail_login; ?> <div class="group-controls"> diff --git a/app/views/entry/bookmark.phtml b/app/views/entry/bookmark.phtml index 55b2d3d3d..c1fc32b7f 100755 --- a/app/views/entry/bookmark.phtml +++ b/app/views/entry/bookmark.phtml @@ -1,7 +1,7 @@ <?php header('Content-Type: application/json; charset=UTF-8'); -if (Minz_Request::param ('is_favorite')) { +if (Minz_Request::param ('is_favorite', true)) { Minz_Request::_param ('is_favorite', 0); } else { Minz_Request::_param ('is_favorite', 1); diff --git a/app/views/entry/read.phtml b/app/views/entry/read.phtml index d063ba3d5..9e79d4c07 100755 --- a/app/views/entry/read.phtml +++ b/app/views/entry/read.phtml @@ -1,7 +1,7 @@ <?php header('Content-Type: application/json; charset=UTF-8'); -if (Minz_Request::param ('is_read')) { +if (Minz_Request::param ('is_read', true)) { Minz_Request::_param ('is_read', 0); } else { Minz_Request::_param ('is_read', 1); diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 92c068f7e..0ecdc1bca 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -1,47 +1,44 @@ <?php - echo '"use strict";', "\n"; - $mark = $this->conf->mark_when; - echo 'var ', - 'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', - ',auto_mark_article=', $mark['article'] ? 'true' : 'false', - ',auto_mark_site=', $mark['site'] ? 'true' : 'false', - ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false', - ',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false', - ',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false', - ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false'; - - $s = $this->conf->shortcuts; - echo ',shortcuts={', - 'mark_read:"', $s['mark_read'], '",', - 'mark_favorite:"', $s['mark_favorite'], '",', - 'go_website:"', $s['go_website'], '",', - 'prev_entry:"', $s['prev_entry'], '",', - 'next_entry:"', $s['next_entry'], '",', - 'collapse_entry:"', $s['collapse_entry'], '",', - 'load_more:"', $s['load_more'], '",', - 'auto_share:"', $s['auto_share'], '"', - "},\n"; - - if (Minz_Request::param ('output') === 'global') { - echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n"; - } - - $mail = Minz_Session::param ('mail', 'null'); - if ($mail != 'null') { - $mail = '"' . $mail . '"'; - } - echo 'use_persona=', Minz_Configuration::authType() === 'persona' ? 'true' : 'false', - ',url_freshrss="', _url ('index', 'index'), '",', - 'url_login="', _url ('index', 'login'), '",', - 'url_logout="', _url ('index', 'logout'), '",', - 'current_user_mail=', $mail, ",\n"; - - echo 'load_shortcuts=', Minz_Request::controllerName () === 'index' && Minz_Request::actionName () === 'index' ? 'true' : 'false', ",\n"; - - echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n"; - - $autoActualise = Minz_Session::param('actualize_feeds', false); - echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n"; - if ($autoActualise) { - Minz_Session::_param('actualize_feeds', false); - } + +echo '"use strict";', "\n"; + +$mark = $this->conf->mark_when; +echo 'var ', + 'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', + ',auto_mark_article=', $mark['article'] ? 'true' : 'false', + ',auto_mark_site=', $mark['site'] ? 'true' : 'false', + ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false', + ',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false', + ',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false', + ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false'; + +$s = $this->conf->shortcuts; +echo ',shortcuts={', + 'mark_read:"', $s['mark_read'], '",', + 'mark_favorite:"', $s['mark_favorite'], '",', + 'go_website:"', $s['go_website'], '",', + 'prev_entry:"', $s['prev_entry'], '",', + 'next_entry:"', $s['next_entry'], '",', + 'collapse_entry:"', $s['collapse_entry'], '",', + 'load_more:"', $s['load_more'], '",', + 'auto_share:"', $s['auto_share'], '"', +"},\n"; + +if (Minz_Request::param ('output') === 'global') { + echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n"; +} + +$authType = Minz_Configuration::authType(); +if ($authType === 'persona') { + echo 'current_user_mail="' . Minz_Session::param ('mail', '') . '",'; +} + +echo 'authType="', $authType, '",', + 'url_freshrss="', _url ('index', 'index'), '",', + 'url_login="', _url ('index', 'login'), '",', + 'url_logout="', _url ('index', 'logout'), '",'; + +echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n"; + +$autoActualise = Minz_Session::param('actualize_feeds', false); +echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n"; diff --git a/app/views/helpers/view/global_view.phtml b/app/views/helpers/view/global_view.phtml index 58ff13d4e..4fb807649 100644 --- a/app/views/helpers/view/global_view.phtml +++ b/app/views/helpers/view/global_view.phtml @@ -2,13 +2,22 @@ <div id="stream" class="global categories"> <?php + $arUrl = array('c' => 'index', 'a' => 'index', 'params' => array()); + if ($this->conf->view_mode !== 'normal') { + $arUrl['params']['output'] = 'normal'; + } + $p = Minz_Request::param('state', ''); + if (($p != '') && ($this->conf->default_view !== $p)) { + $arUrl['params']['state'] = $p; + } + foreach ($this->cat_aside as $cat) { $feeds = $cat->feeds (); if (!empty ($feeds)) { ?> <div class="box-category"> <div class="category"> - <a data-unread="<?php echo $cat->nbNotRead (); ?>" class="btn" href="<?php echo _url ('index', 'index', 'get', 'c_' . $cat->id (), 'output', 'normal'); ?>"> + <a data-unread="<?php echo $cat->nbNotRead (); ?>" class="btn" href="<?php $arUrl['params']['get'] = 'c_' . $cat->id (); echo Minz_Url::display($arUrl); ?>"> <?php echo $cat->name(); ?> </a> </div> @@ -17,7 +26,7 @@ <?php $not_read = $feed->nbNotRead (); ?> <li id="f_<?php echo $feed->id (); ?>" class="item<?php echo $feed->inError () ? ' error' : ''; ?><?php echo $feed->nbEntries () == 0 ? ' empty' : ''; ?>"> <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> - <a class="feed" data-unread="<?php echo $feed->nbNotRead (); ?>" data-priority="<?php echo $feed->priority (); ?>" href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id (), 'output', 'normal'); ?>"> + <a class="feed" data-unread="<?php echo $feed->nbNotRead (); ?>" data-priority="<?php echo $feed->priority (); ?>" href="<?php $arUrl['params']['get'] = 'f_' . $feed->id(); echo Minz_Url::display($arUrl); ?>"> <?php echo $feed->name(); ?> </a> </li> diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index 5e46f3c8e..a1df87579 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -37,50 +37,59 @@ if (!empty($this->entries)) { $bottomline_link = $this->conf->bottomline_link; ?> -<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"> - <?php foreach ($this->entries as $item) { ?> +<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php + foreach ($this->entries as $item) { + if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) { + ?><div class="day" id="day_today"><?php + echo Minz_Translate::t ('today'); + ?><span class="date"> — <?php echo timestamptodate (time (), false); ?></span><?php + ?><span class="name"><?php echo $this->currentName; ?></span><?php + ?></div><?php + $display_today = false; + } + if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $this->today)) { + ?><div class="day" id="day_yesterday"><?php + echo Minz_Translate::t ('yesterday'); + ?><span class="date"> — <?php echo timestamptodate (time () - 86400, false); ?></span><?php + ?><span class="name"><?php echo $this->currentName; ?></span><?php + ?></div><?php + $display_yesterday = false; + } + if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) { + ?><div class="day" id="day_before_yesterday"><?php + echo Minz_Translate::t ('before_yesterday'); + ?><span class="name"><?php echo $this->currentName; ?></span><?php + ?></div><?php + $display_others = false; + } - <?php if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) { ?> - <div class="day" id="day_today"> - <?php echo Minz_Translate::t ('today'); ?> - <span class="date"> - <?php echo timestamptodate (time (), false); ?></span> - <span class="name"><?php echo $this->currentName; ?></span> - </div> - <?php $display_today = false; } ?> - <?php if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $this->today)) { ?> - <div class="day" id="day_yesterday"> - <?php echo Minz_Translate::t ('yesterday'); ?> - <span class="date"> - <?php echo timestamptodate (time () - 86400, false); ?></span> - <span class="name"><?php echo $this->currentName; ?></span> - </div> - <?php $display_yesterday = false; } ?> - <?php if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) { ?> - <div class="day" id="day_before_yesterday"> - <?php echo Minz_Translate::t ('before_yesterday'); ?> - <span class="name"><?php echo $this->currentName; ?></span> - </div> - <?php $display_others = false; } ?> - - <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> + ?><div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> <ul class="horizontal-list flux_header"><?php if ($this->loginOk) { if ($topline_read) { ?><li class="item manage"><?php - ?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php + $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id ())); + if ($item->isRead()) { + $arUrl['params']['is_read'] = 0; + } + ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php ?></li><?php } if ($topline_favorite) { - ?><li class="item manage"><?php - ?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ())); + if ($item->isFavorite()) { + $arUrl['params']['is_favorite'] = 0; + } + ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php ?></li><?php } } $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache if (empty($feed)) $feed = $item->feed (true); - ?> - <li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li> + ?><li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li> <li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li> <?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> <?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?> @@ -103,24 +112,30 @@ if (!empty($this->entries)) { if ($this->loginOk) { if ($bottomline_read) { ?><li class="item manage"><?php - ?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php + $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id ())); + if ($item->isRead()) { + $arUrl['params']['is_read'] = 0; + } + ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php ?></li><?php } if ($bottomline_favorite) { ?><li class="item manage"><?php - ?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php + $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ())); + if ($item->isFavorite()) { + $arUrl['params']['is_favorite'] = 0; + } + ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php ?></li><?php } } ?> - <li class="item"> - <?php + <li class="item"><?php if ($bottomline_sharing) { $link = urlencode ($item->link ()); - $title = urlencode ($item->title () . ' - ' . $feed->name ()); - ?> - <div class="dropdown"> + $title = urlencode ($item->title () . ' · ' . $feed->name ()); + ?><div class="dropdown"> <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div> <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>"> <?php echo FreshRSS_Themes::icon('share'); ?> @@ -181,29 +196,30 @@ if (!empty($this->entries)) { </ul> </div> <?php } ?> - </li> - <?php - $tags = $bottomline_tags ? $item->tags() : null; - if (!empty($tags)) { - ?> - <li class="item"> + </li><?php + $tags = $bottomline_tags ? $item->tags() : null; + if (!empty($tags)) { + ?><li class="item"> <div class="dropdown"> <div id="dropdown-tags-<?php echo $item->id ();?>" class="dropdown-target"></div> - <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"> - <?php echo FreshRSS_Themes::icon('tag'); ?> - <?php echo Minz_Translate::t ('related_tags'); ?> - </a> + <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"><?php + echo FreshRSS_Themes::icon('tag'), Minz_Translate::t ('related_tags'); + ?></a> <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li> - <?php foreach($tags as $tag) { ?> - <li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li> - <?php } ?> + <li class="dropdown-close"><a href="#close">❌</a></li><?php + foreach($tags as $tag) { + ?><li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li><?php + } ?> </ul> </div> - </li> - <?php } ?> - <?php if ($bottomline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> - <?php if ($bottomline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?> + </li><?php + } + if ($bottomline_date) { + ?><li class="item date"><?php echo $item->date (); ?></li><?php + } + if ($bottomline_link) { + ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php + } ?> </ul> </div> </div> @@ -217,5 +233,6 @@ if (!empty($this->entries)) { <?php } else { ?> <div id="stream" class="alert alert-warn normal"> <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span> + <?php echo Minz_Translate::t ('think_to_add'); ?> </div> -<?php } ?>
\ No newline at end of file +<?php } ?> diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml index 2f64e672a..bda96e86d 100644 --- a/app/views/helpers/view/reader_view.phtml +++ b/app/views/helpers/view/reader_view.phtml @@ -22,7 +22,7 @@ if (!empty($this->entries)) { <div class="author"> <?php $author = $item->author (); ?> - <?php echo $author != '' ? Minz_Translate::t ('by_author', $author) . ' - ' : ''; ?> + <?php echo $author != '' ? Minz_Translate::t ('by_author', $author) . ' — ' : ''; ?> <?php echo $item->date (); ?> </div> @@ -44,5 +44,6 @@ if (!empty($this->entries)) { <?php } else { ?> <div id="stream" class="alert alert-warn reader"> <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span> + <?php echo Minz_Translate::t ('think_to_add'); ?> </div> -<?php } ?>
\ No newline at end of file +<?php } ?> diff --git a/app/views/index/about.phtml b/app/views/index/about.phtml index ae64727d7..76ff804d8 100644 --- a/app/views/index/about.phtml +++ b/app/views/index/about.phtml @@ -8,7 +8,7 @@ <dd><a href="<?php echo FRESHRSS_WEBSITE; ?>"><?php echo FRESHRSS_WEBSITE; ?></a></dd> <dt><?php echo Minz_Translate::t ('lead_developer'); ?></dt> - <dd><a href="mailto:contact@marienfressinaud.fr">Marien Fressinaud</a> - <a href="http://marienfressinaud.fr"><?php echo Minz_Translate::t ('website'); ?></a></dd> + <dd><a href="mailto:contact@marienfressinaud.fr">Marien Fressinaud</a> — <a href="http://marienfressinaud.fr"><?php echo Minz_Translate::t ('website'); ?></a></dd> <dt><?php echo Minz_Translate::t ('bugs_reports'); ?></dt> <dd><?php echo Minz_Translate::t ('github_or_email'); ?></dd> diff --git a/app/views/index/formLogin.phtml b/app/views/index/formLogin.phtml new file mode 100644 index 000000000..cc43bcd19 --- /dev/null +++ b/app/views/index/formLogin.phtml @@ -0,0 +1,43 @@ +<div class="post content"> + +<?php +if (Minz_Configuration::canLogIn()) { + ?><h1><?php echo Minz_Translate::t('login'); ?></h1><?php + switch (Minz_Configuration::authType()) { + + case 'form': + ?><form id="loginForm" method="post" action="<?php echo _url('index', 'formLogin'); ?>"> + <div class="form-group"> + <label class="group-name" for="username"><?php echo Minz_Translate::t('username'); ?></label> + <div class="group-controls"> + <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" /> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="passwordPlain"><?php echo Minz_Translate::t('password'); ?></label> + <div class="group-controls"> + <input type="password" id="passwordPlain" required="required" /> + <input type="hidden" id="challenge" name="challenge" /> + <noscript><strong><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></strong></noscript> + </div> + </div> + <div class="form-group form-actions"> + <div class="group-controls"> + <button id="loginButton" type="submit" class="btn btn-important"><?php echo Minz_Translate::t('login'); ?></button> + </div> + </div> + </form><?php + break; + + case 'persona': + ?><p><?php echo FreshRSS_Themes::icon('login'); ?> <a class="signin" href="#"><?php echo Minz_Translate::t('login'); ?></a></p><?php + break; + } +} else { + ?><h1>FreshRSS</h1> + <p><?php echo Minz_Translate::t('forbidden_access', Minz_Configuration::authType()); ?></p><?php +} +?> + + <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo Minz_Translate::t('about_freshrss'); ?></a></p> +</div> diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 549d0b61e..9a7c9f3b9 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -1,15 +1,5 @@ <?php -function showForbidden() { -?><div class="post content"> - <h1><?php echo Minz_Translate::t ('forbidden_access'); ?></h1> - <p><?php echo Minz_Configuration::canLogIn() ? - Minz_Translate::t ('forbidden_access_description') : - Minz_Translate::t ('forbidden_access') . ' (' . Minz_Configuration::authType() . ')'; ?></p> - <p><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about_freshrss'); ?></a></p> -</div><?php -} - $output = Minz_Request::param ('output', 'normal'); if ($this->loginOk || Minz_Configuration::allowAnonymous()) { @@ -31,8 +21,8 @@ if ($this->loginOk || Minz_Configuration::allowAnonymous()) { if ($token_is_ok) { $this->renderHelper ('view/rss_view'); } else { - showForbidden(); + Minz_Request::forward(array('c' => 'index', 'a' => 'formLogin'), true); } } else { - showForbidden(); + Minz_Request::forward(array('c' => 'index', 'a' => 'formLogin'), true); } diff --git a/app/views/javascript/nbUnreadsPerFeed.phtml b/app/views/javascript/nbUnreadsPerFeed.phtml new file mode 100644 index 000000000..68f98ce9e --- /dev/null +++ b/app/views/javascript/nbUnreadsPerFeed.phtml @@ -0,0 +1,8 @@ +<?php +$result = array(); +foreach ($this->categories as $cat) { + foreach ($cat->feeds() as $feed) { + $result[$feed->id()] = $feed->nbNotRead(); + } +} +echo json_encode($result); diff --git a/app/views/javascript/nonce.phtml b/app/views/javascript/nonce.phtml new file mode 100644 index 000000000..4ac46c8fc --- /dev/null +++ b/app/views/javascript/nonce.phtml @@ -0,0 +1,2 @@ +<?php +echo json_encode(array('salt1' => $this->salt1, 'nonce' => $this->nonce)); |
