NIHVIVO-3213: Added alert when user doesn't select a proxy or a profile

This commit is contained in:
manolobevia 2011-11-08 20:42:37 +00:00
parent fad4fd6c11
commit 717fb46864
3 changed files with 40 additions and 41 deletions

View file

@ -321,13 +321,8 @@ a.disable-delete {
#edit-myProxy span.class-label { #edit-myProxy span.class-label {
color: #7F8993; color: #7F8993;
} }
/* MANAGE PROXY ------> */
/* MANAGE PROXY ------> */
/* MANAGE PROXY ------> */
/* MANAGE PROXY ------> */
/* MANAGE PROXY ------> */
/* MANAGE PROXY ------> */
.proxy-profile { .proxy-profile {
width: 930px; width: 930px;
/*background-color: #eaeae8;*/ /*background-color: #eaeae8;*/
@ -339,8 +334,7 @@ a.disable-delete {
margin-bottom: 20px; margin-bottom: 20px;
} }
.list-proxy-profile {
.bg-proxy-profile {
/*background-color: #F7F7F4;*/ /*background-color: #F7F7F4;*/
background-color: #F7F7F4; background-color: #F7F7F4;
border-bottom: 1px dotted #e2e2dd; border-bottom: 1px dotted #e2e2dd;
@ -348,16 +342,14 @@ a.disable-delete {
border-radius: 0; border-radius: 0;
-moz-border-radius: 0; -moz-border-radius: 0;
-webkit-border-radius: 0; -webkit-border-radius: 0;
padding-top: 1.3em;
} }
.proxy-profile legend { .proxy-profile legend {
display: block; display: block;
border: 0; border: 0;
padding-left: 20px; padding-left: 20px;
color: #064D68; color: #064D68;
} }
.proxy { .proxy {
width: 430px; width: 430px;
float: left; float: left;
@ -383,25 +375,18 @@ a.disable-delete {
margin-bottom: 1em; margin-bottom: 1em;
background-color: #317e95; background-color: #317e95;
} }
.proxy-profile .acSelector { .proxy-profile .acSelector {
margin-top: 10px; margin-top: 10px;
margin-left: 20px; margin-left: 20px;
} }
#search-proxy { #search-proxy {
border-top: 1px solid #E1E5E7; border-top: 1px solid #E1E5E7;
border-bottom: 1px solid #E1E5E7; border-bottom: 1px solid #E1E5E7;
padding: 10px; padding: 10px;
} }
#search-proxy h4 { #search-proxy h4 {
margin-bottom: 0; margin-bottom: 0;
} }
.proxy-profile .proxyInfoElement { .proxy-profile .proxyInfoElement {
margin-left: 20px; margin-left: 20px;
} }
@ -433,12 +418,3 @@ p.search-status {
margin-left: 20px; margin-left: 20px;
margin-top: 20px; margin-top: 20px;
} }

View file

@ -1,7 +1,22 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */ /* $This file is distributed under the terms of the license in /doc/license.txt$ */
$(document).ready(function(){ $(document).ready(function(){
//Remove initial value of input text 'Select an existing last name'
$('input[name="proxySelectorAC"]').click(function(){ $('input[name="proxySelectorAC"]').click(function(){
$(this).val(''); $(this).val('');
}) });
//Alert when user doesn't select an editor and a profile
$('input[name="createRelationship"]').click(function(){
var $proxyUri = $('#add-relation input[name="proxyUri"]').val();
var $profileUri = $('#add-relation input[name="profileUri"]').val();
if ($proxyUri == undefined || $profileUri == undefined){
$('#error-alert').removeClass('hidden');
$('#error-alert p').append("<strong>You must select a minimum of 1 editor and profile.</strong>");
return false;
}
});
}); });

View file

