Example #1
0
def index(request):
    users = User.objects.order_by("username")
    view = GarethView(request, ("user", "index"))
    view.title = ("Users",)
    view.activenav = "users"
    view.set(users=users)
    view.crumb(User)
    return view()
Example #2
0
def profile(request, username):
    user = get_object_or_404(User, username=username)
    view = GarethView(request, ("user", "profile"))
    view.title = ("User", ("user", user.username))
    view.activenav = ("users", "user-%s" % user.username)
    view.set(theuser=user)
    view.crumb(user)
    return view()
Example #3
0
def profile(request, username):
	user = get_object_or_404(User, username=username)
	view = GarethView(request, ('user', 'profile'))
	view.title = ("User", ('user', user.username))
	view.activenav = ('users', 'user-%s' % user.username)
	view.set(theuser=user)
	view.crumb(user)
	return view()
Example #4
0
def index(request):
	users = User.objects.order_by('username')
	view = GarethView(request, ('user', 'index'))
	view.title = ("Users",)
	view.activenav = 'users'
	view.set(users=users)
	view.crumb(User)
	return view()
Example #5
0
def index(request):
	projects = Project.objects.order_by('name')
	view = GarethView(request, ('project', 'index'))
	view.title = ("Projects",)
	view.activenav = 'projects'
	view.set(projects=projects)
	view.crumb(Project)
	return view()
Example #6
0
def login(request):
	if request.method == 'POST':
		form = LoginForm(request.POST)
		if form.is_valid():
			request.session['user_id'] = form.cleaned_data['user'].id
			return redirect('home')
	else:
		form = LoginForm

	view = GarethView(request, ('auth', 'login'))
	view.activenav = 'login'
	view.title = ("Login",)
	view.set(form=form)
	view.crumb('Login')
	return view()
Example #7
0
def create(request):
	if request.method == 'POST':
		form = ProjectForm(request.POST)
		if form.is_valid():
			project = form.save(commit=False)
			project.git.initialize()
			project.save()
			return redirect('project', name=project.name)
	else:
		form = ProjectForm()
	view = GarethView(request, ('project', 'create'))
	view.title = ("Create project",)
	view.activenav = 'projects'
	view.set(add_form=form)
	view.crumb(Project, 'Create')
	return view()
Example #8
0
def home(request):
    view = GarethView(request, ('home', ))
    view.title = ()
    view.activenav = 'home'
    view.crumb('home')
    return view()
Example #9
0
def home(request):
	view = GarethView(request, ('home',))
	view.title = ()
	view.activenav = 'home'
	view.crumb('home')
	return view()