Skip to content

Commit

Permalink
Merge branch 'release/0.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
rlskoeser committed Oct 8, 2024
2 parents 6b9e6dc + 5b85d5c commit 28fa40e
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 17 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
CHANGELOG
=========

0.9
---

* Update installation instructions to use current django url syntax
* Update sample login template to use correct django admin `extrastyle` block
* Update styles and wording for PU CAS login include template

0.8
---
* Now tested against Django 3.2-4.2
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ or configure them as needed based on the documentation::

urlpatterns = [
...
url(r'^accounts/', include('pucas.cas_urls')),
path('accounts/', include('pucas.cas_urls')),
...
]

Expand Down
2 changes: 1 addition & 1 deletion pucas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version_info__ = (0, 8, 0, None)
__version_info__ = (0, 9, 0, None)

# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = ".".join([str(i) for i in __version_info__[:-1]])
Expand Down
52 changes: 40 additions & 12 deletions pucas/static/pucas/pu-login.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,69 @@ mezzanine / grappelli */
margin-top: 0 !important;
}


/* match mezzanine/grappelli main content size,
use Princeton colors and image,
make CAS link look like a button and align it with
the other login button to make it clear they are
alternatives.
*/
.cas-login {
margin: 50px auto 5px;
width: 450px;
text-align: left;
margin: 50px auto 50px;
width: 300px;
text-align: center;
background-color: white; /* so PU logo doesn't look so tight on dark bg */
border-radius: 5px;
}

/* match default grappelli login window size */
.grp-container .cas-login {
width: 380px;
}

/* for non-grappelli, display vertically stacked */
.cas-login a {
/* background-image: linear-gradient(rgba(0,0,0,0) 50%, white 51%),*/
background-image: url('https://fed.princeton.edu/cas/images/pu_signature_web.jpg');
background-repeat: no-repeat;
background-position: right;
padding-right: 175px;
height: 55px;
background-position: bottom;
padding-bottom: 8em;
height: 4em;
margin-bottom: 25px;
display: inline-block;
font-size: 15px;
}

/* for grappelli, display login button and PU icon side by side */
.grp-login .cas-login a {
background-position: right;
padding-right: 175px;
padding-bottom: 0;
margin-bottom: 25px;
}

.cas-login .button {
/* princeton orange */
background-color: #ee7f2d;
border: none;
padding: 10px;
display: inline-block;
/* override Chrome/webkit gradient background */
background: -webkit-gradient(linear, left top, left bottom, from(#ee7f2d), to(#ee7f2d));
margin-top: 15px;
line-height: 1.5em;
color: white;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;

}

/* when grappelli is used, match default grappelli login window size */
.grp-login .grp-container .cas-login, .grp-login .cas-alt {
width: 380px;
margin-left: auto;
margin-right: auto;
}

/* adjust for grappelli button styles */
.grp-login .cas-login .button {
box-sizing: inherit;
font-size: 14px;
margin-top: 12px;
}

5 changes: 3 additions & 2 deletions pucas/templates/pucas/pu-cas-login.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{# customized CAS login snippet with Princeton branding #}
{# use with pu-login.css for styles #}
<div class="cas-login">
<a href="{% url 'cas_ng_login' %}?next={{ request.GET.next }}"><span class="button grp-button">Login with Princeton CAS</span></a>
<p>Or login with a local site account:</p>
<a href="{% url 'cas_ng_login' %}{% if request.GET.next %}?next={{ request.GET.next }}{% endif %}"><span class="button grp-button">Login with Princeton NetID</span></a>
</div>

<div class="cas-alt"><p>Or login with a local site account:</p></div>

2 changes: 1 addition & 1 deletion pucas/templates/pucas/sample-pu-login.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% extends 'admin/login.html' %}
{% load static %}

{% block stylesheets %}
{% block extrastyle %}
{{ block.super }}
<link type="text/css" rel="stylesheet" href="{% static 'pucas/pu-login.css' %}"/>
{% endblock %}
Expand Down

0 comments on commit 28fa40e

Please sign in to comment.