Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
9050f93
Apply initial setup for updates for distribution builds
shorodilov Jan 11, 2024
7e7e7a7
Apply webpack development configuration
shorodilov Jan 11, 2024
28e2e0b
Configure webpack to serve images
shorodilov Jan 11, 2024
ae52fda
Extract SVG files while building via Webpack
shorodilov Jan 11, 2024
698bed8
[2.0-development] Set up development environment
shorodilov Jan 11, 2024
d76a7f6
Remove outdated files
shorodilov Jan 11, 2024
cf76751
Update bootstrap SCSS import
shorodilov Jan 12, 2024
5bb74d1
Add base list view template
shorodilov Jan 11, 2024
d1562e6
Adjust articles list view row grid and apply masonry
shorodilov Jan 11, 2024
5592ef1
Update semantic markup
shorodilov Jan 12, 2024
aab2108
Add topics helper for handlebars template processor
shorodilov Jan 12, 2024
9c82c97
Implement topics handlebars helpers to pass various topics
shorodilov Jan 12, 2024
d2da4a1
Update article date placeholders with various values
shorodilov Jan 12, 2024
ec03add
Add header sources (GH-45)
shorodilov Jan 12, 2024
b36fc25
Adjust topics nav (fixes GH-45)
shorodilov Jan 12, 2024
cbf4447
Update builder global variables config
shorodilov Jan 12, 2024
445027d
[CI] Add builds runner workflow
shorodilov Jan 12, 2024
47b8ef6
Add base sidebar (GH-44)
shorodilov Jan 12, 2024
7e4fc2d
Add user section to the sidebar (GH-44)
shorodilov Jan 12, 2024
da1d921
Update sidebar sections (GH-44)
shorodilov Jan 12, 2024
cee49c0
Add user action section content (GH-44)
shorodilov Jan 12, 2024
50ba8fe
Add a reference to a static content page to sidebar (GH-44)
shorodilov Jan 12, 2024
180266b
Configure sidebar rendering conditions (fixes GH-44)
shorodilov Jan 12, 2024
745ffec
Fixes GH-57
shorodilov Jan 12, 2024
04d3ed2
Fixes GH-62
shorodilov Jan 12, 2024
3f27545
Fixes GH-63
shorodilov Jan 12, 2024
8720c65
Fixes GH-61
shorodilov Jan 12, 2024
325593c
Fixes GH-61
shorodilov Jan 12, 2024
b060fb7
Add base profile page sources (GH-48)
shorodilov Jan 12, 2024
95ad8ce
Adjust articles section content for the profile page template (GH-48)
shorodilov Jan 12, 2024
36aabe2
Update CSS classes for user data section (fixes GH-48)
shorodilov Jan 12, 2024
36fa8e5
Adjust profile image align and default avatar sizes
shorodilov Jan 12, 2024
f5cdd3f
Add Jest test runner workflow
shorodilov Jan 12, 2024
5c819bd
Add base sources for auth form views
shorodilov Jan 12, 2024
b326268
Fix dist filenames
shorodilov Jan 12, 2024
d05d0a0
Add sign-up form template
shorodilov Jan 12, 2024
c894022
Add sign-in form template
shorodilov Jan 13, 2024
7a3f073
Center forms headers and append block roles
shorodilov Jan 13, 2024
c4e855e
Apply general auth forms styling
shorodilov Jan 13, 2024
7dd9394
Apply generic filenames for HTML files
shorodilov Jan 13, 2024
b8ef33a
Add base detail sources (GH-49)
shorodilov Jan 13, 2024
a425a02
Add article detail main content (GH-49)
shorodilov Jan 13, 2024
aec339c
Add comment template for article detail view (fixes GH-49)
shorodilov Jan 13, 2024
7474149
Add comment button to detail view template (GH-73)
shorodilov Jan 13, 2024
feaf118
Add article delete modal dialog (fixes GH-58)
shorodilov Jan 13, 2024
4bb05b1
Add profile deactivate modal dialog (fixes GH-60)
shorodilov Jan 13, 2024
837753c
Add change user data modal dialog (fixes GH-66)
shorodilov Jan 13, 2024
dac65c6
Add change password modal dialog (fixes GH-67)
shorodilov Jan 13, 2024
f00e3f7
Add comment article modal dialog (fixes GH-73)
shorodilov Jan 13, 2024
377912e
Apply base configuration for the developers' bundle creation (GH-37)
shorodilov Jan 13, 2024
189342d
Minor updates to webpack development config
shorodilov Jan 13, 2024
67a94d0
Set up separate config for development builds (fixes GH-37)
shorodilov Jan 13, 2024
813b3ae
Add commands for builds testing
shorodilov Jan 13, 2024
6c153c5
Minor change to templates
shorodilov Jan 14, 2024
6c7c4f2
Add article form sources (fixes GH-47)
shorodilov Jan 14, 2024
c8de8e5
Add masonry layout to project dependencies (fixes GH-71)
shorodilov Jan 14, 2024
bc44f40
Add comment (header) to the webpack entry point
shorodilov Jan 14, 2024
e61bfe6
Change package version to "release candidate"
shorodilov Jan 14, 2024
2084cc1
Update package lock file
shorodilov Jan 14, 2024
1ae4d50
Add base template to the development bundle
shorodilov Jan 14, 2024
567a20f
Rename GitHub workflow configs
shorodilov Jan 14, 2024
fbd6b63
Add various sidebars to the development bundle
shorodilov Jan 14, 2024
4aff24c
[CD] Deploy to GitHub pages workflow
shorodilov Jan 14, 2024
ed28045
[CD] Add upload release asset workflow
shorodilov Jan 14, 2024
c299ae6
[CI] Apply base setup for distribution tests (GH-77)
shorodilov Jan 14, 2024
dfbafe9
[CI] Apply base setup for distribution tests (fixes GH-77)
shorodilov Jan 14, 2024
bb9ebd7
Update gitignore patterns
shorodilov Jan 14, 2024
3e6ff90
Add list view dist tests
shorodilov Jan 14, 2024
da0b1f3
Add pagination section to list view (fixes GH-50)
shorodilov Jan 14, 2024
54979e7
Separate distribution content tests
shorodilov Jan 14, 2024
bfb0934
Update distribution content tests
shorodilov Jan 14, 2024
14f2ddb
Add article detail content tests
shorodilov Jan 14, 2024
2aee1c0
Add tests helper module to reduce code duplication
shorodilov Jan 14, 2024
32111c6
Update detail view test name
shorodilov Jan 14, 2024
bbc6a8b
[CD] Update asset upload on release workflow (fixes GH-53)
shorodilov Jan 14, 2024
3196e74
[CD] Update deploy to pages workflow configuration
shorodilov Jan 14, 2024
f916dfd
Update sidebar template condition name (create_view -> can_create) fo…
shorodilov Jan 14, 2024
fde7ba0
Add ids to sidebar buttons elements
shorodilov Jan 14, 2024
6c5efd1
Update project description (fixes GH-30)
shorodilov Jan 14, 2024
2bcc255
Add static content page source (fixes GH-46)
shorodilov Jan 14, 2024
32b73a4
Update meta and add canonical reference
shorodilov Jan 14, 2024
9f8f926
Update upload dist to release workflow configuration
shorodilov Jan 15, 2024
5d94270
Move blog directory stuff to src (#86)
shorodilov Jan 15, 2024
147546e
Rename helper to `iter_topics`
shorodilov Jan 16, 2024
b118476
Add topics to global project variables
shorodilov Jan 16, 2024
241014d
Apply refactoring for webpack configs (dev, prod)
shorodilov Jan 16, 2024
4b8260b
Apply webpack configs refactoring (#91)
shorodilov Jan 16, 2024
eb480c9
Pass topics to handlebars templates
shorodilov Jan 16, 2024
3713412
Add topics view source (fixes GH-87)
shorodilov Jan 16, 2024
77812fe
[Subscriptions View] Add source for the topic subscription view (#94)
shorodilov Jan 16, 2024
1cf3f4a
Add header to dist, remove chunks (css/js) from sidebar templates
shorodilov Jan 16, 2024
cf45883
Add static files refs to header and article list templates (dev)
shorodilov Jan 16, 2024
ceeb9a7
Add topics list sources to dev-dist package
shorodilov Jan 17, 2024
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
53 changes: 53 additions & 0 deletions .github/workflows/deploy_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup NodeJs
uses: actions/setup-node@v4
- name: Install dependencies
run: |
npm install
- name: Build
run: |
npm run build
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload distribution directory
path: "dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
26 changes: 26 additions & 0 deletions .github/workflows/run_js_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test custom JavaScript

on:
pull_request:
branches:
- master
- devel

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Setup NodeJs
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Test code with Jest
run: npm run test
36 changes: 36 additions & 0 deletions .github/workflows/run_selenium.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test distribution with Selenium

on:
pull_request:
branches:
- master
- devel

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Setup NodeJs
uses: actions/setup-node@v4
with:
node-version: 18

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
npm install
pip install -r requirements.txt

- name: Build the dist
run: npm run build:dev

- name: Test distribution with Selenium
run: pytest
44 changes: 44 additions & 0 deletions .github/workflows/test_webpack_builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check project bundle builds

on:
pull_request:
branches:
- master
- devel

jobs:
development:
runs-on: ubuntu-latest

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Setup NodeJs
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Build the distribution bundle
run: npm run build:dev

production:
runs-on: ubuntu-latest

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Setup NodeJs
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Build the distribution bundle
run: npm run build
85 changes: 85 additions & 0 deletions .github/workflows/upload_to_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Upload distribution to release

on:
release:
types:
- published

jobs:
jest:
runs-on: ubuntu-latest

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Setup NodeJs
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Test code with Jest
run: npm run test

pytest:
runs-on: ubuntu-latest

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Setup NodeJs
uses: actions/setup-node@v4
with:
node-version: 18

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
npm install
pip install -r requirements.txt

- name: Build the dist
run: npm run build:dev

- name: Test distribution with Selenium
run: pytest

upload:
runs-on: ubuntu-latest
needs: [jest, pytest]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup NodeJs
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Build the distribution
run: npm run build:dev

- name: Create dist archive
run: zip -r dist.zip ./dist

- name: Upload release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dist.zip
asset_name: dist.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@
# node modules
/node_modules/

# python virtual environment
/.venv/
/.env/
/venv/
/env/

# python byte-compiled
__pycache__

# distribution bundles directories
/dist/

# bootstrap source may be required for autocomplite,
# but they aren't part of current repository content
/css/bootstrap-*.*
/css/bootstrap.*
/js/bootstrap.*
bootstrap-*.*
bootstrap.*

# emacs caches and backup files
\#*\#
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Python training course authors and contributors
Copyright (c) 2024 Python training course authors and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
66 changes: 43 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,56 @@
DJANGO BLOG - BOOTSTRAP TEMPLATES
=================================

[![](https://github.com/edu-python-course/blog-bootstrap/actions/workflows/deploy_pages.yml/badge.svg)](https://edu-python-course.github.io/blog-bootstrap)
![](https://github.com/edu-python-course/blog-bootstrap/actions/workflows/test_webpack_builds.yml/badge.svg)
![](https://github.com/edu-python-course/blog-bootstrap/actions/workflows/run_selenium.yml/badge.svg)

This repo contains Bootstrap5 templates for the main training project, and
itself is a supporting subproject.

[Live preview](https://edu-python-course.github.io/blog-bootstrap/)
Getting started
---------------

For those who want to use the templates provided in this repository -
the shortest way is to check the
[release page](https://github.com/edu-python-course/blog-bootstrap/releases).
Starting from `ver2.0` each release has a **dist.zip** attached to it.
There are partials for individual site parts within the archive. These are
suitable for using with template processors (like Django templates or Jinja2).

In case you want to adjust the sources before build:

1. Clone the repo to your local machine
2. Install project dependencies: `npm install`
3. Build templates: `npm run build`
- to build the developer's version: `npm run build:dev`

Contents
--------

- [index.html](./index.html)
This is the main blog page. It contains a list of blog posts.
Each entity is a link to detailed blog post page.
- [detail.html](./detail.html)
This is a detailed blog post page. It contains the full blog post's
content. Comments related to a single blog post are also present here.
- [form.html](./form_article.html)
Blog post form (Creation and update).
- [profile.html](./profile.html)
User's personal page. This page is supposed to be public for all.
In case current user visiting their own profile page, this page will
include forms to change user data or set a new password. All blog posts
authored by a certain user is listed here in the form, similar to main
page view.
- [form_login.html](./form_login.html)
User login form.
- [form_registration.html](./form_registration.html)
New user registration form.
- [profile.html](./profile.html)
User profile page.
- [about.html](./about.html)
About page (static content).
### Production vs Development bundles

Production bundle is aimed to be served via GitHub pages. It's main purpose is
the site demonstration.

The development bundle is for usage with other projects (Django, Flask etc.).

Both production and development distributions bundle the JS code into a single
file. The same is for CSS. The only difference is the output distribution
structure.

### Sources

All the source are located within **src** directory.

`index.js` file is the entry point for the `webpack`. All resources required
by webpack are to be imported here.

`scss` directory contains individual styles used by various templates.

`js` directory contains custom JavaScript modules used within the project.

`views` directory contains templates for the HTML pages.

References
----------
Expand Down
Loading