-
Notifications
You must be signed in to change notification settings - Fork 56
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
Added a journey page #201
Conversation
oshc/main/views.py
Outdated
|
||
def journey(request): | ||
journey_list = Journey.objects.all() | ||
return render(request, 'journey.html' , |
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.
whitespace before ','
oshc/main/views.py
Outdated
@@ -38,3 +38,8 @@ def add_contest(request): | |||
|
|||
def submit_contest(request): | |||
return render(request, 'contest_submission.html') | |||
|
|||
def journey(request): |
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.
expected 2 blank lines, found 1
oshc/main/models.py
Outdated
|
||
def __str__(self): | ||
return self.title | ||
|
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.
blank line at end of file
oshc/main/models.py
Outdated
@@ -29,3 +29,11 @@ class Contest(models.Model): | |||
|
|||
def __str__(self): | |||
return self.name | |||
|
|||
class Journey(models.Model): |
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.
expected 2 blank lines, found 1
oshc/main/migrations/0002_journey.py
Outdated
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(help_text='Journey title', max_length=128)), | ||
('description', models.TextField(help_text='Session details', max_length=512)), |
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.
line too long (95 > 79 characters)
oshc/main/migrations/0002_journey.py
Outdated
name='Journey', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(help_text='Journey title', max_length=128)), |
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.
line too long (87 > 79 characters)
oshc/main/migrations/0002_journey.py
Outdated
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 comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (114 > 79 characters)
oshc/main/admin.py
Outdated
admin.site.register(Contest, contestAdmin) | ||
|
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.
blank line at end of file
oshc/main/admin.py
Outdated
|
||
|
||
class chatSessionAdmin(admin.ModelAdmin): | ||
list_display = ('title', 'start_date') | ||
|
||
class journeyAdmin(admin.ModelAdmin): |
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.
expected 2 blank lines, found 1
@tapasweni-pathak @vaibhavsingh97 @jarifibrahim @nikhita Please review and suggestions on improving it would be great, thanks |
start_date = models.DateField(null=True) | ||
|
||
def __str__(self): | ||
return self.title |
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.
no newline at end of file
('id', models.AutoField(auto_created=True, | ||
primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(help_text='Journey title', | ||
max_length=128)), |
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.
continuation line under-indented for visual indent
fields=[ | ||
('id', models.AutoField(auto_created=True, | ||
primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(help_text='Journey title', |
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
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 comment
The reason will be displayed to describe this comment to others. Learn more.
continuation line under-indented for visual indent
migrations.CreateModel( | ||
name='Journey', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, |
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
oshc/main/admin.py
Outdated
@@ -26,4 +30,5 @@ def approve_contest(self, request, queryset): | |||
|
|||
|
|||
admin.site.register(chatSession, chatSessionAdmin) | |||
admin.site.register(Contest, contestAdmin) | |||
admin.site.register(Journey, journeyAdmin) | |||
admin.site.register(Contest, contestAdmin) |
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.
no newline at end of file
|
||
def __str__(self): | ||
return self.title | ||
|
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.
blank line at end of file
blank line contains whitespace
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a description
field too?
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.
We are good w/ these two.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to sort the journey_list
by the start_date
before sending it to the HTML page. This ensures that the data we send out of the view is chronologically ordered.
You can use Managers
[0] to achieve this or you could do something like Journey.objects.all().filteryBy('start_date')
[0] - https://docs.djangoproject.com/en/2.0/topics/db/managers/
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.
fixed w/ Journey.objects.order_by('start_date')
.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should put target="_blank"
here. The Journey page is part of the OSHC page.
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.
These needs to be removed for quite a few.
@anubhakushwaha Is there any way we could make the timeline responsive? |
@jarifibrahim Hey thanks for reviewing will do the changes, responsive as in? The current behavior allows new events to be added via the admin. Please help me understand this better. |
@anubhakushwaha By responsive I meant is the timeline mobile device friendly? As far as I know, the OSHC website is mobile friendly, so it would be great if we could make the timeline mobile friendly as well. |
@anubhakushwaha Can we have live demo link please |
@vaibhavsingh97 Live demo for? |
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.
Thanks for sending this through @anubhakushwaha! 🎉
I have fixed few minor reviews that you have got till now. We need to make this work even on a mobile sized/small screens.
@tapasweni-pathak Thank you for doing the changes.
I will update you on this. |
Checklist
predev
branch.Which issue does this PR fix?: fixes #100
If relevant, please include a screenshot.
