Skip to content

Commit 137bd8e

Browse files
shubham-padianiranjan94
authored andcommitted
add support for custom logo placeholder (#2685)
1 parent 83d97bd commit 137bd8e

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

app/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ def social_settings():
257257
settings = get_setts()
258258
return dict(settes=settings)
259259

260+
@app.context_processor
261+
def app_logo():
262+
logo = DataGetter.get_custom_placeholder_by_name('Logo')
263+
return dict(logo=logo)
260264

261265
@app.template_filter('pretty_name')
262266
def pretty_name_filter(string):

app/helpers/static.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
"Opera", "Other", "Pop", "R&B", "Reggae", "Religious/Spiritual", "Rock",
124124
"Top 40"
125125
],
126-
'Other': ["Avatar"],
126+
'Other': ["Avatar","Logo"],
127127
'Performing & Visual Arts': [
128128
"Ballet", "Comedy", "Craft", "Dance", "Fine Art", "Literary Arts",
129129
"Musical", "Opera", "Orchestra", "Other", "Theatre"
@@ -325,6 +325,7 @@
325325
'Language': 'Language.jpg',
326326
'Latin': 'Latin.jpg',
327327
'Literary Arts': 'LiteraryArts.jpg',
328+
'Logo': 'Logo.png',
328329
'Media': 'Media.jpg',
329330
'Medical': 'Medical.jpg',
330331
'Medicine': 'Medicine.jpg',

app/static/placeholders/Logo.png

2.42 KB
Loading

app/templates/gentelella/admin/menu.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
<nav>
55
<ul class="nav navbar-nav">
66
<li style="margin-left: 10px;">
7+
{% if logo == None %}
78
<a href="/" style="font-size: 26px; font-weight: 300;">
89
{{ app_name }}
910
</a>
10-
11+
{% else %}
12+
<a href="/" style="font-size: 26px; font-weight: 300;padding: 0">
13+
<img height="57px" src="{{ logo.url }}"></img>
14+
</a>
15+
{% endif %}
1116
</li>
1217
<li style="margin-left: 10px; line-height:32px;" class="search_bar">
1318
<form action="/browse" method="GET" role="form" id="event_browse">

0 commit comments

Comments
 (0)