Skip to content

Commit

Permalink
Merge pull request #37 from wseis/main
Browse files Browse the repository at this point in the history
from and action
  • Loading branch information
wseis authored Apr 18, 2024
2 parents 4a0cc52 + a2ee39d commit a4f75ee
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
- name: Deploy to remote server
env:
REMOTE_HOST: qmra.org
REMOTE_USER: wseis
REMOTE_DIR: /opt/qmra
REMOTE_HOST: ${{ secrets.DEPLOY_HOST }}
REMOTE_USER: ${{ secrets.DEPLOY_USER }}
REMOTE_DIR: ${{ secrets.DEPLOY_PATH }}
run: |
rsync -avz --itemize-changes --omit-dir-times --no-perms --delete --exclude '.git' --exclude 'private_key.pem' --exclude '**/__pycache__' -e "ssh -i private_key.pem -o StrictHostKeyChecking=no" ./ ${{ env.REMOTE_USER }}@${{ env.REMOTE_HOST }}:${{ env.REMOTE_DIR }}
ssh -i private_key.pem -o StrictHostKeyChecking=no ${{ env.REMOTE_USER }}@${{ env.REMOTE_HOST }} "\
cd ${REMOTE_DIR} && cd tools && sudo systemctl restart qmra"
sudo /usr/bin/pkill gunicorn || true && cd ${{ secrets.DEPLOY_PATH }}/scripts && /bin/bash 07_run.sh"
1 change: 1 addition & 0 deletions tools/qmratool/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def __init__(self, user, *args, **kwargs):
Div('exposure', css_class='radio-div-bg'),
# Add other fields or layout objects as nee
)


class Meta:
model = RiskAssessment
Expand Down
78 changes: 78 additions & 0 deletions tools/qmratool/static/qmratool/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,81 @@ height: 20px;
}


.btn-primary, .btn-primary:hover, .btn-primary:active, .btn-primary:visited {
background-color: #8081F1 !important;
border-color: #8081F1 !important;
}

.text_link_kwb { color: #0003e2; }

.kwb_headline {
color: #0003e2 !important;
font-weight: bold;

}
h4{
color: #0003e2 !important;
font-weight: bold !important;
}

.info{
color: #0003e2;
}
.headline{
color: #0003e2;
font-weight: bold;
}
html, body {
height: 100%; /* Ensure that the html and body elements take up the full height of the viewport */
margin: 0; /* Remove default margin */
}

body {
display: flex; /* Use flexbox to lay out children */
flex-direction: column; /* Stack children vertically */
}

main {
flex: 1; /* Allows the main content to grow and fill available space, pushing the footer down */
/* Adjust padding or margins as needed */
}

footer {
/* Your existing styles should be fine, but ensure it doesn't grow with flex settings */
background-color: #0003e2 !important;;
}
.footer-item{
color: white;
}
/* Add this inside your {% block body %} to scope the style to this template,
or move it to your external CSS file for global scope */


.custom-media:hover {
background-color: #EAEAFD; /* Light grey background on hover */
cursor: pointer; /* Change cursor to indicate clickable */
}
/* Adjust the border color on hover */
.custom-media:hover {
border-color: #0003e2; /* Bootstrap primary color for example */
transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
.text-field-bg {
background-color: #EAEAFD;
; /* Light grey */
}

.radio-div-bg {
background-color: #EAEAFD; /* Slightly darker grey */
}

/* Optional: Directly style the radio buttons if needed */
.radio-bg input[type="radio"] {
background-color: #0003e2 ;
}
#div_id_source, #div_id_treatment, #div_id_exposure{
background-color: #F9F9FE;
padding: 5px;
border-color: #8081F1;

}
7 changes: 3 additions & 4 deletions tools/scripts/07_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ source ./django_deployment_vars

apt install gunicorn -y

cp /opt/.env /opt/$DJANGO_PROJECT

su - $DJANGO_USER -c "source /var/opt/$DJANGO_PROJECT/miniconda3/bin/activate && conda activate $DJANGO_PROJECT && \
cd /opt/$DJANGO_PROJECT && export PYTHONPATH=/etc/opt/$DJANGO_PROJECT:/opt/$DJANGO_PROJECT && \
export DJANGO_SETTINGS_MODULE=settings && cd /opt/$DJANGO_PROJECT && \
python manage.py collectstatic --noinput && gunicorn $DJANGO_PROJECT.wsgi:application --daemon"
cd /opt/$DJANGO_APP_LOCATION && export PYTHONPATH=/etc/opt/$DJANGO_PROJECT:/opt/$DJANGO_APP_LOCATION && \
export DJANGO_SETTINGS_MODULE=settings && cd /opt/$DJANGO_APP_LOCATION && \
python manage.py collectstatic --noinput && gunicorn $DJANGO_APP_DIR.wsgi:application --daemon"
15 changes: 9 additions & 6 deletions tools/scripts/django_deployment_vars
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
DOMAIN=ibathwater-berlin.org
DOMAIN=qmra.org

# You should probably leave these as is
DJANGO_PROJECT=swimai
DJANGO_PROJECT_REPOSITORY=http://github.com/wseis/flussbad_ai.git
REPOSITORY_NAME=flussbad_ai
DJANGO_USER=swimai
DJANGO_GROUP=swimai
DJANGO_PROJECT=qmra
DJANGO_APP_LOCATION=qmra/tools
DJANGO_APP_DIR=tools

DJANGO_PROJECT_REPOSITORY=http://github.com/wseis/qmra.git
REPOSITORY_NAME=qmra
DJANGO_USER=qmra
DJANGO_GROUP=qmra

# Test with both Python 2 and 3
PYTHON=3
Expand Down

0 comments on commit a4f75ee

Please sign in to comment.