Skip to content

Commit

Permalink
Merge pull request #130 from nsosnsos/dev
Browse files Browse the repository at this point in the history
REFACTOR: ORGANIZE STATIC AND TEMPLATES
  • Loading branch information
nsosnsos authored Oct 14, 2023
2 parents 4aff084 + 6f157e9 commit 899d851
Show file tree
Hide file tree
Showing 21 changed files with 96 additions and 35 deletions.
68 changes: 61 additions & 7 deletions hallelujah/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,35 +44,89 @@ a {
transform: translate(-50%, -50%);
}

/* thumbnail image */
.thumbnail-image {
position: relative;
width: 100%;
}

/* gallery */
.gallery {
display: flex;
flex-wrap: wrap;
}

.gallery>a, .gallery::after {
flex-basis: var(--w);
}

.gallery>a {
margin: 0.1rem;
flex-grow: calc(var(--w) / var(--h) * 100);
width: calc(var(--w) * 1px);
}

.gallery::after {
--w: 2;
--h: 1;
content: '';
flex-grow: 1000000;
}

.gallery>a>div {
position: relative;
}

.thumbnail-image {
position: relative;
width: 100%;
/* markdown body */
.markdown-body {
background-color: transparent;
box-sizing: border-box;
padding: 15px;
}
.markdown-body table tr {
background-color: transparent;
}
.markdown-body table tr:nth-child(2n) {
background-color: transparent;
opacity: 1.0;
}
.markdown-body pre {
margin-top, margin-bottom: 5px;
padding: 0;
background-color: #cccccc;
}
.markdown-body code.hljs {
white-space: pre-wrap;
overflow: auto;
}
.markdown-body code.hljs table.hljs-ln {
width: 100%;
border-collapse: collapse;
margin: 0;
border: 0;
padding: 2px;
}
.markdown-body code.hljs table.hljs-ln tbody {
width: 100%;
min-width: 200px;
display: table;
}
.markdown-body code.hljs table.hljs-ln tr {
border: 0;
}
.markdown-body code.hljs table.hljs-ln td.hljs-ln-line {
border: 0;
padding: 0 5px;
}
.markdown-body code.hljs table.hljs-ln td.hljs-ln-numbers {
font-family: inherit;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-align: right;
vertical-align: top;
color: #373737;
border-right: 1px solid #373737;
width: 1rem;
min-width: 1rem;
}

4 changes: 2 additions & 2 deletions hallelujah/templates/auth/login.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends '_base.html' %}
{% from '_form.html' import render_field %}
{% extends 'base.html' %}
{% from 'macros/form.html' import render_field %}

{% block content %}
<div class="row justify-content-center">
Expand Down
2 changes: 1 addition & 1 deletion hallelujah/templates/auth/profile.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends '_base.html' %}
{% extends 'base.html' %}

{% block content %}
<div class="row justify-content-center">
Expand Down
4 changes: 2 additions & 2 deletions hallelujah/templates/auth/register.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends '_base.html' %}
{% from '_form.html' import render_field %}
{% extends 'base.html' %}
{% from 'macros/form.html' import render_field %}

{% block content %}
<div class="row justify-content-center">
Expand Down
4 changes: 2 additions & 2 deletions hallelujah/templates/auth/setting.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends '_base.html' %}
{% from '_form.html' import render_field %}
{% extends 'base.html' %}
{% from 'macros/form.html' import render_field %}

