Skip to content

Commit

Permalink
Merge pull request #1177 from rapidpro/djlint
Browse files Browse the repository at this point in the history
Linting
  • Loading branch information
norkans7 authored Jan 10, 2024
2 parents 54d6ccb + 76b2d59 commit 1d63a1e
Show file tree
Hide file tree
Showing 54 changed files with 567 additions and 608 deletions.
18 changes: 18 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,24 @@ combine_as_imports = true
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "DJANGO", "FIRSTPARTY", "LOCALFOLDER"]
known_django = ["django"]

[tool.djlint]
blank_line_after_tag = "load"
custom_blocks = "render"
format_css = true
format_js = true
ignore = "H006,H019,H021,H023"
indent = 2
max_attribute_length = 100
max_line_length = 200

[tool.djlint.css]
indent_size = 2

[tool.djlint.js]
indent_size = 2
templating = "django"


[tool.coverage.run]
source = ["ureport"]

Expand Down
34 changes: 19 additions & 15 deletions templates/404.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="keywords" content="">
<title>U-Report - Not Found.</title>
<style>
body {
background-color:#FFFFFF;
}
body {
background-color: #FFFFFF;
}

.logo {
.logo {
margin: 0 auto;
margin-top:190px;
width:100%;
text-align:center;
margin-top: 190px;
width: 100%;
text-align: center;

}
}

.message {
margin-top:18px;
.message {
margin-top: 18px;
color: #333;
font-family:"Helvetica Neue", Arial, "Lucida Grande", sans-serif;
font-size:14px;
font-family: "Helvetica Neue", Arial, "Lucida Grande", sans-serif;
font-size: 14px;
text-align: center;
}
}
</style>
</head>
<body>
<div class="logo">
<img src="/sitestatic/img/logo_placeholder.png" />
<img src="/sitestatic/img/logo_placeholder.png" alt="" />
</div>
<div class="message">
Sorry, that page wasn't found.
Expand Down
39 changes: 20 additions & 19 deletions templates/500.html
Original file line number Diff line number Diff line change
@@ -1,50 +1,51 @@
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="keywords" content="">
<title>U-Report Problem - Uh oh!</title>
<style>
body {
background-color:#FFFFFF;
body {
background-color: #FFFFFF;
font-family: "Helvetica Neue", Arial, "Lucida Grande", sans-serif;
}
}

.logo {
.logo {
width: 100%;
text-align: center;
margin: 140px auto 50px;
}
}

h3 {
h3 {
margin-top: 22px;
color: #333;
font-size: 18px;
text-align: center;
}
}

h4 {
h4 {}

}

.message {
.message {
margin: 0 auto;
color: #333;
font-size: 14px;
width: 500px;
}
}

