Added new features for VITRO home page:
-Filtered search based in class groups (It needs to be wired. Just added HTML/CSS/JS) -Class group stats (It needs to be wired. Just added HTML/CSS/JS) -Improveed UX for signing when there is external authorization Removed search box located in header in homepage.
This commit is contained in:
parent
3997440944
commit
c19df41bfd
9 changed files with 411 additions and 37 deletions
|
@ -59,11 +59,21 @@ p.request-account {
|
|||
font-size: .8em;
|
||||
}
|
||||
h3.internal-auth {
|
||||
margin-left: 38px;
|
||||
color: #5F6464;
|
||||
margin-left: 20px;
|
||||
font-size: 1em;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
text-decoration: none;
|
||||
cursor: hand;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
.vivoAccount {
|
||||
display: none;
|
||||
}
|
||||
#vivoAccountError {
|
||||
display: block;
|
||||
}
|
||||
.formFieldAlert {
|
||||
border: 2px solid #900;
|
||||
|
|
|
@ -10,5 +10,10 @@ $(document).ready(function(){
|
|||
|
||||
// fade in error alerts
|
||||
$('section#error-alert').css('display', 'none').fadeIn(1500);
|
||||
|
||||
|
||||
// toggle vivo account authentication form
|
||||
$('h3.internal-auth').click(function() {
|
||||
$('.vivoAccount').toggle();
|
||||
});
|
||||
|
||||
});
|
|
@ -9,4 +9,127 @@ $(document).ready(function(){
|
|||
|
||||
// fade in flash-message when user logs out
|
||||
jQuery('section#flash-message').css('display', 'none').fadeIn(1500);
|
||||
|
||||
|
||||
/////////////////////////////
|
||||
// Home search fiter
|
||||
// Toggle filter select list
|
||||
|
||||
var $searchFilterList = $('#filter-search-nav');
|
||||
var $selectedFilter;
|
||||
var $queryToSend;
|
||||
var $queryToSendAll = true;
|
||||
var $isFilterOpen = false;
|
||||
|
||||
console.log("Filter is open = " + $isFilterOpen);
|
||||
|
||||
$('a.filter-search').click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (!$isFilterOpen) {
|
||||
|
||||
console.log("Filer is close = " + $isFilterOpen);
|
||||
|
||||
//Change button filter state to selected
|
||||
//$(this).css('background','url(../../themes/vivo-cornell/images/filteredSearchActive.gif) no-repeat right top');
|
||||
$(this).removeClass('filter-default');
|
||||
$(this).addClass('filter-active');
|
||||
|
||||
//Reveal filter select list
|
||||
$searchFilterList.css('display','block');
|
||||
|
||||
$isFilterOpen = true;
|
||||
|
||||
console.log("open");
|
||||
} else {
|
||||
//Change button filter state to default
|
||||
//$('a.filter-search').css('background','url(../../themes/vivo-cornell/images/filteredSearch.gif) no-repeat right top');
|
||||
$(this).removeClass('filter-active');
|
||||
$(this).addClass('filter-default');
|
||||
|
||||
//Hide filter select list
|
||||
$searchFilterList.css('display','none');
|
||||
|
||||
$isFilterOpen = false;
|
||||
|
||||
console.log("close");
|
||||
}
|
||||
});
|
||||
|
||||
// Collect users' selection
|
||||
|
||||
$('#filter-search-nav li').each(function(index){
|
||||
$(this).click(function(ev){
|
||||
ev.preventDefault();
|
||||
|
||||
if ($(this).text() == 'All') {
|
||||
$queryToSendAll = true;
|
||||
//Selected filter feedback
|
||||
$('.search-filter-selected').text('');
|
||||
console.log("ALL");
|
||||
} else {
|
||||
|
||||
//Selected filter feedback
|
||||
$('.search-filter-selected').text($(this).text()).fadeIn('slow');
|
||||
$queryToSendAll = false;
|
||||
}
|
||||
|
||||
//Hide filter select list
|
||||
$searchFilterList.css('display','none');
|
||||
|
||||
//Change button filter state to default
|
||||
//$('a.filter-search').css('background','url(../../themes/vivo-cornell/images/filteredSearch.gif) no-repeat right top');
|
||||
$('a.filter-search').removeClass('filter-active');
|
||||
$('a.filter-search').addClass('filter-default');
|
||||
|
||||
|
||||
$selectedFilter = $(this).text();
|
||||
$isFilterOpen = false;
|
||||
console.log("$queryToSend " + $selectedFilter);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//When focus, hide filter select list and change filter button state to default
|
||||
$('input.search-homepage').focus(function(){
|
||||
|
||||
$('input.search-homepage').css({
|
||||
'background' : 'none',
|
||||
'opacity' : 1
|
||||
});
|
||||
|
||||
if (!$isFilterOpen) {
|
||||
|
||||
$isFilterOpen = false;
|
||||
|
||||
}else {
|
||||
|
||||
//Hide filter select list
|
||||
$('#filter-search-nav').hide();
|
||||
|
||||
//Change button filter state to default
|
||||
//$('a.filter-search').css('background','url(../../themes/vivo-cornell/images/filteredSearch.gif) no-repeat right top');
|
||||
$('a.filter-search').removeClass('filter-active');
|
||||
$('a.filter-search').addClass('filter-default');
|
||||
|
||||
$isFilterOpen = false;
|
||||
|
||||
}
|
||||
|
||||
console.log("HIDE input value ") ;
|
||||
});
|
||||
|
||||
$('#search-homepage').submit(function(){
|
||||
|
||||
if ($queryToSendAll) {
|
||||
$filterType = '';
|
||||
}else {
|
||||
$filterType = '&classgroup=http://vivoweb.org/ontology/vitroClassGroup' + $selectedFilter;
|
||||
}
|
||||
|
||||
$queryToSend = 'querytext=' + $('input.search-homepage').val() + $filterType;
|
||||
console.log("Query to send: " + $queryToSend);
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -15,6 +15,9 @@
|
|||
</#macro>
|
||||
|
||||
<#macro loginForm>
|
||||
<#assign infoClassHide = ''/>
|
||||
<#assign infoClassShow = ''/>
|
||||
|
||||
<#-- Don't display the JavaScript required to edit message on the home page even if JavaScript is unavailable -->
|
||||
<#if currentServlet != 'home'>
|
||||
<noscript>
|
||||
|
@ -33,6 +36,8 @@
|
|||
</#if>
|
||||
|
||||
<#if errorMessage??>
|
||||
<#assign infoClassShow = ' id="vivoAccountError"'/>
|
||||
|
||||
<section id="error-alert" role="alert"><img src="${urls.images}/iconAlert.png" alert="Error alert icon" />
|
||||
<p class="login-alert">${errorMessage}</p>
|
||||
</section>
|
||||
|
@ -40,25 +45,32 @@
|
|||
|
||||
<form role="form" id="login-form" action="${formAction}" method="post" name="login-form" />
|
||||
<#if externalAuthUrl??>
|
||||
<p class="external-auth"><a class="blue button" href="${externalAuthUrl}" title="external authentication name">${externalAuthName}</a></p>
|
||||
<p class="or-auth">or</p>
|
||||
|
||||
<h3 class="internal-auth" >Log in using your ${siteName} account</h3>
|
||||
</#if>
|
||||
|
||||
<label for="loginName">Email</label>
|
||||
<input id="loginName" name="loginName" class="text-field focus" type="text" value="${loginName!}" autocapitalize="off" required autofocus />
|
||||
|
||||
<label for="loginPassword">Password</label>
|
||||
<input id="loginPassword" name="loginPassword" class="text-field" type="password" required />
|
||||
<#assign infoClassHide = 'class="vivoAccount"'/>
|
||||
|
||||
<p class="submit"><input name="loginForm" class="green button" type="submit" value="Log in"/></p>
|
||||
<#-- NC: remember me won't be ready for r1.2
|
||||
<input class="checkbox-remember-me" name="remember-me" type="checkbox" value="" />
|
||||
<label class="label-remember-me" for="remember-me">Remember me</label> -->
|
||||
<#-- mb863: forgot password and request an account won't be part of VIVO r1.2
|
||||
<p class="forgot-password"><a href="#" title="forgot password">Forgot your password?</a></p>
|
||||
<p class="request-account"><a class="blue button" href="#" title="request an account">Request an account</a> </p> -->
|
||||
<p class="external-auth"><a class="blue button" href="${externalAuthUrl}" title="external authentication name">${externalAuthName}</a></p>
|
||||
<!--<p class="or-auth">or</p>-->
|
||||
<h3 class="internal-auth"><!--Log in using your--> <b>or</b> ${siteName} account</h3>
|
||||
|
||||
</#if>
|
||||
|
||||
<div ${infoClassHide} ${infoClassShow}>
|
||||
|
||||
<label for="loginName">Email</label>
|
||||
<input id="loginName" name="loginName" class="text-field focus" type="text" value="${loginName!}" autocapitalize="off" required autofocus />
|
||||
|
||||
<label for="loginPassword">Password</label>
|
||||
<input id="loginPassword" name="loginPassword" class="text-field" type="password" required />
|
||||
|
||||
<p class="submit"><input name="loginForm" class="green button" type="submit" value="Log in"/></p>
|
||||
|
||||
<#-- NC: remember me won't be ready for r1.2
|
||||
<input class="checkbox-remember-me" name="remember-me" type="checkbox" value="" />
|
||||
<label class="label-remember-me" for="remember-me">Remember me</label> -->
|
||||
<#-- mb863: forgot password and request an account won't be part of VIVO r1.2
|
||||
<p class="forgot-password"><a href="#" title="forgot password">Forgot your password?</a></p>
|
||||
<p class="request-account"><a class="blue button" href="#" title="request an account">Request an account</a> </p> -->
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</section><!-- #log-in -->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue