
----
{cagridroundpanel}
{pre:class=cagridheaderfont}Table of Contents{pre}
{toc:outline=false|exclude=Part 11 : Finishing Touches|style=bullets}
{cagridroundpanel}
h3. Uncomment the Sync with Trust Fabric Thread
# In *GridClient/views.py*
# Uncomment the following
{code}thread.start_new_thread(syncTrust, ()){code}
# Save the file
h3. Implement the index page
h5. Construct the index template
# In the *mytemplates/thewebapp* folder, make the template *index.html*
# Add the following:
{code:html}
{% if the_username %}
Hello <b>{{ the_username }}</b>, you are logged in. Do you want to <a href="/logout/">Logout?</a><br>
{% else %}
Hello, do you want to <a href="/login/">Login</a> to save queries and query secure data services?<br>
{% endif %}
<h1>Do you want to:</h1>
<a href="/login/">Login?</a><br>
<a href="/listservices/">List Services?</a><br>
<a href="/discoverservices/">Discover Services?</a><br>
<a href="/dataservices/">Query a Data Service?</a><br>
{% if the_username %}<a href="/savedqueries/">Use a Previous Query?</a><br>{%endif%}
{code}
# Save the file
h5. Edit the index method
# In *GridClient/views.py*
# Change the index method
{code}
def index(request):
#return HttpResponse("Hello, you're at the index :)")
return render_to_response("thewebapp/index.html",
{'the_username':logged_in(request),},
context_instance=RequestContext(request))
{code}
# Save the file
h3. Test the index page
# Go to http://localhost:8000/index/
# If you're logged in, you'll see the saved queries page
{gallery:include=Screen shot 2011-11-14 at 9.07.32 PM.png|border=1}
# Otherwise you'll see
{gallery:include=Screen shot 2011-11-14 at 9.09.17 PM.png|border=1}
{scrollbar}