Esempio n. 1
0
def delete(request, remote):
    if request.method == 'POST':
        form = DeleteConfirmForm(request.POST)
        if form.is_valid():
            remote.delete()
            return redirect('project_remotes', project=remote.project.name)
    else:
        form = DeleteConfirmForm()
    view = ProjectView(request, remote.project, ('remote', 'delete'))
    view.title = ("Delete remote", ('remote', remote.name))
    view.activetab = 'remotes'
    view.set(remote=remote, form=form)
    view.crumb(remote)
    view.crumb('Delete')
    return view()
Esempio n. 2
0
def project(request, project):
    project = get_object_or_404(Project, name=project)
    remotes = Remote.objects.filter(project=project)
    view = ProjectView(request, project, ('remote', 'project'))
    view.title = (('project', "%s's" % project.name), "remotes")
    view.activetab = 'remotes'
    view.set(remotes=remotes)
    view.crumb(Remote(project=project))
    return view()
Esempio n. 3
0
def delete(request, remote):
	if request.method == 'POST':
		form = DeleteConfirmForm(request.POST)
		if form.is_valid():
			remote.delete()
			return redirect('project_remotes', project=remote.project.name)
	else:
		form = DeleteConfirmForm()
	view = ProjectView(request, remote.project, ('remote', 'delete'))
	view.title = ("Delete remote", ('remote', remote.name))
	view.activetab = 'remotes'
	view.set(remote=remote, form=form)
	view.crumb(remote)
	view.crumb('Delete')
	return view()
Esempio n. 4
0
def project(request, project):
	project = get_object_or_404(Project, name=project)
	remotes = Remote.objects.filter(project=project)
	view = ProjectView(request, project, ('remote', 'project'))
	view.title = (('project', "%s's" % project.name), "remotes")
	view.activetab = 'remotes'
	view.set(remotes=remotes)
	view.crumb(Remote(project=project))
	return view()
Esempio n. 5
0
def create(request, project):
    project = get_object_or_404(Project, name=project)
    if request.method == 'POST':
        form = RemoteForm(request.POST)
        if form.is_valid():
            remote = form.save(commit=False)
            remote.project = project
            remote.user = request.currentuser
            remote.name = sha1("%s %s %s" % (remote.user.username, remote.url,
                                             uuid.uuid4().hex)).hexdigest()
            project.git.add_remote(remote.name, remote.url)
            remote.save()
            return redirect('remote', project=project.name, ID=remote.name)
    else:
        form = RemoteForm()
    view = ProjectView(request, project, ('remote', 'create'))
    view.title = ("Add remote to", ('project', project.name))
    view.activetab = 'addremote'
    view.set(add_form=form)
    view.crumb(Remote(project=project), 'Create')
    return view()
Esempio n. 6
0
def create(request, project):
	project = get_object_or_404(Project, name=project)
	if request.method == 'POST':
		form = RemoteForm(request.POST)
		if form.is_valid():
			remote = form.save(commit=False)
			remote.project = project
			remote.user = request.currentuser
			remote.name = sha1( "%s %s %s" % (remote.user.username, remote.url, uuid.uuid4().hex ) ).hexdigest()
			project.git.add_remote(remote.name, remote.url)
			remote.save()
			return redirect('remote', project=project.name, ID=remote.name)
	else:
		form = RemoteForm()
	view = ProjectView(request, project, ('remote', 'create'))
	view.title = ("Add remote to", ('project', project.name))
	view.activetab = 'addremote'
	view.set(add_form=form)
	view.crumb(Remote(project=project), 'Create')
	return view()
Esempio n. 7
0
def show(request, remote):
    view = ProjectView(request, remote.project, ('remote', 'show'))
    view.title = ("Remote", ('remote', remote.name))
    view.activetab = 'remotes'
    view.set(project=remote.project, remote=remote)
    view.add_button(href=reverse('remote_fetch',
                                 kwargs={
                                     'project': remote.project.name,
                                     'ID': remote.name
                                 }) + "?fromui=1",
                    post=True,
                    text='Fetch')
    if remote.user == request.currentuser:
        view.add_button(href=reverse('remote_delete',
                                     kwargs={
                                         'project': remote.project.name,
                                         'ID': remote.name
                                     }),
                        text='Delete')
    view.crumb(remote)
    view.use('remote-fetch-progress-alert')
    return view()
Esempio n. 8
0
def show(request, remote):
	view = ProjectView(request, remote.project, ('remote', 'show'))
	view.title = ("Remote", ('remote', remote.name))
	view.activetab = 'remotes'
	view.set(project=remote.project, remote=remote)
	view.add_button(href=reverse('remote_fetch', kwargs={ 'project': remote.project.name, 'ID': remote.name }) + "?fromui=1", post=True, text='Fetch')
	if remote.user == request.currentuser:
		view.add_button(href=reverse('remote_delete', kwargs={ 'project': remote.project.name, 'ID': remote.name }), text='Delete')
	view.crumb(remote)
	view.use('remote-fetch-progress-alert')
	return view()
Esempio n. 9
0
def show(request, project, commit):
	view = ProjectView(request, project, ('commit', 'show'))
	view.title = ("Commit", ('commit', commit.sha1))
	view.set(commit=commit)
	view.crumb(commit)
	return view()
Esempio n. 10
0
def show(request, project, commit):
    view = ProjectView(request, project, ('commit', 'show'))
    view.title = ("Commit", ('commit', commit.sha1))
    view.set(commit=commit)
    view.crumb(commit)
    return view()