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

Responsive Layout and Navbar from archlinux-common-style #382

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
16a8abb
Add meta viewport tag to HTML head
Phosphenius Nov 3, 2019
5c2092c
Add markup and style for a mobile friendly hamburger button menu
Phosphenius Nov 4, 2019
fe8a30f
Add hamburger button JavaScript
Phosphenius Nov 4, 2019
9c873cf
Update mobile navigation to be more user friendly
Phosphenius Nov 16, 2019
b30d6d4
Move the footer and devnavbar sections out of the content section
Phosphenius May 23, 2020
9cadf9d
Introduce responsive (mobile friendly) layout for the start page
Phosphenius May 23, 2020
0eda6bb
Add a max width for news article headlines
Phosphenius May 23, 2020
a211c0c
Add mobile friendly style for the nav-sidebar
Phosphenius May 23, 2020
214fa72
Refactor navbar CSS to use flexbox instead of float
Phosphenius May 24, 2020
da634eb
Introduce a navbar wrapper element to limit the navbar width
Phosphenius May 24, 2020
274e4ea
Add mobile friendly view for packages table
Phosphenius May 28, 2020
6283c49
use navbar from archlinux-common-style
maltejur Nov 8, 2021
f68e692
fix relative path
maltejur Nov 22, 2021
ba94ca5
remove cssmin submodule
maltejur Nov 22, 2021
1aca884
add padding to archnavbar
maltejur Nov 23, 2021
5c42fdc
remove cssmin submodule
maltejur Nov 23, 2021
c4f9736
fix small errors in archnavbar
maltejur Nov 23, 2021
62f6e9b
remove cssmin submodule
maltejur Nov 23, 2021
298bf6f
fix scrolling issue
maltejur Nov 23, 2021
d78aba0
add instructions to initialize the submodules
maltejur Nov 23, 2021
7124f9e
Merge branch 'master' into responsive_layout
maltejur Feb 16, 2022
f539062
delete cssmin
maltejur Feb 16, 2022
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "commonstyle/archlinux-common-style"]
path = commonstyle/archlinux-common-style
url = https://gitlab.archlinux.org/maltejur/archlinux-common-style.git
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,43 @@ packages, you will probably want the following:

# Testing Installation

1. Run `python -m venv env`.
1. Initialize the submodules

cd /path/to/archweb && python -m venv ./env/
cd /path/to/archweb && git submodule update --init

2. Activate the virtualenv.
2. Run `python -m venv env`.

python -m venv ./env/

3. Activate the virtualenv.

source ./env/bin/activate

2. Install dependencies through `pip`.
4. Install dependencies through `pip`.

pip install -r requirements.txt

3. Copy `local_settings.py.example` to `local_settings.py` and modify.
5. Copy `local_settings.py.example` to `local_settings.py` and modify.
Make sure to uncomment the appropriate database section (either sqlite or
PostgreSQL).

4. Migrate changes.
6. Migrate changes.

./manage.py migrate

5. Load the fixtures to pre populate some data. If you don't want some of the
7. Load the fixtures to pre populate some data. If you don't want some of the
provided data, adjust the file glob accordingly.

./manage.py loaddata main/fixtures/*.json
./manage.py loaddata devel/fixtures/*.json
./manage.py loaddata mirrors/fixtures/*.json
./manage.py loaddata releng/fixtures/*.json

6. Use the following commands to start a service instance
8. Use the following commands to start a service instance

./manage.py runserver

7. To optionally populate the database with real data:
9. To optionally populate the database with real data:

wget http://mirrors.kernel.org/archlinux/core/os/x86_64/core.db.tar.gz
./manage.py reporead x86_64 core.db.tar.gz
Expand Down
Empty file added commonstyle/__init__.py
Empty file.
1 change: 1 addition & 0 deletions commonstyle/archlinux-common-style
Submodule archlinux-common-style added at d1fe8a
17 changes: 17 additions & 0 deletions commonstyle/templatetags/archnavbar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from os import path
from django import template
from django.utils.safestring import mark_safe
from django.conf import settings

register = template.Library()


@register.simple_tag
def archnavbar():
with open(path.join(settings.DEPLOY_PATH, "commonstyle", "archlinux-common-style", "html", "navbar.html"), "r", encoding="UTF-8") as f:
return mark_safe(
f.read()
.replace('href="https://archlinux.org"', 'href="/"')
.replace('href="https://archlinux.org/packages/"', 'href="/packages/"')
.replace('href="https://archlinux.org/download/"', 'href="/download/"')
)
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ bleach==4.1.0
requests==2.25.1
xtarfile==0.1.0
zstandard==0.15.2
django-compressor==2.4.1
django-libsass==0.9
14 changes: 14 additions & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
# Look for more static files in these locations
STATICFILES_DIRS = (
path.join(DEPLOY_PATH, 'sitestatic'),
path.join(DEPLOY_PATH, 'commonstyle', 'archlinux-common-style', 'img'),
path.join(DEPLOY_PATH, 'commonstyle', 'archlinux-common-style', 'sass'),
)

# Static files backend that allows us to use far future Expires headers
Expand Down Expand Up @@ -135,6 +137,8 @@
'public',
'releng',
'visualize',
'commonstyle',
'compressor',
)

# Logging configuration for not getting overspammed
Expand Down Expand Up @@ -258,3 +262,13 @@
INSTALLED_APPS = list(INSTALLED_APPS) + ['debug_toolbar']

# vim: set ts=4 sw=4 et:

STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
"compressor.finders.CompressorFinder"
]

COMPRESS_PRECOMPILERS = (
('text/x-scss', 'django_libsass.SassCompiler'),
)
Binary file removed sitestatic/archnavbar/archlogo.png
Binary file not shown.
194 changes: 0 additions & 194 deletions sitestatic/archnavbar/archlogo.svg

This file was deleted.

25 changes: 0 additions & 25 deletions sitestatic/archnavbar/archnavbar.css

This file was deleted.

Loading