Skip to content

Commit d465f9f

Browse files
authored
Merge pull request #70 from aboutcode-org/ui-improvements
UI/UX Improvements for Deployment - 2
2 parents 4634ce2 + c8c48fd commit d465f9f

File tree

9 files changed

+37
-22
lines changed

9 files changed

+37
-22
lines changed

fedcode/templates/403.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% endblock %}
66

77
{% block content %}
8-
<section class="hero is-large is-link">
8+
<section class="hero is-medium is-dark">
99
<div class="hero-body">
1010
<div class="container has-text-centered">
1111
<h1 class="title is-1 pb-2">
@@ -14,7 +14,7 @@ <h1 class="title is-1 pb-2">
1414
<p class="subtitle is-4">
1515
You do not have permission to access this page.
1616
</p>
17-
<a href="{% url 'purl-list' %}" class="button is-dark">Explore available packages</a>
17+
<a href="{% url 'purl-list' %}" class="button is-info">Explore available packages</a>
1818
</div>
1919
</div>
2020
</section>

fedcode/templates/404.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% endblock %}
66

77
{% block content %}
8-
<section class="hero is-large is-link">
8+
<section class="hero is-medium is-dark">
99
<div class="hero-body">
1010
<div class="container has-text-centered">
1111
<h1 class="title is-1 pb-2">
@@ -14,7 +14,7 @@ <h1 class="title is-1 pb-2">
1414
<p class="subtitle is-4">
1515
Sorry, the page you're looking for does not exist.
1616
</p>
17-
<a href="{% url 'purl-list' %}" class="button is-dark">Explore available packages</a>
17+
<a href="{% url 'purl-list' %}" class="button is-info">Explore available packages</a>
1818
</div>
1919
</div>
2020
</section>

fedcode/templates/500.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% extends "base.html" %}
2+
3+
{% block title %}
4+
Something Went Wrong
5+
{% endblock %}
6+
7+
{% block content %}
8+
<section class="hero is-medium is-dark">
9+
<div class="hero-body">
10+
<div class="container has-text-centered">
11+
<h1 class="title is-1 pb-2">
12+
Oops! Something went wrong.
13+
</h1>
14+
<p class="subtitle is-4">
15+
We're experiencing some technical issues at the moment. Please try again later.
16+
</p>
17+
<a href="{% url 'purl-list' %}" class="button is-info">Explore available packages</a>
18+
</div>
19+
</div>
20+
</section>
21+
{% endblock %}

fedcode/templates/create_repository.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% block content %}
88
<div class="columns">
99
<div class="column"></div>
10-
<div class="column is-two-fifths">
10+
<div class="column is-two-thirds">
1111
{% if form.errors %}
1212
<article class="message is-danger">
1313
<div class="message-header">
@@ -19,6 +19,7 @@
1919
</article>
2020
{% endif %}
2121
<h2 class="title">Add Git Repository</h2>
22+
<hr />
2223
<form method="post" class="box px-6 mx-0">
2324
{% csrf_token %}
2425
<div class="field has-addons">

fedcode/templates/home.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717
<div class="content is-normal">
1818
<h1>My Packages</h1>
1919
<hr />
20-
2120
{% if not page_note %}
2221
<div class="has-text-centered">
2322
<p class="is-size-4">Follow the packages to see the updates.</p>
24-
<a href="{% url 'purl-list' %}" class="button is-primary">Browse All Packages</a>
23+
<a href="{% url 'purl-list' %}" class="button is-info">Browse All Packages</a>
2524
</div>
2625
{% else %}
2726
<div>
@@ -80,4 +79,4 @@ <h1>My Packages</h1>
8079
</div>
8180
<div class="column"></div>
8281
</div>
83-
{% endblock %}
82+
{% endblock %}

fedcode/templates/navbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% load static %}
22

3-
<nav class="navbar is-dark mb-6 border-bottom-radius" role="navigation" aria-label="main navigation">
3+
<nav class="navbar is-dark mb-6" role="navigation" aria-label="main navigation">
44
<div class="navbar-brand ml-3">
55
<a class="navbar-item is-size-4 has-text-weight-bold" href="/">
66
FederatedCode<span class="nexb-orange">.</span>io

fedcode/templates/user_profile.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@
174174
<i class="fas fa-external-link-alt fa-xs"></i>
175175
</span>
176176
</a>
177-
to create your profile picture using your email address — {{ person.user.email }}
177+
to create your profile picture using your email address —
178+
{% if person.user.email %}
179+
<span class="has-text-info">{{ person.user.email }}</span>
180+
{% else %}
181+
<span class="has-text-danger">No email found!</span>
182+
{% endif %}
178183
</p>
179184
<div class="has-text-centered mt-3">
180185
<button class="button is-info" onclick="closeModal()">Close</button>

fedcode/views.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def wrapper(request, *args, **kwargs):
234234
if hasattr(request.user, "service"):
235235
return view(request, *args, **kwargs)
236236
else:
237-
return HttpResponseForbidden()
237+
raise PermissionDenied("You are not authorized to view this page.")
238238

239239
return wrapper
240240

@@ -887,11 +887,3 @@ def revoke_token(request):
887887
},
888888
)
889889
return JsonResponse(json.loads(r.content), status=r.status_code, content_type=AP_CONTENT_TYPE)
890-
891-
892-
def permission_denied(request, exception=None):
893-
return render(request, "403.html", {})
894-
895-
896-
def page_not_found(request, exception=None):
897-
return render(request, "404.html", {})

federatedcode/settings.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,3 @@
280280
"django.contrib.auth.backends.ModelBackend",
281281
"oauth2_provider.backends.OAuth2Backend",
282282
)
283-
284-
HANDLER403 = "fedcode.views.permission_denied"
285-
HANDLER404 = "fedcode.views.page_not_found"

0 commit comments

Comments
 (0)