|
1 | 1 | # simplesamlphp-module-themevanilla |
2 | 2 |
|
3 | | -A customizable theme for SimpleSAMLphp. |
| 3 | +A customisable theme for SimpleSAMLphp based on Bootstrap. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +You can install the theme using any of the methods below. |
| 8 | + |
| 9 | +### Composer |
| 10 | + |
| 11 | +Add the following lines in the `composer.json` file that is located in your |
| 12 | +SimpleSAMLphp installation: |
| 13 | + |
| 14 | +If you want to use [composer](https://getcomposer.org/) to install this theme |
| 15 | +you need to edit `composer.json` file that is located in your SimpleSAMLphp |
| 16 | +installation. Check the following example, that includes all the necessary |
| 17 | +additions for the installation of the **simplesamlphp-module-themevanilla v1.0.0**. |
| 18 | + |
| 19 | +``` |
| 20 | +"require": { |
| 21 | +
|
| 22 | + ... |
| 23 | +
|
| 24 | + "rciam/simplesamlphp-module-themevanilla": "1.0.0", |
| 25 | + "rciam/css": "1.0.0", |
| 26 | + "rciam/js": "1.0.0" |
| 27 | +}, |
| 28 | +"repositories": [ |
| 29 | +
|
| 30 | + ... |
| 31 | +
|
| 32 | + { |
| 33 | + "type": "vcs", |
| 34 | + "url": "https://github.com/rciam/simplesamlphp-module-themevanilla" |
| 35 | + }, |
| 36 | + { |
| 37 | + "type": "package", |
| 38 | + "package": { |
| 39 | + "name": "rciam/css", |
| 40 | + "version": "1.0.0", |
| 41 | + :w |
| 42 | + "dist": { |
| 43 | + "type": "zip", |
| 44 | + "url": "https://github.com/rciam/simplesamlphp-module-themevanilla/releases/download/v1.0.0/css.zip" |
| 45 | + } |
| 46 | + } |
| 47 | + }, |
| 48 | + { |
| 49 | + "type": "package", |
| 50 | + "package": { |
| 51 | + "name": "rciam/js", |
| 52 | + "version": "1.0.0", |
| 53 | + "dist": { |
| 54 | + "type": "zip", |
| 55 | + "url": "https://github.com/rciam/simplesamlphp-module-themevanilla/releases/download/v1.0.0/js.zip" |
| 56 | + } |
| 57 | + } |
| 58 | + } |
| 59 | + ], |
| 60 | + "scripts": { |
| 61 | +
|
| 62 | + ... |
| 63 | +
|
| 64 | + "post-update-cmd": [ |
| 65 | + "cp -r 'vendor/rciam/css' 'modules/themevanilla/www/resources'", |
| 66 | + "cp -r 'vendor/rciam/js' 'modules/themevanilla/www/resources'" |
| 67 | + ] |
| 68 | + }, |
| 69 | +``` |
| 70 | + |
| 71 | +With the above configuration composer will do several operations: |
| 72 | +- It will put the module `themevanilla` in the `modules` directory. |
| 73 | +- It will download and extract the compressed `css` and `js` directories that |
| 74 | + include the minified css and javascript files. |
| 75 | +- It will copy the `css` and `js` directories from the `vendor/rciam` directory |
| 76 | + in the `themevanilla/www/resources` directory, where the static files of the |
| 77 | + theme should be placed. |
| 78 | + |
| 79 | +### Direct download |
| 80 | + |
| 81 | +You can download `themevanilla.zip` from the [release page](https://github.com/rciam/simplesamlphp-module-themevanilla/releases). |
| 82 | +Download the zip file of the preferred release and extract its contents in the |
| 83 | +`modules` directory of your SimpleSAMLphp installation. |
| 84 | + |
| 85 | +### Clone repository |
| 86 | + |
| 87 | +Clone this repository into the `modules` directory of your SimpleSAMLphp |
| 88 | +installation as follows: |
| 89 | +``` |
| 90 | +cd /path/to/simplesamlphp/modules |
| 91 | +git clone https://github.com/rciam/simplesamlphp-module-themevanilla.git themevanilla |
| 92 | +``` |
| 93 | +Note that the cloned repository will not include the css files or minified |
| 94 | +javascript files. |
| 95 | +You'll need to download or produce them. You can download the compressed |
| 96 | +directories (`js.zip` and `css.zip`) from the [release page](https://github.com/rciam/simplesamlphp-module-themevanilla/releases) and |
| 97 | +extract them under `modules/themevanilla/www/resources`. If you want to produce |
| 98 | +them, you may read the customisation instructions below. |
| 99 | + |
| 100 | + |
| 101 | +## Configuration |
| 102 | + |
| 103 | +### Basic usage |
| 104 | + |
| 105 | +In order to use this module as theme you need to set in the |
| 106 | +`config/config.php`: `'theme.use' => 'themevanilla:ssp'` |
| 107 | + |
| 108 | +### Using IdP login buttons with icons |
| 109 | + |
| 110 | +The theme splits the discopower IdP discovery page into 2 sections. |
| 111 | +The first section contains all IdPs in a simple list of links, while the second |
| 112 | +one contains login buttons for a selected subset of the IdPs. |
| 113 | + |
| 114 | +If you want to include an IdP in the second section, you need to attach the |
| 115 | +`idps_with_logos` tag to that IdP. The css class name, icon and label of the IdP login |
| 116 | +button can then be specified using the `login_button` configuration as follows: |
| 117 | +``` |
| 118 | +'tags' => array( |
| 119 | + 'idps_with_logos', |
| 120 | +), |
| 121 | +'login_button' => array( |
| 122 | + 'css_classname' => 'orcid', |
| 123 | + 'icon_filename' => 'orcid.svg', |
| 124 | + 'label' => 'ORCID', |
| 125 | +) |
| 126 | +``` |
| 127 | +To set style rules for the button, the configured css_classname value must be |
| 128 | +defined in the `idps_buttons.scss` file. See more information bellow. |
| 129 | + |
| 130 | + |
| 131 | +## Customization |
| 132 | + |
| 133 | +### Wording |
| 134 | + |
| 135 | +You can find definitions and dictionaries in the `dictionaries` directory. |
| 136 | + |
| 137 | +### Images |
| 138 | + |
| 139 | +Place your logo and favicon in the directory: |
| 140 | +`themevanilla/www/resources/images` If you name them `logo.png` and |
| 141 | +`favicon.ico` they will be loaded without any other modification. If you name |
| 142 | +them differently you need to modify the template `header.php` that is placed in: |
| 143 | +`themevanilla/themes/ssp/default/includes/`. |
| 144 | + |
| 145 | +By default, the logo has height 60px. See below how you can modify it. |
| 146 | + |
| 147 | +### Footer |
| 148 | +If you want to make any changes in the footer you need to modify the template |
| 149 | +`footer.php` that is placed in: `themevanilla/themes/ssp/default/includes/`. |
| 150 | + |
| 151 | +### CSS |
| 152 | + |
| 153 | +To produce the css files for this theme follow these steps: |
| 154 | +- Install sass ([installation guide](http://sass-lang.com/install)) |
| 155 | +- Go to the directory `themevanilla/www/resources` |
| 156 | +- Run the cli sass: `sass --update sass:css` |
| 157 | + |
| 158 | +After these steps the css files will be in the directory |
| 159 | +`themevanilla/www/resources/css` |
| 160 | + |
| 161 | +You can change the settings of this theme from the files: |
| 162 | +* `themevanilla/www/resources/sass/_settings.scss`: Here you will see the |
| 163 | + following variables: |
| 164 | + - $btn-action: background color of primary button |
| 165 | + - $btn-warning: background color of warning button |
| 166 | + - $footer-bg: footer background color |
| 167 | + - $footer-text: color of the text in the footer |
| 168 | + - $footer-link: color of the links in the footer |
| 169 | + - $btn-footer-text: text color of button that is in the footer |
| 170 | + - $btn-footer-border: border color of button that is in the footer |
| 171 | + |
| 172 | +* `themevanilla/www/resources/sass/_colors.scss`: Here you can add or change |
| 173 | + color settings. |
| 174 | + |
| 175 | +* `themevanilla/www/resources/sass/_idps_buttons.scss`: Here you can add or |
| 176 | + modify settings that are related with the buttons of the selected subset of |
| 177 | + IdPs. |
| 178 | + |
| 179 | +After you change any of these files you need to produce the css file that the |
| 180 | +browser will serve. You can do that by running: `sass --update sass:css`, as |
| 181 | +mentioned above. |
| 182 | + |
| 183 | +Please, check the help page of the cli tool sass if you want to use more |
| 184 | +compiling options. |
| 185 | + |
| 186 | + |
| 187 | +## About SimpleSAMLphp themes |
| 188 | + |
| 189 | +You can read more about themes in a SimpleSAMLphp installation from the |
| 190 | +[official documentation](https://simplesamlphp.org/docs/stable/simplesamlphp-theming). |
| 191 | + |
| 192 | + |
| 193 | +## License |
| 194 | + |
| 195 | +Licensed under the Apache 2.0 license, for details see `LICENSE`. |
0 commit comments