Permalink
Browse files

Added a stage param to plugin urls

  • Loading branch information...
Marc Hughes
Marc Hughes committed Oct 2, 2011
1 parent 7115cb9 commit fbeff85cfaaad6c062bac5002195d3c0a38b299d
View
@@ -9,4 +9,5 @@ django-haystack==1.1
mysql-python
pil
Werkzeug
-markdown==2.0.3
+markdown==2.0.3
+suds
@@ -78,8 +78,10 @@ def getExtraActions( self, project, **kwargs):
invoke for this extra. Example: ('Syncronize','/blah/blah/syncronize','') """
return []
- def doProjectdoProjectConfiguration( self, request, project ):
- """ Should return a django style response that handles any configuration that this extra may need. """
+ def doProjectdoProjectConfiguration( self, request, project, stage=""):
+ """ Should return a django style response that handles any configuration that this extra may need.
+ Stage is an optional parameter that you can use for multi step configuration sequences. It's
+ taken from the last bit of the URL /extras/extra-slug/project-slug/configure/STAGE """
raise NotImplementedError("ScrumdoProjectExtra subclasses must implement doProjectConfiguration()")
def initialSync( self, project):
@@ -23,7 +23,7 @@ def getDescription(self):
return "This Extra demonstrates the bare minimal required to get a ScrumDo Project based extra working."
- def doProjectConfiguration( self, request, project ):
+ def doProjectConfiguration( self, request, project, stage=""):
"Should return a django style response that handles any configuration that this extra may need."
return render_to_response("extras/example/configure.html", {
"extra":self,
@@ -37,7 +37,7 @@ def getDescription(self):
"Returns a user-friendly description of this extra. This text will be passed through a Markdown filter when displayed to the user."
return "Create ScrumDo stories for any open GitHub issue. Push ScrumDo stories to GitHub issues."
- def doProjectConfiguration( self, request, project ):
+ def doProjectConfiguration( self, request, project, stage=""):
"""Handles a request to do configuration for the github_issues extra.
This displays a form asking for credentials / repository information,
then saves that with the saveConfiguration() api in ScrumdoProjectExtra base
@@ -19,7 +19,7 @@
<a href="{% url organization_detail project.organization.slug %}">{{ project.organization.name }}</a> /
{% endif %}
<a href="{% url project_detail project.slug %}">{{ project.name }}</a> /
- Project Extras
+ <a href="{% url project_extras_url project.slug %}">Project Extras</a>
{% endblock %}
{% block body %}
@@ -6,7 +6,8 @@
url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/hook$', "project_extra_callback", name="projct_extra_callback_url"),
url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/enable$', "enable_extra", name="enable_extra_url"),
url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/disable$', "disable_extra", name="disable_extra_url"),
- url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/configure$', "configure_extra", name="configure_extra_url"),
+ url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/configure$', "configure_extra", name="configure_extra_url"),
+ url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/configure/(?P<stage>[-\w]+)$', "configure_extra", name="configure_extra_with_stage"),
url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/sync$', "syncronize_extra", name="syncronize_extra_url"),
@@ -151,12 +151,12 @@ def disable_extra( request, project_slug, extra_slug):
return HttpResponseRedirect(reverse("project_extras_url",kwargs={'project_slug':project_slug}))
@login_required
-def configure_extra( request, project_slug, extra_slug):
+def configure_extra( request, project_slug, extra_slug, stage=""):
project = get_object_or_404( Project, slug=project_slug )
admin_access_or_403(project, request.user )
extra = manager.getExtra( extra_slug )
if extra != None:
- return extra.doProjectConfiguration(request, project)
+ return extra.doProjectConfiguration(request, project, stage)
return HttpResponseRedirect(reverse("project_extras_url",kwargs={'project_slug':project_slug}))
@login_required
@@ -40,6 +40,7 @@
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{GOOGLE_ANALYTICS_ACCOUNT}}']);
_gaq.push(['_trackPageview']);
+ _gaq.push(['_trackPageLoadTime']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

0 comments on commit fbeff85

Please sign in to comment.