#319 Add theming capabilities
Merged a year ago by ngompa. Opened a year ago by hellcp.
hellcp/ipsilon master  into  master

file modified
+9
@@ -54,6 +54,12 @@ 

      cherrypy.config[option] = admin_config[option]

  

  template_loaders = []

+ theme_dir = cherrypy.config.get('theme_dir')

+ if theme_dir:

+     if theme_dir.startswith('/'):

+         template_loaders.append(FileSystemLoader(os.path.join(theme_dir, 'templates')))

+     else:

+         template_loaders.append(FileSystemLoader(os.path.join(cherrypy.config['base.dir'], theme_dir, 'templates')))

  default_template_dir = 'templates'

  template_dir = cherrypy.config.get('template_dir', default_template_dir)

  if template_dir.startswith('/'):
@@ -85,6 +91,9 @@ 

                      'tools.staticdir.dir': 'ui'},

              '/cache': {'tools.staticdir.on': True,

                         'tools.staticdir.dir': 'cache'}}

+     if theme_dir:

+         conf['/ui/res'] = {'tools.staticdir.on': True,

+                         'tools.staticdir.dir': os.path.join(theme_dir, 'res')}

      cherrypy.quickstart(Root('default', template_env),

                          cherrypy.config.get('base.mount') or '/', conf)

  

file modified
+9 -5
@@ -130,6 +130,12 @@ 

      penv.update(os.environ)

      penv['PYTHONPATH'] = os.getcwd()

  

+     if not os.path.exists(args['workdir']):

+         conf = config(args['workdir'])

+         init(args['workdir'])

+     else:

+         conf = os.path.join(args['workdir'], 'ipsilon.conf')

+ 

      schema_init = os.path.join(os.getcwd(),

                                 'ipsilon/install/ipsilon-upgrade-database')

      exe = os.path.join(os.getcwd(), 'ipsilon/ipsilon')
@@ -137,11 +143,9 @@ 

      if args['cleanup']:

          shutil.rmtree(args['workdir'])

  

-     if not os.path.exists(args['workdir']):

-         conf = config(args['workdir'])

-         init(args['workdir'])

-     else:

-         conf = os.path.join(args['workdir'], 'ipsilon.conf')

+     if not os.path.exists(os.path.join(args['workdir'], 'themes')):

