Skip to content

Commit

Permalink
Fix footer logo and footer-drawer layout issues; remove legacy javasc…
Browse files Browse the repository at this point in the history
…ript in org identity fields (CO-2115)
  • Loading branch information
spartanicus committed Apr 21, 2021
1 parent 1d52f36 commit 8637c0c
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 119 deletions.
1 change: 0 additions & 1 deletion app/View/Elements/footer.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
*/
?>

<div id="footer-drawer"></div>
<div class="footer">
<div class="poweredByComanage">
<span class="poweredText">Powered by</span>
Expand Down
4 changes: 2 additions & 2 deletions app/View/Elements/javascript.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@
// Observers list
var observer = new Array();
// Options for the Dropdown Action Menu Observer
const options = {
const cmActionMenuOptions = {
attributes: true,
attributeFilter: ['class']
};
Expand Down Expand Up @@ -601,7 +601,7 @@
}
}
});
observer[element].observe(element,options);
observer[element].observe(element,cmActionMenuOptions);
}

// Define default text for confirm dialog
Expand Down
92 changes: 46 additions & 46 deletions app/View/Layouts/default.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -240,60 +240,60 @@
?>
<main id="main" class="<?php print $mainCssClasses; ?>">

<?php
// display the view content
if(!empty($sidebarButtons) || !empty($enrollmentFlowSteps)) {
print '<div id="content" class="with-sidebar">';
} else {
print '<div id="content">';
}
print '<div id="content-inner">';
<?php
// display the view content
if(!empty($sidebarButtons) || !empty($enrollmentFlowSteps)) {
print '<div id="content" class="with-sidebar">';
} else {
print '<div id="content">';
}
print '<div id="content-inner">';

// insert breadcrumbs on all but the homepage
if( $vv_ui_mode === EnrollmentFlowUIMode::Full
&& $this->request->here !== $this->request->webroot) {
print '<div id="breadcrumbs">' . $this->Html->getCrumbs(' &gt; ', _txt('bc.home')) . "</div>";
}
// insert breadcrumbs on all but the homepage
if( $vv_ui_mode === EnrollmentFlowUIMode::Full
&& $this->request->here !== $this->request->webroot) {
print '<div id="breadcrumbs">' . $this->Html->getCrumbs(' &gt; ', _txt('bc.home')) . "</div>";
}

// insert the anchor that is the target of accessible "skip to content" link
print '<a id="content-start"></a>';
// insert the anchor that is the target of accessible "skip to content" link
print '<a id="content-start"></a>';

// insert the page internal content
print $this->fetch('content');
print '</div>'; // end #content-inner
// insert the page internal content
print $this->fetch('content');
print '</div>'; // end #content-inner

if(!empty($sidebarButtons) || !empty($enrollmentFlowSteps)) {
print '<div id="right-sidebar">';
if(!empty($sidebarButtons) || !empty($enrollmentFlowSteps)) {
print '<div id="right-sidebar">';

// insert the sidebar buttons if they exist
$sidebarButtons = $this->get('sidebarButtons');
if (!empty($sidebarButtons)) {
print $this->element('sidebarButtons');
}
// insert the sidebar buttons if they exist
$sidebarButtons = $this->get('sidebarButtons');
if (!empty($sidebarButtons)) {
print $this->element('sidebarButtons');
}

// display enrollment flow steps when they exist
$enrollmentFlowSteps = $this->get('enrollmentFlowSteps');
if (!empty($enrollmentFlowSteps)) {
print $this->element('enrollmentFlowSteps');
// display enrollment flow steps when they exist
$enrollmentFlowSteps = $this->get('enrollmentFlowSteps');
if (!empty($enrollmentFlowSteps)) {
print $this->element('enrollmentFlowSteps');
}
print "</div>"; // end #right-sidebar
print "</div>"; // end #content
}
print "</div>"; // end #right-sidebar
print "</div>"; // end #content
}
?>

<!-- Include custom footer -->
<?php if(!empty($vv_theme_footer)): ?>
<footer id="customFooter">
<?php print $vv_theme_footer; ?>
</footer>
<?php endif; ?>
?>

<?php if(Configure::read('debug') > 0): ?>
<div id="debug">
<?php print $this->element('sql_dump'); ?>
</div>
<?php endif; ?>
</main>
<!-- Include custom footer -->
<?php if(!empty($vv_theme_footer)): ?>
<footer id="customFooter">
<?php print $vv_theme_footer; ?>
</footer>
<?php endif; ?>

<?php if(Configure::read('debug') > 0): ?>
<div id="debug">
<?php print $this->element('sql_dump'); ?>
</div>
<?php endif; ?>
</main>
</div>

<?php if(!isset($vv_theme_hide_footer_logo) || !$vv_theme_hide_footer_logo): ?>
Expand Down
14 changes: 7 additions & 7 deletions app/View/Layouts/redirect.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@
</div>
</div>

<!-- Include custom footer -->
<?php if(!empty($vv_theme_footer)): ?>
<footer id="customFooter">
<?php print $vv_theme_footer; ?>
</footer>
<?php endif; ?>

<?php if(Configure::read('debug') > 0): ?>
<div id="debug">
<?php print $this->element('sql_dump'); ?>
Expand All @@ -217,13 +224,6 @@
</footer>
<?php endif; ?>

<!-- Include custom footer -->
<?php if(!empty($vv_theme_footer)): ?>
<footer id="customFooter">
<?php print $vv_theme_footer; ?>
</footer>
<?php endif; ?>

</div>
</body>
</html>
29 changes: 0 additions & 29 deletions app/View/OrgIdentities/fields.inc
Original file line number Diff line number Diff line change
Expand Up @@ -102,35 +102,6 @@

});

