Skip to content

Commit 379be76

Browse files
committed
Some improvements to styles in result list. Now the result controller doesn't appear when there are no results.
1 parent 5a9462e commit 379be76

File tree

4 files changed

+36
-31
lines changed

4 files changed

+36
-31
lines changed

Dataface/ResultList.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,10 @@ function toHtml($mode = 'all'){
339339
// where Direction is "asc" or "desc"
340340

341341

342-
343342
if (true or $this->_resultSet->found() > 0 ) {
344343

345344

346-
if ($desktop and @$app->prefs['use_old_resultlist_controller'] ){
345+
if ($desktop and @$app->prefs['use_old_resultlist_controller'] and $this->_resultSet->found() > 0){
347346
ob_start();
348347
df_display(array(), 'Dataface_ResultListController.html');
349348
$controller = ob_get_contents();
@@ -373,7 +372,7 @@ function toHtml($mode = 'all'){
373372
}
374373
unset($query);
375374

376-
if ( @$app->prefs['use_old_resultlist_controller'] ){
375+
if ( @$app->prefs['use_old_resultlist_controller'] and $this->_resultSet->found() > 0){
377376
echo '<div class="resultlist-controller" id="resultlist-controller-top">';
378377

379378
echo $controller;
@@ -735,7 +734,7 @@ function toHtml($mode = 'all'){
735734
}
736735
echo "</tbody>
737736
</table>";
738-
if ( $canSelect ){
737+
if ( $canSelect and $this->_resultSet->found() > 0){
739738
echo '<form id="result_list_selected_items_form" method="post" action="'.df_absolute_url(DATAFACE_SITE_HREF).'">';
740739
$app =& Dataface_Application::getInstance();
741740
$q =& $app->getQuery();
@@ -777,7 +776,7 @@ function toHtml($mode = 'all'){
777776
}
778777
}
779778

780-
if ( @$app->prefs['use_old_resultlist_controller'] ){
779+
if ( @$app->prefs['use_old_resultlist_controller'] and $this->_resultSet->found() > 0){
781780
echo '<div class="resultlist-controller" id="resultlist-controller-bottom">';
782781

783782
echo $controller;
@@ -794,7 +793,7 @@ function toHtml($mode = 'all'){
794793
if ($desktop) {
795794
// Just to prevent from running twice.
796795
// In actuality this is used for both mobile and desktop
797-
if ( @$app->prefs['use_old_resultlist_controller'] ){
796+
if ( @$app->prefs['use_old_resultlist_controller'] and $this->_resultSet->found() > 0){
798797
ob_start();
799798
df_display(array(), 'Dataface_ResultListController.html');
800799
$out .= ob_get_contents();

Dataface/templates/Dataface_List_View.html

+4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@
3131
{/if}
3232
<div id="list-window">
3333
{if !$ENV.prefs.use_old_resultlist_controller}
34+
{if $ENV.resultSet->found() > 0}
3435
{if !$ENV.prefs.hide_resultlist_controller}
3536
{if $ENV.resultSet->found() > $ENV.resultSet->limit() or !$ENV.APPLICATION_OBJECT->prefs.show_resultlist_controller_only_when_needed}
3637
{result_controller}
3738
{/if}
3839
{/if}
40+
{/if}
3941
{/if}
4042
<div style="clear:both">
4143
{block name="before_result_list_content"}
@@ -45,11 +47,13 @@
4547
{block name="after_result_list_content"}
4648
</div>
4749
{if !$ENV.prefs.use_old_resultlist_controller}
50+
{if $ENV.resultSet->found() > 0}
4851
{if !$ENV.prefs.hide_resultlist_controller}
4952
{if ($ENV.resultSet->found() > $ENV.resultSet->limit()) or !$ENV.APPLICATION_OBJECT->prefs.show_resultlist_controller_only_when_needed}
5053
{result_controller}
5154
{/if}
5255
{/if}
56+
{/if}
5357
{/if}
5458
</div>
5559
{/define_slot}

actions.ini.php

+2-24
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,7 @@ class="featured-action"
8181
[post]
8282
permission = post
8383
84-
;; Show all records in the current table
85-
[show_all]
86-
label = Show All
87-
description = Show all records in table
88-
url = "{$site_href}?-action=list&-table={$table}"
89-
icon = "{$dataface_url}/images/zoom-out.gif"
90-
accessKey = a
91-
category = table_actions
92-
mode = list
93-
permission = show all
94-
order=4
95-
tags="#large#"
84+
9685
9786
[copy_replace]
9887
label="Copy Set"
@@ -597,18 +586,7 @@ class="featured-action"
597586
[post]
598587
permission = post
599588
600-
;; Show all records in the current table
601-
[show_all]
602-
label = Show All
603-
description = Show all records in table
604-
url = "{$site_href}?-action=list&-table={$table}"
605-
icon = "{$dataface_url}/images/zoom-out.gif"
606-
accessKey = a
607-
category = table_actions
608-
mode = list
609-
permission = show all
610-
order=4
611-
tags="#large#"
589+
612590
613591
[copy_replace]
614592
label="Copy Set"

plone.css

+25-1
Original file line numberDiff line numberDiff line change
@@ -2887,7 +2887,6 @@ nav.personal-tools-menu a {
28872887
border: 1px solid rgb(218, 220, 224);
28882888
border-radius: 4px;
28892889
display: block;
2890-
float: right;
28912890
padding: 0.25em;
28922891
padding-left: 10px;
28932892
padding-right: 10px;
@@ -2896,6 +2895,22 @@ nav.personal-tools-menu a {
28962895
transition-duration: 0.5s;
28972896
margin-bottom: 0;
28982897
}
2898+
@media only screen and (min-width:768px) {
2899+
div.xf-button-bar-actions li.mobile,
2900+
nav.tables li.mobile,
2901+
nav.personal-tools-menu li.mobile {
2902+
display:none;
2903+
}
2904+
}
2905+
@media only screen and (max-width:768px) {
2906+
div.xf-button-bar-actions li.desktop,
2907+
nav.tables li.desktop,
2908+
nav.personal-tools-menu li.desktop {
2909+
display:none;
2910+
}
2911+
}
2912+
body.large div.xf-button-bar-actions li,
2913+
body.large nav.tables li,
28992914
nav.tables li {
29002915
float:left;
29012916
}
@@ -3004,6 +3019,9 @@ div.xf-button-bar-actions > ul > li.featured-action,
30043019
opacity: 1;
30053020
display: block
30063021
}
3022+
3023+
3024+
30073025
div.xf-button-bar-actions ul li ul li,
30083026
nav.tables ul li ul li,
30093027
nav.personal-tools-menu ul li ul li {
@@ -3016,6 +3034,12 @@ div.xf-button-bar-actions > ul > li.featured-action,
30163034
padding:0.5em;;
30173035
}
30183036

3037+
nav.personal-tools-menu {
3038+
float:right;
3039+
}
3040+
nav.personal-tools-menu > ul {
3041+
display:flex;
3042+
}
30193043

30203044

30213045
/*table tabs*/

0 commit comments

Comments
 (0)