diff options
| author | 2014-10-02 19:49:49 +0200 | |
|---|---|---|
| committer | 2014-10-02 19:49:49 +0200 | |
| commit | 43c1183c93d149f74dbb02887cfb0ca86c71fed8 (patch) | |
| tree | 530e926a456b07a869a0ea7a15616623c67b5d95 /app | |
| parent | 9b2ad32e98e4720d5ee422fccd3069f086ee8563 (diff) | |
| parent | ce43b1761b810c89e5e8660e8ae2638e97ca6339 (diff) | |
Merge branch '646-new-cat-system' into dev
Diffstat (limited to 'app')
| -rwxr-xr-x | app/Controllers/feedController.php | 20 | ||||
| -rw-r--r-- | app/Controllers/subscriptionController.php | 2 | ||||
| -rw-r--r-- | app/views/helpers/javascript_vars.phtml | 1 | ||||
| -rw-r--r-- | app/views/subscription/index.phtml | 11 |
4 files changed, 30 insertions, 4 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index e4859b110..b2b53185e 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -378,6 +378,26 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } } + public function moveAction() { + if (Minz_Request::isPost()) { + $feed_id = Minz_Request::param('f_id'); + $cat_id = Minz_Request::param('c_id'); + + $feedDAO = FreshRSS_Factory::createFeedDao(); + + $values = array( + 'category' => $cat_id, + ); + + if (!$feedDAO->updateFeed($feed_id, $values)) { + Minz_Error::error( + 404, + array('error' => array(_t('error_occurred'))) + ); + } + } + } + public function deleteAction() { if (Minz_Request::isPost()) { $id = Minz_Request::param('id'); diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index aabae7b8f..7cc8179a0 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -30,6 +30,8 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { * It displays categories and associated feeds. */ public function indexAction() { + Minz_View::appendScript(Minz_Url::display('/scripts/category.js?' . + @filemtime(PUBLIC_PATH . '/scripts/category.js'))); Minz_View::prependTitle(_t('subscription_management') . ' · '); $id = Minz_Request::param('id'); diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 1139eb446..71798369d 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -54,6 +54,7 @@ echo 'authType="', $authType, '",', echo 'str_confirmation_default="', Minz_Translate::t('confirm_action'), '"', ",\n"; echo 'str_notif_title_articles="', Minz_Translate::t('notif_title_new_articles'), '"', ",\n"; echo 'str_notif_body_articles="', Minz_Translate::t('notif_body_new_articles'), '"', ",\n"; +echo 'str_category_empty="', Minz_Translate::t('category_empty'), '"', ",\n"; echo 'html5_notif_timeout=', $this->conf->html5_notif_timeout,",\n"; diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml index 577ddd972..2c56f79ed 100644 --- a/app/views/subscription/index.phtml +++ b/app/views/subscription/index.phtml @@ -1,6 +1,6 @@ <?php $this->partial('aside_subscription'); ?> -<div class="post"> +<div class="post drop-section"> <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> <h2><?php echo _t('subscription_management'); ?></h2> @@ -113,21 +113,24 @@ </form> </div> - <ul class="box-content"> + <ul class="box-content" data-cat-id="<?php echo $cat->id(); ?>"> <?php if (!empty($feeds)) { ?> <?php foreach ($feeds as $feed) { $error = $feed->inError() ? ' error' : ''; $empty = $feed->nbEntries() == 0 ? ' empty' : ''; ?> - <li class="item<?php echo $error, $empty; ?>"> + <li class="item feed<?php echo $error, $empty; ?>" + draggable="true" + data-feed-id="<?php echo $feed->id(); ?>" + dropzone="move"> <a class="configure open-slider" href="<?php echo _url('subscription', 'feed', 'id', $feed->id()); ?>"><?php echo _i('configure'); ?></a> <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <?php echo $feed->name(); ?> </li> <?php } } else { ?> - <li class="item"><?php echo _t('category_empty'); ?></li> + <li class="item disabled" dropzone="move"><?php echo _t('category_empty'); ?></li> <?php } ?> </ul> </div> |
