Skip to content

Commit

Permalink
Merge pull request #4 from bear-rsg/dev
Browse files Browse the repository at this point in the history
photographs app
  • Loading branch information
mike-allaway authored Apr 10, 2024
2 parents 58b3129 + 696de2d commit 49523bb
Show file tree
Hide file tree
Showing 35 changed files with 645 additions and 131 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/ci-django-tests.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/ci-flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Run Tests
run: |
flake8 -v .
1 change: 0 additions & 1 deletion .github/workflows/ci-pa11y.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Run Tests
run: |
cd django
Expand Down
Empty file.
17 changes: 17 additions & 0 deletions django/captchanotimeout/templates/captcha/includes/js_v3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script src="https://{{ recaptcha_domain }}/recaptcha/api.js?render={{ public_key }}{% if api_params %}&{{ api_params }}{% endif %}"></script>
<script type="text/javascript">

function updateCaptcha() {
grecaptcha.execute('{{ public_key }}', {action: 'form'})
.then(function(token) {
console.log("reCAPTCHA validated for 'data-widget-uuid=\"{{ widget_uuid }}\"'. Setting input value...")
var element = document.querySelector('.g-recaptcha[data-widget-uuid="{{ widget_uuid }}"]');
element.value = token;
});
}

grecaptcha.ready(function() {
updateCaptcha();
setInterval(updateCaptcha, 110000)
});
</script>
4 changes: 4 additions & 0 deletions django/core/local_settings.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# Online tools can help generate this for you, e.g. https://www.miniwebtool.com/django-secret-key-generator/
SECRET_KEY = ''

# Create Google RECAPTCHA public and private keys: https://www.google.com/recaptcha/
RECAPTCHA_PUBLIC_KEY = ''
RECAPTCHA_PRIVATE_KEY = ''

# Set to True if in development, or False is in production
DEBUG = True/False

Expand Down
4 changes: 4 additions & 0 deletions django/core/local_settings.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

SECRET_KEY = 'u6n(9&8g-3=6d1#jyp^#))you-h&y^-5y7*&hu)cpxzeu_7#j+'

# Create Google RECAPTCHA public and private keys: https://www.google.com/recaptcha/
RECAPTCHA_PUBLIC_KEY = ''
RECAPTCHA_PRIVATE_KEY = ''

DEBUG = True

# Used by Django Debug Toolbar (comment out to disable DDT)
Expand Down
2 changes: 1 addition & 1 deletion django/core/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ msgstr ""

#: core/templates/base.html:7 core/templates/base.html:47
msgid "ProjectTitle"
msgstr "Encarnación de Díaz: Photohistories of the Cristero War"
msgstr "Encarnación de Díaz"

#: core/templates/base.html:60
msgid "Welcome"
Expand Down
12 changes: 9 additions & 3 deletions django/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@
'django.contrib.staticfiles',
'django.contrib.humanize',
# 3rd Party
# captchanotimeout is a custom app to override "captcha" to prevent 2 minute timeouts
# See: https://github.com/praekelt/django-recaptcha/issues/183
'captchanotimeout',
'django_recaptcha',
'debug_toolbar',
'ckeditor',
'ckeditor_uploader',
# Custom apps
'account',
'general',
'pages'
'pages',
'photographs'
]

MIDDLEWARE = [
Expand Down Expand Up @@ -56,6 +61,7 @@
],
'libraries': {
'settings_value': 'core.templatetags.settings_value',
'language_url': 'core.templatetags.language_url',
}
},
},
Expand Down Expand Up @@ -167,9 +173,9 @@
'items': ['Find', '-', 'Scayt']
},
],
'format_tags': 'h2;h3;h4;h5;p',
'format_tags': 'h2;h3;p',
'tabSpaces': 4,
'height': '80vh',
'height': '40vh',
'width': '100%',
'allowedContent': True,
'entities_greek': False,
Expand Down
135 changes: 110 additions & 25 deletions django/core/static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ main section {
#welcome-banner {
color: white;
background-color: var(--color-black);
background-size: 2em 2em;
background-size: cover;
background-position: center;
background-image: url('../images/welcome-banner-bg.jpg');
position: relative;
}
Expand All @@ -413,39 +414,21 @@ main section {
color: white;
font-weight: 700;
width: fit-content;
background-color: var(--color-black);
padding: 1em;
}

#welcome-banner-content-title,
#welcome-banner-content-tagline {
background: var(--color-black);
line-height: 1em;
}

#welcome-banner-content-links {
margin-top: 5em;
}