// Options for the observer (which mutations to observe)
let options = {
attributes: true,
attributeFilter: ['class']
};

function add_observer(element, target_element, modify_class) {
observer[element] = new MutationObserver((mutationList) => {
// Use traditional 'for loops' for IE 11
for(const mutation of mutationList) {
if (mutation.type === 'attributes') {
bs_dropdown = mutation.target.parentNode;
if($(bs_dropdown).hasClass('show')) {
if(target_element === 'tr') {
$(bs_dropdown).closest(target_element).prev(target_element).addClass(target_element + '-' + modify_class);
}
$(bs_dropdown).closest(target_element).addClass(modify_class);
} else {
if(target_element === 'tr') {
$(bs_dropdown).closest(target_element).prev(target_element).removeClass(target_element + '-' + modify_class);
}
$(bs_dropdown).closest(target_element).removeClass(modify_class);
}
}
}
});
observer[element].observe(element,options);
}

function js_local_onload() {
enum_update_gadgets(false);
}
Expand Down
10 changes: 3 additions & 7 deletions app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -2411,18 +2411,14 @@ td.indented {
font-size: smaller;
}
/* FOOTER */
footer {
#co-footer {
text-align: center;
padding: 2em;
}
body.logged-out footer,
body.redirect footer {
body.logged-out #co-footer,
body.redirect #co-footer {
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%);
}
body.logged-out #footer-drawer,
body.redirect #footer-drawer {
display: none;
}
45 changes: 18 additions & 27 deletions app/webroot/css/co-responsive.css
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@
}
#main {
flex-basis: 100%;
padding-bottom: 66px; /* offset for footer logo height */
}
#navigation-drawer {
position: static;
Expand All @@ -266,7 +267,7 @@
z-index: unset;
width: 180px;
min-width: 180px;
min-height: calc(100vh - 160px);
min-height: calc(100vh - 94px); /* offset for header height */
}
/* menu drawer half-closed styles */
#navigation-drawer.half-closed {
Expand Down Expand Up @@ -509,27 +510,29 @@
column-gap: 20px;
}
/* FOOTER */
footer {
display: flex;
justify-content: space-between;
#co-footer,
body.co_petitions.petitionerAttributes.logged-out #co-footer {
position: static;
float: right;
padding: 0;
}
#footer-drawer {
background-color: #fafafa;
width: 180px;
border-right: 1px solid #ddd;
}
#footer-drawer.half-closed {
width: 50px;
margin-top: -66px;
right: unset;
bottom: unset;
left: unset;
transform: unset;
}
.poweredByComanage {
display: inline-block;
padding: 1em 2em 2em 0;
}
body.logged-out footer,
body.redirect footer {
body.logged-out #co-footer,
body.redirect #co-footer,
body.pages #co-footer {
position: fixed;
display: block;
float: none;
right: 0;
bottom: 0;
margin: 0;
left: unset;
transform: unset;
}
Expand Down Expand Up @@ -559,9 +562,6 @@
#right-sidebar #menu {
padding-left: 1em;
}
#footer-drawer {
width: 200px;
}
}

/* EXTRA LARGE */
Expand All @@ -575,13 +575,4 @@
#co_people .person-info-inner {
width: 550px;
}
#footer-drawer {
width: 240px;
}
}

@media only screen and (min-width: 1708px) {
#footer-drawer.half-closed {
width: 51px;
}
}

0 comments on commit 8637c0c

Please sign in to comment.