-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CHE-490: add footer with product logo and support stuff #377
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
dashboard/src/components/widget/footer/che-footer.directive.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
* Copyright (c) 2015-2016 Codenvy, S.A. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Codenvy, S.A. - initial API and implementation | ||
*/ | ||
'use strict'; | ||
|
||
/** | ||
* @ngdoc directive | ||
* @name components.directive:cheFooter | ||
* @restrict E | ||
* @function | ||
* @element | ||
* | ||
* @author Ann Shumilova | ||
*/ | ||
export class CheFooter { | ||
|
||
/** | ||
* @ngdoc directive | ||
* @name components.directive:cheFooter | ||
* @restrict E | ||
* @function | ||
* @element | ||
* | ||
* @description | ||
* `<che-footer>` defines a bottom footer. | ||
* | ||
* @param {string=} che-logo product logo location | ||
* @param {string=} che-product-name product name | ||
* @param {string=} che-support-email support email address | ||
* @param {string=} che-support-help link to support help | ||
* | ||
* @usage | ||
* <che-footer che-logo="src/logo.svg"></che-footer> | ||
* | ||
* @example | ||
<example module="userDashboard"> | ||
<file name="index.html"> | ||
<che-footer | ||
che-logo="src/logo.svg" | ||
che-product-name="Eclipse Che" | ||
che-support-email="support@codenvy.com" | ||
che-support-help="http://www.eclipse.org/che"> | ||
</che-footer> | ||
</file> | ||
</example> | ||
* @author Ann Shumilova | ||
*/ | ||
constructor () { | ||
this.restrict='E'; | ||
this.replace = true; | ||
this.transclude= true; | ||
} | ||
|
||
/** | ||
* Template for the current footer | ||
* @param element | ||
* @param attrs | ||
* @returns {string} the template | ||
*/ | ||
template(element, attrs) { | ||
var logo = attrs.cheLogo; | ||
var productName = attrs.cheProductName; | ||
var supportEmail = attrs.cheSupportEmail; | ||
var supportHelp = attrs.cheSupportHelp; | ||
|
||
var template = '<div class=\"che-footer\" layout=\"row\" layout-align=\"start center\">'; | ||
if (logo) { | ||
template += '<img class=\"che-footer-logo\" ng-src=\"' + logo + '\" alt=\"logo\">'; | ||
} | ||
template += '<div flex />'; | ||
template += '<ng-transclude></ng-transclude>'; | ||
|
||
if (supportEmail) { | ||
let subject = '?subject=' + encodeURIComponent('Wishes for ' + productName); | ||
template += '<input class=\"che-footer-input\" ng-model=\"productWish\" placeholder=\"I wish this product...\" />'; | ||
template += '<a class=\"che-footer-button-mail che-footer-button\" ng-href=\"mailto:' + supportEmail + subject + '&body={{productWish}}\">Make a wish<a/>'; | ||
} | ||
|
||
if (supportHelp) { | ||
template += '<a class=\"che-footer-button-community che-footer-button\" ng-href=\"' + supportHelp + '\" target=\"_blank\">Community<a/>'; | ||
} | ||
template += '</div>'; | ||
return template; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
.che-footer | ||
height 30px | ||
background-color $white-color | ||
border-top 1px solid $list-separator-color | ||
padding 0px 10px | ||
|
||
.che-footer-logo | ||
padding 5px 0px | ||
height 30px | ||
flex-shrink 0 | ||
flex-grow 0 | ||
|
||
.che-footer-button | ||
padding 0px 15px | ||
font-size 9pt | ||
cursor pointer | ||
height 18px | ||
color $white-color | ||
border-radius 2px | ||
|
||
.che-footer a | ||
text-decoration none | ||
color $white-color | ||
|
||
.che-footer-button-community | ||
background-color $che-logo-yellow-color | ||
|
||
.che-footer-button-community:hover | ||
background-color darken($che-logo-yellow-color, 25%) | ||
|
||
.che-footer-button-mail | ||
background-color $che-logo-blue-color | ||
margin 0px 15px 0px 5px | ||
|
||
.che-footer-button-mail:hover | ||
background-color darken($che-logo-blue-color, 20%) | ||
|
||
.che-footer-input | ||
width 200px | ||
background-color inherit | ||
color $che-logo-blue-color | ||
box-shadow none | ||
border 1px solid $che-logo-blue-color | ||
border-radius 3px | ||
height 18px | ||
line-height 18px | ||
outline none | ||
font-size 9pt | ||
padding 0px 5px | ||
|
||
.che-footer-input::-webkit-input-placeholder | ||
color $che-logo-blue-color | ||
font-size 9pt | ||
|
||
.che-footer-input:-moz-placeholder | ||
/* Mozilla Firefox 4 to 18 */ | ||
color $che-purple-color | ||
font-size 9pt | ||
|
||
.che-footer-input::-moz-placeholder | ||
/* Mozilla Firefox 19+ */ | ||
color $che-purple-color | ||
font-size 9pt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've failed on the split as this file should be auto generated from the json file and then should be ignored