Added a journey page#201
Added a journey page#201anubhakushwaha wants to merge 1 commit intoOpenSourceHelpCommunity:predevfrom anubhakushwaha:predev
Conversation
|
|
||
| def journey(request): | ||
| journey_list = Journey.objects.all() | ||
| return render(request, 'journey.html' , |
| def submit_contest(request): | ||
| return render(request, 'contest_submission.html') | ||
|
|
||
| def journey(request): |
|
|
||
| def __str__(self): | ||
| return self.title | ||
|
|
| def __str__(self): | ||
| return self.name | ||
|
|
||
| class Journey(models.Model): |
| 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.
line too long (95 > 79 characters)
| 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.
line too long (87 > 79 characters)
| 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.
line too long (114 > 79 characters)
| admin.site.register(chatSession, chatSessionAdmin) | ||
| admin.site.register(Journey, journeyAdmin) | ||
| admin.site.register(Contest, contestAdmin) | ||
|
|
| class chatSessionAdmin(admin.ModelAdmin): | ||
| list_display = ('title', 'start_date') | ||
|
|
||
| class journeyAdmin(admin.ModelAdmin): |
|
@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 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.
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', |
| name='Journey', | ||
| fields=[ | ||
| ('id', models.AutoField(auto_created=True, | ||
| primary_key=True, serialize=False, verbose_name='ID')), |
There was a problem hiding this comment.
continuation line under-indented for visual indent
| migrations.CreateModel( | ||
| name='Journey', | ||
| fields=[ | ||
| ('id', models.AutoField(auto_created=True, |
| admin.site.register(chatSession, chatSessionAdmin) | ||
| admin.site.register(Contest, contestAdmin) | ||
| admin.site.register(Journey, journeyAdmin) | ||
| admin.site.register(Contest, contestAdmin) No newline at end of file |
|
|
||
| def __str__(self): | ||
| return self.title | ||
|
No newline at end of file |
There was a problem hiding this comment.
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.
Can we add a description field too?
There was a problem hiding this comment.
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.
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.
fixed w/ Journey.objects.order_by('start_date').
| <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.
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.
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.
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
predevbranch.Which issue does this PR fix?: fixes #100
If relevant, please include a screenshot.
