Skip to content

Commit 2badcdd

Browse files
Index page revamp (#176)
* add app updates to index.html, reduce index.html image size, replace docs with empty getting started page * disables getting started and changes header text * change static file path, add conditional to showing updates on index page * collect static on run * fix scrolling issue index page Co-authored-by: Daniel Xenes <[email protected]>
1 parent 500e5f3 commit 2badcdd

File tree

10 files changed

+200
-20
lines changed

10 files changed

+200
-20
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,5 @@ neuvue_project/workspace/static/ts/wrapper/webpack-stats-*
141141
neuvue_project/workspace/static/ts/wrapper/third_party
142142
neuvue_project/workspace/static/ts/wrapper/node_modules
143143
old_migrations/
144-
scratch/
144+
neuvue_project/static/
145+
scratch/

neuvue_project/neuvue/settings.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@
161161

162162
STATIC_URL = '/static/'
163163

164-
if not DEBUG:
165-
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
166-
164+
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
167165

168166
STATICFILES_DIRS = [
169167
os.path.join(BASE_DIR, 'workspace/static')

neuvue_project/neuvue/urls.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
InspectTaskView,
2626
LineageView,
2727
TokenView,
28-
SynapseView
28+
SynapseView,
29+
GettingStartedView
2930
)
3031
from preferences.views import PreferencesView
3132
from dashboard.views import DashboardView
@@ -34,6 +35,7 @@
3435
path('', IndexView.as_view(), name="index"),
3536
path('preferences/', PreferencesView.as_view(), name="preferences"),
3637
path('tasks/', TaskView.as_view(), name="tasks"),
38+
path('getting-started/', GettingStartedView.as_view(), name="getting-started"),
3739
path('workspace/<str:namespace>', WorkspaceView.as_view(), name="workspace"),
3840
path('admin/', admin.site.urls),
3941
path('accounts/', include('allauth.urls')),

neuvue_project/templates/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<ul class="navbar-nav ml-auto " style="flex-direction: row;">
3030

3131
<li class="nav-item">
32-
<a class="nav-link disabled" href="#" aria-disabled="true">Docs</a>
32+
<a class="nav-link disabled" href="{% url "getting-started" %}">Getting Started</a>
3333
</li>
3434

3535
<li class="nav-item">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% extends "base.html" %}
2+
{% load static %}
3+
{% load socialaccount %}
4+
5+
{% block header_includes %}
6+
<link rel="stylesheet" href="{% static 'css/tasks.css' %}">
7+
{% endblock %}
8+

neuvue_project/templates/index.html

+46-8
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,52 @@
44

55
{% block content %}
66

7-
<div class="intro">
8-
<div class="index-title-container">
9-
<span class="index-title-text">Welcome to NeuVue</span>
10-
{% if user.is_authenticated %}
11-
<span class="index-title-sub-text">You are logged in as <b>{{ user.username }}. </b> </p>
12-
{% else %}
13-
<a class="index-title-sub-text" href="{% provider_login_url 'google' %}" ><img width="200"src="static/images/google.png" ></a>
14-
{% endif %}
7+
<div class="basic workspace">
8+
<div class="intro">
9+
<div class="container-fluid">
10+
<div class="row">
11+
<div class="col-md-6">
12+
<div class="index-block d-flex justify-content-center" style="margin-top: 50%;">
13+
<div class="title-container">
14+
<div class="index-title-text ">Welcome to NeuVue</div>
15+
{% if user.is_authenticated %}
16+
<div class="d-flex justify-content-center">
17+
<span class="index-title-sub-text">You are logged in as <b>{{ user.username }}. </b> </p>
18+
</div>
19+
{% else %}
20+
<a class="index-title-sub-text d-flex justify-content-center" href="{% provider_login_url 'google' %}" ><img width="200"src="static/images/google.png" ></a>
21+
{% endif %}
22+
</div>
23+
</div>
24+
</div>
25+
<div class="col-md-6">
26+
<div class="row">
27+
<div class="index-card-container d-flex justify-content-center">
28+
<div class="card index-card" id="bootstrap-overrides">
29+
<div class="index-card-header card-header text-center">
30+
Recent Changes
31+
</div>
32+
<div class="index-card-items">
33+
{% if recent_updates %}
34+
{% for update in recent_updates %}
35+
<div class="index-card-item">
36+
<div class="index-card-item-title">{{update.update_name}}</div>
37+
<div class="index-card-item-date"><i>{{update.update_date}}</i></div>
38+
<div class="index-card-item-description">{{update.update_description}}</div>
39+
</div>
40+
{% endfor %}
41+
{% else %}
42+
<div class="index-card-no-updates">There are no new updates to show</div>
43+
{% endif %}
44+
</div>
45+
</div>
46+
</div>
47+
</div>
48+
<div class="index-card-column">
49+
</div>
50+
</div>
51+
</div>
52+
</div>
1553
</div>
1654
</div>
1755
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>

neuvue_project/workspace/static/css/workspace.css

+67-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
--transparent-standard:#e6f1ff44;
3636
--transparent-hover:#e6f1ff62;
3737
--transparent-analytics:#e6f1ff21;
38+
--transparent-card-background: #120e14dc;
39+
--transparent-card-header-background: #120e14e8;
40+
--transparent-card-items-background: #29202ece;
3841

3942
/* FONTS */
4043
--header-font: "Lato", sans-serif;
@@ -79,7 +82,7 @@ ul li {
7982
}
8083

