Skip to content

Commit 52b63b3

Browse files
committed
Merge branch 'release-2.0.0'
2 parents 783b2b5 + 7b75792 commit 52b63b3

22 files changed

Lines changed: 209 additions & 96 deletions

README.md

Lines changed: 83 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,79 @@
1-
# simplesamlphp-module-themevanilla
1+
<h1 align="center">Vanilla theme for SimpleSAMLphp</h1>
2+
3+
![discopower](/screenshots/disco_buttons_bottom.png)
24

35
A customisable theme for SimpleSAMLphp based on Bootstrap.
6+
See more screens in the directory [screenshots](screenshots/).
7+
48

59
## Installation
610

711
You can install the theme using any of the methods below.
812

913
### Composer
1014

11-
Add the following lines in the `composer.json` file that is located in your
12-
SimpleSAMLphp installation:
13-
1415
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+
you need to edit `composer.json`. The file is located in your SimpleSAMLphp
1617
installation. Check the following example, that includes all the necessary
17-
additions for the installation of the **simplesamlphp-module-themevanilla v1.0.0**.
18+
additions for the installation of the **simplesamlphp-module-themevanilla
19+
v1.0.0**.
1820

1921
```
2022
"require": {
2123
22-
...
24+
...
2325
24-
"rciam/simplesamlphp-module-themevanilla": "1.0.0",
25-
"rciam/css": "1.0.0",
26-
"rciam/js": "1.0.0"
26+
"rciam/simplesamlphp-module-themevanilla": "1.0.0",
27+
"rciam/css": "1.0.0",
28+
"rciam/js": "1.0.0"
2729
},
2830
"repositories": [
2931
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-
}
32+
...
33+
34+
{
35+
"type": "vcs",
36+
"url": "https://github.com/rciam/simplesamlphp-module-themevanilla"
37+
},
38+
{
39+
"type": "package",
40+
"package": {
41+
"name": "rciam/css",
42+
"version": "1.0.0",
43+
"dist": {
44+
"type": "zip",
45+
"url": "https://github.com/rciam/simplesamlphp-module-themevanilla/releases/download/v1.0.0/css.zip"
4646
}
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-
}
47+
}
48+
},
49+
{
50+
"type": "package",
51+
"package": {
52+
"name": "rciam/js",
53+
"version": "1.0.0",
54+
"dist": {
55+
"type": "zip",
56+
"url": "https://github.com/rciam/simplesamlphp-module-themevanilla/releases/download/v1.0.0/js.zip"
5757
}
5858
}
59-
],
60-
"scripts": {
59+
}
60+
],
61+
"scripts": {
6162
62-
...
63+
...
6364
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-
},
65+
"post-update-cmd": [
66+
"cp -r 'vendor/rciam/css' 'modules/themevanilla/www/resources'",
67+
"cp -r 'vendor/rciam/js' 'modules/themevanilla/www/resources'"
68+
]
69+
},
6970
```
7071

7172
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
73+
* It will put the module `themevanilla` in the `modules` directory.
74+
* It will download and extract the compressed `css` and `js` directories that
7475
include the minified css and javascript files.
75-
- It will copy the `css` and `js` directories from the `vendor/rciam` directory
76+
* It will copy the `css` and `js` directories from the `vendor/rciam` directory
7677
in the `themevanilla/www/resources` directory, where the static files of the
7778
theme should be placed.
7879

@@ -107,13 +108,27 @@ In order to use this module as theme you need to set in the
107108

