Commits

powersurge360 committed cd9e7be

Logged in users can add stores now, logged out users are prompted to
register.

Comments (0)

Files changed (2)

share_search/reviews/templates/reviews/store_list.html

 
 {% block content %}
     <div class="row">
+        <div class="span9 offset2">
+            <h1>{{ object_list.count }} stores found</h1>
+            {% if user.is_authenticated %}
+                <p>
+                    Not seeing the store you're looking for? Add a store now!
+                    <a href="{% url "reviews:store_create" %}" class="btn btn-success">Add a store</a>
+                </p>
+            {% else %}
+                <p>
+                    Register now to get started adding stores
+                    <a href="{% url "site:register" %}" class="btn btn-success">Register</a>
+                </p>
+            {% endif %}
+        </div>
+    </div>
+    <div class="row">
         {% if object_list %}
             {% gridify object_list 3 as grid %}
             <div class="grid">

share_search/reviews/urls.py

     '',
     url(r'^stores/$', StoreListView.as_view(), name="store_list"),
     url(r'^stores/(?P<pk>\d+)/$', StoreDetailView.as_view(), name="store"),
-    url(r'^stores/create/$', StoreCreateView.as_view(), name="store"),
+    url(r'^stores/create/$', StoreCreateView.as_view(), name="store_create"),
     url(r'^products/$', ProductListView.as_view(), name="product_list"),
     url(
         r'^products/(?P<id>\d+)/$',