+         os.symlink(os.path.join(os.getcwd(), 'themes'),

+                    os.path.join(args['workdir'], 'themes'))

  

      if not os.path.exists(os.path.join(args['workdir'], 'ui')):

          os.symlink(os.path.join(os.getcwd(), 'ui'),

empty or binary file added
@@ -0,0 +1,7 @@ 

+ html, body, .bodycontent {

+   height: 100vh;

+   max-width: 100vw;

+   margin: 0;

+   display: flex;

+   flex-flow: column;

+ }

@@ -0,0 +1,7 @@ 

+ {% extends "layout.html" %}

+ {% block maintitle %}

+ Federated Open Authentication

+ {% endblock %}

+ {% block main %}

+ You will be redirected to this application whenever another application requires you to authenticate.

+ {% endblock %}

@@ -0,0 +1,15 @@ 

+ {% extends "layout.html" %}

+ {% block maintitle %}

+ 500 - Internal Server Error

+ {% endblock %}

+ {% block main %}

+   {% if message: %}

+     <p>{{ message }}</p>

+   {% else %}

+     <p>Ipsilon encountered an unexpected internal error while trying to

+        fulfill your request.</p>

+   {% endif %}

+   <p>Please retry again.</p>

+   <p>If the error persists, contact the server administrator to resolve

+      the problem.</p>

+ {% endblock %}

@@ -0,0 +1,52 @@ 

+ <!doctype html>

+ <html>

+     <head>

+         <meta charset="UTF-8">

+         <title>{{ title }}</title>

+ 

+         <link rel="shortcut icon" type="image/vnd.microsoft.icon"

+             href="//fedoraproject.org/static/images/favicon.ico"/>

+ 

+         <link href="https://apps.fedoraproject.org/global/fedora-bootstrap-1.5.0/fedora-bootstrap.min.css" rel="stylesheet">

+         <link href='/ui/res/login.css' rel='stylesheet' type='text/css'>

+         <meta name="generator" content="Ipsilon">

+ 

+ 

+         {%- if heads %}

+           {%- for group, value in heads.items() %}

+             {%- for head in value %}

+               {{ head | safe }}

+             {%- endfor %}

+           {%- endfor %}

+         {%- endif %}

+     </head>

+     <body>

+         <div class="navbar navbar-light masthead">

+             <div class="container justify-content-center">

+                 <img alt="logo" src="{{ basepath }}/ui/res/fedora-authn-logo-white.png?v=dcabcce440f62c6282cfffb82f2f5614" height=40px />

+             </div>

+         </div>

+         <div class="bodycontent">

+             <div class="container m-auto">

+                 <div class="m-auto {% block cardwidths %}{% endblock %}">

+                     {% block toptext %}{% endblock %}

+                     <div class="card">

+                         <div class="card-header">

+                             {% block maintitle %}{% endblock %}

+                         </div>

+                         <div class="card-body">

+                             {% block main %}{% endblock %}

+                         </div>

+                     </div>

+                     {% block after_card %}{% endblock %}

+                 </div>

+             </div>

+         </div>

+ 

+         <div class="footer py-3 text-white text-center">

+             <div class="container">

+                 Fedora FAS Login uses OpenID powered by <a href="https://ipsilon-project.org/" target="_blank">Ipsilon</a>

+             </div>

+         </div>

+     </body>

+ </html>

@@ -0,0 +1,32 @@ 

+ {% extends "layout.html" %}

+ {% block title %}Login{% endblock %}

+ {% block toptext %}

+ 

+ <div class="mb-2"><strong>{{ login_target }}</strong> wants to use your Fedora Account System (FAS) credentials</div>

+ {% endblock %}

+ {% block cardwidths %}col-md-6 col-sm-8{% endblock %}

+ {% block maintitle %}

+     Log in with FAS

+ {% endblock %}

+ {% block main %}

+                 {% if error %}<p>{{error}}</p>{% endif %}

+                 <form method="post" action="{{ action }}" enctype="application/x-www-form-urlencoded">

+                     <input type="hidden" name="ipsilon_transaction_id" id="ipsilon_transaction_id" value="{{ ipsilon_transaction_id}}"/>

+                     <div class="form-group">

+                         <input class="form-control" id="username" name="login_name" placeholder="Username" autofocus value="{{ username | e }}" />

+                     </div>

+                     <div class="form-group mb-0">

+                         <input class="form-control" id="password" name="login_password" type="password" placeholder="Password" />

+                         <a target="_blank" href="https://admin.fedoraproject.org/accounts/user/resetpass">Forgot password?</a>

+                     </div>

+                     <div class="d-flex justify-content-end">

+                         <input class="btn btn-primary" type="submit" id="loginbutton" value="Log in" />

+                     </div>

+                 </form>

+ {% endblock %}

+ 

+ {% block after_card %}

+ 

+ <div class="mt-2">Don't have a FAS account? <a target="_blank" href="https://admin.fedoraproject.org/accounts/user/new">Sign up now</a>.</div>

+ 

+ {% endblock %}

@@ -0,0 +1,11 @@ 

+ {% extends "layout.html" %}

+ {% block title %}Login{% endblock %}

+ {% block toptext %}

+ {{ login_target }} is asking to authenticate using Ipsilon

+ {% endblock %}

+ {% block main %}

+     <div>

+       Redirecting... {{ redirect }}

+     </div>

+ {% endblock %}

+ 

@@ -0,0 +1,13 @@ 

+ {% extends "layout.html" %}

+ {% block maintitle %}

+ Logged out

+ {% endblock %}

+ {% block main %}

+ {% if user.name %}

+     <p>Something prevented a successful logout</p>

+     <p>You are still logged in as {{ user.fullname }}</p>

+ {% else %}

+     <p>Successfully logged out.</p>

+     <p>Return to <a href="{{ basepath }}/">Home</a> page</p>

+ {% endif %}

+ {% endblock %}

@@ -0,0 +1,13 @@ 

+ {% extends "layout.html" %}

+ {% block maintitle %}

+ 404 - Not Found

+ {% endblock %}

+ {% block main %}

+   {% if message: %}

+     <p>{{ message }}</p>

+   {% else %}

+     <p>This page does not exist.</p>

+   {% endif %}

+   <p>If you think this is an error, contact the server administrator to resolve

+      the problem.</p>

+ {% endblock %}

@@ -0,0 +1,37 @@ 

+ {% extends "layout.html" %}

+ {% block toptext %}

+ <p><strong>{{trustroot}}</strong> requests to use the following details from your FAS Account</p>

+ {% endblock %}

+ {% block cardwidths %}col-md-10 col-md-offset-1{% endblock %}

+ {% block maintitle %}Review the authorization details{% endblock %}

+ {% block main %}

+     <div>

+         <form method="post" action="{{action}}" enctype="application/x-www-form-urlencoded">

+             <input type="hidden" name="ipsilon_transaction_id" id="ipsilon_transaction_id" value="{{ ipsilon_transaction_id }}" />

+                     {% for entry in authz_details|dictsort %}

+                         <div class="row">

+                             <div class="col"><strong>{{ entry[0] }}</strong></div>

+                             {%- if entry[1] is iterable and not entry[1] is string -%}

+                             <div class="col-auto">{{ entry[1] | join(', ') }}</div>

+                             {%- else -%}

+                             <div class="col-auto">{{ entry[1] }}</div>

+                             {%- endif -%}

+                         </div>

+                     {% endfor %}

+ 

+                     <div class="row">

+                         <div class="col"><strong>Remember&nbsp;approval</strong></div>

+                         <div class="col-auto"><select name="remember_for_days" class="custom-select">

+                                 <option value="0">never</option>

+                                 <option value="3">3 days</option>

+                                 <option value="7">7 days</option>

+                             </select>

+                         </div>

+                     </div>

+             <div class="d-flex justify-content-end">

+                 <input class="btn btn-primary" name="decided_allow" type="submit" value="Approve" />

+                 <input class="btn btn-link" name="decided_deny" type="submit" value="Reject" />

+             </p>

+         </form>

+     </div>

+ {% endblock %}

@@ -0,0 +1,7 @@ 

+ {% extends "layout.html" %}

+ {% block toptext %}

+ This is the OpenID page for {{username}}.

+ {% endblock %}

+ {% block main %}

+ This page is primarily used internally

+ {% endblock %}

@@ -0,0 +1,16 @@ 

+ <?xml version="1.0" encoding="UTF-8"?>

+ <xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)">

