login tests with new ostauth module. Also embedded new layout.

parent 79ab1c50
# Output debugging info
# loglevel: debug
# Major version of Bootstrap: 3 or 4
bootstrapVersion: 4
# If Bootstrap version 4 is used - turn on/off flexbox model
useFlexbox: false
# Webpack loaders, order matters
styleLoaders:
- style
- css
- sass
# Extract styles to stand-alone css file
# Different settings for different environments can be used,
# It depends on value of NODE_ENV environment variable
# This param can also be set in webpack config:
# entry: 'bootstrap-loader/extractStyles'
extractStyles: false
# env:
# development:
# extractStyles: false
# production:
# extractStyles: true
# Customize Bootstrap variables that get imported before the original Bootstrap variables.
# Thus, derived Bootstrap variables can depend on values from here.
# See the Bootstrap _variables.scss file for examples of derived Bootstrap variables.
#
# preBootstrapCustomizations: ./path/to/bootstrap/pre-customizations.scss
preBootstrapCustomizations: ./myschool/pre-customizations.scss
# This gets loaded after bootstrap/variables is loaded
# Thus, you may customize Bootstrap variables
# based on the values established in the Bootstrap _variables.scss file
#
# bootstrapCustomizations: ./path/to/bootstrap/customizations.scss
# Import your custom styles here
# Usually this endpoint-file contains list of @imports of your application styles
#
# appStyles: ./path/to/your/app/styles/endpoint.scss
appStyles: ./myschool/myschool.scss
### Bootstrap styles
styles:
# Mixins
mixins: true
# Reset and dependencies
normalize: true
print: true
# Core CSS
reboot: true
type: true
images: true
code: true
grid: true
tables: true
forms: true
buttons: true
# Components
transitions: true
dropdown: true
button-group: true
input-group: true
custom-forms: true
nav: true
navbar: true
card: true
breadcrumb: true
pagination: true
jumbotron: true
alert: true
progress: true
media: true
list-group: true
responsive-embed: true
close: true
# Components w/ JavaScript
modal: true
tooltip: true
popover: true
carousel: true
# Utility classes
utilities: true
utilities-background: false
utilities-spacing: false
utilities-responsive: false
### Bootstrap scripts
scripts:
alert: true
button: true
carousel: true
collapse: true
dropdown: true
modal: true
popover: true
scrollspy: true
tab: true
tooltip: true
util: true
epal_is_logged_in:
path: '/epal/login/check'
defaults:
_controller: '\Drupal\epal\Controller\Login::helloWorld'
requirements:
_access: 'TRUE'
epal_auth_test:
path: 'epal/auth/test'
options:
_auth: [ 'oauthost' ]
defaults:
_controller: '\Drupal\epal\Controller\Login::helloWorld'
_title: 'Greeting'
requirements:
_permission: 'access content'
_user_is_logged_in: 'TRUE'
<?php
/**
* @file
* Contains \Drupal\query_example\Controller\QueryExampleController.
*/
namespace Drupal\epal\Controller;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Drupal\Core\Controller\ControllerBase;
/**
* Controller routines for page example routes.
*/
class Login extends ControllerBase {
protected $query_factory;
public function __construct(EntityTypeManagerInterface $entityTypeManager, QueryFactory $query_factory) {
// public function __construct(QueryFactory $query_factory) {
$this->entityTypeManager = $entityTypeManager;
$this->query_factory = $query_factory;
}
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity.manager'),
$container->get('entity.query')
);
}
public function helloWorld() {
$name = \Drupal::request()->query->get('name');
$authToken = "no authToken";
$accessKey = "no accessKey";
if (\Drupal::request()->headers->has('X-AUTH-TOKEN')) {
$authToken = \Drupal::request()->headers->get( 'X-AUTH-TOKEN' );
}
if (\Drupal::request()->headers->has('X-ACCESS-KEY')) {
$accessKey = \Drupal::request()->headers->get( 'X-ACCESS-KEY' );
}
$response = new JsonResponse(['hello' => 'world', 'name' => $name, 'authToken' => $authToken, 'accessKey' => $accessKey]);
$response->headers->set('X-AUTH-TOKEN', 'HELLOTOKEN');
return $response;
}
protected function simpleQuery() {
$query = $this->query_factory->get('student_class');
// ->condition('status', 1);
$scids = $query->execute();
$studentClass_storage = $this->entityTypeManager->getStorage('student_class');
$studentClasses = $studentClass_storage->loadMultiple($scids);
$arrayToReturn = array();
foreach ($studentClasses as $studentClass) {
array_push($arrayToReturn,
array(
array('data' => $studentClass->get('name')->value, 'class' => 'not-editable'),
array('data' => "hello")
));
}
return array_values($arrayToReturn);
}
public function basicQuery() {
return [
'#title' => 'All student class ids',
'studentclasses' => array(
'#attributes' => ['id' => 'studentclasses', 'name' => 'studentclasses'],
'#theme' => 'table',
'#caption' => t('Student Classes'),
'#header' => array(t('Name'), t('Max No')),
'#rows' => $this->simpleQuery(),
),
'#attached' => [
'library' => [
'eepal/eepal-styles', //include our custom module library for this response
'eepal/data-tables' //include data tables libraries with this response
]
]
];
}
protected function intermediateQuery() {
$query = $this->query_factory->get('node')
->condition('status', 1)
->condition('changed', REQUEST_TIME, '<')
->condition('title', 'ipsum lorem', 'CONTAINS')
->condition('field_tags.entity.name', 'test');
$nids = $query->execute();
return array_values($nids);
}
public function conditionalQuery() {
return [
'#title' => 'Published Nodes Called "ipsum lorem" That Have a Tag "test"',
'content' => [
'#theme' => 'item_list',
'#items' => $this->intermediateQuery()
]
];
}
protected function advancedQuery() {
$query = $this->query_factory->get('node')
->condition('status', 1)
->condition('changed', REQUEST_TIME, '<');
$group = $query->orConditionGroup()
->condition('title', 'ipsum lorem', 'CONTAINS')
->condition('field_tags.entity.name', 'test');
$nids = $query->condition($group)->execute();
return array_values($nids);
}
public function conditionalGroupQuery() {
return [
'#title' => 'Published Nodes That Are Called "ipsum lorem" Or Have a Tag "test"',
'content' => [
'#theme' => 'item_list',
'#items' => $this->advancedQuery()
]
];
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
.subfooter {
// position: absolute;
// bottom: 41px;
background-color: #dcdcdc;
height: 100px;
width: 100%;
}
.footer {
//position: absolute;
//bottom: 0;
width: 100%;
height: 41px;
line-height: 41px;
background-color: #3a3a3a;
color: #909090;
.ft-text {
font-size: 12px;
a {
color: #909090;
font-size: 12px;
text-decoration: none;
&:hover {
text-decoration: none;
}
}
}
}
.header-wrapper {
background: none repeat scroll 0 0 #F2F1F1;
border-bottom: 1px solid #e2e2e2;
height: 32px;
.navbar {
border-color: transparent;
a.navbar-brand {
text-decoration: none;
font-size: 16px;
font-weight: 500;
}
#block-block-1 {
padding-top: 12px;
}
}
.name-slogan {
float:left;
margin: 0 0 30px 15px;
padding-top: 25px;
#site-name {
.navbar-sitename {
text-decoration: none;
font-size: 16px;
font-weight: 500;
color: #fff;
&:hover {
text-decoration: default;
color: #fff;
}
}
}
#site-slogan {
.lead {
font-size: 14px;
color: #fff;
}
}
}
}
\ No newline at end of file
.main-wrapper {
background: #FFF none repeat-y 0 0;
min-height: calc(100vh - 220px);
#content {
zoom: 1;
background-color: white;
box-shadow: none;
position: relative;
z-index: 0;
padding: 15px 10px 10px;
//padding: 0 10px 10px;
margin-top: 0;
.crumb {
border-bottom: 1px solid #EFEFEF!important;
border-top: 1px solid #EFEFEF!important;
color: #333333!important;
display: block!important;
font: 12px 'Trebuchet MS',Helvetica,Arial,Verdana,sans-serif!important;
padding: 8px 8px 8px 0!important;
background-color: white;
}
.left-sidebar {
background-color: #EEEEEE;
padding: 10px;
.navig-left-img {
text-align: center;
}
.content {
margin-left: 1.4%;
}
.small-text {
font-weight: bold;
font-size: 8pt!important;
line-height: 1.4em!important;
margin-bottom: 0;
}
p {
margin-bottom: 0;
}
}
}
}
@include media-breakpoint-up(md) {
.main-wrapper {
#content {
padding: 0 10px 10px;
box-shadow: 0 0 20px #888888;
}
}
}
\ No newline at end of file
@import 'header';
@import 'navbar';
@import 'main';
@import 'footer';
@import 'scss/font-awesome';
html {
position: relative;
min-height: 100%;
}
.nav-wrapper {
.navbar-toggler {
border: 2px solid #f15a26;
.navbar-toggler-icon {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
}
.navbar-collapse {
height: auto;
.navbar-nav {
padding-bottom: 15px;
margin-top: 10px;
margin-bottom: 10px;
li a.active {
&::after{
border-width: 0px;
}
}
a {
&:hover:after {
border-width: 0px;
}
}
}
}
}
.nav-wrapper {
z-index: 1;
position: relative;
background-color: #fff;
.navbar {
margin-top: 10px;
padding-top: 0;
.navbar-brand {
padding-top: 0;
padding-bottom: 0;
}
}
.navbar-collapse {
// height: 46px;
.navbar-nav {
padding-bottom: 0px;
li {
float: none;
display: block;
line-height: 24px;
margin: 0;
padding: 0;
}
li a.active {
color: #fff;
font-weight: bold;
text-shadow: 0 1px 0 rgba(0,0,0,0.5);
background: #f15a23;
// box-shadow: inset 0 3px 5px rgba(0,0,0,0.4);
&::after{
// border-left: 10px solid transparent;
// border-right: 10px solid transparent;
// border-top: 7px solid #f15a23;
// content: "";
// display: block;
// height: 0;
// margin: 0px auto 0 auto;
// width: 0;
}
}
a {
display: block;
padding: 0px 21px;
color: #000;
text-decoration: none;
font-weight: bold;
text-transform: uppercase;
font-size: 12px;
height: 46px;
line-height: 46px;
&:hover {
background: #ddd;
// box-shadow: inset 0 3px 5px rgba(0,0,0,0.4);
}
&:hover:after {
// border-left: 10px solid transparent;
// border-right: 10px solid transparent;
// border-top: 7px solid #ddd;
// content: "";
// display: block;
// height: 0;
// margin: 0px auto 0 auto;
// width: 0;
}
}
}
}
}
@include media-breakpoint-up(md) {
.nav-wrapper {
.navbar {
padding-bottom: 0;
}
.navbar-collapse {
height: 46px;
.navbar-nav {
margin-top: 0px;
margin-bottom: 0px;
li a.active {
box-shadow: inset 0 3px 5px rgba(0,0,0,0.4);
&::after{
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 7px solid #f15a23;
content: "";
display: block;
height: 0;
margin: 0px auto 0 auto;
width: 0;
}
}
a {
&:hover {
box-shadow: inset 0 3px 5px rgba(0,0,0,0.4);
}
&:hover:after {
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 7px solid #ddd;
content: "";
display: block;
height: 0;
margin: 0px auto 0 auto;
width: 0;
}
}
}
}
}
}
\ No newline at end of file
// Spinning Icons
// --------------------------
.#{$fa-css-prefix}-spin {
-webkit-animation: fa-spin 2s infinite linear;
animation: fa-spin 2s infinite linear;
}
.#{$fa-css-prefix}-pulse {
-webkit-animation: fa-spin 1s infinite steps(8);
animation: fa-spin 1s infinite steps(8);
}
@-webkit-keyframes fa-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes fa-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
// Bordered & Pulled
// -------------------------
.#{$fa-css-prefix}-border {
padding: .2em .25em .15em;
border: solid .08em $fa-border-color;
border-radius: .1em;
}
.#{$fa-css-prefix}-pull-left { float: left; }
.#{$fa-css-prefix}-pull-right { float: right; }
.#{$fa-css-prefix} {
&.#{$fa-css-prefix}-pull-left { margin-right: .3em; }
&.#{$fa-css-prefix}-pull-right { margin-left: .3em; }
}
/* Deprecated as of 4.4.0 */
.pull-right { float: right; }
.pull-left { float: left; }
.#{$fa-css-prefix} {
&.pull-left { margin-right: .3em; }
&.pull-right { margin-left: .3em; }
}
// Base Class Definition
// -------------------------
.#{$fa-css-prefix} {
display: inline-block;
font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
font-size: inherit; // can't have font-size inherit on line above, so need to override
text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
// Fixed Width Icons
// -------------------------
.#{$fa-css-prefix}-fw {
width: (18em / 14);
text-align: center;
}
This diff is collapsed.
// Icon Sizes
// -------------------------
/* makes the font 33% larger relative to the icon container */
.#{$fa-css-prefix}-lg {
font-size: (4em / 3);
line-height: (3em / 4);
vertical-align: -15%;
}
.#{$fa-css-prefix}-2x { font-size: 2em; }
.#{$fa-css-prefix}-3x { font-size: 3em; }
.#{$fa-css-prefix}-4x { font-size: 4em; }
.#{$fa-css-prefix}-5x { font-size: 5em; }
// List Icons
// -------------------------
.#{$fa-css-prefix}-ul {
padding-left: 0;
margin-left: $fa-li-width;
list-style-type: none;
> li { position: relative; }
}
.#{$fa-css-prefix}-li {
position: absolute;
left: -$fa-li-width;
width: $fa-li-width;
top: (2em / 14);
text-align: center;
&.#{$fa-css-prefix}-lg {
left: -$fa-li-width + (4em / 14);
}
}
// Mixins
// --------------------------
@mixin fa-icon() {
display: inline-block;
font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
font-size: inherit; // can't have font-size inherit on line above, so need to override
text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@mixin fa-icon-rotate($degrees, $rotation) {
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})";
-webkit-transform: rotate($degrees);
-ms-transform: rotate($degrees);
transform: rotate($degrees);
}
@mixin fa-icon-flip($horiz, $vert, $rotation) {
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)";
-webkit-transform: scale($horiz, $vert);
-ms-transform: scale($horiz, $vert);
transform: scale($horiz, $vert);
}
// Only display content to screen readers. A la Bootstrap 4.
//
// See: http://a11yproject.com/posts/how-to-hide-content/
@mixin sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);
border: 0;
}
// Use in conjunction with .sr-only to only display content when it's focused.
//
// Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
//
// Credit: HTML5 Boilerplate
@mixin sr-only-focusable {