Skip to content

Commit

Permalink
Adding 403 page (access denied).
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopaulonsoares committed Dec 3, 2017
1 parent 9e00073 commit 09452ad
Show file tree
Hide file tree
Showing 4 changed files with 198 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ htmlcov
.ropeproject/
**/public/**
**/ReceitaMais.egg-info/**
staticfiles
Binary file added medical_prescription/static/error/403.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
195 changes: 195 additions & 0 deletions medical_prescription/templates/403.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
<!--A Design by W3layouts
Author: W3layout
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE HTML>
<html>
<head>
<title>Preskribe 404</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href='//fonts.googleapis.com/css?family=Love+Ya+Like+A+Sister' rel='stylesheet' type='text/css'>
<style type="text/css">
body{
font-family: 'Love Ya Like A Sister', cursive;
}
body{
background:#eaeaea;
}
.wrap{
margin:0 auto;
width:100%;
}
.logo{
text-align:center;
margin-top:100px;
}
.logo img{
width:350px;
}
.logo p{
color:#272727;
font-size:40px;
margin-top:1px;
}
.logo p span{
color:lightgreen;
}
.sub a{
color:#fff;
background:#272727;
text-decoration:none;
padding:10px 20px;
font-size:13px;
font-family: arial, serif;
font-weight:bold;
-webkit-border-radius:.5em;
-moz-border-radius:.5em;
-border-radius:.5em;
}

.footer{
color:black;
position:relative;
bottom:0px;
text-align: center;
}

.footer a{
color:rgb(114, 173, 38);
}
/*@media screen and (max-width: 1024px){
.logo img {
width: 330px;
}
.logo {
margin-top: 120px;
}
}
@media screen and (max-width: 991px){
.logo p {
font-size: 37px;
}
.logo img {
width: 315px;
}
}
@media screen and (max-width: 900px){
.logo img {
width: 320px;
}
}
@media screen and (max-width: 800px){
.logo img {
width: 300px;
}
.logo p {
font-size: 35px;
}
.logo {
margin-top: 140px;
}
}
@media screen and (max-width: 768px){
.logo img {
width: 274px;
}
}
@media screen and (max-width: 736px){
.logo img {
width: 250px;
}
.logo {
margin-top: 160px;
}
}
@media screen and (max-width: 667px){
.logo {
margin-top: 150px;
}
.logo img {
width: 230px;
}
}
@media screen and (max-width: 640px){
.logo p {
font-size: 33px;
}
}
@media screen and (max-width: 600px){
.logo p {
font-size: 31px;
}
.sub a {
padding: 8px 17px;
font-size: 12px;
}
.logo img {
width: 208px;
}
}
@media screen and (max-width: 568px){
.logo p {
font-size: 29px;
}
.logo {
margin-top: 185px;
}
.footer {
font-size: 15px;
bottom: 0;
}
}
@media screen and (max-width: 480px){}
@media screen and (max-width: 414px){
.logo img {
width: 190px;
}
.footer {
font-size: 14px;
padding: 15px;
text-align: center;
line-height: 1.8;
}
.logo p {
font-size: 27px;
}
}
@media screen and (max-width: 384px){
.logo img {
width: 180px;
}
}
@media screen and (max-width: 375px){}
@media screen and (max-width: 320px){
.logo p {
font-size: 25px;
}
.logo img {
width: 172px;
}
}*/
</style>
</head>
{% load static %} {% load staticfiles %} {% load i18n %}

<body>
<div>
<div class="logo">
<p>Acesso Negado!</p>
<img src="{% static 'error/403.png' %}"/>
<!-- <img src="error/404.png"/> -->
<h2> Parece que você não possui permissão para acessar essa página!</h2>
<div class="sub">
<p><a href="{% url 'landing_page'%}">Voltar a página inicial </a></p>
</div>
</div>
</div>

<div>
<div class="footer">
</div>
</div>

</body>
4 changes: 2 additions & 2 deletions medical_prescription/user/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def wrap(request, *args, **kwargs):
if is_health_professional:
return method(request, *args, **kwargs)
else:
return redirect('/user/login_healthprofessional')
raise PermissionDenied

return wrap

Expand All @@ -26,7 +26,7 @@ def wrap(request, *args, **kwargs):
if is_patient:
return method(request, *args, **kwargs)
else:
return redirect('/user/login_patient')
raise PermissionDenied

return wrap

Expand Down

0 comments on commit 09452ad

Please sign in to comment.