diff --git a/settings.py b/settings.py index d768793..defa80a 100644 --- a/settings.py +++ b/settings.py @@ -48,6 +48,7 @@ # Third party 'account', 'core', + 'job_ads', 'sponsors', ]) diff --git a/src/job_ads/__init__.py b/src/job_ads/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/job_ads/admin.py b/src/job_ads/admin.py new file mode 100644 index 0000000..831957e --- /dev/null +++ b/src/job_ads/admin.py @@ -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'] diff --git a/src/job_ads/cms_apps.py b/src/job_ads/cms_apps.py new file mode 100644 index 0000000..9348763 --- /dev/null +++ b/src/job_ads/cms_apps.py @@ -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) diff --git a/src/job_ads/migrations/0001_initial.py b/src/job_ads/migrations/0001_initial.py new file mode 100644 index 0000000..55bd0c5 --- /dev/null +++ b/src/job_ads/migrations/0001_initial.py @@ -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)), + ], + ), + ] diff --git a/src/job_ads/migrations/__init__.py b/src/job_ads/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/job_ads/models.py b/src/job_ads/models.py new file mode 100644 index 0000000..84a5aa6 --- /dev/null +++ b/src/job_ads/models.py @@ -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 diff --git a/src/job_ads/urls.py b/src/job_ads/urls.py new file mode 100644 index 0000000..f77bd83 --- /dev/null +++ b/src/job_ads/urls.py @@ -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'), +] diff --git a/src/job_ads/views.py b/src/job_ads/views.py new file mode 100644 index 0000000..b2d515a --- /dev/null +++ b/src/job_ads/views.py @@ -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' diff --git a/templates/job_ads/list.html b/templates/job_ads/list.html new file mode 100644 index 0000000..97d701d --- /dev/null +++ b/templates/job_ads/list.html @@ -0,0 +1,78 @@ +{% extends "base.html" %} +{% load cms_tags core_tags i18n l10n static sekizai_tags %} + +{% block css %} + + +{% endblock css %} + +{% block content %} +
+
+

{% trans 'Dashboard' %}

+
+
+
+

JOB LISTING

+
+ +
+

Stadia Entertainment

+

Network Ninja

+
+
+

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.

+ +
+
+

JOB LISTING

+
+ +
+

Stadia Entertainment

+

Network Ninja

+
+
+

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.

+ +
+
+

JOB LISTING

+
+ +
+

Stadia Entertainment

+

Network Ninja

+
+
+

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.

+ +
+
+

JOB LISTING

+
+ +
+

Stadia Entertainment

+

Network Ninja

+
+
+

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.

+ +
+
+
+{% endblock content %}