+   <XRD>

+     <Service>

+ {%- for t in types %}

+       <Type>{{ t }}</Type>

+ {%- endfor %}

+ {%- if uri %}

+       <URI>{{ uri }}</URI>

+ {%- endif %}

+ {%- if localid %}

+       <LocalID>{{ localid }}</LocalID>

+ {%- endif %}

+     </Service>

+   </XRD>

+ </xrds:XRDS>

@@ -0,0 +1,59 @@ 

+ {% extends "layout.html" %}

+ {% block toptext %}

+ This page is used internally

+ {% endblock %}

+ {% block main %}

+ <script type="text/javascript" src="https://login.persona.org/provisioning_api.js"></script>

+ <script type="text/javascript">

+     var xmlhttp = new XMLHttpRequest()

+ 

+     var loggedin = {{ loggedin|lower }};

+ 

+     xmlhttp.onreadystatechange = function()

+     {

+         if(xmlhttp.readyState == 4)

+         {

+             if(xmlhttp.status == 200)

+             {

+                 navigator.id.registerCertificate(xmlhttp.responseText);

+             }

+             else if((xmlhttp.status == 401) || (xmlhttp.status == 403))

+             {

+                 navigator.id.raiseProvisioningFailure('Error in provisioning!');

+             }

+             else

+             {

+                 alert("Response code: " + xmlhttp.status);

+                 alert("Response text: " + xmlhttp.responseText);

+             }

+         }

+     }

+ 

+     function generateServerSide(email, publicKey, certDuration, callback)

+     {

+         xmlhttp.open("POST", "Sign/", true);

+         xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

+         xmlhttp.send("email=" + encodeURIComponent(email)

+                      + "&publicKey=" + encodeURIComponent(publicKey)

+                      + "&certDuration=" + encodeURIComponent(certDuration));

+     }

+ 

+     function startProvisioning()

