Skip to content

Commit fbeff85

Browse files
author
Marc Hughes
committedOct 2, 2011
Added a stage param to plugin urls
1 parent 7115cb9 commit fbeff85

File tree

8 files changed

+14
-9
lines changed

8 files changed

+14
-9
lines changed
 

‎requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ django-haystack==1.1
99
mysql-python
1010
pil
1111
Werkzeug
12-
markdown==2.0.3
12+
markdown==2.0.3
13+
suds

‎scrumdo-web/apps/extras/interfaces.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ def getExtraActions( self, project, **kwargs):
7878
invoke for this extra. Example: ('Syncronize','/blah/blah/syncronize','') """
7979
return []
8080

81-
def doProjectdoProjectConfiguration( self, request, project ):
82-
""" Should return a django style response that handles any configuration that this extra may need. """
81+
def doProjectdoProjectConfiguration( self, request, project, stage=""):
82+
""" Should return a django style response that handles any configuration that this extra may need.
83+
Stage is an optional parameter that you can use for multi step configuration sequences. It's
84+
taken from the last bit of the URL /extras/extra-slug/project-slug/configure/STAGE """
8385
raise NotImplementedError("ScrumdoProjectExtra subclasses must implement doProjectConfiguration()")
8486

8587
def initialSync( self, project):

‎scrumdo-web/apps/extras/plugins/example/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def getDescription(self):
2323
return "This Extra demonstrates the bare minimal required to get a ScrumDo Project based extra working."
2424

2525

26-
def doProjectConfiguration( self, request, project ):
26+
def doProjectConfiguration( self, request, project, stage=""):
2727
"Should return a django style response that handles any configuration that this extra may need."
2828
return render_to_response("extras/example/configure.html", {
2929
"extra":self,

‎scrumdo-web/apps/extras/plugins/github_issues/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def getDescription(self):
3737
"Returns a user-friendly description of this extra. This text will be passed through a Markdown filter when displayed to the user."
3838
return "Create ScrumDo stories for any open GitHub issue. Push ScrumDo stories to GitHub issues."
3939

40-
def doProjectConfiguration( self, request, project ):
40+
def doProjectConfiguration( self, request, project, stage=""):
4141
"""Handles a request to do configuration for the github_issues extra.
4242
This displays a form asking for credentials / repository information,
4343
then saves that with the saveConfiguration() api in ScrumdoProjectExtra base

‎scrumdo-web/apps/extras/templates/extras/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<a href="{% url organization_detail project.organization.slug %}">{{ project.organization.name }}</a> /
2020
{% endif %}
2121
<a href="{% url project_detail project.slug %}">{{ project.name }}</a> /
22-
Project Extras
22+
<a href="{% url project_extras_url project.slug %}">Project Extras</a>
2323
{% endblock %}
2424

2525
{% block body %}

‎scrumdo-web/apps/extras/urls.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/hook$', "project_extra_callback", name="projct_extra_callback_url"),
77
url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/enable$', "enable_extra", name="enable_extra_url"),
88
url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/disable$', "disable_extra", name="disable_extra_url"),
9-
url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/configure$', "configure_extra", name="configure_extra_url"),
9+
url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/configure$', "configure_extra", name="configure_extra_url"),
10+
url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/configure/(?P<stage>[-\w]+)$', "configure_extra", name="configure_extra_with_stage"),
1011
url(r'^(?P<extra_slug>[-\w]+)/(?P<project_slug>[-\w]+)/sync$', "syncronize_extra", name="syncronize_extra_url"),
1112

1213

‎scrumdo-web/apps/extras/views.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ def disable_extra( request, project_slug, extra_slug):
151151
return HttpResponseRedirect(reverse("project_extras_url",kwargs={'project_slug':project_slug}))
152152

153153
@login_required
154-
def configure_extra( request, project_slug, extra_slug):
154+
def configure_extra( request, project_slug, extra_slug, stage=""):
155155
project = get_object_or_404( Project, slug=project_slug )
156156
admin_access_or_403(project, request.user )
157157
extra = manager.getExtra( extra_slug )
158158
if extra != None:
159-
return extra.doProjectConfiguration(request, project)
159+
return extra.doProjectConfiguration(request, project, stage)
160160
return HttpResponseRedirect(reverse("project_extras_url",kwargs={'project_slug':project_slug}))
161161

162162
@login_required

‎scrumdo-web/templates/base.html

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
var _gaq = _gaq || [];
4141
_gaq.push(['_setAccount', '{{GOOGLE_ANALYTICS_ACCOUNT}}']);
4242
_gaq.push(['_trackPageview']);
43+
_gaq.push(['_trackPageLoadTime']);
4344

4445
(function() {
4546
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

0 commit comments

Comments
 (0)
Please sign in to comment.