Skip to content
Snippets Groups Projects
Commit b4070a06 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Updated UI on consent module...

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1027 44740490-163a-0410-bde0-09ae8108e29a
parent ad6d632c
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,40 @@ if (array_key_exists('descr_purpose', $this->data['dstMetadata'])) {
$attributes = $this->data['attributes'];
$this->data['header'] = 'Consent'; /* TODO: translation */
$this->data['header'] = $this->t('{consent:consent_header}');
$this->data['head'] = '<link rel="stylesheet" type="text/css" href="/' . $this->data['baseurlpath'] . 'module.php/consent/style.css" />' . "\n";
$this->data['head'] .= '<script type="text/javascript" src="/' . $this->data['baseurlpath'] . 'resources/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("table[id=table_with_attributes]").hide();
$("legend[@id=attribute_switch]").
click(function(event){
$("table[id=table_with_attributes]").toggle();
$("div[@id=addattributes]").toggle();
});
$("a[@id=addattributesb]").
click(function(event){
event.preventDefault();
$("table[id=table_with_attributes]").show();
$("div[@id=addattributes]").hide("fast");
});
});
</script>
';
$this->includeAtTemplateBase('includes/header.php');
......@@ -103,12 +136,16 @@ foreach ($this->data['noData'] as $name => $value) {
}
?>
<input type="submit" id="nobutton" value="<?php echo htmlspecialchars($this->t('{consent:no}')) ?>" />
</form>
<p>
<table class="attributes">
<fieldset>
<legend id="attribute_switch"> » <?php echo $this->t('{consent:consent_attributes_header}'); ?></legend>
<div id="addattributes"><a id="addattributesb"><?php echo $this->t('{consent:show_attributes}'); ?></a></div>
<table id="table_with_attributes" class="attributes">
<?php
$alternate = array('odd', 'even'); $i = 0;
foreach ($attributes as $name => $value) {
$nameTag = '{attributes:attribute_' . strtolower($name) . '}';
if ($this->getTag($nameTag) !== NULL) {
......@@ -116,19 +153,21 @@ foreach ($attributes as $name => $value) {
}
if (sizeof($value) > 1) {
echo '<tr><td>' . htmlspecialchars($name) . '</td><td><ul>';
echo '<tr class="' . $alternate[($i++ % 2)] . '"><td class="attrname">' . htmlspecialchars($name) . '</td><td class="attrvalue"><ul>';
foreach ($value AS $v) {
echo '<li>' . htmlspecialchars($v) . '</li>';
}
echo '</ul></td></tr>';
} else {
echo '<tr><td>' . htmlspecialchars($name) . '</td><td>' . htmlspecialchars($value[0]) . '</td></tr>';
echo '<tr class="' . $alternate[($i++ % 2)] . '"><td class="attrname">' . htmlspecialchars($name) . '</td><td class="attrvalue">' . htmlspecialchars($value[0]) . '</td></tr>';
}
}
?>
</table>
</p>
</fieldset>
</form>
<?php
......
fieldset {
margin: 2em 1em 1em 1em;
border: 1px solid #bbb;
padding: 0px;
}
fieldset div#addattributes {
text-align: right;
margin: 0px .5em .5em 1em;
}
fieldset div#addattributes a {
text-decoration: none;
color: #888;
font-weight: normal;
border-bottom: 1px dotted #bbb;
}
fieldset div#addattributes a:hover,fieldset div.addattributes a:link {
border-bottom: 1px solid #bbb;
}
fieldset legend {
margin-left: 2em;
padding: 3px 2em 3px 2em;
border: 1px solid #bbb;
cursor: pointer; cursor: hand;
}
fieldset legend:hover {
background: #eee;
}
table.attributes {
width: 100%;
margin: 0px 0px 1em 0px;
border: 0px;
border-collapse: collapse;
}
table.attributes td.attrname {
text-align: right;
}
table.attributes tr.even td {
background: #eee;
}
table.attributes tr td {
border-bottom: 1px solid #bbb;
border-left: 0px;
border-right: 0px;
padding-top: 5px;
padding-left: 1em;
padding-right: 1em;
vertical-align: top;
}
......@@ -266,13 +266,6 @@ div.preferredidp {
table.attributes tr td {
border-bottom: 1px dashed #ccc;
padding-top: 5px;
padding-left: 1em;
padding-right: 1em;
vertical-align: top;
}
div.allcompleted#interrupt {
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment