Redo footer

This commit is contained in:
Daoud Clarke 2023-11-08 12:49:17 +00:00
parent dc2bd082cf
commit c0605e6bf7
9 changed files with 62 additions and 68 deletions

View File

@ -159,7 +159,7 @@ mwmbl-results, footer {
font-weight: var(--bold-font-weight);
}
footer {
.footer {
position: sticky;
top: 100vh;
margin-bottom: 25px;

View File

@ -103,4 +103,20 @@ Phosphor Web Font
.ph-info-bold::before {
content: "\f88f";
}
}
.ph-book-bold::before {
content: "\f6fb";
}
.ph-browser-bold::before {
content: "\f70d";
}
.ph-youtube-logo-bold::before {
content: "\fa5d";
}
.ph-chat-circle-text-bold::before {
content: "\f74c";
}

View File

@ -13290,10 +13290,6 @@
content: "\f6fa";
}
.ph-book-bold::before {
content: "\f6fb";
}
.ph-book-bookmark-bold::before {
content: "\f6fc";
}
@ -13362,10 +13358,6 @@
content: "\f70c";
}
.ph-browser-bold::before {
content: "\f70d";
}
.ph-browsers-bold::before {
content: "\f70e";
}
@ -13614,10 +13606,6 @@
content: "\f74b";
}
.ph-chat-circle-text-bold::before {
content: "\f74c";
}
.ph-chat-dots-bold::before {
content: "\f74d";
}
@ -16750,10 +16738,6 @@
content: "\fa5c";
}
.ph-youtube-logo-bold::before {
content: "\fa5d";
}
.ph-activity-fill::before {
content: "\fa5e";
}

View File

@ -11,18 +11,6 @@ export default {
publicApiURL: '/api/v1/',
// publicApiURL: 'http://localhost:5000/',
searchQueryParam: 'q',
footerLinks: [
{
name: 'Github',
icon: 'ph-github-logo-bold',
href: 'https://github.com/mwmbl/mwmbl'
},
{
name: 'Wiki',
icon: 'ph-info-bold',
href: 'https://github.com/mwmbl/mwmbl/wiki'
}
],
commands: {
'go: ': 'https://',
'search: google.com ': 'https://www.google.com/search?q=',

View File

@ -1,36 +0,0 @@
import define from '../../utils/define.js';
import config from '../../../config.js';
const template = ({ data }) => /*html*/`
<p class="footer-text">Find more on</p>
<ul class="footer-list">
${ data.links.map(link => /*html*/`
<li class="footer-item">
<a href="${link.href}" class="footer-link" target="__blank">
<i class="${link.icon}"></i>
<span>${link.name}</span>
</a>
</li>
`).join('') }
</ul>
`;
export default define('footer', class extends HTMLElement {
constructor() {
super();
this.__setup();
}
__setup() {
this.innerHTML = template({
data: {
links: config.footerLinks
}
});
this.__events();
}
__events() {
}
}, { extends: 'footer' });

View File

@ -16,7 +16,6 @@ import 'vite/modulepreload-polyfill';
if (!redirected) {
// Load components only after redirects are checked.
import("./components/organisms/results.js");
import("./components/organisms/footer.js");
import("./components/organisms/save.js");
import("./components/molecules/add-button.js");
import("./components/molecules/add-result.js");

View File

@ -134,3 +134,33 @@ ACCOUNT_EMAIL_VERIFICATION = "mandatory"
DEFAULT_FROM_EMAIL = "admin@mwmbl.org"
LOGIN_REDIRECT_URL = "/"
FOOTER_LINKS = [
{
"name": "Matrix",
"icon": "ph-chat-circle-text-bold",
"href": "https://matrix.to/#/#mwmbl:matrix.org",
},
{
"name": "Book",
"icon": "ph-book-bold",
"href": "https://book.mwmbl.org",
},
{
"name": "Blog",
"icon": "ph-browser-bold",
"href": "https://blog.mwmbl.org",
},
{
"name": "GitHub",
"icon": "ph-github-logo-bold",
"href": "https://github.com/mwmbl/mwmbl",
},
{
"name": "YouTube",
"icon": "ph-youtube-logo-bold",
"href": "https://www.youtube.com/channel/UCFLbqrH63-icAHxQ1eFfAvA",
},
]

View File

@ -86,7 +86,18 @@
</mwmbl-results>
</main>
<div is="mwmbl-add-result"></div>
<footer is="mwmbl-footer"></footer>
<div class="footer">
<ul class="footer-list">
{% for link in footer_links %}
<li class="footer-item">
<a href="{{ link.href }}" class="footer-link" target="__blank">
<i class="{{ link.icon }}"></i>
<span>{{ link.name }}</span>
</a>
</li>
{% endfor %}
</ul>
</div>
{% vite_asset 'index.js' %}
{% vite_legacy_polyfills %}
{% vite_legacy_asset 'index-legacy.js' %}

View File

@ -19,6 +19,7 @@ from justext.core import html_to_dom, ParagraphMaker, classify_paragraphs, revis
from mwmbl.settings import NUM_EXTRACT_CHARS
from mwmbl.tinysearchengine.indexer import Document
from django.conf import settings
def justext_with_dom(html_text, stoplist, length_low=LENGTH_LOW_DEFAULT,
@ -54,6 +55,7 @@ def index(request):
"query": query,
"user": request.user,
"activity": activity,
"footer_links": settings.FOOTER_LINKS,
})