Skip to content

Commit

Permalink
Merge pull request #4771 from freelawproject/4769-feat-adds-eoy-banner
Browse files Browse the repository at this point in the history
feat(assets): Adds EOY banner
  • Loading branch information
ERosendo authored Dec 4, 2024
2 parents 3352ab3 + eb467f2 commit b188986
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions cl/assets/static-global/css/override.css
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,10 @@ emphasis {
border-color: #999999;
}

.alert-dismissible .second-row-btn {
margin-bottom: 10px;
}

.h-captcha > div {
color: #333333 !important;
font-family: Helvetica;
Expand Down
2 changes: 1 addition & 1 deletion cl/assets/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h1>You did not supply the "private" variable to your template.
<header class="row">
<!-- Donate Banner -->
{% if FUNDRAISING_MODE %}
{% include 'includes/dismissible_nav_banner.html' with link="https://donate.free.law/forms/givingtuesday" text="<strong>Today is GivingTuesday.</strong> Your support of Free Law Project helps make the justice system more transparent and accessible to all." cookie_name="giving_tuesday" button_text="Donate Today!"%}
{% include 'includes/dismissible_nav_banner.html' with link="https://donate.free.law/forms/supportflp" cookie_name="eoy_banner" button_text="Make your DONATION TODAY" button_emoji='<i class="fa fa-heart-o"></i>' text="Your support has grown CourtListener to over 10 million opinions, with improved search and API functionality. Help us continue expanding and enhancing access to the law. Donate before the end of 2024 to power free and open legal information for everyone" %}
{% endif %}

<!-- Broken Email Banner -->
Expand Down
15 changes: 9 additions & 6 deletions cl/assets/templates/includes/dismissible_nav_banner.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- cookie_name: Name of the cookie used to remember if the user has already
dismissed the banner. This prevents them from seeing the same message
repeatedly.
- single_row (optional): A Boolean flag that, when set to True for medium
and large resolutions, condenses the banner into a single line of text
with a button positioned to the right. Defaults to False.
- button_text (optional): Text for the button. Defaults to "Learn More".
- button_emoji (optional): An Idiomatic Text element (<i></i>) to display
inside the button.
Expand All @@ -27,7 +30,7 @@
{% endcomment %}

{% if cookie_name not in request.COOKIES %}
<div class="navbar navbar-default subnav alert-info alert-dismissible" role="navigation">
<div class="navbar navbar-default subnav alert-danger alert-dismissible" role="navigation">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
Expand All @@ -39,15 +42,15 @@
class="x-large">&times;</span></button>
</div>
</div>
<div class="row flex flex-column flex-sm-row align-items-center justify-content-between">
<div class="col-xs-12 col-sm-10 navbar-text lead">
<div class="row flex flex-column {% if single_row %}flex-sm-row{% endif %} align-items-center justify-content-between">
<div class="col-xs-12 {% if single_row %}col-sm-10{% endif %} navbar-text lead">
<p>{% if emoji %}{{emoji}}{% endif %} {{text}}</p>
</div>
<div class="col-xs-2 flex justify-content-center justify-content-sm-end">
<div class="{% if single_row %}col-xs-2{% else %}col-xs-12{% endif %} flex justify-content-center justify-content-sm-end {% if not single_row %}second-row-btn{% endif %}">
<a href="{{link}}"
class="btn btn-primary btn-lg hidden-xs">{% if button_emoji %}{{button_emoji}}{% endif %}&nbsp;{% if button_text %}{{button_text}}{% else %}Learn More{% endif %}</a>
class="btn btn-danger btn-lg hidden-xs">{% if button_emoji %}{{button_emoji}}{% endif %}&nbsp;{% if button_text %}{{button_text}}{% else %}Learn More{% endif %}</a>
<a href="{{link}}"
class="btn btn-primary btn-sm hidden-sm hidden-md hidden-lg">{% if button_emoji %}{{button_emoji}}{% endif %}&nbsp;{% if button_text %}{{button_text}}{% else %}Learn More{% endif %}</a>
class="btn btn-danger btn-sm hidden-sm hidden-md hidden-lg">{% if button_emoji %}{{button_emoji}}&nbsp;{% endif %}{% if button_text %}{{button_text}}{% else %}Learn More{% endif %}</a>
</div>
</div>
</div>
Expand Down

0 comments on commit b188986

Please sign in to comment.