108109
### Using IdP login buttons with icons
109110

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.
111+
The theme splits the discopower IdP discovery page into 2 sections, depending on
112+
the tags of the included IdPs:
113+
* The section that its IdPs have the tag `idps_in_searchable_list` contains all
114+
the IdPs in a list of links with a search box.
115+
* The section that its IdPs have the tag `idps_with_logos` contains login
116+
buttons with specified style rules for each IdP. Each button may have a logo
117+
icon, too.
118+
119+
Also, you need to define the order of the 2 sections. You can set this in the
120+
file `config/module_discopower.php` from the variable `taborder`.
121+
For example:
122+
```
123+
'taborder' => array(
124+
'idps_in_searchable_list',
125+
'idps_with_logos'
126+
)
127+
```
113128

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:
129+
Especially for the of the `idps_with_logos`, you need to specify the css class
130+
name, icon and label of the IdP login button using the `login_button`
131+
configuration as follows:
117132
```
118133
'tags' => array(
119134
'idps_with_logos',
@@ -124,8 +139,18 @@ button can then be specified using the `login_button` configuration as follows:
124139
'label' => 'ORCID',
125140
)
126141
```
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.
142+
To set style rules for the each button, the configured css_classname value must
143+
be defined in the `idps_buttons.scss` file. See more information bellow.
144+
145+
At the moment there are style rules for the IdPs:
146+
* B2ACCESS
147+
* DARIAH
148+
* Elixir
149+
* Facebook
150+
* Google
151+
* IGTF
152+
* LinkedIn
153+
* ORCID
129154

130155

131156
## Customization
@@ -151,9 +176,9 @@ If you want to make any changes in the footer you need to modify the template
151176
### CSS
152177

