-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* HSD8-251 Custom login block * added context * use text_format for the preface and remove postface * added unit test * cc fix * cc fix
- Loading branch information
Showing
12 changed files
with
7,867 additions
and
0 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
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,174 @@ | ||
/** | ||
* @file | ||
*/ | ||
module.exports = function(grunt) { | ||
|
||
// This is where we configure each task that we'd like to run. | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
watch: { | ||
// This is where we set up all the tasks we'd like grunt to watch for changes. | ||
scripts: { | ||
files: ['js/source/**/*.js'], | ||
tasks: ['uglify', 'drush:ccall'], | ||
options: { | ||
spawn: false, | ||
}, | ||
}, | ||
images: { | ||
files: ['images/source/*.{png,jpg,gif}'], | ||
tasks: ['imagemin'], | ||
options: { | ||
spawn: false, | ||
} | ||
}, | ||
vector: { | ||
files: ['images/source/**/*.svg'], | ||
tasks: ['svgmin'], | ||
options: { | ||
spawn: false, | ||
} | ||
}, | ||
css: { | ||
files: ['scss/**/*.scss', 'scss/**/**/*.scss', 'patterns/**/**/scss/*.scss'], | ||
tasks: ['sass'], | ||
options: { | ||
interrupt: true | ||
} | ||
}, | ||
twig: { | ||
files: ['templates/**/*.html.twig'], | ||
tasks: ['uglify', 'svgmin', 'imagemin', 'sass', 'drush:ccall'] | ||
} | ||
}, | ||
uglify: { | ||
// This is for minifying all of our scripts. | ||
options: { | ||
sourceMap: true, | ||
mangle: false | ||
}, | ||
my_target: { | ||
files: [{ | ||
expand: true, | ||
cwd: 'js/source', | ||
src: '{,*/}*.js', | ||
dest: 'js/build' | ||
}] | ||
} | ||
}, | ||
imagemin: { | ||
// This will optimize all of our images for the web. | ||
dynamic: { | ||
files: [{ | ||
expand: true, | ||
cwd: 'img/source/', | ||
src: ['{,*/}*.{png,jpg,gif}'], | ||
dest: 'img/optimized/' | ||
}] | ||
} | ||
}, | ||
svgmin: { | ||
options: { | ||
plugins: [{ | ||
removeViewBox: false | ||
}, { | ||
removeUselessStrokeAndFill: false | ||
}] | ||
}, | ||
dist: { | ||
files: [{ | ||
expand: true, | ||
cwd: 'images/source/', | ||
src: ['{,*/}*.svg'], | ||
dest: 'images/optimized/' | ||
}] | ||
} | ||
}, | ||
sass: { | ||
// This will compile all of our sass files | ||
// Additional configuration options can be found at https://github.com/sindresorhus/grunt-sass | ||
options: { | ||
includePaths: [ | ||
"scss", | ||
"node_modules/bourbon/core", | ||
"node_modules/bourbon-neat/app/assets/stylesheets", | ||
"node_modules/neat-omega/core", | ||
"node_modules/decanter/scss", | ||
"node_modules", | ||
], | ||
sourceMap: false, | ||
// This controls the compiled css and can be changed to nested, compact or compressed. | ||
outputStyle: 'compressed', | ||
precision: 10 | ||
}, | ||
dist: { | ||
files: [{ | ||
expand: true, | ||
cwd: 'scss', | ||
src: ['**/[a-z]*.scss'], | ||
dest: 'css', | ||
ext: '.css', | ||
extDot: 'last', | ||
rename: function(dest, src) { | ||
return dest + '/' + src.replace('scss', 'css'); | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
drush: { | ||
ccall: { | ||
args: ['cache-rebuild', 'all'] | ||
} | ||
}, | ||
browserSync: { | ||
dev: { | ||
bsFiles: { | ||
src: [ | ||
'css/**/*.css', | ||
'templates/**/*.twig', | ||
'images/optimized/**/*.{png,jpg,gif,svg}', | ||
'js/build/**/*.js', | ||
'*.theme' | ||
] | ||
}, | ||
options: { | ||
watchTask: true, | ||
// reloadDelay: 1000, | ||
// reloadDebounce: 500, | ||
reloadOnRestart: true, | ||
logConnections: true, | ||
injectChanges: false // Depends on enabling the link_css module | ||
} | ||
} | ||
}, | ||
availabletasks: { | ||
tasks: { | ||
options: { | ||
filter: "include", | ||
tasks: [ | ||
'browserSync', 'imagemin', 'sass', 'svgmin', 'uglify', 'watch', 'devmode' | ||
] | ||
} | ||
} | ||
} | ||
}); | ||
|
||
// This is where we tell Grunt we plan to use this plug-in. | ||
grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
grunt.loadNpmTasks('grunt-contrib-imagemin'); | ||
grunt.loadNpmTasks('grunt-svgmin'); | ||
grunt.loadNpmTasks('grunt-sass'); | ||
grunt.loadNpmTasks('grunt-contrib-watch'); | ||
grunt.loadNpmTasks('grunt-browser-sync'); | ||
grunt.loadNpmTasks('grunt-available-tasks'); | ||
grunt.loadNpmTasks('grunt-drush'); | ||
|
||
// My tasks. | ||
grunt.registerTask('devmode', "Watch and BrowserSync all in one.", ['browserSync', 'watch']); | ||
|
||
// This is where we tell Grunt what to do when we type "grunt" into the terminal. | ||
// Note: if you'd like to run and of the tasks individually you can do so by typing 'grunt mytaskname' alternatively | ||
// you can type 'grunt watch' to automatically track your files for changes. | ||
grunt.registerTask('default', ['availabletasks']); | ||
}; |
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 @@ | ||
#drupal-off-canvas .cke_top{border-bottom:1px solid #d1d1d1}#drupal-off-canvas .cke_top,#drupal-off-canvas .cke_top *{background-color:#f8f8f8;color:#484848}#drupal-off-canvas .cke_button_icon{margin-right:5px} |
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,8 @@ | ||
name: 'H&S Blocks' | ||
type: module | ||
description: 'Custom blocks for Humsci' | ||
core: 8.x | ||
version: 8.x | ||
package: 'Humanities & Sciences' | ||
dependencies: | ||
- block |
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,5 @@ | ||
login.admin: | ||
version: VERSION | ||
css: | ||
base: | ||
css/hs_blocks.login.admin.css: {} |
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,36 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Contains hs_blocks.module. | ||
*/ | ||
|
||
use Drupal\Core\Routing\RouteMatchInterface; | ||
|
||
/** | ||
* Implements hook_help(). | ||
*/ | ||
function hs_blocks_help($route_name, RouteMatchInterface $route_match) { | ||
switch ($route_name) { | ||
// Main module help for the hs_blocks module. | ||
case 'help.page.hs_blocks': | ||
$output = ''; | ||
$output .= '<h3>' . t('About') . '</h3>'; | ||
$output .= '<p>' . t('Humsci Blocks') . '</p>'; | ||
return $output; | ||
|
||
default: | ||
} | ||
} | ||
|
||
/** | ||
* Implements hook_theme(). | ||
*/ | ||
function hs_blocks_theme($existing, $type, $theme, $path) { | ||
return [ | ||
'hs_blocks_login' => [ | ||
'template' => 'block--hs-login', | ||
'variables' => ['preface' => NULL, 'link' => NULL, 'postface' => NULL], | ||
], | ||
]; | ||
} |
Oops, something went wrong.