+     {

+         navigator.id.beginProvisioning(function(email, certDuration)

+         {

+             if(loggedin)

+             {

+                 navigator.id.genKeyPair(function(publicKey)

+                 {

+                     generateServerSide(email, publicKey, certDuration);

+                 });

+             } else {

+                 navigator.id.raiseProvisioningFailure('user is not authenticated');

+             }

+         });

+     }

+ 

+     startProvisioning();

+ </script>

+ {% endblock %}

@@ -0,0 +1,19 @@ 

+ {% extends "layout.html" %}

+ {% block toptext %}

+ This page is used internally

+ {% endblock %}

+ {% block main %}

+ <script type="text/javascript" src="https://login.persona.org/authentication_api.js"></script>

+ <script type="text/javascript">

+     var loggedin = {{ loggedin|lower }};

+ 

+     if(loggedin)

+     {

+         navigator.id.beginAuthentication(function(email) {

+             navigator.id.completeAuthentication();

+         });

+     } else {

+         navigator.id.raiseAuthenticationFailure('User cancelled signon');

+     }

+ </script>

+ {% endblock %}

@@ -0,0 +1,12 @@ 

+ {% extends "layout.html" %}

+ {% block maintitle %}

+ 401 - Unauthorized

+ {% endblock %}

+ {% block main %}

+   {% if message: %}

+     <p>{{ message }}</p>

+   {% else %}

+     <p>Authentication was not succesful</p>

+   {% endif %}

+   <p><a href="{{ basepath }}/login" title="Login">Try to login again</a></p>

+ {% endblock %}

@@ -0,0 +1,7 @@ 

+ html, body, .bodycontent {

+   height: 100vh;

+   max-width: 100vw;

+   margin: 0;

+   display: flex;

+   flex-flow: column;

+ }

@@ -0,0 +1,5 @@ 

+ {% extends "layout.html" %}

+ {% block main %}

+ <div class="card-header">Federated Open Authentication</div>

+ <div class="card-body">You will be redirected to this application whenever another application requires you to authenticate.</div>

+ {% endblock %}

@@ -0,0 +1,19 @@ 

+ {% extends "layout.html" %}

+ {% block toptext %}

+ <div class="alert alert-danger">

+   {% if message: %}

+     {{ message }}

+   {% else %}

+     Ipsilon encountered an unexpected internal error while trying to

+     fulfill your request.

+   {% endif %}

+ </div>

+ {% endblock %}

+ {% block main %}

+ <div class="card-header">500 - Internal Server Error</div>

+ <div class="card-body">

+   <p>Please retry again.</p>

+   <p>If the error persists, contact the server administrator to resolve

+      the problem.</p>

+ </div>

+ {% endblock %}

@@ -0,0 +1,48 @@ 

+ <!doctype html>

+ <html>

+     <head>

+         <meta charset="UTF-8">

+         <title>{% block title %}{{ title }}{% endblock %}</title>

+ 

+         <link rel="shortcut icon" type="image/vnd.microsoft.icon"

+             href="//static.opensuse.org/chameleon/dist/images/favicons/favicon.ico"/>

+ 

+         <link href="https://static.opensuse.org/chameleon/dist/css/chameleon.css" rel="stylesheet">

+         <link href='/ui/res/login.css' rel='stylesheet' type='text/css'>

+         <meta name="generator" content="Ipsilon">

+         <script defer src="https://static.opensuse.org/chameleon/dist/js/chameleon.js" type="text/javascript" charset="utf-8"></script>

+ 

+         {%- if heads %}

+           {%- for group, value in heads.items() %}

+             {%- for head in value %}

+               {{ head | safe }}

+             {%- endfor %}

+           {%- endfor %}

+         {%- endif %}

+     </head>

+     <body>

+         <nav class="navbar navbar-expand-md navbar-light bg-light noprint">

+             <a class="navbar-brand" href="/">

+                 <img src="https://static.opensuse.org/chameleon/dist/images/logo/logo-white.svg" class="mr-2" alt="Logo">

+                 <span>Login</span>

+             </a>

+             <div class="ml-auto">

+             </div>

+         </nav>

+         <div class="container m-auto">

+             <div class="m-auto {% block cardwidths %}col-md-6{% endblock %}">

+                 {% block toptext %}{% endblock %}

+                 <div class="card">

