Skip to content
Snippets Groups Projects
home.py 844 B
Newer Older
  • Learn to ignore specific revisions
  • from flask import render_template, abort
    def home(request, builddate, version, domain_prepared, recaptchaPublicKey, showDomainSelect, cookieNotice, domain_to_index, s):
        try:
            loginbar = "Hello " + s.loads(request.cookies.get('username')) + ' (<a href="/user/links" style="color:white">your links</a>, <a href="/user/logout" style="color:white">logout</a>)'
        except:
            loginbar = '<a href="#" onClick="showLogin()" style="color:white">login</a>'
    
        try:
            return render_template('home.html', builddate=builddate, version=version, domain=domain_prepared, recaptchaPublicKey=recaptchaPublicKey, showDomainSelect=showDomainSelect, loginbar=loginbar, cookieNotice=cookieNotice ,domain_prefilled=domain_to_index[request.headers["host"]]) #return the default site to create a new shorten link
        except:
            abort(500)