Commits

Scott Nixon committed 2f812f2

Added MailChimp template.

Comments (0)

Files changed (4)

inbounding/dispatch/templates/dashboard.html

-{% extends "subpage.html" %}
+{% extends "site-template.html" %}
 
 {% block main %}
-<h2 class="cufon">Your Actions</h2>
+<h2 class="">Your Actions</h2>
 <br>
 <div>
-  <h3 class="cufon"><a href="{% url dispatch.views.action_page %}">+ Add an Action</a></h3>
+  <h3 class=""><a href="{% url dispatch.views.action_page %}">+ Add an Action</a></h3>
+  <h3 class=""><a href="{% url dispatch.views.mailchimp-url %}">MailChimp</a></h3>
   <ul class="ul">
   {% for action in object_list %}
-      <li><a href="{% url dispatch.views.action_page action.id %}">{{ action.url }}</a></li>
+      <li><a href="{% url dispatch.views.action_page action.id %}">{{ action.label }}</a></li>
   {% endfor %}
   </ul>
 </div>
 
 <section>
   <h1>Getting Started</h1>
+
   <p>
 &lt;script&gt;
 (function() {

inbounding/dispatch/templates/mailchimp.html

+{% extends "site-template.html" %}
+
+{% block main %}
+<h2 class="">MailChimp</h2>
+<br>
+
+<section>
+  <h1>Getting Started</h1>
+  <p>
+
+  </p>
+
+</section>
+
+{% endblock %}

inbounding/dispatch/urls.py

 
 urlpatterns = patterns('dispatch.views',
     url(r'^dashboard/$', Dashboard.as_view(), name="dashboard-url"),
+    url(r'^mailchimp/$', MailChimp.as_view(), name="mailchimp-url"),
     url(r'^action/(?P<id>\d)/$', 'action_page'),                       
     url(r'^action/$', 'action_page'),                       
     url(r'^capture/$', 'ref_log'), 

inbounding/dispatch/views.py

 from django.utils.decorators import method_decorator
 from django.views.generic.create_update import create_object, update_object
 
+from mailsnake import MailSnake
+
 from models import Refer, Action
 from forms import ActionForm
 
+
 class HomeView(TemplateView):
     template_name = "index2.html"
 
 class Dashboard(ListView):
-    template_name = "form.html"
+    template_name = "dashboard.html"
 
     def get_queryset(self, *args, **kwargs):
         return Action.objects.filter(user=self.request.user)
 
-    @method_decorator(login_required)
+    #@method_decorator(login_required)
     def dispatch(self, *args, **kwargs):
         return super(Dashboard, self).dispatch(*args, **kwargs)
 
-@login_required
-def edit_breweries(request, id):
-        if request.method == 'POST':
-                return update_object(request, form_class=BreweriesForm, object_id=id, template_name='hops/edit_breweries.html', post_save_redirect=(reverse('hops.views.breweries')))
-        else:
-                brew_instance = get_object_or_404(Breweries, pk=id)
-                form = BreweriesForm(instance=brew_instance)
-                
-        return render_to_response('hops/edit_breweries.html', locals(),context_instance=RequestContext(request))
 
-@login_required
+class MailChimp(ListView):
+    template_name = "mailchimp.html"
+
+#@login_required
 def action_page(request, id=None):
     # MUST FIX LOGIC.
     if request.method == 'POST' and request.POST.get('id'):
         raise Http404
     return HttpResponse("Success")
 
+
 def mc_signup(request):
     '''
     OAuth enhancement: http://apidocs.mailchimp.com/oauth2/
     '''
     ck_list_id = mc_list_id = '0a66cc769c'
     ck_api_key = mc_api_key ='30060673b5472f3674d20c65782422ca-us2'
-    from mailsnake import MailSnake
+
     ms = MailSnake(mc_api_key)
     if ms.ping():
         ms.listSubscribe(id=mc_list_id, email_address='scott@happyherbivore.com')