Skip to content

Commit e766c30

Browse files
committed
feat: add the react app
1 parent 6060155 commit e766c30

30 files changed

+1887
-0
lines changed

apps/jobs/__init__.py

Whitespace-only changes.

apps/jobs/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

apps/jobs/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class JobsConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'apps.jobs'

apps/jobs/cms_apps.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from cms.app_base import CMSApp
2+
from cms.apphook_pool import apphook_pool
3+
4+
@apphook_pool.register
5+
class JobsApp(CMSApp):
6+
app_name = "jobs"
7+
name = "Jobs App"
8+
9+
def get_urls(self, *args, **kwargs):
10+
return ["apps.jobs.urls"]

apps/jobs/migrations/__init__.py

Whitespace-only changes.

apps/jobs/models.py

Whitespace-only changes.

apps/jobs/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

apps/jobs/urls.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from django.urls import re_path
2+
from .views import JobsView
3+
4+
app_name = "jobs"
5+
6+
urlpatterns = [
7+
re_path("", JobsView.as_view(), name="jobs-list"),
8+
]

apps/jobs/views.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from django.views.generic import TemplateView
2+
from generic.utils import get_css_and_js_link_from_vite_assets
3+
4+
5+
class JobsView(TemplateView):
6+
template_name = "jobs/job_list.html"
7+
def get_context_data(self, **kwargs):
8+
context = super().get_context_data(**kwargs)
9+
css_links, js_links, main_js_links = get_css_and_js_link_from_vite_assets("jobs")
10+
context["css_links"] = css_links
11+
context["js_links"] = js_links
12+
return context
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { render, screen } from '@testing-library/react';
2+
import App from './App';
3+
4+
test('renders learn react link', () => {
5+
render(<App />);
6+
const linkElement = screen.getByText(/learn react/i);
7+
expect(linkElement).toBeInTheDocument();
8+
});

0 commit comments

Comments
 (0)