Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom management command that sets an announcement banner on front page #1781

Merged
merged 8 commits into from
Jun 20, 2024
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
2 changes: 2 additions & 0 deletions freesound/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@
ADVANCED_SEARCH_MENU_ALWAYS_CLOSED_ON_PAGE_LOAD = True
USER_DOWNLOADS_PUBLIC = True

ANNOUNCEMENT_CACHE_KEY = 'announcement_cache'

# -------------------------------------------------------------------------------
# Freesound data paths and urls

Expand Down
4 changes: 2 additions & 2 deletions freesound/static/bw-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ To update icons:
* Open iconmoon app in web browser
* Import `bw-icons/selection.json` file
* Add/modify icons using the online editor
* Go to "generate font", it will complain that "Strokes get ignored when generating fonts. You can convert them to fills to prevent this.", say "Continue"
* Go to "generate font". It will complain that "Strokes get ignored when generating fonts. You can convert them to fills to prevent this.", say "Continue"
* Click "download". A compressed folder will be downloaded which wou use to replace whole bw-icons folder from this directory.
* Check the differences in `bw-icons/style.css` after you replaced folder contents, and make sure you copy code bits from old `style.css` that were added manually to the new version (the diff editor will make thos changes very clear).
* Check the differences in `bw-icons/style.css` after you replaced folder contents, and make sure you copy code bits from old `style.css` that were added manually to the new version (the diff editor will make those changes very clear).

## Running the new frontend in Django

Expand Down
2 changes: 1 addition & 1 deletion freesound/static/bw-frontend/bw-icons/Read Me.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Open *demo.html* to see a list of all the glyphs in your font along with their codes/ligatures.

To use the generated font in desktop programs, you can install the TTF font. In order to copy the character associated with each icon, refer to the text box at the bottom right corner of each glyph in demo.html. The character inside this text box may be invisible; but it can still be copied. See this guide for more info: https://icomoon.io/#docs/local-fonts
To use the generated font in desktop programs, you can install the TTF font. In order to copy the character associated with each icon, refer to the text box at the bottom right corner of each glyph in demo.html. The character inside this text box may be invisible; but it can still be copied. See this guide for more info: https://icomoon.io/docs/#local-fonts

You won't need any of the files located under the *demo-files* directory when including the generated font in your own projects.

Expand Down
30 changes: 29 additions & 1 deletion freesound/static/bw-frontend/bw-icons/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link rel="stylesheet" href="style.css"></head>
<body>
<div class="bgc1 clearfix">
<h1 class="mhmm mvm"><span class="fgc1">Font Name:</span> bw-icons <small class="fgc1">(Glyphs:&nbsp;87)</small></h1>
<h1 class="mhmm mvm"><span class="fgc1">Font Name:</span> bw-icons <small class="fgc1">(Glyphs:&nbsp;89)</small></h1>
</div>
<div class="clearfix mhl ptl">
<h1 class="mvm mtn fgc1">Grid Size: 16</h1>
Expand Down Expand Up @@ -1231,6 +1231,34 @@ <h1 class="mvm mtn fgc1">Grid Size: 16</h1>
<input type="text" readonly value="" class="liga unitRight" />
</div>
</div>
<div class="glyph fs1">
<div class="clearfix bshadow0 pbs">
<span class="bw-icon-bullhorn"></span>
<span class="mls"> bw-icon-bullhorn</span>
</div>
<fieldset class="fs0 size1of1 clearfix hidden-false">
<input type="text" readonly value="e94a" class="unit size1of2" />
<input type="text" maxlength="1" readonly value="&#xe94a;" class="unitRight size1of2 talign-right" />
</fieldset>
<div class="fs0 bshadow0 clearfix hidden-true">
<span class="unit pvs fgc1">liga: </span>
<input type="text" readonly value="bullhorn, megaphone" class="liga unitRight" />
</div>
</div>
<div class="glyph fs1">
<div class="clearfix bshadow0 pbs">
<span class="bw-icon-info"></span>
<span class="mls"> bw-icon-info</span>
</div>
<fieldset class="fs0 size1of1 clearfix hidden-false">
<input type="text" readonly value="ea0c" class="unit size1of2" />
<input type="text" maxlength="1" readonly value="&#xea0c;" class="unitRight size1of2 talign-right" />
</fieldset>
<div class="fs0 bshadow0 clearfix hidden-true">
<span class="unit pvs fgc1">liga: </span>
<input type="text" readonly value="info, information" class="liga unitRight" />
</div>
</div>
</div>

<!--[if gt IE 8]><!-->
Expand Down
Binary file modified freesound/static/bw-frontend/bw-icons/fonts/bw-icons.eot
Binary file not shown.
2 changes: 2 additions & 0 deletions freesound/static/bw-frontend/bw-icons/fonts/bw-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified freesound/static/bw-frontend/bw-icons/fonts/bw-icons.ttf
Binary file not shown.
Binary file modified freesound/static/bw-frontend/bw-icons/fonts/bw-icons.woff
Binary file not shown.
2 changes: 1 addition & 1 deletion freesound/static/bw-frontend/bw-icons/selection.json

Large diffs are not rendered by default.

19 changes: 14 additions & 5 deletions freesound/static/bw-frontend/bw-icons/style.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@font-face {
font-family: 'bw-icons';
src: url('fonts/bw-icons.eot?anucm6');
src: url('fonts/bw-icons.eot?anucm6#iefix') format('embedded-opentype'),
url('fonts/bw-icons.ttf?anucm6') format('truetype'),
url('fonts/bw-icons.woff?anucm6') format('woff'),
url('fonts/bw-icons.svg?anucm6#bw-icons') format('svg');
src: url('fonts/bw-icons.eot?8pbk45');
src: url('fonts/bw-icons.eot?8pbk45#iefix') format('embedded-opentype'),
url('fonts/bw-icons.ttf?8pbk45') format('truetype'),
url('fonts/bw-icons.woff?8pbk45') format('woff'),
url('fonts/bw-icons.svg?8pbk45#bw-icons') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
Expand Down Expand Up @@ -84,6 +84,9 @@
.bw-radio:checked + .bw-radio-container .bw-icon-radio-unchecked:before { /* NOTE: this was added manually */
content: '\e936';
}
.bw-icon-checkbox:before {
content: "\e912";
}
.bw-icon-chevron-up:before {
content: "\e913";
}
Expand Down Expand Up @@ -338,3 +341,9 @@
.bw-icon-copy:before {
content: "\e93d";
}
.bw-icon-bullhorn:before {
content: "\e94a";
}
.bw-icon-info:before {
content: "\ea0c";
}
14 changes: 14 additions & 0 deletions freesound/static/bw-frontend/styles/atoms/announcementBanner.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.bw-announcement_banner {
display: flex;
flex-direction: row;
align-items: stretch;

padding: $small-spacing;
background-color: $red;
border-radius: 2px;
color: #ffffff;

a {
color: #000000;
}
}
3 changes: 2 additions & 1 deletion freesound/static/bw-frontend/styles/atoms/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
@import 'recaptcha';
@import 'selectableObject';
@import 'remixArrows';
@import 'table';
@import 'table';
@import 'announcementBanner';
Loading
Loading