Merged in [9242] from rjsparks@nostrum.com:

Restores add-to-community-list functionality to several pages. Fixes #1601.
 - Legacy-Id: 9251
Note: SVN reference [9242] has been migrated to Git commit 02d807581a
This commit is contained in:
Henrik Levkowetz 2015-03-19 19:45:14 +00:00
commit f8ce949f4c
4 changed files with 16 additions and 11 deletions

View file

@ -164,6 +164,14 @@ VER="$(printf %d.%d.%d $MAJOR $MINOR $MAINT)"
NEXT=$(( $MAINT + 1 ))
DEV="$(printf %d.%d.%d.dev0 $MAJOR $MINOR $NEXT)"
#cd $DIR ??
note "Running the tests suite and writing release coverage data ..."
$do ietf/manage.py test --settings=ietf.settings_sqlitetest --save-version-coverage=$VER
note "Committing the release coverage data ..."
$do svn commit release-coverage.json -m "Code coverage data for release $VER"
note "Checking that there's a recent test-crawler log"
touch -d $RDATE .svn/.latest-commit
TCLOG=$(ls -t ../test-crawl-*.log | head -n 1)

View file

@ -404,12 +404,6 @@ def search(request):
# Determine whether each document is being tracked or not, and remember
# that so we can display the proper track/untrack option.
# We use a slightly cumbersome pair of dictionaries:
# - have_doc_status is set if we know anything about the document at all
# - doc_is_tracked is set if we are tracking the document
# If have_doc_status is False, then we use an empty cell, otherwise
# we either use the track or untrack option in the cell, as appropriate.
have_doc_status = { }
doc_is_tracked = { }
if request.user.is_authenticated():
try:
@ -420,10 +414,9 @@ def search(request):
for doc in results:
if clist.get_documents().filter(name=doc.name).count() > 0:
doc_is_tracked[doc.name] = True
have_doc_status[doc.name] = True
return render_to_response('doc/search/search.html',
{'form':form, 'docs':results, 'have_doc_status':have_doc_status, 'doc_is_tracked':doc_is_tracked, 'meta':meta, },
{'form':form, 'docs':results, 'doc_is_tracked':doc_is_tracked, 'meta':meta, },
context_instance=RequestContext(request))
def frontpage(request):

View file

@ -163,6 +163,12 @@ class GroupPagesTests(TestCase):
self.assertTrue(draft2.name in r.content)
# Make sure that a logged in user is presented with an opportunity to add results to their community list
self.client.login(username="secretary", password="secretary+password")
r = self.client.get(url)
q = PyQuery(r.content)
self.assertTrue(any([draft2.name in x.attrib['href'] for x in q('table.ietf-doctable td.addtolist a')]))
# test the txt version too while we're at it
url = urlreverse('ietf.group.info.group_documents_txt', kwargs=dict(group_type=group.type_id, acronym=group.acronym))
r = self.client.get(url)

View file

@ -35,9 +35,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{% load ietf_filters %}
<tr class="{{ forloop.counter|divisibleby:2|yesno:"oddrow,evenrow" }}">
{% if user.is_authenticated %}
{% if not doc.name in have_doc_status %}
<td>&nbsp;</td>
{% elif doc.name in doc_is_tracked %}
{% if doc.name in doc_is_tracked %}
<td class="removefromlist">
<a href="{% url "community_remove_track_document" doc.name %}" title="Remove from your personal ID list"><img src="/images/remove_from_list.png" alt="Remove from your personal ID list" /></a>
</td>