diff options
| author | 2013-03-19 21:35:02 +0100 | |
|---|---|---|
| committer | 2013-03-19 21:35:02 +0100 | |
| commit | 82386d8630bf5e23cffad3cf3643fcd00835ef50 (patch) | |
| tree | 1f6e620631bc44f195ef5f262ce5de1b01969118 | |
| parent | c47b3dc50a60622521b9050d7ee54e2f7c758ac8 (diff) | |
Fix bug #33 : possibilité d'assigner directement la catégorie à un flux lors de son ajout + correction design
| -rwxr-xr-x | app/controllers/configureController.php | 3 | ||||
| -rwxr-xr-x | app/controllers/feedController.php | 2 | ||||
| -rw-r--r-- | app/layout/aside_feed.phtml | 21 | ||||
| -rw-r--r-- | public/theme/base.css | 16 |
4 files changed, 38 insertions, 4 deletions
diff --git a/app/controllers/configureController.php b/app/controllers/configureController.php index b0fd4a8f9..243c155f9 100755 --- a/app/controllers/configureController.php +++ b/app/controllers/configureController.php @@ -61,6 +61,9 @@ class configureController extends ActionController { } public function feedAction () { + $catDAO = new CategoryDAO (); + $this->view->categories = $catDAO->listCategories (); + $feedDAO = new FeedDAO (); $this->view->feeds = $feedDAO->listFeeds (); diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 622adb96f..e16161842 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -15,10 +15,12 @@ class feedController extends ActionController { } else { if (Request::isPost ()) { $url = Request::param ('url_rss'); + $cat = Request::param ('category'); $params = array (); try { $feed = new Feed ($url); + $feed->_category ($cat); $feed->load (); $feedDAO = new FeedDAO (); diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index 71603c8ab..30fa8c994 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -1,9 +1,28 @@ -<ul class="nav nav-list aside"> +<ul class="nav nav-list aside aside_feed"> <li class="nav-header">Vos flux RSS</li> <li class="nav-form"><form id="add_rss" method="post" action="<?php echo Url::display (array ('c' => 'feed', 'a' => 'add')); ?>"> <div class="stick"> <input type="url" name="url_rss" placeholder="Ajouter un flux RSS" /> + <div class="dropdown"> + <div id="dropdown-cat" class="dropdown-target"></div> + + <a class="dropdown-toggle btn" href="#dropdown-cat"><i class="icon i_down"></i></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close"><i class="icon i_close"></i></a></li> + + <li class="dropdown-header">Catégorie</li> + + <?php foreach ($this->categories as $cat) { ?> + <li class="item"> + <label class="radio" for="radio_<?php echo $cat->id (); ?>"> + <input type="radio" name="category" id="radio_<?php echo $cat->id (); ?>" value="<?php echo $cat->id (); ?>"<?php echo $cat->id ()=='000000' ? ' checked="checked"' : ''; ?>/> + <?php echo $cat->name (); ?> + </label> + </li> + <?php } ?> + </ul> + </div> <button class="btn" type="submit"><i class="icon i_add"></i></button> </div> </form></li> diff --git a/public/theme/base.css b/public/theme/base.css index e918f32ab..0532db6d2 100644 --- a/public/theme/base.css +++ b/public/theme/base.css @@ -65,6 +65,7 @@ label { padding: 5px 0; font-size: 14px; line-height: 25px; + cursor: pointer; } input, select, textarea { display: inline-block; @@ -321,22 +322,25 @@ input, select, textarea { padding: 0 5px; color: #888; font-weight: bold; + font-size: 14px; + line-height: 30px; } .dropdown .dropdown-menu .item { display: block; height: 30px; - padding: 0 25px; font-size: 90%; line-height: 30px; } - .dropdown .dropdown-menu .item a { + .dropdown .dropdown-menu .item > * { display: block; + padding: 0 25px; + line-height: 30px; } .dropdown .dropdown-menu .item:hover { background: #0062BE; color: #fff; } - .dropdown .dropdown-menu .item:hover a { + .dropdown .dropdown-menu .item:hover > * { color: #fff; text-decoration: none; } @@ -508,6 +512,12 @@ input, select, textarea { .aside.aside_flux { padding: 10px 0; } + .aside.aside_feed .nav-form input { + width: 140px; + } + .aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; + } .nav_menu { width: 100%; |
