Commits

Michele Orrù committed 0a56e43 Merge

merge

Comments (0)

Files changed (3)

seedswap/seed/templates/search.html

 
 
 {% block page_title %}
-About
+Seed Search
 {% endblock %}
 
 
 {% block content %}
-<div class="entry" >
  <form action="/seed/search" id="searchForm" method="post">{% csrf_token %}
 {{ form.as_p }}
 <input type="submit" value="Submit" />
 </form>
 
 <div id="map" class="smallmap" />
-</div>
 {% endblock %}
 

seedswap/seed/templates/searchSeed.html

+{% extends "base.html" %}
+{% block page_title %}
+Search Seeds
+{% endblock %}
+{% block content %}
+    
+{% endblock %}

seedswap/seed/views.py

 from seed.models import UserProfile, Species, Varieties, Seed
 from seed.forms import SearchForm, InsertSeedForm, InsertSpeciesForm, InsertVarietiesForm, InsertUserForm
 
+@login_required
 def add_seeds(request):
     """
     A simple form to add a stock of seeds.
-    TODO: add login requirement
     """
     if request.method == 'POST':
         myForm = InsertSeedForm(request.POST)
                               dict(form=myForm),
                               context_instance = RequestContext(request))
 
+@login_required
 def add_species(request):
     """ Minimalist form to insert specie. """
     if request.method == 'POST':
                               dict(form = myForm),
                               context_instance=RequestContext(request))
 
+@login_required
 def add_variety(request):
     """ Minimalist form to insert variety. """
     if request.method == 'POST':