Skip to content

Commit

Permalink
Fixed: dropdown menu not working in homepage #2193
Browse files Browse the repository at this point in the history
  • Loading branch information
Thakur Adhikari committed Apr 15, 2021
1 parent 3bcd8f8 commit 6421fc0
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 50 deletions.
79 changes: 37 additions & 42 deletions grails-app/views/home/public.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -23,58 +23,53 @@
<asset:stylesheet src="homepage.css"/>
<asset:stylesheet src="common-bs4.css"/>
</head>
<body>
<div class="content container">
<div id="stats-holder">
<g:render template="/report/statistics"/>
</div>
<div class="row-fluid row">
<div id="latest-news" class="span6 col-sm-6">
<h4>Latest news</h4>
<g:render template="/shared/blog" />
<div class="content container">
<div id="stats-holder">
<g:render template="/report/statistics"/>
</div>
<div id="poi" class="span6 col-sm-6">
<g:render template="/shared/poi"/>
<div class="row">
<div id="latest-news" class="col-sm-6">
<h4>Latest news</h4>
<g:render template="/shared/blog" />
</div>
<div id="poi" class="col-sm-6">
<g:render template="/shared/poi"/>
</div>
</div>
<div id="help-links-container">
<fc:getSettingContent settingType="${au.org.ala.merit.SettingPageType.HELP_LINKS_TITLE}"/>
<g:render template="helpLinks"/>
</div>
<a id="project-explorer-holder" href="${g.createLink(controller: 'home', action:'projectExplorer')}">
<button>
<div id="project-explorer-icon"><i class="text-center fa fa-search"></i></div>
<h2 class="col-sm-12 text-center project-explorer-text">PROJECT EXPLORER</h2>
</button>
</a>
</div>
<div id="help-links-container">
<fc:getSettingContent settingType="${au.org.ala.merit.SettingPageType.HELP_LINKS_TITLE}"/>
<g:render template="helpLinks"/>
</div>
<a id="project-explorer-holder" href="${g.createLink(controller: 'home', action:'projectExplorer')}">
<button>
<div id="project-explorer-icon"><i class="text-center fa fa-search"></i></div>
<h2 class="span12 col-sm-12 text-center project-explorer-text">PROJECT EXPLORER</h2>
</button>
</a>
</div>
<asset:javascript src="common-bs4.js"/>
<asset:javascript src="homepage.js"/>
<asset:deferredScripts/>
<script>
$(function() {
<asset:javascript src="common.js"/>
<asset:javascript src="homepage.js"/>
<asset:deferredScripts/>
<script>
$(function() {
var url = '${g.createLink(controller:'report', action:'statisticsReport')}';
var url = '${g.createLink(controller:'report', action:'statisticsReport')}';
var working = false;
$('#stats-holder').on('click', '.show-more-stats', function() {
if (!working) {
working = true;
replaceContentSection('.statistics', url).always(function() { working = false; });
}
});
var working = false;
$('#stats-holder').on('click', '.show-more-stats', function() {
if (!working) {
working = true;
replaceContentSection('.statistics', url).always(function() { working = false; });
if ($('#latest-news').height() > 400) {
$('#latest-news').height(400).css('overflow-y', 'scroll');
}
});
if ($('#latest-news').height() > 400) {
$('#latest-news').height(400).css('overflow-y', 'scroll');
}
});
</script>
</script>
</body>
</html>
16 changes: 8 additions & 8 deletions grails-app/views/report/_statistics.gsp
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<div class="statistics">
%{--This section expects exactly 6 statistics to display--}%
<div class="row-fluid row">
<div class="col-sm-4 span4 box1">
<div class="row">
<div class="col-sm-4 box1">
<g:render template="/report/statistic" model="${statistics[0]}"/>
</div>
<div class="col-sm-4 span4 box2">
<div class="col-sm-4 box2">
<g:render template="/report/statistic" model="${statistics[1]}"/>
</div>
<div class="col-sm-4 span4 box3">
<div class="col-sm-4 box3">
<g:render template="/report/statistic" model="${statistics[2]}"/>
</div>
</div>
<div class="row">
<div class="col-sm-4 span4 box4">
<div class="col-sm-4 box4">
<g:render template="/report/statistic" model="${statistics[3]}"/>
</div>
<div class="col-sm-4 span4 box5">
<div class="col-sm-4 box5">
<g:render template="/report/statistic" model="${statistics[4]}"/>
</div>
<div class="col-sm-4 span4 box6">
<div class="col-sm-4 box6">
<g:render template="/report/statistic" model="${statistics[5]}"/>
</div>
</div>
<div class="row">
<div class="col-sm-12 span12 align-content-center text-center"><a href="#" class="show-more-stats text-dark">Show more stats <i class="fa fa-refresh"></i></a></div>
<div class="col-sm-12 align-content-center text-center"><a href="#" class="show-more-stats text-dark">Show more stats <i class="fa fa-refresh"></i></a></div>
</div>
</div>

0 comments on commit 6421fc0

Please sign in to comment.