Skip to content

Commit 041f214

Browse files
committed
Merge pull request angular-fullstack#1045 from kingcody/feature/footer-directive
feat(app): implement footer as directive
2 parents cc841e1 + cf298a7 commit 041f214

15 files changed

+114
-95
lines changed

Diff for: app/templates/client/app/main/main(css).css

+14-21
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
.thing-form {
2-
margin: 20px 0;
2+
margin: 20px 0;
33
}
44

55
#banner {
6-
border-bottom: none;
7-
margin-top: -20px;
6+
border-bottom: none;
7+
margin-top: -20px;
88
}
99

1010
#banner h1 {
11-
font-size: 60px;
12-
line-height: 1;
13-
letter-spacing: -1px;
11+
font-size: 60px;
12+
line-height: 1;
13+
letter-spacing: -1px;
1414
}
1515

1616
.hero-unit {
17-
position: relative;
18-
padding: 30px 15px;
19-
color: #F5F5F5;
20-
text-align: center;
21-
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
22-
background: #4393B9;
23-
}
24-
25-
.footer {
26-
text-align: center;
27-
padding: 30px 0;
28-
margin-top: 70px;
29-
border-top: 1px solid #E5E5E5;
17+
position: relative;
18+
padding: 30px 15px;
19+
color: #F5F5F5;
20+
text-align: center;
21+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
22+
background: #4393B9;
3023
}
3124

3225
.navbar-text {
33-
margin-left: 15px;
34-
}
26+
margin-left: 15px;
27+
}

Diff for: app/templates/client/app/main/main(html).html

+1-7
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,4 @@ <h1 class="page-header">Features:</h1>
2929
</form><% } %>
3030
</div>
3131

32-
<footer class="footer">
33-
<div class="container">
34-
<p>Angular Fullstack v<%= pkg.version %> |
35-
<a href="https://twitter.com/tyhenkel">@tyhenkel</a> |
36-
<a href="https://github.com/DaftMonk/generator-angular-fullstack/issues?state=open">Issues</a></p>
37-
</div>
38-
</footer>
32+
<footer></footer>

Diff for: app/templates/client/app/main/main(jade).jade

+1-8
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,4 @@ header#banner.hero-unit
2323
span.input-group-btn
2424
button.btn.btn-primary(type='submit', ng-click='addThing()') Add New<% } %>
2525

26-
footer.footer
27-
.container
28-
p
29-
| Angular Fullstack v<%= pkg.version %>
30-
= ' | '
31-
a(href='https://twitter.com/tyhenkel') @tyhenkel
32-
= ' | '
33-
a(href='https://github.com/DaftMonk/generator-angular-fullstack/issues?state=open') Issues
26+
footer

Diff for: app/templates/client/app/main/main(less).less

+13-20
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,25 @@
33
}
44

55
#banner {
6-
border-bottom: none;
7-
margin-top: -20px;
6+
border-bottom: none;
7+
margin-top: -20px;
88
}
99

1010
#banner h1 {
11-
font-size: 60px;
12-
line-height: 1;
13-
letter-spacing: -1px;
11+
font-size: 60px;
12+
line-height: 1;
13+
letter-spacing: -1px;
1414
}
1515

1616
.hero-unit {
17-
position: relative;
18-
padding: 30px 15px;
19-
color: #F5F5F5;
20-
text-align: center;
21-
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
22-
background: #4393B9;
23-
}
24-
25-
.footer {
26-
text-align: center;
27-
padding: 30px 0;
28-
margin-top: 70px;
29-
border-top: 1px solid #E5E5E5;
17+
position: relative;
18+
padding: 30px 15px;
19+
color: #F5F5F5;
20+
text-align: center;
21+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
22+
background: #4393B9;
3023
}
3124

3225
.navbar-text {
33-
margin-left: 15px;
34-
}
26+
margin-left: 15px;
27+
}

Diff for: app/templates/client/app/main/main(sass).scss

+13-20
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
.thing-form {
2-
margin: 20px 0;
2+
margin: 20px 0;
33
}
44

55
#banner {
6-
border-bottom: none;
7-
margin-top: -20px;
6+
border-bottom: none;
7+
margin-top: -20px;
88
}
99

1010
#banner h1 {
11-
font-size: 60px;
12-
line-height: 1;
13-
letter-spacing: -1px;
11+
font-size: 60px;
12+
line-height: 1;
13+
letter-spacing: -1px;
1414
}
1515

