summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-01 10:06:04 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-01 10:06:04 +0200
commit7481887db746fd2d6eefab021776b8abd4076429 (patch)
tree1c55bd7d354a52e3a1601cc78bb4ee37a579edc9
parent0d5a1f3a659b6f407b47859c794a662075e3f48e (diff)
Load feed configuration on the same page
Need improvements See https://github.com/marienfressinaud/FreshRSS/issues/646
-rwxr-xr-xapp/Controllers/configureController.php4
-rw-r--r--app/views/configure/categorize.phtml5
-rw-r--r--app/views/configure/feed.phtml8
-rw-r--r--p/scripts/main.js30
-rw-r--r--p/themes/base-theme/template.css5
5 files changed, 49 insertions, 3 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php
index a7def6d9a..dd7a0a441 100755
--- a/app/Controllers/configureController.php
+++ b/app/Controllers/configureController.php
@@ -90,6 +90,10 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
* Default values are empty strings unless specified.
*/
public function feedAction() {
+ if (Minz_Request::param('ajax')) {
+ $this->view->_useLayout(false);
+ }
+
$catDAO = new FreshRSS_CategoryDAO();
$this->view->categories = $catDAO->listCategories(false);
diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtml
index 8f77f9724..008dc8c98 100644
--- a/app/views/configure/categorize.phtml
+++ b/app/views/configure/categorize.phtml
@@ -73,7 +73,7 @@
$empty = $feed->nbEntries() == 0 ? ' empty' : '';
?>
<li class="item<?php echo $error, $empty; ?>">
- <a class="configure" href="<?php echo _url('configure', 'feed', 'id', $feed->id()); ?>"><?php echo _i('configure'); ?></a>
+ <a class="configure open-slider" href="<?php echo _url('configure', 'feed', 'id', $feed->id()); ?>"><?php echo _i('configure'); ?></a>
<img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <?php echo $feed->name(); ?>
</li>
<?php }
@@ -85,3 +85,6 @@
</div>
<?php } ?>
</div>
+
+<div id="slider">
+</div>
diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml
index e96a28739..f58ac65af 100644
--- a/app/views/configure/feed.phtml
+++ b/app/views/configure/feed.phtml
@@ -1,8 +1,12 @@
-<?php $this->partial ('aside_feed'); ?>
+<?php
+ if (!Minz_Request::param('ajax')) {
+ $this->partial('aside_feed');
+ }
+?>
<?php if ($this->flux) { ?>
<div class="post">
- <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <?php echo Minz_Translate::t ('or'); ?> <a href="<?php echo _url ('index', 'index', 'get', 'f_' . $this->flux->id ()); ?>"><?php echo Minz_Translate::t ('filter'); ?></a>
+ <!-- <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <?php echo Minz_Translate::t ('or'); ?> <a href="<?php echo _url ('index', 'index', 'get', 'f_' . $this->flux->id ()); ?>"><?php echo Minz_Translate::t ('filter'); ?></a> -->
<h1><?php echo $this->flux->name (); ?></h1>
<?php echo $this->flux->description (); ?>
diff --git a/p/scripts/main.js b/p/scripts/main.js
index f6d5d2907..7fed7a819 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -1240,6 +1240,35 @@ function faviconNbUnread(n) {
}
}
+function init_slider_observers() {
+ var slider = $('#slider');
+ if (slider.length < 1) {
+ return;
+ }
+
+ $('.open-slider').on('click', function() {
+ if (ajax_loading) {
+ return false;
+ }
+
+ ajax_loading = true;
+
+ var url_slide = $(this).attr('href');
+
+ $.ajax({
+ type: 'GET',
+ url: url_slide,
+ data : { ajax: true }
+ }).done(function (data) {
+ slider.html(data);
+ slider.show();
+ ajax_loading = false;
+ });
+
+ return false;
+ })
+}
+
function init_all() {
if (!(window.$ && window.url_freshrss)) {
if (window.console) {
@@ -1275,6 +1304,7 @@ function init_all() {
init_feed_observers();
init_password_observers();
init_stats_observers();
+ init_slider_observers();
}
if (window.console) {
diff --git a/p/themes/base-theme/template.css b/p/themes/base-theme/template.css
index a5a29ab23..397f943a6 100644
--- a/p/themes/base-theme/template.css
+++ b/p/themes/base-theme/template.css
@@ -645,6 +645,11 @@ br + br + br {
display: none;
}
+/*=== Slider */
+#slider {
+ min-height: 50px;
+}
+
/*=== DIVERS */
/*===========*/
.nav-login,