+                     {% block main %}{% endblock %}

+                 </div>

+                 {% block after_card %}{% endblock %}

+             </div>

+         </div>

+ 

+         <div class="global-footer py-3 text-center">

+             <div class="container">

+                 openSUSE Login uses OpenID powered by <a href="https://ipsilon-project.org/" target="_blank">Ipsilon</a>

+             </div>

+         </div>

+     </body>

+ </html>

@@ -0,0 +1,33 @@ 

+ {% extends "layout.html" %}

+ {% block title %}openSUSE Login{% endblock %}

+ {% block toptext %}

+ <div class="alert alert-info">

+   <span class="typcn typcn-key-outline"></span>

+   {%- if login_target %}

+     <strong>{{ login_target }}</strong>

+   {%- else %}

+     Application

+   {%- endif %}

+   wants to use your openSUSE Account credentials

+ </div>

+ {% endblock %}

+ {% block cardwidths %}col-md-6 col-sm-8{% endblock %}

+ {% block main %}

+                 {% if error %}<p>{{error}}</p>{% endif %}

+                 <form method="post" action="{{ action }}" enctype="application/x-www-form-urlencoded">

+                     <div class="card-body">

+                     <input type="hidden" name="ipsilon_transaction_id" id="ipsilon_transaction_id" value="{{ ipsilon_transaction_id}}"/>

+                     <div class="form-group">

+                         <input class="form-control" id="username" name="login_name" placeholder="Username" autofocus value="{{ username | e }}" />

+                     </div>

+                     <div class="form-group mb-0">

+                         <input class="form-control" id="password" name="login_password" type="password" placeholder="Password" />

+                         <a target="_blank" href="https://www.microfocus.com/selfreg/jsp/forgotPassword.jsp">Forgot password?</a>

+                     </div>

+                     </div>

+                     <div class="card-footer d-flex justify-content-between align-items-center">

+                         <a target="_blank" href="https://www.microfocus.com/selfreg/jsp/createOpenSuseAccount.jsp">Sign up</a>

+                         <input class="btn btn-primary" type="submit" id="loginbutton" value="Log in" />

+                     </div>

+                 </form>

+ {% endblock %}

@@ -0,0 +1,11 @@ 

+ {% extends "layout.html" %}

+ {% block title %}openSUSE Login{% endblock %}

+ {% block toptext %}

+ {{ login_target }} is asking to authenticate

+ {% endblock %}

+ {% block main %}

+     <div class="card-body">

+       Redirecting... {{ redirect }}

+     </div>

+ {% endblock %}

+ 

@@ -0,0 +1,13 @@ 

+ {% extends "layout.html" %}

+ {% block main %}

+ <div class="card-header">Logged out</div>

+ <div class="card-body">

+   {% if user.name %}

+     <p>Something prevented a successful logout</p>

+     <p>You are still logged in as {{ user.fullname }}</p>

+   {% else %}

+     <p>Successfully logged out.</p>

+     <p>Return to <a href="{{ basepath }}/">Home</a> page</p>

+   {% endif %}

+ </div>

+ {% endblock %}

@@ -0,0 +1,17 @@ 

+ {% extends "layout.html" %}

+ {% block toptext %}

+ <div class="alert alert-danger">

+   {% if message: %}

+     {{ message }}

+   {% else %}

+     This page does not exist.

+   {% endif %}

+ </div>

+ {% endblock %}

+ {% block main %}

+ <div class="card-header">404 - Not Found</div>

+ <div class="card-body">

+   <p>If you think this is an error, contact the server administrator to resolve

+      the problem.</p>

+ </div>

+ {% endblock %}

@@ -0,0 +1,41 @@ 

+ {% extends "layout.html" %}

+ {% block toptext %}

+ <div class="alert alert-warning">

+     <span class="typcn typcn-lock-open-outline"></span>

+     <strong>{{trustroot}}</strong>

+     requests to use the following details from your openSUSE Account

+ </div>

+ {% endblock %}

+ {% block cardwidths %}col-md-10{% endblock %}

+ {% block main %}

+         <form method="post" action="{{action}}" enctype="application/x-www-form-urlencoded">

+             <ul class="list-group list-group-flush">

+                 {% for entry in authz_details|dictsort %}

