Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

+ Fixed bugs in the repo creation, still having issues with cloning t…

…o resolve

Tane Piper <digitalspaghetti@gmail.com>
  • Loading branch information...
commit 472e9487b8b13f30139ac973f03b90c5526c7477 1 parent d49006d
Tane Piper authored
View
12 hgfront/repo/views.py
@@ -14,6 +14,7 @@
from django.template import RequestContext
from django.utils import simplejson
from hgfront.core.json_encode import json_encode
+from django.utils.translation import ugettext as _
# Project Libraries
from hgfront.project.models import Project
from hgfront.repo.forms import RepoCreateForm
@@ -135,10 +136,9 @@ def repo_create(request, slug):
if creation_method== "New":
# We create the repo right away
u = ui.ui()
- hg.repository(u, project.project_directory() + str(form.cleaned_data['directory_name']), create=True)
+ hg.repository(u, project.project_directory + str(form.cleaned_data['directory_name']), create=True)
form.cleaned_data['created'] = True
form.save();
- return HttpResponseRedirect(reverse('project-detail', kwargs={'slug': slug}))
else:
# We pass off to a queue event
msg_string = {}
@@ -153,6 +153,14 @@ def repo_create(request, slug):
# Save the repo, save the world!
form.cleaned_data['created'] = False
form.save()
+
+ request.user.message_set.create(message=_("The repository " + form.cleaned_data['display_name'] + " has been queued"))
+ if request.is_ajax():
+ return HttpResponse(
+ "{'success': 'true', 'url': '" + reverse('project-detail', kwargs={'slug':slug}) + "', 'project': " + json_encode(project) + "}"
+ , mimetype="application/json"
+ )
+ else:
return HttpResponseRedirect(reverse('project-detail', kwargs={'slug': slug}))
else:
# Return to the project view
View
2  hgfront/templates/project/project_create_ajax.html
@@ -1,5 +1,5 @@
{% block main_content %}
- {{fail}}
+ {{form.messages.errors}}
<form id="project-create-form" action="{% url project-create %}" method="post">
<table>{{form}}</table>
<input type="submit" />
View
2  hgfront/templates/project/project_detail_ajax.html
@@ -31,7 +31,7 @@
<div id="project-repositories">
{% if permissions.add_repos %}
- <p><a href="{% url repo-create project.name_short %}" class="link-create-repo">Create New Repo</a></p>
+ <p><a href="{% url repo-create project.project_id %}" class="link-create-repo">Create New Repo</a></p>
{% endif %}
{% with project.repo_set.select_related as repos %}
View
2  hgfront/templates/repos/js/repo_create.js
@@ -23,7 +23,7 @@ $(document).ready(function(){
console.log(data);
if (data.success == 'true') {
- target = $(form).parent().parent();
+ target = $(form).parent().parent().parent();
$(target).load(data.url, function(){
hgfront.jsactivate();
Please sign in to comment.
Something went wrong with that request. Please try again.