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()
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()
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()
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()
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()
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()
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()
def home(request): view = GarethView(request, ('home', )) view.title = () view.activenav = 'home' view.crumb('home') return view()
def home(request): view = GarethView(request, ('home',)) view.title = () view.activenav = 'home' view.crumb('home') return view()