-
Notifications
You must be signed in to change notification settings - Fork 56
Added a journey page #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a journey page #201
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.6 on 2017-12-17 21:29 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('main', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Journey', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, | ||
primary_key=True, serialize=False, verbose_name='ID')), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. continuation line under-indented for visual indent |
||
('title', models.CharField(help_text='Journey title', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. trailing whitespace |
||
max_length=128)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. continuation line under-indented for visual indent |
||
('description', models.TextField(help_text='Session details', | ||
max_length=512)), | ||
('start_date', models.DateTimeField()), | ||
], | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,12 @@ class Contest(models.Model): | |
|
||
def __str__(self): | ||
return self.name | ||
|
||
|
||
class Journey(models.Model): | ||
title = models.CharField(max_length=128, help_text="Journey title") | ||
start_date = models.DateField(null=True) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are good w/ these two. |
||
def __str__(self): | ||
return self.title | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. blank line at end of file |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,8 @@ | |
</ul> | ||
</li> | ||
<li><a href="https://github.com/OpenSourceHelpCommunity" target="_blank">Resources</a></li> | ||
<li><a href="{% url 'contests' %}" target="_blank">Contests</a></li> | ||
<li><a href="{% url 'contests' %}" target="_blank">Contests</a></li> | ||
<li><a href="{% url 'journey' %}" target="_blank">Journey</a></li> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These needs to be removed for quite a few. |
||
<li><a href="mailto:[email protected]" target="_blank">Contact</a></li> | ||
<li><a href="https://opensourcehelp.herokuapp.com/" target="_blank">Join Us!</a></li> | ||
{% if user.is_authenticated %} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% extends 'base.html' %} | ||
{% load static %} | ||
{% block content %} | ||
<section class="timeline"> | ||
<body> | ||
<ul> | ||
{% if Journey %} | ||
{% for j in Journey %} | ||
<li> | ||
<div> {{j.start_date}}<br>{{j.title}} </div> | ||
</li> | ||
<!-- more list items here --> | ||
{% endfor %} | ||
{% else %} | ||
<li> | ||
<div> No journey available </div> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
</body> | ||
</section> | ||
{% endblock %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from django.shortcuts import render | ||
from django.http import HttpResponseRedirect | ||
from main.models import chatSession, Contest | ||
from main.models import chatSession, Contest, Journey | ||
from .forms import ContestForm | ||
|
||
|
||
|
@@ -38,3 +38,9 @@ def add_contest(request): | |
|
||
def submit_contest(request): | ||
return render(request, 'contest_submission.html') | ||
|
||
|
||
def journey(request): | ||
journey_list = Journey.objects.all() | ||
return render(request, 'journey.html', | ||
context={'Journey': journey_list}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might want to sort the [0] - https://docs.djangoproject.com/en/2.0/topics/db/managers/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed w/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace