Skip to content

Commit

Permalink
Fix HTML in the homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
cpina committed Nov 24, 2020
1 parent f64cef3 commit 075d761
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions SchemaCollaboration/core/templatetags/includefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

@register.simple_tag
def include_homepage():
content = ''
if settings.HOMEPAGE_FILE is None:
return mark_safe(f'''
content = f'''
<h1>Welcome to schema-collaboration</h1>
<p>
This is the default homepage. Set the environment variable <span style="font-family: monospace;">DEFAULT_HOMEPAGE</span> point at an HTML file to change it.
Expand All @@ -23,10 +24,12 @@ def include_homepage():
href="{reverse('login')}">management area</a> (login required available on the next page).
</li>
</ul>
''')
'''
else:
file_content = read_file(settings.HOMEPAGE_FILE)
if file_content is None:
return f'''Cannot load {settings.HOMEPAGE_FILE}. Please make sure that it exist and is readable by schema-collaboration.'''
content = f'''Cannot load {settings.HOMEPAGE_FILE}. Please make sure that it exist and is readable by schema-collaboration.'''
else:
return file_content
content = file_content

return mark_safe(content)

0 comments on commit 075d761

Please sign in to comment.