#welcome-banner-content-links a {
border-radius: 2em;
background-color: var(--color-black);
color: var(--color-primary);
padding: 0.6em 1.3em;
width: fit-content;
font-size: 1.45em;
font-weight: 600;
display: block;
text-align: center;
}

#welcome-banner-content-links a:hover {
text-decoration: none;
opacity: 0.95;
letter-spacing: 0.05em;
}

#welcome-banner-content hr {
border-top: 1rem solid white;
border-top: 1rem solid var(--color-primary);
width: 100%;
margin: 3rem 0;
margin: 0.5rem 0 1.5rem 0;
}

#welcome-banner-proceed {
Expand All @@ -461,13 +444,74 @@ main section {
padding-top: 0.1em;
cursor: pointer;
line-height: 80px;
background: var(--color-black);
}

#welcome-banner-proceed:hover {
background-color: white;
color: var(--color-primary);
}

/* ---------- Photographs ---------- */

#photograph-list-search-form {
margin: 2em auto;
}

#photograph-list-search-input {
background: rgba(255, 255, 255, 0.2);
border: none;
color: white;
}

#photograph-list-search-button {
color: var(--color-black);
background: var(--color-primary);
width: 3em;
}

#photograph-list-items {
margin: 2em auto;
width: fit-content;
}

.photograph-list-items-item {
display: inline-block;
width: 22rem;
height: 22rem;
border: 2px solid #303030;
vertical-align: top;
margin: 0.5em 0.4em;
background-size: cover;
background-position: center;
}

.photograph-list-items-item:hover {
text-decoration: none;
border: 2px solid var(--color-primary);
}

.photograph-list-items-item-text {
background: var(--color-black);
color: var(--color-primary);
font-size: 1.2em;
font-weight: bold;
padding: 0.3em;
}

#photograph-detail-image {
display: block;
text-align: center;
}

#photograph-detail-image img {
width: 100%;
}

#photograph-detail-description {
display: block;
margin: 3em 0;
}

/* ---------- Pages ---------- */

#pages-editinadmin {
Expand Down Expand Up @@ -560,6 +604,47 @@ footer a:hover {
text-decoration: underline;
}

/* ---------- Translation / Languages / i18n ---------- */

#language-show {
z-index: 1000;
position: fixed;
bottom: 1.1em;
left: 0;
width: 1.5em;
height: 1.5em;
text-align: center;
font-size: 2.5em;
border-radius: 0 100% 100% 0;
background: #272727;
cursor: pointer;
padding-top: 0.5em;
user-select: none;
}

#language-show:hover {
background: var(--color-primary);
}

#language-popup {
position: fixed;
bottom: 2em;
left: -10em;
width: 10em;
background: #272727;
color: white;
padding: 1em 1em 0.2em 1em;
z-index: 1000;
}

#lang-options li {
padding-bottom: 0.8em;
}

#lang-options a:hover {
text-decoration: none;
}

/* ---------- Error Pages ---------- */

.errorpage-path {
Expand Down
9 changes: 4 additions & 5 deletions django/core/static/css/custom_large.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}

.nav-link.active {
border-bottom: 0.3em solid white;
border-bottom: 0.3em solid #f36112;
}

#nav-search {
Expand All @@ -43,16 +43,15 @@
}

#welcome-banner-content {
margin: 1vh 5vw;
margin: 7vh 5vw;
}

#welcome-banner-content-title {
font-size: 4.7em;
font-size: 4em;
}

#welcome-banner-content-tagline {
font-size: 2.5em;
letter-spacing: 0.2em;
font-size: 2.4em;
}

}
4 changes: 1 addition & 3 deletions django/core/static/css/custom_small.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
}

.nav-link.active {
padding-left: 0.5em;
border-left: 3px solid white;
color: #f36112;
}

/* ---------- Main ---------- */
Expand All @@ -50,7 +49,6 @@

#welcome-banner-content-tagline {
font-size: 1.8em;
letter-spacing: 0.1em;
line-height: 1em;
}

Expand Down
Binary file added django/core/static/images/welcome-banner-bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions django/core/static/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$(document).ready(function() {

// Language / Translation / i18n
var languageVisible = false;
$('#language-show').on('click', function() {
// Hide language popup
if (languageVisible) {
$('#language-popup').animate({left: '-10rem'});
$(this).animate({left: '0em'});
languageVisible = false;
}
// Show language popup
else {
$('#language-popup').animate({left: '0'});
$(this).animate({left: '10rem'});
languageVisible = true;
}
});

});
Loading

0 comments on commit 49523bb

Please sign in to comment.