Skip to content

Commit 97b5811

Browse files
committed
substituting /static/images for /images in all urls -fixes 12208
/images remains in the ngnix config, on the off chance that I missed a couple
1 parent c7c1c6b commit 97b5811

30 files changed

Lines changed: 46 additions & 56 deletions

openlibrary/macros/CoverImage.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
$if cover_url:
3535
<img src="$cover_url" height="58" title="$title" alt="$title"/>
3636
$else:
37-
<img src="/images/icons/avatar_book-sm.png" alt="$title"/>
37+
<img src="/static/images/icons/avatar_book-sm.png" alt="$title"/>

openlibrary/macros/FulltextSearchSuggestionItem.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<div class="fsi" itemscope itemtype="https://schema.org/Book" $:attrs>
4545
<div class="fsi__main">
4646
<span class="fsi__book-cover">
47-
$ cover = get_cover_url(selected_ed) or "/images/icons/avatar_book-sm.png"
47+
$ cover = get_cover_url(selected_ed) or "/static/images/icons/avatar_book-sm.png"
4848
<a data-ol-link-track="SearchInsideSuggestion|BookClick" href="$work_edition_url">
4949
<img class="fsi__book-cover-img $blur_cover"
5050
itemprop="image"

openlibrary/macros/LoadingIndicator.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<div class="$hidden loadingIndicator $additional_classes">
66
<figure>
7-
<img src="/images/ajax-loader-bar.gif" alt="$_('Loading indicator')" loading="lazy">
7+
<img src="/static/images/ajax-loader-bar.gif" alt="$_('Loading indicator')" loading="lazy">
88
<figcaption style="
99
justify-content: center;
1010
display: flex;

openlibrary/macros/SearchResultsWork.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
</div>
6565
<div class="sri__main">
6666
<span class="bookcover $blur_cover">
67-
$ cover = get_cover_url(selected_ed) or "/images/icons/avatar_book-sm.png"
67+
$ cover = get_cover_url(selected_ed) or "/static/images/icons/avatar_book-sm.png"
6868
<a href="$work_edition_url">
6969
<img
7070
itemprop="image"

openlibrary/plugins/openlibrary/js/covers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export function initCoversSaved() {
110110
cover_url = `${coverstore_url}/a/id/${image}-M.jpg`;
111111
}
112112
else {
113-
cover_url = '/images/icons/avatar_author-lg.png';
113+
cover_url = '/static/images/icons/avatar_author-lg.png';
114114
}
115115
parent.$(cover_selector).attr('src', cover_url);
116116
}

openlibrary/plugins/openlibrary/js/lists/ShowcaseItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export class ShowcaseItem {
197197
*/
198198
let i18nStrings
199199

200-
const DEFAULT_COVER_URL = '/images/icons/avatar_book-sm.png'
200+
const DEFAULT_COVER_URL = '/static/images/icons/avatar_book-sm.png'
201201

202202
/**
203203
* Returns the inferred type of the given seed key.

openlibrary/plugins/openlibrary/js/my-books/MyBooksDropper/ReadingLists.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { addItem, removeItem } from '../../lists/ListService'
99
import { attachNewActiveShowcaseItem, toggleActiveShowcaseItems } from '../../lists/ShowcaseItem'
1010
import { FadingToast } from '../../Toast'
1111

12-
const DEFAULT_COVER_URL = '/images/icons/avatar_book-sm.png'
12+
const DEFAULT_COVER_URL = '/static/images/icons/avatar_book-sm.png'
1313

1414
/**
1515
* Represents a single My Books dropper's list affordances, and defines their

openlibrary/plugins/openlibrary/lists.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ def get_list_data(list, seed, include_cover_url=True):
240240
)
241241
if include_cover_url:
242242
cover = list.get_cover() or list.get_default_cover()
243-
d["cover_url"] = (cover and cover.url("S")) or "/images/icons/avatar_book-sm.png"
243+
d["cover_url"] = (cover and cover.url("S")) or "/static/images/icons/avatar_book-sm.png"
244244
if "None" in d["cover_url"]:
245-
d["cover_url"] = "/images/icons/avatar_book-sm.png"
245+
d["cover_url"] = "/static/images/icons/avatar_book-sm.png"
246246

247247
d["owner"] = None
248248
if owner := list.get_owner():

openlibrary/plugins/upstream/addbook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def make_work(doc: dict[str, str | list]) -> web.Storage:
8282
for key, name in zip(doc.get('author_key', []), doc.get('author_name', []))
8383
]
8484

85-
w.cover_url = "/images/icons/avatar_book-sm.png"
85+
w.cover_url = "/static/images/icons/avatar_book-sm.png"
8686
w.setdefault('ia', [])
8787
w.setdefault('first_publish_year', None)
8888
return w

openlibrary/plugins/upstream/code.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@
4646

4747
logger = logging.getLogger('openlibrary.plugins.upstream.code')
4848

49-
50-
# Note: This is done in web_nginx.conf on production ; this endpoint is
51-
# only used in development environments.
52-
class static(delegate.page):
53-
path = "/images/.*"
54-
55-
def GET(self):
56-
return web.seeother(f'/static{web.ctx.path}')
57-
58-
5949
class history(delegate.mode):
6050
"""Overwrite ?m=history to remove IP"""
6151

0 commit comments

Comments
 (0)