Index: trunk/extensions/GPoC/templates/FilterRatingsTemplate.php |
— | — | @@ -11,15 +11,21 @@ |
12 | 12 | $selection = $this->data['selection']; |
13 | 13 | ?> |
14 | 14 | |
15 | | -<form method="GET"> |
| 15 | +<form method="GET" id="filterForm"> |
16 | 16 | <p> |
17 | 17 | Project Name: <input type="text" name="project" value="<?php echo $filters['r_project']?>" /> |
18 | 18 | Importance: <input type="text" name="importance" value="<?php echo $filters['r_importance']?>" /> |
19 | 19 | Quality: <input type="text" name="quality" value="<?php echo $filters['r_quality']?>" /> |
20 | 20 | <br /> |
21 | 21 | Categories (comma separated): <input type="text" name="categories" value="<?php echo $filters['categories']?>" /> |
22 | | -<input type="submit" /> |
| 22 | +<input type="submit" id="submit-query" /> |
23 | 23 | </p> |
| 24 | +<div> |
| 25 | +Add to Selection: |
| 26 | +<input type="text" name="selection" id="selection" /> |
| 27 | +<input type="hidden" name="action" id="action" /> |
| 28 | +<input type="button" id="add-to-selection" value="Add" /> |
| 29 | +</div> |
24 | 30 | </form> |
25 | 31 | <div id="notice"> |
26 | 32 | <?php if( $action == 'addtoselection' ) { ?> |
— | — | @@ -50,6 +56,20 @@ |
51 | 57 | <?php } ?> |
52 | 58 | </div> |
53 | 59 | |
| 60 | + <script type="text/javascript"> |
| 61 | + // Should I use RL for tiny snippets like this too? |
| 62 | + $("#add-to-selection").click(function() { |
| 63 | + $("#action").val("addtoselection"); |
| 64 | + $("#filterForm").submit(); |
| 65 | + return false; |
| 66 | + }); |
| 67 | + $("#submit-query").click(function() { |
| 68 | + $("#selection").val(""); |
| 69 | + // Hitting submit shouldn't add to selection |
| 70 | + $("#filterForm").submit(); |
| 71 | + return false; |
| 72 | + }); |
| 73 | + </script> |
54 | 74 | |
55 | 75 | <?php |
56 | 76 | } // execute() |