Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fedcode/templates/403.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% endblock %}

{% block content %}
<section class="hero is-large is-link">
<section class="hero is-medium is-dark">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title is-1 pb-2">
Expand All @@ -14,7 +14,7 @@ <h1 class="title is-1 pb-2">
<p class="subtitle is-4">
You do not have permission to access this page.
</p>
<a href="{% url 'purl-list' %}" class="button is-dark">Explore available packages</a>
<a href="{% url 'purl-list' %}" class="button is-info">Explore available packages</a>
</div>
</div>
</section>
Expand Down
4 changes: 2 additions & 2 deletions fedcode/templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% endblock %}

{% block content %}
<section class="hero is-large is-link">
<section class="hero is-medium is-dark">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title is-1 pb-2">
Expand All @@ -14,7 +14,7 @@ <h1 class="title is-1 pb-2">
<p class="subtitle is-4">
Sorry, the page you're looking for does not exist.
</p>
<a href="{% url 'purl-list' %}" class="button is-dark">Explore available packages</a>
<a href="{% url 'purl-list' %}" class="button is-info">Explore available packages</a>
</div>
</div>
</section>
Expand Down
21 changes: 21 additions & 0 deletions fedcode/templates/500.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% extends "base.html" %}

{% block title %}
Something Went Wrong
{% endblock %}

{% block content %}
<section class="hero is-medium is-dark">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title is-1 pb-2">
Oops! Something went wrong.
</h1>
<p class="subtitle is-4">
We're experiencing some technical issues at the moment. Please try again later.
</p>
<a href="{% url 'purl-list' %}" class="button is-info">Explore available packages</a>
</div>
</div>
</section>
{% endblock %}
3 changes: 2 additions & 1 deletion fedcode/templates/create_repository.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% block content %}
<div class="columns">
<div class="column"></div>
<div class="column is-two-fifths">
<div class="column is-two-thirds">
{% if form.errors %}
<article class="message is-danger">
<div class="message-header">
Expand All @@ -19,6 +19,7 @@
</article>
{% endif %}
<h2 class="title">Add Git Repository</h2>
<hr />
<form method="post" class="box px-6 mx-0">
{% csrf_token %}
<div class="field has-addons">
Expand Down
5 changes: 2 additions & 3 deletions fedcode/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
<div class="content is-normal">
<h1>My Packages</h1>
<hr />

{% if not page_note %}
<div class="has-text-centered">
<p class="is-size-4">Follow the packages to see the updates.</p>
<a href="{% url 'purl-list' %}" class="button is-primary">Browse All Packages</a>
<a href="{% url 'purl-list' %}" class="button is-info">Browse All Packages</a>
</div>
{% else %}
<div>
Expand Down Expand Up @@ -80,4 +79,4 @@ <h1>My Packages</h1>
</div>
<div class="column"></div>
</div>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion fedcode/templates/navbar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load static %}

<nav class="navbar is-dark mb-6 border-bottom-radius" role="navigation" aria-label="main navigation">
<nav class="navbar is-dark mb-6" role="navigation" aria-label="main navigation">
<div class="navbar-brand ml-3">
<a class="navbar-item is-size-4 has-text-weight-bold" href="/">
FederatedCode<span class="nexb-orange">.</span>io
Expand Down
7 changes: 6 additions & 1 deletion fedcode/templates/user_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@
<i class="fas fa-external-link-alt fa-xs"></i>
</span>
</a>
to create your profile picture using your email address — {{ person.user.email }}
to create your profile picture using your email address —
{% if person.user.email %}
<span class="has-text-info">{{ person.user.email }}</span>
{% else %}
<span class="has-text-danger">No email found!</span>
{% endif %}
</p>
<div class="has-text-centered mt-3">
<button class="button is-info" onclick="closeModal()">Close</button>
Expand Down
10 changes: 1 addition & 9 deletions fedcode/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def wrapper(request, *args, **kwargs):
if hasattr(request.user, "service"):
return view(request, *args, **kwargs)
else:
return HttpResponseForbidden()
raise PermissionDenied("You are not authorized to view this page.")

return wrapper

Expand Down Expand Up @@ -887,11 +887,3 @@ def revoke_token(request):
},
)
return JsonResponse(json.loads(r.content), status=r.status_code, content_type=AP_CONTENT_TYPE)


def permission_denied(request, exception=None):
return render(request, "403.html", {})


def page_not_found(request, exception=None):
return render(request, "404.html", {})
3 changes: 0 additions & 3 deletions federatedcode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,3 @@
"django.contrib.auth.backends.ModelBackend",
"oauth2_provider.backends.OAuth2Backend",
)

HANDLER403 = "fedcode.views.permission_denied"
HANDLER404 = "fedcode.views.page_not_found"