This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from DHRI-Curriculum/kallewesterling/issue68
Addresses #68 and beyond
- Loading branch information
Showing
19 changed files
with
160 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from django.contrib import admin | ||
from .models import Page | ||
|
||
# Register your models here. | ||
admin.site.register(Page) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from workshop.models import Workshop | ||
from website.models import Page | ||
|
||
from pathlib import Path | ||
|
||
def add_to_all_contexts(request): | ||
context_data = dict() | ||
|
||
context_data['footer'] = dict() | ||
context_data['footer']['workshops'] = Workshop.objects.all() | ||
context_data['website'] = dict() | ||
context_data['website']['workshops'] = Workshop.objects.all() | ||
context_data['website']['pages'] = Page.objects.all() | ||
|
||
return context_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
class Page(models.Model): | ||
name = models.CharField(max_length=200) | ||
slug = models.CharField(max_length=200, blank=True) | ||
text = models.TextField() | ||
is_homepage = models.BooleanField(default=False) | ||
|
||
def __str__(self): | ||
return str(self.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ | |
|
||
urlpatterns = [ | ||
path('', views.index, name='index'), | ||
path('<str:page_slug>/', views.page, name='page'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
from django.shortcuts import render | ||
from django.shortcuts import render, get_object_or_404 | ||
from .models import Page | ||
|
||
def index(request): | ||
return render(request, 'website/index.html', {}) | ||
print('index!') | ||
page = Page.objects.filter(is_homepage=True).last() | ||
return render(request, 'website/index.html', {'page': page}) | ||
|
||
def page(request, page_slug): | ||
print('page!') | ||
page = get_object_or_404(Page, slug=page_slug) | ||
return render(request, 'website/index.html', {'page': page}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 19 additions & 6 deletions
25
app/workshop/templates/lesson/lesson-elements/pagination.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
<nav aria-label="Page navigation example"> | ||
<nav aria-label="Lesson navigation"> | ||
<ul class="pagination justify-content-center justify-content-sm-end"> | ||
<li class="page-item disabled"> | ||
<a class="page-link" href="#" tabindex="-1" aria-disabled="true">Previous</a> | ||
<a class="page-link special-link-disabled" href="#" tabindex="-1" aria-disabled="true">Previous</a> | ||
</li> | ||
<li class="page-item"><a class="page-link" href="#">1</a></li> | ||
<li class="page-item"><a class="page-link" href="#">2</a></li> | ||
<li class="page-item"><a class="page-link" href="#">3</a></li> | ||
<li class="page-item"> | ||
<a class="page-link" href="#">Next</a> | ||
<a class="page-link special-link" href="#">1</a></li> | ||
<li class="page-item"> | ||
<a class="page-link special-link" href="#">2</a></li> | ||
<li class="page-item"> | ||
<a class="page-link special-link" href="#">3</a></li> | ||
<li class="page-item"> | ||
<a class="page-link special-link" href="#">4</a></li> | ||
<li class="page-item"> | ||
<a class="page-link special-link" href="#">5</a></li> | ||
<li class="page-item"> | ||
<a class="page-link special-link" href="#">6</a></li> | ||
<li class="page-item"> | ||
<a class="page-link special-link" href="#">7</a></li> | ||
<li class="page-item"> | ||
<a class="page-link special-link" href="#">8</a></li> | ||
<li class="page-item"> | ||
<a class="page-link special-link" href="#">Next</a> | ||
</li> | ||
</ul> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<h1 class="dhri-hero">Digital Humanities Research Institute</h1> | ||
<h1 class="display-4">Curriculum Website</h1> | ||
<p class="lead">Introduction text here. Should probably live in website.models somehow.</p> | ||
<p class="lead">{{ page.text }}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters