Esempio n. 1
0
def index(request):
    objects = Issue.objects.order_by('-updated')

    if 'tag' in request.GET:
        for tag in request.GET.getlist('tag'):
            objects = objects.filter(tags__name=tag)
    else: return render_to_response('issues/index.html', locals())
Esempio n. 2
0
def new(request):
    form = IssueForm(initial={
        'writer': request.user,
        'status': 'open',
    })
    return render_to_response('issues/new.html', locals(),
                              RequestContext(request))
Esempio n. 3
0
def index(request):
    objects = Issue.objects.order_by('-updated')

    if 'tag' in request.GET:
        for tag in request.GET.getlist('tag'):
            objects = objects.filter(tags__name=tag)
    else:
        return render_to_response('issues/index.html', locals())
Esempio n. 4
0
def show(request, resource_id):
    issue = Issue.objects.get(id=resource_id)
    issue.read_count += 1
    issue.save()

    if request.user.is_anonymous():
        user_vote = None
    else:
        try:
            user_vote = issue.vote_set.get(voter=request.user)
        except ObjectDoesNotExist:
            user_vote = None

    action_form = ActionForm(initial={'writer': request.user,
                                        'issue': issue})
    comment_form = CommentForm(initial={'writer': request.user,
                                        'issue': issue})

    return render_to_response('issues/show.html', locals(), RequestContext(request))
Esempio n. 5
0
def show(request, resource_id):
    issue = Issue.objects.get(id=resource_id)
    issue.read_count += 1
    issue.save()

    if request.user.is_anonymous():
        user_vote = None
    else:
        try:
            user_vote = issue.vote_set.get(voter=request.user)
        except ObjectDoesNotExist:
            user_vote = None

    action_form = ActionForm(initial={'writer': request.user, 'issue': issue})
    comment_form = CommentForm(initial={
        'writer': request.user,
        'issue': issue
    })

    return render_to_response('issues/show.html', locals(),
                              RequestContext(request))
Esempio n. 6
0
def login(request):
    return render_to_response('accounts/login.html', locals(),
                              RequestContext(request))
Esempio n. 7
0
def index(request):
    return render_to_response('index.html', locals(), RequestContext(request))
Esempio n. 8
0
def edit(request, resource_id):
    csrf_token = csrf(request)['csrf_token']
    issue = Issue.objects.get(id=resource_id)
    return render_to_response('issues/edit.html', locals())
Esempio n. 9
0
def edit(request, resource_id):
    csrf_token = csrf(request)['csrf_token']
    issue = Issue.objects.get(id=resource_id)
    return render_to_response('issues/edit.html', locals())
Esempio n. 10
0
def histories(request, resource_id):
    issue = Issue.objects.get(id=resource_id)
    return render_to_response('issues/histories.html', locals())
Esempio n. 11
0
def index(request, resource_id):
    return render_to_response('historic/index.html', locals())
Esempio n. 12
0
def index(request, resource_id):
    return render_to_response('scraper/index.html', locals())
Esempio n. 13
0
def edit(request, resource_id):
    issue = Issue.objects.get(id=resource_id)
    form = IssueForm(instance=issue)
    return render_to_response('issues/edit.html', locals(), RequestContext(request))
Esempio n. 14
0
def new(request):
    form = IssueForm(initial={'writer': request.user,
                                            'status': 'open',
                                            })
    return render_to_response('issues/new.html', locals(), RequestContext(request))
Esempio n. 15
0
def history(request, resource_id):
    history = IssueHistory.objects.get(id=resource_id)
    return render_to_response('issues/history.html', locals())
Esempio n. 16
0
def histories(request, resource_id):
    issue = Issue.objects.get(id=resource_id)
    return render_to_response('issues/histories.html', locals())
Esempio n. 17
0
def history(request, resource_id):
    history = IssueHistory.objects.get(id=resource_id)
    return render_to_response('issues/history.html', locals())
Esempio n. 18
0
def index(request, resource_id):
    tags = Tag.objects.all()
    return render_to_response('tags/index.html', locals())
Esempio n. 19
0
def new(request):
    form = ActionForm()
    return render_to_response('actions/new.html', locals(), RequestContext(request))
Esempio n. 20
0
def index(request, resource_id):
    return render_to_response('historic/index.html', locals())
Esempio n. 21
0
def edit(request, resource_id):
    issue = Issue.objects.get(id=resource_id)
    form = IssueForm(instance=issue)
    return render_to_response('issues/edit.html', locals(),
                              RequestContext(request))
Esempio n. 22
0
def login(request):
    return render_to_response('accounts/login.html', locals(), RequestContext(request))