Skip to content

Commit

Permalink
Some gentle UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gthole committed Jul 2, 2021
1 parent fc39570 commit a2561f4
Show file tree
Hide file tree
Showing 15 changed files with 122 additions and 55 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ RUN mkdir -p /static && \

USER app

CMD uvicorn --host=0.0.0.0 asgi:application
CMD sh ./run.sh
11 changes: 9 additions & 2 deletions asgi.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

from django.conf import settings
from django.core.asgi import get_asgi_application
from django_simple_task import django_simple_task_middlware

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from asgi_middleware_static_file import ASGIMiddlewareStaticFile

app = get_asgi_application()
app = ASGIMiddlewareStaticFile(
app,
static_url=settings.STATIC_URL,
static_root_paths=[settings.STATIC_ROOT]
)
application = django_simple_task_middlware(app)
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ services:
image: 'gedgo_app'
env_file: '.env'
container_name: 'gedgo_app'
# command: ['python', 'manage.py', 'runserver', '0.0.0.0:8000']
command: ['uvicorn', '--host=0.0.0.0', '--reload', 'asgi:application']
command: ['python', 'manage.py', 'runserver', '0.0.0.0:8000']
# command: ['uvicorn', '--host=0.0.0.0', '--reload', 'asgi:application']
ports:
- '8000:8000'
volumes:
Expand Down
6 changes: 3 additions & 3 deletions gedgo/static/js/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
.append("line")
.attr("x1", w/2).attr("y1", 10)
.attr("x2", w/2).attr("y2", h - 10)
.attr("stroke", "teal");
.attr("stroke", "#004643");

svg.selectAll("circle")
.data(events)
Expand All @@ -45,9 +45,9 @@
.attr("cx", w/2)
.attr("cy", (d) => scale(d.year))
.attr("r", 5)
.attr("fill", d => (d.year === birthyear || d.year === deathyear) ? "teal" : "white")
.attr("fill", d => (d.year === birthyear || d.year === deathyear) ? "#004643" : "#fffffe")
.attr("stroke-width", 3)
.attr("stroke", d => (d.type === 'personal') ? "teal" : "orange");
.attr("stroke", d => (d.type === 'personal') ? "#004643" : "#f9bc60");

svg.selectAll("text")
.data(events)
Expand Down
73 changes: 60 additions & 13 deletions gedgo/static/styles/style-default.css
Original file line number Diff line number Diff line change
@@ -1,47 +1,79 @@
/* Move down content because we have a fixed navbar that is 50px tall */
body {
background-color: #d5dce0;
background-color: #abd1c6;
font-family: Camphor, Open Sans, Segoe UI, sans-serif;
text-rendering: optimizeLegibility;
color: #001e1d;
}

a {
color: #537484;
color: #004643;
}
a:hover {
color: #004643;
}

.navbar {
background-color: #538463 !important;
background-color: #004643;
}
.navbar.navbar-inverse {
border: none;
}
.navbar-nav li a {
color: #fcfcfc !important;
}
.navbar-nav .dropdown .footlist a {
color: #666 !important;
}

