Skip to content

Commit

Permalink
Remove inline styles from error pages and create new css file
Browse files Browse the repository at this point in the history
  • Loading branch information
ialarmedalien committed Oct 23, 2020
1 parent 0322e93 commit be56aab
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 40 deletions.
19 changes: 7 additions & 12 deletions kbase-extension/kbase_templates/403.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@

{% block stylesheet %}
{{super()}}
<style type="text/css">
/* disable initial hide */
div#header, div#site {
display: block;
}
</style>
<link rel="stylesheet" href="{{ static_url("kbase/css/errorPage.css") }}" type="text/css" />
{% endblock %}

{% block loading_message %}
Expand All @@ -22,11 +17,11 @@

{% block site %}

<div class="error" data-code={{status_code}}>
<p style="font-weight: bold">You do not have permission to access this Narrative.</p>
<p style="font-size: 150%">You can request access from the Narrative owners using the controls below.</p>
<div id="error_container" class="access-error__container" data-code={{status_code}}>
<p class="access-error__heading">You do not have permission to access this Narrative.</p>
<p class="access-error__text">You can request access from the Narrative owners using the controls below.</p>

<div id="perm-request" class="form-group form-inline" style="margin-top: 2em">
<div id="perm-request" class="form-group form-inline access-request-form__container">
<label for="req-level">Access Level</label>
<select id="req-level" class="form-control">
<option value="r">View only</option>
Expand All @@ -35,10 +30,10 @@
</select>
<button id="req-btn" type="button" class="btn btn-sm btn-primary">Request</button>
</div>
<div id="loader" style="display: none; margin-top: 1em">
<div id="loader" class="access-request-progress__container">
<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
</div>
<div id="request-result" style="font-size: 125%; margin-top: 2em"></div>
<div id="request-result" class="access-request-result"></div>
</div>

{% endblock %}
Expand Down
9 changes: 2 additions & 7 deletions kbase-extension/kbase_templates/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@

{% block stylesheet %}
{{super()}}
<style type="text/css">
/* disable initial hide */
div#header, div#site {
display: block;
}
</style>
<link rel="stylesheet" href="{{ static_url("kbase/css/errorPage.css") }}" type="text/css" />
{% endblock %}

{% block loading_message %}
{% endblock %}

{% block site %}

<div class="error">
<div id="error_container" class="error">
{% block h1_error %}
<h1>{{status_code}} : {{status_message}}</h1>
{% endblock h1_error %}
Expand Down
13 changes: 4 additions & 9 deletions kbase-extension/kbase_templates/generic_error.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@

{% block stylesheet %}
{{super()}}
<style type="text/css">
/* disable initial hide */
div#header, div#site {
display: block;
}
</style>
<link rel="stylesheet" href="{{ static_url("kbase/css/errorPage.css") }}" type="text/css" />
{% endblock %}

{% block loading_message %}
Expand All @@ -22,15 +17,15 @@

{% block site %}

<div class="error" data-code={{status_code}}>
<div id="error_container" class="generic-error__container" data-code={{status_code}}>
{% block h1_error %}
<p style="font-weight: bold">
<p class="generic-error__heading">
An error occurred while loading this Narrative
</p>
{% endblock h1_error %}
{% block error_detail %}
{% if message %}
<p>{{message}}</p>
<p class="generic-error__text">{{message}}</p>
{% endif %}
{% endblock %}
</div>
Expand Down
2 changes: 1 addition & 1 deletion kbase-extension/static/errorMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require([
return Login.init($('#signin-button'), true);
})
.then(function () {
let statusCode = document.getElementsByClassName('error')[0].getAttribute('data-code');
let statusCode = document.getElementById('error_container').getAttribute('data-code');
if (statusCode === '403') {
buildRequestControl();
}
Expand Down
11 changes: 0 additions & 11 deletions kbase-extension/static/kbase/css/advancedViewCell.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/

/*
Created on : Jul 14, 2016, 2:31:08 PM
Author : erik
*/

.kb-advanced-view-cell .kb-panel-container[data-element=parameters-group] > div.panel-collapse > .panel-body {
padding: 0;
}
37 changes: 37 additions & 0 deletions kbase-extension/static/kbase/css/errorPage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#header,
#site {
display: block;
}

.access-error__container,
.generic-error__container {
text-align: center;
margin: 2rem;
}

.access-error__heading,
.generic-error__heading {
font-weight: bold;
font-size: 200%;
line-height: 1.5;
}

.access-error__text,
.generic-error__text {
font-size: 150%;
line-height: 2;
}

.access-request-form__container {
margin-top: 2rem;
}

.access-request-progress__container {
display: none;
margin-top: 1rem;
}

.access-request-result {
font-size: 125%;
margin-top: 2rem;
}

0 comments on commit be56aab

Please sign in to comment.