.reference {
padding:20px;
.reference {
padding: 20px;
background: #f3f3f3;
font-size: 14px;
text-align: center;
width: 460px;
margin: 30px auto 0;
}

}
</style>
</head>
<body>
<div class="logo">
<img src="/sitestatic/img/logo_placeholder.png" />
<img src="/sitestatic/img/logo_placeholder.png" alt="" />
</div>
<div style="text-align: center;">
<h3>Sometimes bad things happen to good people.</h3>
Expand All @@ -56,7 +57,7 @@ <h3>Sometimes bad things happen to good people.</h3>
<br />
</div>
{% if request.sentry.id %}
<div class='reference'>
<div class="reference">
If you'd like to contact us about this error, please be sure to include your reference number
<b>{{ request.sentry.id }}</b>
</div>
Expand Down
46 changes: 23 additions & 23 deletions templates/base_admin_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<div class="level">
{% if is_rtl_org %}<div class="level-left"></div>{% endif %}
<div class="{% if is_rtl_org %}level-right{% else %}level-left{% endif %}">
<a href="/"
<a href="{% url 'public.index' %}"
style="justify-content: start"
class="level-item has-text-black">
<div style="{% if is_rtl_org %}margin-right:0;
Expand Down Expand Up @@ -145,54 +145,54 @@
<li>
<a href="{% url 'polls.poll_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/polls_icon.png">
<img src="{{ STATIC_URL }}img/polls_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Opinions" %}</span>
</a>
</li>
<li>
<a href="{% url 'stories.story_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/stories_icon.png">
<img src="{{ STATIC_URL }}img/stories_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Stories" %}</span>
</a>
</li>
<li>
<a href="{% url 'bots.bot_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/settings_icon.png">
<img src="{{ STATIC_URL }}img/settings_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Bots" %}</span>
</a>
</li>
<li>
<a href="{% url 'orgs.org_manage_accounts' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/users_icon.png">
<img src="{{ STATIC_URL }}img/users_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Users" %}</span>
</a>
</li>
<li>
<a href="{% url 'orgs.org_edit' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/settings_icon.png">
<img src="{{ STATIC_URL }}img/settings_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Settings" %}</span>
</a>
</li>
<li>
<a href="{% url 'dashblocks.dashblock_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/pages_icon.png">
<img src="{{ STATIC_URL }}img/pages_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Pages" %}</span>
</a>
<li>
<a href="{% url 'landingpages.landingpage_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/pages_icon.png">
<img src="{{ STATIC_URL }}img/pages_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Landing Pages" %}</span>
</a>
Expand All @@ -201,31 +201,31 @@
<li>
<a href="{% url 'jobs.jobsource_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/jobs_icon.png">
<img src="{{ STATIC_URL }}img/jobs_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Jobs" %}</span>
</a>
</li>
<li>
<a href="{% url 'categories.category_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/categories_icon.png">
<img src="{{ STATIC_URL }}img/categories_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Categories" %}</span>
</a>
</li>
<li>
<a href="{% url 'tags.tag_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/categories_icon.png">
<img src="{{ STATIC_URL }}img/categories_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Tags" %}</span>
</a>
</li>
<li>
<a href="{% url 'assets.image_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/photos_icon.png">
<img src="{{ STATIC_URL }}img/photos_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Partners Logos" %}</span>
</a>
Expand All @@ -234,7 +234,7 @@
<li>
<a href="{% url 'categories.categoryimage_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/photos_icon.png">
<img src="{{ STATIC_URL }}img/photos_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Categories Images" %}</span>
</a>
Expand All @@ -244,7 +244,7 @@
<li>
<a href="{% url 'news.newsitem_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/news_icon.png">
<img src="{{ STATIC_URL }}img/news_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "News Items" %}</span>
</a>
Expand All @@ -254,31 +254,31 @@
<li>
<a href="{% url 'orgs.org_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/settings_icon.png">
<img src="{{ STATIC_URL }}img/settings_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Orgs" %}</span>
</a>
</li>
<li>
<a href="/users/user/">
<a href="{% url 'users.user_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/settings_icon.png">
<img src="{{ STATIC_URL }}img/settings_icon.png" alt="" >
</span>
<span class="menu-link-title">{% trans "Users" %}</span>
</a>
</li>
<li>
<a href="{% url 'dashblocks.dashblocktype_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/settings_icon.png">
<img src="{{ STATIC_URL }}img/settings_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Content Types" %}</span>
</a>
</li>
<li>
<a href="{% url 'assets.image_list' %}">
<span class="icon">
<img src="{{ STATIC_URL }}img/settings_icon.png">
<img src="{{ STATIC_URL }}img/settings_icon.png" alt="">
</span>
<span class="menu-link-title">{% trans "Images" %}</span>
</a>
Expand Down Expand Up @@ -326,10 +326,10 @@
<div style="max-width:185px" class="md:block block">
{% if org.language != "ar" and org.language != "ru" %}
<img src="{{ STATIC_URL }}/img/UNICEF_footer_Logo_black_en.png"
class="md:-ml-0 -ml-2">
class="md:-ml-0 -ml-2" alt="">
{% else %}
<img src="{{ STATIC_URL }}/img/UNICEF_footer_Logo_black_{{ org.language }}.png"
class="md:-ml-0 -ml-2">
class="md:-ml-0 -ml-2" alt="">
{% endif %}
</div>
{% endif %}
Expand All @@ -346,10 +346,10 @@
<div style="width:150px" class="md:block block">
{% if org.language != "ar" and org.language != "ru" %}
<img src="{{ STATIC_URL }}/img/UNICEF_footer_Logo_black_en.png"
class="-ml-2">
class="-ml-2" alt="">
{% else %}
<img src="{{ STATIC_URL }}/img/UNICEF_footer_Logo_black_{{ org.language }}.png"
class="-ml-2">
class="-ml-2" alt="">
{% endif %}
</div>
{% endif %}
Expand Down
3 changes: 2 additions & 1 deletion templates/categories/category_list.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{% extends "smartmin/list.html" %}
{% load thumbnail smartmin i18n %}

{% block content-title %}
<h2 class="is-size-2 has-text-weight-bold">
<img src="{{ STATIC_URL }}img/settings_icon.png">
<img src="{{ STATIC_URL }}img/settings_icon.png" alt="">
<div class="is-inline-block content-title-text">{% trans "Categories" %}</div>
</h2>
{% endblock content-title %}
Loading

0 comments on commit 1d63a1e

Please sign in to comment.