@ -8,7 +8,7 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/cust
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/autocomplete.css" />')} ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/autocomplete.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')} ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')}
<h3>Manage proxy self editors & profiles</h3> <h3>Manage profile editing</h3>
<#if message??> <#if message??>
<section class="account-feedback" role="region"> <section class="account-feedback" role="region">
@ -22,13 +22,18 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/sm
</section> </section>
</#if> </#if>
<h4 class="grey">Relate proxy self editors and profiles</h4> <section id="error-alert" role="alert" class="hidden">
<img src="${urls.images}/iconAlert.png" width="24" height="24" alert="Error alert icon" />
<p></p>
</section>
<h4 class="grey">Relate profile editors and profiles<a href="" title="The editors you select on the left hand side will have the ability to edit the VIVO profiles you select on the right hand side. You can select multiple editors and multiple profiles, but you must select a minimum of 1 each.">i</a></h4>
<section class="proxy-profile"> <section class="proxy-profile">
<form action="${formUrls.create}" method="POST"> <form id="add-relation" action="${formUrls.create}" method="POST">
<fieldset class="proxy"> <fieldset class="proxy">
<legend>Select proxies</legend> <legend>Select editors</legend>
<div name="proxyProxiesPanel"> <div name="proxyProxiesPanel">
<input type="text" name="proxySelectorAC" class="acSelector" size="35" value="Select an existing last name" role="input" /> <input type="text" name="proxySelectorAC" class="acSelector" size="35" value="Select an existing last name" role="input" />
@ -82,7 +87,7 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/sm
<table> <table>
<tr> <tr>
<td> <td>
<img class="photo-profile" width="90" alt="%label%" src="%imageUrl%"> <img class="photo-profile" width="60" alt="%label%" src="%imageUrl%">
</td> </td>
<td class="proxy-info"> <td class="proxy-info">
%label% | <span class="class-label">%classLabel%</span> %label% | <span class="class-label">%classLabel%</span>
@ -102,9 +107,11 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/sm
</form> </form>
</section> </section>
<h4>Profile editors</h4>
<section id="search-proxy" role="region"> <section id="search-proxy" role="region">
<form action="${formUrls.list}" method="POST"> <form action="${formUrls.list}" method="POST">
<h4>Proxy self editors</h4>
<input type="text" name="searchTerm" role="input" /> <input type="text" name="searchTerm" role="input" />
<input class="submit" type="submit" name="searchBytProxy" value="Search" role="button" /> | <input class="submit" type="submit" name="searchBytProxy" value="Search" role="button" /> |
@ -122,14 +129,15 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/sm
<#list relationships as r> <#list relationships as r>
<section class="proxy-profile bg-proxy-profile"> <section class="proxy-profile list-proxy-profile">
<form action="${formUrls.edit}" method="POST">
<form class="edit-proxy-profiles" action="${formUrls.edit}" method="POST">
<fieldset class="proxy"> <fieldset class="proxy">
<#assign p = r.proxyInfos[0]> <#assign p = r.proxyInfos[0]>
<table class="proxy-item"> <table class="proxy-item">
<tr> <tr>
<td> <td>
<img class="photo-profile" width="120" src="${p.imageUrl}" alt="${p.label}"> <img class="photo-profile" width="90" src="${p.imageUrl}" alt="${p.label}">
</td> </td>
<td class="proxyInfoElement proxy-info"> <td class="proxyInfoElement proxy-info">
${p.label} | <span class="class-label">${p.classLabel}</span> ${p.label} | <span class="class-label">${p.classLabel}</span>
@ -138,7 +146,7 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/sm
</td> </td>
</tr> </tr>
</table> </table>
<#--><a href="${formUrls.edit}?deleteProxy=Delete%20proxy">Delete proxy</a>-->
<input class="submit" type="submit" name="deleteProxy" value="Delete proxy" /> <input class="submit" type="submit" name="deleteProxy" value="Delete proxy" />
</fieldset> </fieldset>
@ -176,7 +184,7 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/sm
<table> <table>
<tr> <tr>
<td> <td>
<img class="photo-profile" width="90" alt="%label%" src="%imageUrl%"> <img class="photo-profile" width="60" alt="%label%" src="%imageUrl%">
</td> </td>
<td class="proxy-info"> <td class="proxy-info">
%label% | <span class="class-label">%classLabel%</span> %label% | <span class="class-label">%classLabel%</span>