1616
.hero-unit {
17-
position: relative;
18-
padding: 30px 15px;
19-
color: #F5F5F5;
20-
text-align: center;
21-
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
22-
background: #4393B9;
23-
}
24-
25-
.footer {
26-
text-align: center;
27-
padding: 30px 0;
28-
margin-top: 70px;
29-
border-top: 1px solid #E5E5E5;
17+
position: relative;
18+
padding: 30px 15px;
19+
color: #F5F5F5;
20+
text-align: center;
21+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
22+
background: #4393B9;
3023
}
3124

3225
.navbar-text {
3326
margin-left: 15px;
34-
}
27+
}

Diff for: app/templates/client/app/main/main(stylus).styl

+13-19
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
.thing-form
2-
margin 20px 0
2+
margin 20px 0
33

44
#banner
5-
border-bottom none
6-
margin-top -20px
5+
border-bottom none
6+
margin-top -20px
77

88
#banner h1
9-
font-size 60px
10-
letter-spacing -1px
11-
line-height 1
9+
font-size 60px
10+
letter-spacing -1px
11+
line-height 1
1212

1313
.hero-unit
14-
background #4393B9
15-
color #F5F5F5
16-
padding 30px 15px
17-
position relative
18-
text-align center
19-
text-shadow 0 1px 0 rgba(0, 0, 0, 0.1)
20-
21-
.footer
22-
border-top 1px solid #E5E5E5
23-
margin-top 70px
24-
padding 30px 0
25-
text-align center
14+
background #4393B9
15+
color #F5F5F5
16+
padding 30px 15px
17+
position relative
18+
text-align center
19+
text-shadow 0 1px 0 rgba(0, 0, 0, 0.1)
2620

2721
.navbar-text
28-
margin-left 15px
22+
margin-left 15px
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
footer.footer {
2+
text-align: center;
3+
padding: 30px 0;
4+
margin-top: 70px;
5+
border-top: 1px solid #E5E5E5;
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<div class="container">
2+
<p>Angular Fullstack v<%= pkg.version %> |
3+
<a href="https://twitter.com/tyhenkel">@tyhenkel</a> |
4+
<a href="https://github.com/DaftMonk/generator-angular-fullstack/issues?state=open">Issues</a>
5+
</p>
6+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.container
2+
p
3+
| Angular Fullstack v<%= pkg.version %>
4+
= ' | '
5+
a(href='https://twitter.com/tyhenkel') @tyhenkel
6+
= ' | '
7+
a(href='https://github.com/DaftMonk/generator-angular-fullstack/issues?state=open') Issues
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
footer.footer {
2+
text-align: center;
3+
padding: 30px 0;
4+
margin-top: 70px;
5+
border-top: 1px solid #E5E5E5;
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
footer.footer {
2+
text-align: center;
3+
padding: 30px 0;
4+
margin-top: 70px;
5+
border-top: 1px solid #E5E5E5;
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
footer.footer
2+
border-top 1px solid #E5E5E5
3+
margin-top 70px
4+
padding 30px 0
5+
text-align center
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict'
2+
3+
angular.module '<%= scriptAppName %>'
4+
.directive 'footer', ->
5+
templateUrl: 'components/footer/footer.html'
6+
restrict: 'E',
7+
link: (scope, element) ->
8+
element.addClass('footer')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict';
2+
3+
angular.module('<%= scriptAppName %>')
4+
.directive('footer', function () {
5+
return {
6+
templateUrl: 'components/footer/footer.html',
7+
restrict: 'E',
8+
link: function (scope, element) {
9+
element.addClass('footer');
10+
}
11+
};
12+
});

Diff for: test/test-file-creation.js

+3
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ describe('angular-fullstack generator', function () {
172172
'client/app/main/main.controller.' + script,
173173
'client/app/main/main.controller.spec.' + script,
174174
'client/assets/images/yeoman.png',
175+
'client/components/footer/footer.' + stylesheet,
176+
'client/components/footer/footer.' + markup,
177+
'client/components/footer/footer.directive.' + script,
175178
'client/components/navbar/navbar.' + markup,
176179
'client/components/navbar/navbar.controller.' + script,
177180
'client/components/navbar/navbar.directive.' + script,

0 commit comments

Comments
 (0)