Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit d68f790

Browse files
author
Nick Litwin
committed
Move peer-review's header and footer into topcoder-app
1 parent c805f8a commit d68f790

File tree

5 files changed

+153
-0
lines changed

5 files changed

+153
-0
lines changed

app/layout/footer/footer.jade

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
footer
2+
.container
3+
section.connected
4+
.social
5+
h4 Get Connected
6+
7+
ul
8+
li #[a.fb(href='https://www.facebook.com/topcoder') FB]
9+
li #[a.tw(href='http://www.twitter.com/topcoder') TW]
10+
li #[a.gp(href='https://plus.google.com/u/0/b/104268008777050019973/104268008777050019973/posts') GP]
11+
li #[a.in(href='https://www.linkedin.com/company/topcoder') IN]
12+
13+
.updates
14+
form
15+
input.email(type='email', name='EMAIL', placeholder='Your email address', maxlength='64')
16+
17+
input.btnSubmitFooter(type='button', value='Submit')
18+
19+
section.copyright
20+
p © 2014 topcoder. All Rights Reserved.
21+
22+
ul
23+
li
24+
a(href='http://topcoder.com/community/how-it-works/privacy-policy/') Privacy Policy
25+
26+
li |
27+
28+
li
29+
a(href='http://topcoder.com/community/how-it-works/terms/') Terms
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('tc.layout').controller('HeaderController', HeaderController);
5+
6+
HeaderController.$inject = ['$window', '$stateParams', 'Auth', 'ENV', 'ProfileService'];
7+
8+
function HeaderController() {
9+
var vm = this;
10+
$vm.domain = ENV.domain
11+
$vm.login = Auth.login
12+
$vm.isAuth = Auth.isAuthenticated
13+
$vm.logout = function() {
14+
Auth.logout(function() {
15+
if($stateParams.challengeId) {
16+
$window.location.href = 'https://www.' + vm.domain + '/challenge-details/' + $stateParams.challengeId + '/?type=develop';
17+
}
18+
});
19+
}
20+
}
21+
22+
})();

app/layout/header/header.jade

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
header(ng-controller="HeaderController", ng-class="{slided: main.sidebarActive}")
2+
.container
3+
a(id="topcoder-logo", ng-href="https://www.{{domain}}", title="topcoder")
4+
img(src="content/images/logo.png", alt="Topcoder Logo")
5+
6+
nav.top-right
7+
ul
8+
li.login(ng-hide="isAuth()") #[a(href="/login") Log In]
9+
10+
li.logout(ng-show="isAuth()") #[a(ng-click="logout()") Log Out]
11+
12+
li.contact #[a(href="#") Contact]
13+
14+
li.help #[a(href="#") Help]
15+
16+
li.search #[a(href="#") #[i#search] Search]
17+
18+
li.my-account(ng-show="isAuth()") #[a(ng-click="isActive = !isActive", slide-toggle="#user-widget") My Account]
19+
20+
li.signup(ng-hide="isAuth()") #[a(href="#") Sign Up]
21+
22+
button.bars(type="button", ng-click="main.sidebarActive = !main.sidebarActive")
23+
span.icon-bar
24+
span.icon-bar
25+
span.icon-bar
26+
27+
nav.bottom
28+
ul
29+
li #[a(ng-href="https://www.{{domain}}/challenges/") Challenges]
30+
31+
li #[a(ng-href="https://www.{{domain}}/community/") Community]
32+
33+
li #[a(ng-href="https://www.{{domain}}/about/") About]
34+
35+
li #[a.blog(ng-href="https://www.{{domain}}/blog/") Blog]
36+
37+
a#signup(ng-hide="isAuth()", href="#") Sign Up
38+
a#my-account(ng-show="isAuth()", ng-click="isActive = !isActive", ng-init="isActive = false", slide-toggle="#user-widget") My Account
39+
i(ng-class="{'active': isActive}")
40+
41+
div#user-widget.slideable
42+
div#user-widget-content(style="visibility: hidden;")
43+
.userWidget(style='display: block;')
44+
.details
45+
.userPic
46+
img(ng-src='{{main.profile.photoLink}}')
47+
48+
.userDetails
49+
a.tc_coder.coder(ng-href='https://www.topcoder-dev.com/member-profile/{{main.profile.handle}}', style='{{handleColor}}') {{main.profile.handle}}
50+
51+
p.country {{main.profile.country}}
52+
p.lbl Member Since :
53+
54+
p.val.memberSince {{main.profile.memberSince | date : 'MMM d, yyyy'}}
55+
56+
p.lbl(style='display: none;') Total Earnings :
57+
58+
p.val.memberEarning
59+
60+
.action
61+
a.profileLink(ng-href='https://www.topcoder-dev.com/member-profile/{{main.profile.handle}}') My Profile
62+
a(href='/my-dashboard') My TopCoder
63+
a.linkAlt(href='//community.topcoder.com/tc?module=MyHome') Account Settings

app/layout/header/sidebar.jade

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#sidebar-nav(ng-class="{active: main.sidebarActive}")
2+
ul.nav.nav-pills.nav-stacked
3+
li #[a(ng-href="https://www.{{main.domain}}/challenges/") Challenges]
4+
5+
li #[a(ng-href="https://www.{{main.domain}}/community/") Community]
6+
7+
li #[a(ng-href="https://www.{{main.domain}}/about/") About]
8+
9+
li #[a.blog(ng-href="https://www.{{main.domain}}/blog/") Blog]
10+
11+
li
12+
.userInfo
13+
.userPic
14+
img(ng-src="{{main.profile.photoLink}}", alt="Profile Picture")
15+
.userDetails
16+
a.handle(ng-href='https://www.{{main.domain}}/member-profile/{{main.profile.handle}}', style='{{main.handleColor}}', ng-bind="main.profile.handle")
17+
p.country(ng-bind="main.profile.country")
18+
a.link.myProfileLink(href="") My Profile
19+
a.link(href="https://community.{{main.domain}}/tc?module=MyHome") My TopCoder
20+
a.link(href="https://community.{{main.domain}}/tc?module=MyHome") Account Settings
21+
a.link(href="javascript:;", ng-click="main.logout()") Log Out

app/layout/layout.module.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(function() {
2+
'use strict';
3+
4+
var dependencies = [];
5+
6+
angular
7+
.module('tc.layout', dependencies)
8+
.run(appRun);
9+
10+
appRun.$inject = ['$rootScope', '$state'];
11+
12+
function appRun($rootScope, $state) {
13+
// Attaching $state to the $rootScope allows us to access the
14+
// current state in index.html (see div with ui-view on the index page)
15+
$rootScope.$state = $state;
16+
}
17+
18+
})();

0 commit comments

Comments
 (0)