153178
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`
179+
* Install sass ([installation guide](http://sass-lang.com/install))
180+
* Go to the directory `themevanilla/www/resources`
181+
* Run the cli sass: `sass --update sass:css`
157182

158183
After these steps the css files will be in the directory
159184
`themevanilla/www/resources/css`
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
{
22
"friendly_title": {
3-
"en": "Missing data from"
3+
"en": "Sorry, we were not able to log you in"
44
},
55
"friendly_description": {
6-
"en": "Friendly description: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."
6+
"en": "<strong>What is the problem?</strong> %IDP% does not return a persistent identifier to help us uniquely identify you."
7+
},
8+
"resolution_description": {
9+
"en": "<strong>What can you do?</strong> At the moment, the only way to log in is to <a href=\"%RETRY_URL%\">use a different account</a>. For future use, you may ask your institution administrator to release the required information, by sending them a print screen of this error, or asking them to contact our support at <a href=\"mailto:support@example.org\">support@example.org</a>."
710
},
811
"details_title": {
912
"en": "Error details"
1013
},
1114
"details_description": {
12-
"en": "Details description: It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English."
13-
},
14-
"contact_title": {
15-
"en": "How to get help"
16-
},
17-
"contact_description": {
18-
"en": "Contact description: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard."
15+
"en": "Your identity provider needs to release any of the following user identifiers to help us uniquely identify you:"
1916
},
2017
"go2disco": {
21-
"en": "Choose another provider"
18+
"en": "Log in with a different account"
2219
}
2320
}
236 KB
Loading
109 KB
Loading

screenshots/consent_overall.png

210 KB
Loading
230 KB
Loading

screenshots/disco_buttons_top.png

237 KB
Loading

screenshots/disco_dropup_list.png

282 KB
Loading

screenshots/disco_modal.png

199 KB
Loading

themes/ssp/discopower/disco-tpl.php

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
$(document).ready(function() {';
3939
$i = 0;
4040
foreach ($this->data['idplist'] AS $tab => $slist) {
41-
if ($tab == 'all') {
41+
if ($tab == 'idps_in_searchable_list') {
4242
$this->data['head'] .= "\n" . '$("#query_' . $tab . '").liveUpdate("#list_' . $tab . '")' .
4343
(($i++ == 0) && (empty($faventry)) ? '.focus()' : '') . ';';
4444
}
@@ -84,7 +84,7 @@ function showEntry($t, $metadata, $favourite = FALSE, $withIcon = FALSE) {
8484
}
8585
else {
8686
$html = '<a class="metaentry " href="' . $basequerystring . urlencode($metadata['entityid']) . '">';
87-
$html .= htmlspecialchars($metadata['UIInfo']['DisplayName']['en']) . '';
87+
$html .= htmlspecialchars(getTranslatedName($t, $metadata)) . '';
8888

8989
if(array_key_exists('icon', $metadata) && $metadata['icon'] !== NULL) {
9090
$iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($metadata['icon']);
@@ -159,10 +159,12 @@ function getTranslatedName($t, $metadata) {
159159
');
160160
}
161161

162-
162+
$idps_in_searchable_list_index;
163+
$idps_with_logos_index;
163164
foreach( $this->data['idplist'] AS $tab => $slist) {
164165
if (!empty($slist)) {
165-
if($tab == 'all') {
166+
if($tab == 'idps_in_searchable_list') {
167+
$idps_in_searchable_list_index = array_search($tab, array_keys($this->data['idplist']));
166168
$top = '<div class="row ssp-content-group js-spread">
167169
<div class="col-sm-12 js-spread">';
168170
$search_name = 'query_' . $tab;
@@ -173,7 +175,7 @@ function getTranslatedName($t, $metadata) {
173175
. $search_name . '" id="' . $search_name . '" />'
174176
. '</form>'
175177
. '</div>';
176-
$list_open = '<div class="metalist ssp-content-group__provider-list ssp-content-group__provider-list--all js-spread" id="list_' . $tab . '">';
178+
$list_open = '<div class="metalist ssp-content-group__provider-list ssp-content-group__provider-list--idps_in_searchable_list js-spread" id="list_' . $tab . '">';
177179
$list_items = '';
178180
$close = '</div></div></div>'; // /metalist /ssp-content-group /row
179181

@@ -190,12 +192,13 @@ function getTranslatedName($t, $metadata) {
190192
echo($top . $search . $list_open . $list_items . $close);
191193
}
192194
else if($tab == "idps_with_logos") {
193-
$top = '<div class="row ssp-content-group">
194-
<div class="col-sm-12">';
195-
$or = '<div class="text-center ssp-line-or-line"><span class="ssp-line-or-line__or">' . $this->t('{themevanilla:discopower:or}') . '</span></div>';
196-
$list_open = '<div class="metalist ssp-content-group__provider-list ssp-content-group__provider-list--other">';
195+
$idps_with_logos_index = array_search($tab, array_keys($this->data['idplist']));
196+
$top = '<div class="row ssp-content-group"><div class="col-sm-12">
197+
';
198+
$list_open = '<div class="metalist ssp-content-group__provider-list ssp-content-group__provider-list--other js-idps">';
197199
$list_items = '';
198-
$close = '</div></div></div>'; // /metalist /ssp-content-group /row
200+
$close_list = '</div>'; // /metalist
201+
$close = '</div></div>'; // /ssp-content-group /col-sm-12
199202
if (!empty($this->data['preferredidp']) && array_key_exists($this->data['preferredidp'], $slist)) {
200203
$idpentry = $slist[$this->data['preferredidp']];
201204
$list_items .= (showEntry($this, $idpentry, TRUE, TRUE));
@@ -206,7 +209,14 @@ function getTranslatedName($t, $metadata) {
206209
$list_items .= (showEntry($this, $idpentry, FALSE, TRUE));
207210
}
208211
}
209-
echo $top . $or . $list_open . $list_items . $close;
212+
if($idps_in_searchable_list_index < $idps_with_logos_index) {
213+
$or = '<div class="text-center ssp-line-or-line ssp-line-or-line--top"><span class="ssp-line-or-line__or">' . $this->t('{themevanilla:discopower:or}') . '</span></div>';
214+
echo $top . $or . $list_open . $list_items . $close_list . $close;
215+
}
216+
else {
217+
$or = '<div class="text-center ssp-line-or-line ssp-line-or-line--bottom"><span class="ssp-line-or-line__or">' . $this->t('{themevanilla:discopower:or}') . '</span></div>';
218+
echo $top . $list_open . $list_items . $close_list . $or . $close;
219+
}
210220
}
211221
}
212222
}

0 commit comments

Comments
 (0)