8184
.intro {
82-
background-image: url('/static/images/xrayneuron01-min.png');
85+
background-image: url('/static/images/xrayneuron01-compressed.png');
8386
background-size: cover;
8487
background-repeat: no-repeat;
8588
-webkit-background-size: cover;
@@ -89,6 +92,8 @@ ul li {
8992
width: 100vw;
9093
}
9194

95+
96+
9297
/* Separates left column with NG window, text, and buttons from right column: sidebar */
9398

9499
.left {
@@ -368,13 +373,13 @@ flex-direction: column;
368373
margin-left: 100;
369374
width: 50%;
370375
position: absolute;
371-
top: 42%;
376+
top: 45%;
372377
}
373378

374379
.index-title-text {
375380
color: rgb(255, 255, 255);
376381
font-family: var(--header-font);
377-
font-size: 5vh;
382+
font-size: 6vh;
378383
text-align: center;
379384
order: 1;
380385
}
@@ -386,6 +391,65 @@ font-size: 2vh;
386391
text-align: center;
387392
order: 1;
388393
}
394+
395+
/* INDEX CARD */
396+
.index-card {
397+
border: 2px solid var(--secondary-accent) !important;
398+
background-color: var(--transparent-card-background) !important;
399+
border-radius: 8pt !important;
400+
width: 86%;
401+
height: 60%;
402+
margin-top: 25%;
403+
margin-right: 7%;
404+
}
405+
406+
.index-card-container {
407+
height: 100vh;
408+
}
409+
410+
.index-card-items {
411+
overflow:scroll;
412+
}
413+
414+
.index-card-header {
415+
color: var(--primary-accent);
416+
font-family: var(--header-font);
417+
font-size: 3vh;
418+
background-color: var(--header-background) !important;
419+
}
420+
421+
.index-card-item {
422+
background-color: transparent;
423+
padding: 20px;
424+
margin-top: 10px;
425+
margin-bottom: 10px;
426+
}
427+
428+
429+
.index-card-item-title {
430+
font-size: 2.15vh;
431+
color: var(--primary-accent);
432+
}
433+
434+
.index-card-item-date {
435+
font-size: 1.65vh;
436+
color: var(--secondary-accent);
437+
}
438+
439+
.index-card-item-description {
440+
font-size: 1.5vh;
441+
color: rgb(155, 153, 153);
442+
}
443+
444+
.index-card-no-updates {
445+
font-size: 3vh;
446+
color: var(--primary-accent);
447+
padding: 50px;
448+
text-align: center;
449+
}
450+
451+
452+
389453
/* PROGRESS BAR */
390454

391455
.progress {
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"recent_updates" : [
3+
{"update_name": "update 1",
4+
"update_date": "March 7th, 2022",
5+
"update_description": "I did something to update the application! I did something to update the application! I did something to update the application!I did something to update the application!I did something to update the application!"},
6+
7+
{"update_name": "update 2",
8+
"update_date": "March 7th, 2022",
9+
"update_description": "I did something to update the application!"},
10+
11+
{"update_name": "update 3",
12+
"update_date": "March 7th, 2022",
13+
"update_description": "I did something to update the application!"},
14+
15+
{"update_name": "update 4",
16+
"update_date": "March 7th, 2022",
17+
"update_description": "I did something to update the application!"},
18+
19+
{"update_name": "update 5",
20+
"update_date": "March 7th, 2022",
21+
"update_description": "I did something to update the application!"},
22+
23+
{"update_name": "update 1",
24+
"update_date": "March 7th, 2022",
25+
"update_description": "I did something to update the application!"},
26+
27+
{"update_name": "update 2",
28+
"update_date": "March 7th, 2022",
29+
"update_description": "I did something to update the application!"},
30+
31+
{"update_name": "update 3",
32+
"update_date": "March 7th, 2022",
33+
"update_description": "I did something to update the application!"},
34+
35+
{"update_name": "update 4",
36+
"update_date": "March 7th, 2022",
37+
"update_description": "I did something to update the application!"},
38+
39+
{"update_name": "update 5",
40+
"update_date": "March 7th, 2022",
41+
"update_description": "I did something to update the application!"},
42+
43+
{"update_name": "update 6",
44+
"update_date": "March 7th, 2022",
45+
"update_description": "I did something to update the application!"}
46+
]
47+
}

neuvue_project/workspace/views.py

+25-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from django.views.generic.base import View
33
from django.conf import settings
44
from django.contrib.auth.mixins import LoginRequiredMixin
5-
5+
from django.contrib.staticfiles.storage import staticfiles_storage
66
from .models import Namespace
77

88
from neuvueclient import NeuvueQueue
@@ -22,6 +22,10 @@
2222

2323
from .analytics import user_stats
2424
from .utils import utc_to_eastern, is_url, is_json, is_authorized
25+
import json
26+
import os
27+
28+
2529

2630
# import the logging library
2731
import logging
@@ -485,12 +489,30 @@ def post(self, request, *args, **kwargs):
485489
#TODO: Move simple views to other file
486490
class IndexView(View):
487491
def get(self, request, *args, **kwargs):
488-
return render(request, "index.html")
492+
493+
recent_updates = True
494+
try:
495+
p = staticfiles_storage.path('updates.json')
496+
with open(p) as update_json:
497+
updates = json.load(update_json)
498+
recent_updates = updates['recent_updates']
499+
except:
500+
recent_updates = False
501+
502+
## Get updates from local updates.json
503+
context = {
504+
"recent_updates": recent_updates
505+
}
506+
return render(request, "index.html", context)
489507

490508
class AuthView(View):
491509
def get(self, request, *args, **kwargs):
492510
return render(request, "auth_redirect.html")
493511

494512
class TokenView(View):
495513
def get(self, request, *args, **kwargs):
496-
return render(request, "token.html", context={'code': request.GET.get('code')})
514+
return render(request, "token.html", context={'code': request.GET.get('code')})
515+
516+
class GettingStartedView(View):
517+
def get(self, request, *args, **kwargs):
518+
return render(request, "getting-started.html")

0 commit comments

Comments
 (0)