Skip to content
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 job-ads app #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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 settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
# Third party
'account',
'core',
'job_ads',
'sponsors',
])

Expand Down
Empty file added src/job_ads/__init__.py
Empty file.
8 changes: 8 additions & 0 deletions src/job_ads/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.contrib import admin

from .models import JobAd


@admin.register(JobAd)
class JobAdAdmin(admin.ModelAdmin):
list_display = ['title', 'company_name', 'is_active']
15 changes: 15 additions & 0 deletions src/job_ads/cms_apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _

from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool


class JobAdsApp(CMSApp):
name = _("Job ads")

def get_urls(self, page=None, language=None, **kwargs):
return ['job_ads.urls']


apphook_pool.register(JobAdsApp)
30 changes: 30 additions & 0 deletions src/job_ads/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated by Django 2.1.7 on 2019-05-21 04:31

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import filer.fields.image


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.FILER_IMAGE_MODEL),
]

operations = [
migrations.CreateModel(
name='JobAd',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=200)),
('description', models.TextField()),
('company_name', models.CharField(max_length=200)),
('url', models.URLField()),
('is_active', models.BooleanField(default=False)),
('company_logo', filer.fields.image.FilerImageField(on_delete=django.db.models.deletion.PROTECT, to=settings.FILER_IMAGE_MODEL)),
],
),
]
Empty file.
15 changes: 15 additions & 0 deletions src/job_ads/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from django.db import models

from filer.fields.image import FilerImageField


class JobAd(models.Model):
title = models.CharField(max_length=200)
description = models.TextField()
company_name = models.CharField(max_length=200)
company_logo = FilerImageField(on_delete=models.PROTECT)
url = models.URLField()
is_active = models.BooleanField(default=False)

def __str__(self):
return self.title
9 changes: 9 additions & 0 deletions src/job_ads/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from django.urls import path

from .views import JobAdListView


urlpatterns = [
path('', JobAdListView.as_view(), name='job_ad_list'),
]
8 changes: 8 additions & 0 deletions src/job_ads/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.views.generic.list import ListView

from .models import JobAd


class JobAdListView(ListView):
model = JobAd
template_name = 'job_ads/list.html'
78 changes: 78 additions & 0 deletions templates/job_ads/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{% extends "base.html" %}
{% load cms_tags core_tags i18n l10n static sekizai_tags %}

{% block css %}
<link rel="stylesheet" type="text/css" href="{% static 'css/dashboard.css' %}"/>
<style>
{# define the background image as an in-line style to make use of the static tag #}
.ticket-details {
background-image: url('{% static "img/Border001.png" %}');
}
</style>
{% endblock css %}

{% block content %}
<div id="dashboard__container">
<div class="dashboard__header">
<h1>{% trans 'Dashboard' %}</h1>
</div>
<div class="dashboard">
<div class='dashboard__card dashboard__job-listing--alt'>
<h2>JOB LISTING</h2>
<div class='card__row'>
<img src="https://cdn.mos.cms.futurecdn.net/6rC7i9xDYn6Y6EXcF9snEQ-320-80.jpg" alt="">
<div>
<h3>Stadia Entertainment</h3>
<h4>Network Ninja</h4>
</div>
</div>
<p>Horsehead offer. Quarterly sales are at an all-time low we don't want to boil the ocean move the
needle, yet after I ran into Helen at a restaurant, I realized she was just office pretty, so hard
stop.</p>
<button><a href="">Apply Now</a></button>
</div>
<div class='dashboard__card dashboard__job-listing--alt'>
<h2>JOB LISTING</h2>
<div class='card__row'>
<img src="https://cdn.mos.cms.futurecdn.net/6rC7i9xDYn6Y6EXcF9snEQ-320-80.jpg" alt="">
<div>
<h3>Stadia Entertainment</h3>
<h4>Network Ninja</h4>
</div>
</div>
<p>Horsehead offer. Quarterly sales are at an all-time low we don't want to boil the ocean move the
needle, yet after I ran into Helen at a restaurant, I realized she was just office pretty, so hard
stop.</p>
<button><a href="">Apply Now</a></button>
</div>
<div class='dashboard__card dashboard__job-listing--alt'>
<h2>JOB LISTING</h2>
<div class='card__row'>
<img src="https://cdn.mos.cms.futurecdn.net/6rC7i9xDYn6Y6EXcF9snEQ-320-80.jpg" alt="">
<div>
<h3>Stadia Entertainment</h3>
<h4>Network Ninja</h4>
</div>
</div>
<p>Horsehead offer. Quarterly sales are at an all-time low we don't want to boil the ocean move the
needle, yet after I ran into Helen at a restaurant, I realized she was just office pretty, so hard
stop.</p>
<button><a href="">Apply Now</a></button>
</div>
<div class='dashboard__card dashboard__job-listing--alt'>
<h2>JOB LISTING</h2>
<div class='card__row'>
<img src="https://cdn.mos.cms.futurecdn.net/6rC7i9xDYn6Y6EXcF9snEQ-320-80.jpg" alt="">
<div>
<h3>Stadia Entertainment</h3>
<h4>Network Ninja</h4>
</div>
</div>
<p>Horsehead offer. Quarterly sales are at an all-time low we don't want to boil the ocean move the
needle, yet after I ran into Helen at a restaurant, I realized she was just office pretty, so hard
stop.</p>
<button><a href="">Apply Now</a></button>
</div>
</div>
</div>
{% endblock content %}