Skip to content

Added a journey page#201

Closed
anubhakushwaha wants to merge 1 commit intoOpenSourceHelpCommunity:predevfrom
anubhakushwaha:predev
Closed

Added a journey page#201
anubhakushwaha wants to merge 1 commit intoOpenSourceHelpCommunity:predevfrom
anubhakushwaha:predev

Conversation

@anubhakushwaha
Copy link
Copy Markdown
Member

@anubhakushwaha anubhakushwaha commented Dec 18, 2017

Checklist

  • My branch is up-to-date with the upstream predev branch.
  • I have added necessary documentation (if appropriate).

Which issue does this PR fix?: fixes #100

If relevant, please include a screenshot.
screenshot from 2017-12-18 23-14-40

Comment thread oshc/main/views.py Outdated

def journey(request):
journey_list = Journey.objects.all()
return render(request, 'journey.html' ,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace before ','

Comment thread oshc/main/views.py
def submit_contest(request):
return render(request, 'contest_submission.html')

def journey(request):
Copy link
Copy Markdown

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

Comment thread oshc/main/models.py Outdated

def __str__(self):
return self.title

Copy link
Copy Markdown

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

Comment thread oshc/main/models.py
def __str__(self):
return self.name

class Journey(models.Model):
Copy link
Copy Markdown

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

Comment thread 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)),
Copy link
Copy Markdown

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)

Comment thread 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)),
Copy link
Copy Markdown

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)

Comment thread 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')),
Copy link
Copy Markdown

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)

Comment thread oshc/main/admin.py Outdated
admin.site.register(chatSession, chatSessionAdmin)
admin.site.register(Journey, journeyAdmin)
admin.site.register(Contest, contestAdmin)

Copy link
Copy Markdown

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

Comment thread oshc/main/admin.py
class chatSessionAdmin(admin.ModelAdmin):
list_display = ('title', 'start_date')

class journeyAdmin(admin.ModelAdmin):
Copy link
Copy Markdown

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

@anubhakushwaha
Copy link
Copy Markdown
Member Author

@tapasweni-pathak @vaibhavsingh97 @jarifibrahim @nikhita Please review and suggestions on improving it would be great, thanks

Comment thread oshc/main/models.py Outdated
start_date = models.DateField(null=True)

def __str__(self):
return self.title No newline at end of file
Copy link
Copy Markdown

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)),
Copy link
Copy Markdown

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',
Copy link
Copy Markdown

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')),
Copy link
Copy Markdown

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,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

Comment thread oshc/main/admin.py Outdated
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
Copy link
Copy Markdown

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

Comment thread oshc/main/models.py

def __str__(self):
return self.title

No newline at end of file
Copy link
Copy Markdown

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

Comment thread oshc/main/models.py
class Journey(models.Model):
title = models.CharField(max_length=128, help_text="Journey title")
start_date = models.DateField(null=True)

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member

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.

Comment thread oshc/main/views.py
def journey(request):
journey_list = Journey.objects.all()
return render(request, 'journey.html',
context={'Journey': journey_list})
Copy link
Copy Markdown
Member

@jarifibrahim jarifibrahim Dec 18, 2017

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/

Copy link
Copy Markdown
Member

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').

<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>
Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

@tapaswenipathak tapaswenipathak Dec 24, 2017

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.

@jarifibrahim
Copy link
Copy Markdown
Member

@anubhakushwaha Is there any way we could make the timeline responsive?

@anubhakushwaha
Copy link
Copy Markdown
Member Author

@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.

@jarifibrahim
Copy link
Copy Markdown
Member

@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.

@vaibhavsingh97
Copy link
Copy Markdown
Member

@anubhakushwaha Can we have live demo link please

@anubhakushwaha
Copy link
Copy Markdown
Member Author

@vaibhavsingh97 Live demo for?

Copy link
Copy Markdown
Member

@tapaswenipathak tapaswenipathak left a 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.

@tapaswenipathak
Copy link
Copy Markdown
Member

tapaswenipathak commented Dec 24, 2017

This is merged after few fixes w/ 7922fee, live here.

@anubhakushwaha
Copy link
Copy Markdown
Member Author

@tapasweni-pathak Thank you for doing the changes.

We need to make this work even on a mobile sized/small screens.

I will update you on this.

@anubhakushwaha anubhakushwaha deleted the predev branch December 27, 2017 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a team page

5 participants