a.dropdown-toggle {
margin-top: 3px;
padding-bottom: 0;
}
.navbar-nav .open .dropdown-toggle,
.navbar-nav .active a {
background-color: #6e9b7d !important;
background-color: #004643 !important;
color: #f9bc60 !important;
}
.navbar-nav .open .dropdown-toggle {
background-color: #6e9b7d !important;
.btn-primary {
border: none;
background-color: #f9bc60 !important;
}

.navbar-brand {
color: #fff !important;
padding-bottom: 35px;
}

.main-container {
margin-top: 65px;
}

.main-container > .row > div {
padding: 0 5px;
}

.blog .time {
color: #999;
}

.documentary,
.blog {
padding: 20px 0;
border-bottom: 1px solid #eee;
}

.documentary:first-child,
.blog:first-child {
padding-top: 0;
}

.main {
margin: 5px;
color: #666;
background-color: #fff;
color: #001e1d;
background-color: #fffffe;
padding: 20px;
border-radius: 5px;
border-style: solid;
border-color: #d3d3d3;
border-width: 1px;
}
.section {
margin-top: 35px;
Expand All @@ -55,6 +87,7 @@ a {
min-height: 100%;
max-height: 100%;
margin-bottom: 10px;
border: 1px solid #eee
}
.subsection-thumb {
display: block;
Expand Down Expand Up @@ -84,9 +117,23 @@ a {
min-height: 64px;
}

.comment-area {
textarea.comment-area.form-control {
resize: none;
appearance: none;
box-shadow: none;
outline: none;
border-radius: 0;
border: none;
background-color: #eee;
border-bottom: 2px solid #004643;
}
textarea.comment-area.form-control:focus {
background-color: #fffffe;
border-top: 1px solid #004643;
border-left: 1px solid #004643;
border-right: 1px solid #004643;
}

.card {
margin-bottom: 5px;
}
Expand All @@ -106,7 +153,7 @@ a {

rect {
fill: white;
stroke: teal;
stroke: #004643;
stroke-width: 2;
}
path {
Expand Down
11 changes: 3 additions & 8 deletions gedgo/static/styles/style-login.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,16 @@ body {
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="email"] {
margin-bottom: -1px;
.form-signin input {
margin-bottom: 5px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.pod {
background-color: #FFFBFF;
border-radius: 10px;
padding: 15px 15px 20px 15px;
margin: 0 auto;
min-height: 80px;
max-width: 380px;
}
}
2 changes: 1 addition & 1 deletion gedgo/templates/default/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="{{ STATIC_URL }}styles/style-default.css?v=2" rel="stylesheet" type="text/css" >
<link href="{{ STATIC_URL }}styles/style-default.css?v=3" rel="stylesheet" type="text/css" >
{% block headappend %}{% endblock %}
</head>
<body>
Expand Down
12 changes: 6 additions & 6 deletions gedgo/templates/default/blogpost_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,33 @@ <h4>Archive</h4>
<!-- Posts -->
{% if posts.object_list %}
{% for post in posts.object_list %}
<div class="pod">
<div class="pod blog">
<a href="/gedgo/blog/post/{{ post.id }}"><h2>{{ post.title }}</h2></a>
<div class="body">{{ post.body|linebreaks|truncatewords:200 }}</div>
<div class="time">{{ post.created }}</div>
<div class="body">{{ post.body|linebreaks|truncatewords:200 }}</div>
</div>
{% endfor %}
{% else %}
<div class="pod">
No blog posts written yet.
</div>
{% endif %}

<!-- Next/Prev page links -->
{% if posts.object_list and posts.paginator.num_pages > 1 %}
<div class="section">
<div style="text-align: center;">
{% if posts.has_previous %}
<a class="btn btn-default" href="?page={{ posts.previous_page_number }}"> &lt;&lt; newer entries </a>
<a class="btn btn-default" href="?page={{ posts.previous_page_number }}"> &lt; newer</a>
{% endif %}

<span class="current">
&nbsp;Page {{ posts.number }} of {{ posts.paginator.num_pages }}&nbsp;
</span> {# post list #}

{% if posts.has_next %}
<a class="btn btn-default" href="?page={{ posts.next_page_number }}">older entries &gt;&gt; </a>
{% endif %}
<a class="btn btn-default" href="?page={{ posts.next_page_number }}">older &gt;</a>
{% endif %}
</div>
</div>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion gedgo/templates/default/documentaries.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% block content %}
{% if documentaries.exists %}
{% for documentary in documentaries.iterator %}
<div class="row">
<div class="row documentary">
<div class="col-xs-6 col-sm-3">
<a class="pull-left" href="/gedgo/documentaries/{{ documentary.title | urlencode }}/">
<img style="width: 100%" class="documentary-thumb media-object" src="/gedgo/media/gedcom/{{ documentary.thumb.docfile.name }}?size=w640h480">
Expand Down
2 changes: 1 addition & 1 deletion gedgo/templates/default/gedcom.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% for photo in gedcom.photo_sample %}
<div class="col-lg-4 col-md-6" style="padding: 0 10px; padding-bottom: 10px">
<a href="{% if photo.key_person_tag %}{{ photo.key_person_tag.pointer }}{% else %}/gedgo/document/{{ photo.id }}{% endif %}">
<img src="/gedgo/media/gedcom/{{ photo.docfile.name }}?size=w128h128" class="sidebar-thumb img-rounded" onerror="this.onerror=null;this.src='{{ STATIC_URL }}/question.jpg';">
<img src="/gedgo/media/gedcom/{{ photo.docfile.name }}?size=w128h128" class="sidebar-thumb img-rounded" onerror="this.onerror=null;this.src='{{ STATIC_URL }}img/question.jpg';">
</a>
</div>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion gedgo/templates/default/person-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="col-xs-5">
<a href="/gedgo/{{ somebody.gedcom.id }}/{{ somebody.pointer }}/">
<img src="{% if somebody.photos %}/gedgo/media/gedcom/{{ somebody.key_photo.docfile.name }}?size=w128h128{% else %}{{ STATIC_URL }}img/generic_person.gif{% endif %}"
class="thumb img-rounded" onerror="this.onerror=null;this.src='{{ STATIC_URL }}/question.jpg';"></a>
class="thumb img-rounded" onerror="this.onerror=null;this.src='{{ STATIC_URL }}img/question.jpg';"></a>
</div>
<div class="card-content col-xs-7">
<h4 class="card-title"><a href="/gedgo/{{ somebody.gedcom.id }}/{{ somebody.pointer }}/">{{ somebody.full_name }}</a></h4>
Expand Down
26 changes: 13 additions & 13 deletions gedgo/templates/default/person.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% for photo in photos %}
<div class="col-lg-4 col-md-6" style="padding: 0 10px; padding-bottom: 10px">
<a href="/gedgo/document/{{ photo.id }}">
<img src="/gedgo/media/gedcom/{{ photo.docfile.name }}?size=w128h128" class="sidebar-thumb img-rounded" onerror="this.onerror=null;this.src='{{ STATIC_URL }}/question.jpg';">
<img src="/gedgo/media/gedcom/{{ photo.docfile.name }}?size=w128h128" class="sidebar-thumb img-rounded" onerror="this.onerror=null;this.src='{{ STATIC_URL }}img/question.jpg';">
</a>
</div>
{% empty %}
Expand All @@ -23,7 +23,7 @@
<div class="row">
<div class="col-xs-5">
<a href="{% if person.photos %}/gedgo/document/{{ person.key_photo.id }}{% else %}#{% endif %}">
<img src="{% if person.photos %}/gedgo/media/gedcom/{{ person.key_photo.docfile.name }}?size=w640h480{% else %}{{ STATIC_URL }}img/generic_person.gif{% endif %}" class="thumb img-rounded" onerror="this.onerror=null;this.src='{{ STATIC_URL }}/question.jpg';">
<img src="{% if person.photos %}/gedgo/media/gedcom/{{ person.key_photo.docfile.name }}?size=w640h480{% else %}{{ STATIC_URL }}img/generic_person.gif{% endif %}" class="thumb img-rounded" onerror="this.onerror=null;this.src='{{ STATIC_URL }}img/question.jpg';">
</a>
</div>
<div class="col-xs-7">
Expand Down Expand Up @@ -97,8 +97,8 @@ <h4>Family Photos:</h4>
<div class="col-xs-4 col-sm-3">
<a href="/gedgo/document/{{ photo.id }}">
<!-- TODO: Fix hacks -->
<img src="/gedgo/media/gedcom/{{ photo.docfile.name }}?size=w128h128" class="subsection-thumb img-rounded center-block clearfix visible-xs" onerror="this.onerror=null;this.src='{{ STATIC_URL }}/question.jpg';">
<img src="/gedgo/media/gedcom/{{ photo.docfile.name }}?size=w128h128" class="sidebar-thumb img-rounded center-block clearfix hidden-xs" onerror="this.onerror=null;this.src='{{ STATIC_URL }}/question.jpg';">
<img src="/gedgo/media/gedcom/{{ photo.docfile.name }}?size=w128h128" class="subsection-thumb img-rounded center-block clearfix visible-xs" onerror="this.onerror=null;this.src='{{ STATIC_URL }}img/question.jpg';">
<img src="/gedgo/media/gedcom/{{ photo.docfile.name }}?size=w128h128" class="sidebar-thumb img-rounded center-block clearfix hidden-xs" onerror="this.onerror=null;this.src='{{ STATIC_URL }}img/question.jpg';">
</a>
</div>
{% endfor %}
Expand All @@ -108,7 +108,7 @@ <h4>Family Photos:</h4>

<!-- Children -->
{% if family.children.exists %}
<h4>Children:</h4>
<h4>Children</h4>
<div class="row">
{% for somebody in family.ordered_children.iterator %}
<div class="col-sm-6">
Expand All @@ -123,7 +123,7 @@ <h4>Children:</h4>

{% if posts.exists %}
<div class="section">
<h3>Related blog posts:</h3>
<h3>Related blog posts</h3>
{% for post in posts.iterator %}
<a href="/gedgo/blog/post/{{ post.id }}">{{ post.title }}</a>&nbsp; ({{ post.created }})<br>
{% endfor %}
Expand All @@ -132,12 +132,12 @@ <h3>Related blog posts:</h3>

{% if photos %}
<div class="section visible-xs">
<h3>Photos:</h3>
<h3>Photos</h3>
<div class="row">
{% for photo in photos %}
<div class="col-xs-4">
<a href="/gedgo/document/{{ photo.id }}">
<img src="/gedgo/media/gedcom/{{ photo.docfile.name }}?size=w128h128" class="subsection-thumb img-rounded center-block clearfix" onerror="this.onerror=null;this.src='{{ STATIC_URL }}/question.jpg';">
<img src="/gedgo/media/gedcom/{{ photo.docfile.name }}?size=w128h128" class="subsection-thumb img-rounded center-block clearfix" onerror="this.onerror=null;this.src='{{ STATIC_URL }}img/question.jpg';">
</a>
</div>
{% endfor %}
Expand All @@ -147,7 +147,7 @@ <h3>Photos:</h3>

{% if person.documentaries %}
<div class="section">
<h3>Documentaries:</h3>
<h3>Documentaries</h3>
{% for doc in person.documentaries %}
<a href="{{ doc.location }}">{{ doc.title }}</a><br>
{% endfor %}
Expand All @@ -156,7 +156,7 @@ <h3>Documentaries:</h3>

{% if person.notes.exists %}
<div class="section">
<h3>Notes:</h3>
<h3>Notes</h3>
{% for note in person.notes.all %}
{{ note.text|linebreaks }}
{% endfor %}
Expand All @@ -165,7 +165,7 @@ <h3>Notes:</h3>

{% if person.documents %}
<div class="section">
<h3>Documents:</h3>
<h3>Documents</h3>
{% for doc in person.documents %}
<a href="/gedgo/document/{{ doc.id }}">
<span class="glyphicon glyphicon-{{ doc.glyph }}"></span> &nbsp; {{ doc.docfile.name }}
Expand All @@ -174,13 +174,13 @@ <h3>Documents:</h3>
{% endif %}

<div class="section hidden-xs" id="timeline-pod">
<h3>Timeline:</h3>
<h3>Timeline</h3>
<div id="timeline" data-gid="{{gedcom.id}}" data-pid="{{person.pointer}}"></div>
</div>

{% if person.child_family %}
<div class="section hidden-xs">
<h3>Pedigree Chart:</h3>
<h3>Pedigree Chart</h3>
<div id="pedigree-tree" data-gid="{{gedcom.id}}" data-pid="{{person.pointer}}"></div>
</div>
{% endif %}
Expand Down
Loading

0 comments on commit a2561f4

Please sign in to comment.