+                     <li class="list-group-item d-flex justify-content-between align-items-center">

+                         <strong>{{ entry[0] }}</strong>

+                         {%- if entry[1] is iterable and not entry[1] is string -%}

+                         <span class="w-auto">{{ entry[1] | join(', ') }}</span>

+                         {%- else -%}

+                         <span class="w-auto">{{ entry[1] }}</span>

+                         {%- endif -%}

+                     </li>

+                 {% endfor %}

+ 

+                 <li class="list-group-item d-flex justify-content-between align-items-center">

+                     <strong>Remember&nbsp;approval</strong>

+                     <span class="w-auto">

+                         <select name="remember_for_days" class="custom-select">

+                             <option value="0">never</option>

+                             <option value="3">3 days</option>

+                             <option value="7">7 days</option>

+                         </select>

+                     </span>

+                 </li>

+             </ul>

+             <input type="hidden" name="ipsilon_transaction_id" id="ipsilon_transaction_id" value="{{ ipsilon_transaction_id }}" />

+             <div class="card-footer d-flex justify-content-end">

+                 <input class="btn btn-success mr-2" name="decided_allow" type="submit" value="Approve" />

+                 <input class="btn btn-danger" name="decided_deny" type="submit" value="Reject" />

+             </div>

+         </form>

+ {% endblock %}

@@ -0,0 +1,5 @@ 

+ {% extends "layout.html" %}

+ {% block main %}

+ <div class="card-header">OpenID page for {{username}}</div>

+ <div class="card-body">This page is primarily used internally.</div>

+ {% endblock %}

@@ -0,0 +1,16 @@ 

+ <?xml version="1.0" encoding="UTF-8"?>

+ <xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)">

+   <XRD>

+     <Service>

+ {%- for t in types %}

+       <Type>{{ t }}</Type>

+ {%- endfor %}

+ {%- if uri %}

+       <URI>{{ uri }}</URI>

+ {%- endif %}

+ {%- if localid %}

+       <LocalID>{{ localid }}</LocalID>

+ {%- endif %}

+     </Service>

+   </XRD>

+ </xrds:XRDS>

@@ -0,0 +1,59 @@ 

+ {% extends "layout.html" %}

+ {% block toptext %}

+ This page is used internally

+ {% endblock %}

+ {% block main %}

+ <script type="text/javascript" src="https://login.persona.org/provisioning_api.js"></script>

+ <script type="text/javascript">

+     var xmlhttp = new XMLHttpRequest()

+ 

+     var loggedin = {{ loggedin|lower }};

+ 

+     xmlhttp.onreadystatechange = function()

+     {

+         if(xmlhttp.readyState == 4)

+         {

+             if(xmlhttp.status == 200)

+             {

+                 navigator.id.registerCertificate(xmlhttp.responseText);

+             }

+             else if((xmlhttp.status == 401) || (xmlhttp.status == 403))

+             {

+                 navigator.id.raiseProvisioningFailure('Error in provisioning!');

+             }

+             else

+             {

+                 alert("Response code: " + xmlhttp.status);

+                 alert("Response text: " + xmlhttp.responseText);

+             }

+         }

+     }

+ 

+     function generateServerSide(email, publicKey, certDuration, callback)

+     {

+         xmlhttp.open("POST", "Sign/", true);

+         xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

+         xmlhttp.send("email=" + encodeURIComponent(email)

+                      + "&publicKey=" + encodeURIComponent(publicKey)

+                      + "&certDuration=" + encodeURIComponent(certDuration));

+     }

+ 

+     function startProvisioning()

+     {

+         navigator.id.beginProvisioning(function(email, certDuration)

+         {

+             if(loggedin)

+             {

+                 navigator.id.genKeyPair(function(publicKey)

+                 {

+                     generateServerSide(email, publicKey, certDuration);

+                 });

+             } else {

+                 navigator.id.raiseProvisioningFailure('user is not authenticated');

+             }

+         });

+     }

+ 

+     startProvisioning();

+ </script>

+ {% endblock %}

@@ -0,0 +1,19 @@ 

+ {% extends "layout.html" %}

+ {% block toptext %}

+ This page is used internally

+ {% endblock %}

+ {% block main %}

+ <script type="text/javascript" src="https://login.persona.org/authentication_api.js"></script>