{% block content %}
<div class="row justify-content-center">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
{% from '_nav.html' import render_nav_item %}
{% from 'macros/nav.html' import render_nav_item %}
<html lang="en">
<head>
{% block metas %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,4 @@
{% endfor %}
</div>
{% endmacro %}

Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{# render modal html #}


{% macro render_modal(modal_title, resource_title, resource_del_uri, resource_id='') %}
<button type="button" class="btn btn-primary btn-sm my-1 my-auto float-end" data-bs-toggle="modal" data-bs-target="#modal_{{ resource_id }}"><i class="bi-trash">Delete</i></button>
<div class="modal fade" id="modal_{{ resource_id }}" tabindex="-1" role="dialog" aria-labelledby="modal_{{ resource_id }}" aria-hidden="true">
Expand All @@ -20,3 +23,4 @@ <h5 class="modal-title" id="modal_{{ resource_id }}">{{ modal_title }}</h5>
</div>
</div>
{% endmacro %}

Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{# render navigation item #}


{% macro render_nav_item(endpoint, text, badge='', use_li=True, icon='') %}
{% set active = True if request.endpoint and request.endpoint == endpoint else False %}
{% if use_li %}<li class="nav-item">{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion hallelujah/templates/main/about.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends '_base.html' %}
{% extends 'base.html' %}

{% block content %}
<div class="row justify-content-center">
Expand Down
2 changes: 1 addition & 1 deletion hallelujah/templates/main/articles.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends '_base.html' %}
{% extends 'base.html' %}

{% block content %}
<div class="row mt-5">
Expand Down
4 changes: 2 additions & 2 deletions hallelujah/templates/main/edit_article.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends '_simplemde.html' %}
{% from '_form.html' import render_simple, render_field %}
{% extends 'plugins/simplemde.html' %}
{% from 'macros/form.html' import render_simple, render_field %}

{% block content %}
<div class="row justify-content-center">
Expand Down
8 changes: 4 additions & 4 deletions hallelujah/templates/main/medias.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% if form %}
{% extends '_dropzone.html' %}
{% from '_form.html' import render_field %}
{% from '_modal.html' import render_modal %}
{% extends 'plugins/dropzone.html' %}
{% from 'macros/form.html' import render_field %}
{% from 'macros/modal.html' import render_modal %}
{% else %}
{% extends '_base.html' %}
{% extends 'base.html' %}
{% endif %}

{% block content %}
Expand Down
6 changes: 3 additions & 3 deletions hallelujah/templates/main/resources.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% if not columns and not form %}
{% extends '_base.html' %}
{% extends 'base.html' %}
{% else %}
{% extends '_gridjs.html' %}
{% from '_form.html' import render_field %}
{% extends 'plugins/gridjs.html' %}
{% from 'macros/form.html' import render_field %}
{% endif %}

{% block content %}
Expand Down
2 changes: 1 addition & 1 deletion hallelujah/templates/main/search.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends '_base.html' %}
{% extends 'base.html' %}

{% block content %}
<div class="row mt-5">
Expand Down
2 changes: 1 addition & 1 deletion hallelujah/templates/main/user.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends '_base.html' %}
{% extends 'base.html' %}

{% block content %}
<div class="row justify-content-center">
Expand Down
4 changes: 2 additions & 2 deletions hallelujah/templates/main/view_article.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends '_highlight.html' %}
{% from '_modal.html' import render_modal %}
{% extends 'plugins/highlight.html' %}
{% from 'macros/modal.html' import render_modal %}

{% block content %}
<div class="row justify-content-center my-5">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends '_base.html' %}
{% extends 'base.html' %}

{% block styles %}
<link rel="stylesheet" href="https://unpkg.com/dropzone@6.0.0-beta.1/dist/dropzone.css">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends '_base.html' %}
{% extends 'base.html' %}

{% block styles %}
{{ super() }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{% extends '_base.html' %}
{% extends 'base.html' %}

{% block styles %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.6.0/build/styles/googlecode.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@5.1.0/github-markdown.min.css">
{{ super() }}
<link rel="stylesheet" href="{{ url_for('static', filename='css/markdown_patch.css', _external=True) }}">
{% endblock styles %}

{% block scripts %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends '_highlight.html' %}
{% extends 'plugins/highlight.html' %}

{% block styles %}
{{ super() }}
Expand Down

0 comments on commit 899d851

Please sign in to comment.