Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
'linkshortener',
'credits',
'gitcoinbot',
'jobs'
'external_bounties',
'dataviz',
]
Expand Down
4 changes: 4 additions & 0 deletions app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@
# for robots
url(r'^robots.txt/?', retail.views.robotstxt, name='robotstxt'),
url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap'),

# Jobs dashboard
path(r'jobs/', include('jobs.urls', namespace='jobs'), name='jobs'),

# Interests
path('interest/modal', dashboard.views.get_interest_modal, name='get_interest_modal'),
path('actions/bounty/<int:bounty_id>/interest/new/', dashboard.views.new_interest, name='express-interest'),
Expand Down
Empty file added app/jobs/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions app/jobs/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

Choose a reason for hiding this comment

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

F401 'django.contrib.admin' imported but unused


# Register your models here.
5 changes: 5 additions & 0 deletions app/jobs/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class JobsConfig(AppConfig):
name = 'jobs'
32 changes: 32 additions & 0 deletions app/jobs/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 2.0.3 on 2018-05-05 07:04

import datetime
import django.contrib.postgres.fields
from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Jobs',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=255)),
('description', models.TextField(blank=True, default='')),
('apply_location_url', models.URLField()),
('apply_location_mail', models.EmailField(max_length=254)),
('profile', models.URLField()),
('active', models.BooleanField(help_text='When a job is active.')),
('skills', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, default=[], size=None)),
('company', models.CharField(max_length=255)),
('github_profile', models.CharField(default='', max_length=255)),
('expires_date', models.DateTimeField(default=datetime.datetime(2018, 6, 4, 7, 4, 16, 648752))),
],
),
]
Empty file added app/jobs/migrations/__init__.py
Empty file.
18 changes: 18 additions & 0 deletions app/jobs/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from datetime import datetime, timedelta

from django.contrib.postgres.fields import ArrayField
from django.db import models


class Jobs(models.Model):
title = models.CharField(max_length=255)
description = models.TextField(default='', blank=True)
apply_location_url = models.URLField()
apply_location_mail = models.EmailField()
profile = models.URLField()
active = models.BooleanField(help_text='When a job is active.')
skills = ArrayField(models.CharField(max_length=200), blank=True, default=[])
company = models.CharField(max_length=255)
github_profile = models.CharField(max_length=255, default='')
expires_date = models.DateTimeField(default=datetime.utcnow()+timedelta(days=30))

Choose a reason for hiding this comment

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

W391 blank line at end of file

13 changes: 13 additions & 0 deletions app/jobs/templates/jobs/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<ul>
{% for job in jobs %}
<li>{{job.title}}</li>
{% endfor %}
</body>
</html>
3 changes: 3 additions & 0 deletions app/jobs/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

Choose a reason for hiding this comment

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

F401 'django.test.TestCase' imported but unused


# Create your tests here.
10 changes: 10 additions & 0 deletions app/jobs/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.urls import path

from jobs.apps import JobsConfig
from jobs.views import list_jobs

app_name = JobsConfig.name

urlpatterns = [
path('', list_jobs, name='jobs_list')
]
12 changes: 12 additions & 0 deletions app/jobs/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django.shortcuts import render

Choose a reason for hiding this comment

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

F401 'django.shortcuts.render' imported but unused


# Create your views here.
from django.template.response import TemplateResponse

from jobs.models import Jobs


def list_jobs(request):
context = {'jobs': Jobs.objects.all()}

return TemplateResponse(request, 'jobs/list.html', context=context)