|
39 | 39 | {% regroup docs by view_sort_group as grouped_docs %} |
40 | 40 |
|
41 | 41 | <table class="ietf-table ietf-doctable" style="margin-top:16px;"> |
42 | | -<tr><th class="doc">Document</th><th class="title">Title</th><th class="date">Date</th><th class="status" colspan="2">Status</th><th class="ipr">ipr</th><th class="ad">Area Director</th></tr> |
| 42 | +<tr> |
| 43 | +{% if user.is_authenticated %}<th></th>{% endif %} |
| 44 | +<th class="doc">Document</th><th class="title">Title</th><th class="date">Date</th><th class="status" colspan="2">Status</th><th class="ipr">ipr</th><th class="ad">Area Director</th></tr> |
43 | 45 | {% for doc_group in grouped_docs %} |
44 | 46 | <tr class="header"><td colspan="7">{{doc_group.grouper}}s</td></tr> |
45 | 47 |
|
| 48 | +{% with 1 as show_add_to_list %} |
46 | 49 | {% for doc in doc_group.list %} |
47 | 50 | {% include "idrfc/search_result_row.html" %} |
48 | 51 | {% endfor %} |
| 52 | +{% endwith %} |
49 | 53 |
|
50 | 54 | {% endfor %} |
51 | 55 | </table> |
52 | 56 |
|
53 | 57 | {% regroup docs_related by view_sort_group as grouped_docs_related %} |
54 | 58 |
|
55 | 59 | <table class="ietf-table ietf-doctable" style="margin-top:16px;"> |
56 | | -<tr><th class="doc">Related Documents</th><th class="title">Title</th><th class="date">Date</th><th class="status" colspan="2">Status</th><th class="ipr">ipr</th><th class="ad">Area Director</th></tr> |
| 60 | +<tr> |
| 61 | +{% if user.is_authenticated %}<th></th>{% endif %} |
| 62 | +<th class="doc">Related Documents</th><th class="title">Title</th><th class="date">Date</th><th class="status" colspan="2">Status</th><th class="ipr">ipr</th><th class="ad">Area Director</th></tr> |
57 | 63 | {% for doc_group in grouped_docs_related %} |
58 | 64 | <tr class="header"><td colspan="7">{{doc_group.grouper}}s</td></tr> |
59 | 65 |
|
| 66 | +{% with 1 as show_add_to_list %} |
60 | 67 | {% for doc in doc_group.list %} |
61 | 68 | {% include "idrfc/search_result_row.html" %} |
62 | 69 | {% endfor %} |
| 70 | +{% endwith %} |
63 | 71 |
|
64 | 72 | {% endfor %} |
65 | 73 | </table> |
66 | 74 |
|
67 | 75 | {% endblock wg_content %} |
68 | 76 |
|
| 77 | +{% block scripts %} |
| 78 | +YAHOO.util.Event.onContentReady("search_submit_button", function () { |
| 79 | + var oButton = new YAHOO.widget.Button("search_submit_button", {}); |
| 80 | +}); |
| 81 | +(function ($) { |
| 82 | + $(document).ready(function () { |
| 83 | + $('.addtolist a').click(function() { |
| 84 | + var trigger = $(this); |
| 85 | + $.ajax({ |
| 86 | + url: trigger.attr('href'), |
| 87 | + type: 'GET', |
| 88 | + cache: false, |
| 89 | + dataType: 'json', |
| 90 | + success: function(response){ |
| 91 | + if (response.success) { |
| 92 | + trigger.replaceWith('added'); |
| 93 | + } |
| 94 | + } |
| 95 | + }); |
| 96 | + return false; |
| 97 | + }); |
| 98 | + }); |
| 99 | +})(jQuery); |
| 100 | +{% endblock scripts %} |
| 101 | + |
| 102 | +{% block js %} |
| 103 | +<script type="text/javascript" src="/js/doc-search.js"></script> |
| 104 | +{% endblock %} |
0 commit comments