-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #546 from alphagov/tidy-admin
Tidy up administration area
- Loading branch information
Showing
52 changed files
with
1,253 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//= require jquery | ||
//= require jquery_ujs | ||
//= require auto_logout | ||
//= require autosubmit_selects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
(function ($) { | ||
'use strict'; | ||
|
||
$.fn.autoLogout = function() { | ||
var $html = this; | ||
var $continue = $html.find('#logout-warning-continue'); | ||
var $logout = $html.find('#logout-warning-logout'); | ||
var INTERVAL = 10000; | ||
var WARNING_TIME = 120; | ||
|
||
var AutoLogout = { | ||
continueClicked: function(e) { | ||
$.getJSON('/admin/continue.json', AutoLogout.processContinue); | ||
}, | ||
|
||
logoutClicked: function(e) { | ||
window.location = '/admin/logout'; | ||
}, | ||
|
||
processContinue: function(data) { | ||
$html.hide(); | ||
}, | ||
|
||
processStatus: function(data) { | ||
if (data.time_remaining == 0) { | ||
window.location = '/admin/logout'; | ||
} else if (data.time_remaining <= WARNING_TIME) { | ||
$html.show(); | ||
} else { | ||
$html.hide(); | ||
} | ||
}, | ||
|
||
checkStatus: function() { | ||
$.getJSON('/admin/status.json', AutoLogout.processStatus); | ||
} | ||
}; | ||
|
||
$continue.on('click', AutoLogout.continueClicked); | ||
$logout.on('click', AutoLogout.logoutClicked); | ||
|
||
window.setInterval(AutoLogout.checkStatus, INTERVAL); | ||
} | ||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#logout-warning { | ||
width: 100%; | ||
height: 100%; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
display: none; | ||
|
||
.logout-warning-modal { | ||
background-color: #FFF; | ||
margin: 10% auto 0; | ||
width: 40%; | ||
padding: 24px; | ||
box-shadow: 0px 5px 20px 10px rgba(0, 0, 0, 0.3); | ||
} | ||
|
||
.logout-warning-message { | ||
margin: 0 0 24px 0; | ||
} | ||
|
||
.logout-warning-actions { | ||
margin: 0; | ||
|
||
button { | ||
font-size: 16px; | ||
margin-bottom: 2px; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
class Admin::AdminController < ApplicationController | ||
include Authentication | ||
include Authentication, FlashI18n, FlashRender | ||
|
||
before_action :require_admin_and_check_for_password_change | ||
before_action :do_not_cache | ||
|
||
layout 'admin' | ||
|
||
def index | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.