-
Notifications
You must be signed in to change notification settings - Fork 6
Feature/lore wiki page #675
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
Open
Gunvor4
wants to merge
31
commits into
main
Choose a base branch
from
feature/lore-wiki-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+527
−39
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
aa4ac4f
Created new model Lore
Gunvor4 17d65c5
Made form for lore articles
Gunvor4 612185f
Added urls, views and template for lore wiki
Gunvor4 1a3e879
Added styling to lore wiki
Gunvor4 99080f8
Updated translation files
Gunvor4 33d45af
Added internal joke
Gunvor4 64c9027
Added hamburger menu to be shown on smaller screens
Gunvor4 dea71b2
Updated translation files
Gunvor4 d5ee29d
Updated changelog
Gunvor4 c0f69d7
Adjusted burger menu
Gunvor4 9f2d6e5
Adjusted media rules
Gunvor4 49257d6
Changed permissions
Gunvor4 d43b644
Changed how pencil and trash icon are shown on devices with smaller s…
Gunvor4 31443bf
Made CSS changes to lore page
Gunvor4 da6d810
Commented on checkbox
Gunvor4 ff5aefb
Set max length on main text field for lore article
Gunvor4 a99bb65
Added error to deal with titles consisting of symbols
Gunvor4 d8192ac
Changed the placement of the checkbox in the lore article update form
Gunvor4 ba0a763
Updated translation files
Gunvor4 6f6f595
Improved slugification of titles
Gunvor4 f38a527
Fixed alphabetical order of imports
Gunvor4 3bf1b3a
Changed content field on model from TextField to RichTextUploadingField
Gunvor4 31d6537
Change name on template files and CSS file
Gunvor4 f1e3c35
Switched from validating form data in views to validating in forms
Gunvor4 b16dc06
Changed url names
Gunvor4 b89ea66
Changed migrations
Gunvor4 e2bfa3d
Switched from overriding get_context_data to using extra_context
Gunvor4 2f5da3d
Changed context object names
Gunvor4 60c48d5
Various small changes
Gunvor4 94e8144
Updated translation files
Gunvor4 4d9e2a4
Removed additional CSS code for update forms from style.css
Gunvor4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Generated by Django 4.1.7 on 2023-11-17 16:00 | ||
|
|
||
| import ckeditor_uploader.fields | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('internal', '0026_add_secret_permissions'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name='Lore', | ||
| fields=[ | ||
| ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
| ('title', models.CharField(max_length=200, unique=True, verbose_name='title')), | ||
| ('slug', models.SlugField(unique=True)), | ||
| ('content', ckeditor_uploader.fields.RichTextUploadingField(max_length=150000, verbose_name='text')), | ||
| ], | ||
| options={ | ||
| 'verbose_name': 'lore article', | ||
| 'verbose_name_plural': 'lore articles', | ||
| }, | ||
| ), | ||
| ] |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,159 @@ | ||
| #lore-page { | ||
| position: relative; | ||
| max-width: 100vw; | ||
| } | ||
|
|
||
| #lore-wiki-list { | ||
| float: left; | ||
| width: 20%; | ||
| padding: 3rem 0 40px 40px; | ||
| position: relative; | ||
| } | ||
|
|
||
| .lore-article-links a { | ||
| color: black; | ||
| } | ||
|
|
||
| ul.lore-article-links { | ||
| list-style-type: none; | ||
| list-style-position: inside; | ||
| padding: 0; | ||
| } | ||
|
|
||
| .lore-article-links .selected-lore-article { | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| #lore-article { | ||
| float: left; | ||
| width: 80%; | ||
| padding: 3rem 25% 0 5%; | ||
| position: relative; | ||
| } | ||
|
|
||
| #lore-article p { | ||
| text-align: justify; | ||
| } | ||
|
|
||
| .lore-container img { | ||
| margin: 20px 30px; | ||
| } | ||
|
|
||
| #lore-article .lore-container { | ||
| margin-bottom: 70px; | ||
| } | ||
|
|
||
| #lore-wiki-list .plus.icon { | ||
| font-size: 90%; | ||
| } | ||
|
|
||
| #lore-burger-icon + h2 .plus.icon { | ||
Gunvor4 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| font-size: 80%; | ||
| } | ||
|
|
||
| #lore-article .trash.icon, | ||
| #lore-article .pencil.icon { | ||
| font-size: 120%; | ||
| } | ||
|
|
||
| #lore-article .lore-heading { | ||
| display: block; | ||
| max-width: 100vw; | ||
| } | ||
|
|
||
| /* The burger menu used on the lore page is loosely based on https://alvarotrigo.com/blog/hamburger-menu-css-responsive/ */ | ||
|
|
||
| #burger-input { | ||
| display: none; | ||
| } | ||
|
|
||
| #lore-burger-icon { | ||
| display: none; | ||
| width: 15px; | ||
| height: 15px; | ||
| cursor: pointer; | ||
| border: none; | ||
| margin-top:6px; | ||
| background: linear-gradient( | ||
| to bottom, | ||
| black, black 20%, | ||
| white 20%, white 40%, | ||
| black 40%, black 60%, | ||
| white 60%, white 80%, | ||
| black 80%, black 100% | ||
| ); | ||
| position: absolute; | ||
| top: 3rem; | ||
| left: 15%; | ||
| } | ||
|
|
||
| #lore-burger-icon + h2 { | ||
| position: absolute; | ||
| top: 3rem; | ||
| left: 15%; | ||
| margin: 0 0 0 30px; | ||
| display: none; | ||
| } | ||
|
|
||
| #lore-burger-menu { | ||
| display: none; | ||
| max-width: 100vw; | ||
| padding: 6rem 15% 0 15%; | ||
| } | ||
|
|
||
| @media screen and (max-width: 992px) { | ||
|
|
||
| #lore-burger-icon { | ||
| display: inline; | ||
| } | ||
|
|
||
| #lore-burger-icon + h2 { | ||
| display: block; | ||
| } | ||
|
|
||
| #burger-input:not(:checked) ~ #lore-article { | ||
| position: absolute; | ||
| top: 6rem; | ||
| } | ||
|
|
||
| #burger-input:checked + #lore-burger-icon { | ||
| clip-path: polygon(15% 0%, 0% 15%, 35% 50%, 0% 85%, 15% 100%, 50% 65%, 85% 100%, 100% 85%, 65% 50%, 100% 15%, 85% 0%, 50% 35%); | ||
| background: black; | ||
| } | ||
|
|
||
| #burger-input:checked + #lore-burger-icon ~ #lore-burger-menu { | ||
Gunvor4 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| display: block; | ||
| top: 6rem; | ||
| } | ||
|
|
||
| #lore-wiki-list { | ||
| display: none; | ||
| float: none; | ||
| max-width: 100vw; | ||
| padding: 2rem 15% 0 15%; | ||
| } | ||
|
|
||
| #lore-article { | ||
| float: none; | ||
| width: 100vw; | ||
| padding: 3rem 15% 2rem 15%; | ||
| position: relative; | ||
| } | ||
| } | ||
|
|
||
| @media screen and (max-width: 450px) { | ||
|
|
||
| #lore-article { | ||
| float: none; | ||
| width: 100%; | ||
| padding: 3rem 15% 2rem 15%; | ||
| position: relative; | ||
| } | ||
|
|
||
| .lore-container img { | ||
| float: none; | ||
| width: 100%; | ||
| height: unset; | ||
| margin: 10px 0; | ||
| } | ||
| } | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| $(document).ready(function() { | ||
| $('img').each(function() { | ||
Gunvor4 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if ($(this).css('float') === 'left') { | ||
| $(this).css('margin-left', '0'); | ||
| } | ||
| if ($(this).css('float') === 'right') { | ||
Gunvor4 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| $(this).css('margin-right', '0'); | ||
| } | ||
| }); | ||
Gunvor4 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| {% extends 'internal/base.html' %} | ||
| {% load i18n %} | ||
| {% load static %} | ||
|
|
||
|
|
||
| {% block title %} | ||
| {% translate "The wiki of MAKE lore" %} | ||
| {% endblock title %} | ||
|
|
||
| {% block extra_head %} | ||
| <link rel="stylesheet" href="{% static 'internal/css/lore_list.css' %}"/> | ||
| <script src="{% static 'internal/js/lore_list.js' %}"></script> | ||
Gunvor4 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {% endblock extra_head %} | ||
|
|
||
| {% block body %} | ||
| <div id="lore-page"> | ||
| <div id="lore-wiki-list" class="word-breaking hyphenated"> | ||
| <h2>{% translate "Topics" %} | ||
| {% if perms.internal.add_lore %} | ||
| <a href="{% url 'lore_create' %}"> | ||
| <i class="green plus icon"></i> | ||
| </a> | ||
| {% endif %} | ||
| </h2> | ||
| {% include 'internal/lore/lore_list__article_links.html' %} | ||
| </div> | ||
|
|
||
| {# Checkbox belongs to hamburger menu. Checkbox status decides if hamburger menu will be shown or not #} | ||
| <input type="checkbox" id="burger-input"/> | ||
| <label id="lore-burger-icon" for="burger-input"></label> | ||
| <h2>{% translate "Topics" %} | ||
| {% if perms.internal.add_lore %} | ||
| <a href="{% url 'lore_create' %}"> | ||
| <i class="green plus icon"></i> | ||
| </a> | ||
| {% endif %} | ||
| </h2> | ||
| <div id="lore-burger-menu" class="word-breaking hyphenated"> | ||
| {% include 'internal/lore/lore_list__article_links.html' %} | ||
| </div> | ||
|
|
||
| <div id="lore-article"> | ||
| {% if show_article %} | ||
| <h1 class="lore-heading word-breaking hyphenated">{{ shown_lore_article.title|capfirst }}</h1> | ||
| {% if perms.internal.delete_lore and shown_lore_article.title != "Dev" %} | ||
| <a class="delete-modal-button" | ||
| data-url="{% url 'lore_delete' shown_lore_article.slug %}" | ||
| data-obj-name="{{ shown_lore_article }}"> | ||
| <i class="red trash icon"></i> | ||
| </a> | ||
| {% endif %} | ||
| {% if perms.internal.change_lore and shown_lore_article.title != "Dev" %} | ||
Gunvor4 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <a href="{% url 'lore_update' shown_lore_article.slug %}"> | ||
| <i class="make-col-yellow pencil icon"></i> | ||
| </a> | ||
| {% endif %} | ||
| <div class="lore-container word-breaking hyphenated"> | ||
| <p>{{ shown_lore_article.content|safe }}</p> | ||
| </div> | ||
| {% else %} | ||
| <h1>{% translate "Welcome to the wiki of MAKE lore" %}</h1> | ||
| <p>{% translate "Click a topic in the menu to access a wiki article" %}</p> | ||
| {% endif %} | ||
| </div> | ||
| </div> | ||
| {% endblock body %} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.