+ <script type="text/javascript">

+     var loggedin = {{ loggedin|lower }};

+ 

+     if(loggedin)

+     {

+         navigator.id.beginAuthentication(function(email) {

+             navigator.id.completeAuthentication();

+         });

+     } else {

+         navigator.id.raiseAuthenticationFailure('User cancelled signon');

+     }

+ </script>

+ {% endblock %}

@@ -0,0 +1,16 @@ 

+ {% extends "layout.html" %}

+ {% block toptext %}

+ <div class="alert alert-danger">

+   {% if message: %}

+     {{ message }}

+   {% else %}

+     Authentication was not succesful

+   {% endif %}

+ </div>

+ {% endblock %}

+ {% block main %}

+ <div class="card-header">401 - Unauthorized</div>

+ <div class="card-body">

+   <p><a href="{{ basepath }}/login" title="Login">Try to login again</a></p>

+ </div>

+ {% endblock %}

Adds theming with a drop-in directory and 2 themes.

I like this commit, but I do not understand how the default theme works, i see the code mentions the directory 'themes/default', but the commit does not add such directory, it only adds Fedora and OpenSUSE directories under themes

Yeah, I implemented default theme for the /ui directory, but I realized there is no easy way to override the assets and keep the other assets hosted like there is to override templates. I will just remove it.

1 new commit added

  • Only use theme_dir if it's set
a year ago

2 new commits added

  • Only use theme_dir if it's set
  • Add theming capabilities
a year ago

1 new commit added

  • Update the openSUSE theme
a year ago

@hellcp Could you squash the update to the openSUSE theme into the commit that adds the theme in the first place?

rebased onto f10cfe7

a year ago

Another question, why the /res directory ?
I understand it mean "resources", but why do you need another high level directory? why /ui is not sufficient ?

For the sake of compartmentalization, I didn't want to just place content of every theme in one directory. I also can't override the default /ui because some templates still use data from that directory.

Sure but why not simply /ui/res ?

1 new commit added

  • Move res to ui
a year ago

2 new commits added

  • Only use theme_dir if it's set
  • Add theming capabilities
a year ago

Looks good, if you can squash the two commits I will push

rebased onto 2aa8218

a year ago

rebased onto 1cd7e58

a year ago

Pull-Request has been merged by ngompa

a year ago
Metadata
Changes Summary 31
+9 -0
file changed
ipsilon/ipsilon
+9 -5
file changed
quickrun.py
+0
file added
themes/Fedora/res/fedora-authn-logo-white.png
+7
file added
themes/Fedora/res/login.css
+7
file added
themes/Fedora/templates/index.html
+15
file added
themes/Fedora/templates/internalerror.html
+52
file added
themes/Fedora/templates/layout.html
+32
file added
themes/Fedora/templates/login/form.html
+11
file added
themes/Fedora/templates/login/index.html
+13
file added
themes/Fedora/templates/logout.html
+13
file added
themes/Fedora/templates/notfound.html
+37
file added
themes/Fedora/templates/openid/consent_form.html
+7
file added
themes/Fedora/templates/openid/userpage.html
+16
file added
themes/Fedora/templates/openid/xrds.xml
+59
file added
themes/Fedora/templates/persona/provisioning.html
+19
file added
themes/Fedora/templates/persona/signin_result.html
+12
file added
themes/Fedora/templates/unauthorized.html
+7
file added
themes/openSUSE/res/login.css
+5
file added
themes/openSUSE/templates/index.html
+19
file added
themes/openSUSE/templates/internalerror.html
+48
file added
themes/openSUSE/templates/layout.html
+33
file added
themes/openSUSE/templates/login/form.html
+11
file added
themes/openSUSE/templates/login/index.html
+13
file added
themes/openSUSE/templates/logout.html
+17
file added
themes/openSUSE/templates/notfound.html
+41
file added
themes/openSUSE/templates/openid/consent_form.html
+5
file added
themes/openSUSE/templates/openid/userpage.html
+16
file added
themes/openSUSE/templates/openid/xrds.xml
+59
file added
themes/openSUSE/templates/persona/provisioning.html
+19
file added
themes/openSUSE/templates/persona/signin_result.html
+16
file added
themes/openSUSE/templates/unauthorized.html