Skip to content

Commit d42c75a

Browse files
committed
Better Layout for sketch details.
I think this should suffice to fix #31
1 parent 8c8f411 commit d42c75a

File tree

2 files changed

+66
-57
lines changed

2 files changed

+66
-57
lines changed

src/components/Comment.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,17 @@ export default {
4242
.comment {
4343
border-bottom: 1px solid #0a6aa6;
4444
padding-bottom: 5px;
45-
& + .comment {
46-
margin-top: 17px;
47-
}
45+
padding-left: 8px;
46+
border-left: 1px solid #0a6aa6;
47+
padding-right: 5px;
48+
margin-bottom: 17px;
4849
.comment-body {
4950
margin-top: 7px;
5051
margin-bottom: 7px;
5152
}
53+
.created {
54+
float: right;
55+
}
5256
.author-link {
5357
margin-right: 20px;
5458
}

src/views/SketchDetails.vue

Lines changed: 59 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<v-container>
2+
<v-container grid-list-lg>
33
<v-dialog v-model="showFeatureThisDialog">
44
<v-card>
55
<v-card-title class="headline">Please enter a little teaser text</v-card-title>
@@ -18,53 +18,57 @@
1818
<Sketch :sketch="sketch" :showDetailsLink=false :showAuthor=false></Sketch>
1919
</v-flex>
2020
<v-flex xs12 md6 class="details">
21-
<v-btn v-if="isModerator" @click="showFeatureThisDialog = true">Feature this</v-btn>
22-
<div class="likes">
23-
<v-icon v-if="didLike" large color="pink" :title="didLikeTitle">favorite</v-icon>
24-
<v-icon v-else large color="grey">favorite</v-icon>
25-
<v-progress-circular v-if="isLoading" class="wait-icon" indeterminate color="primary"></v-progress-circular>
26-
<div v-else class="like-interaction">
27-
<v-btn v-if="didLike" icon @click="invertLike" title="I want my egg back!">
28-
<v-icon>remove</v-icon>
29-
</v-btn>
30-
<v-btn v-else icon @click="invertLike" title="Add an egg to the basket">
31-
<v-icon>add</v-icon>
32-
</v-btn>
33-
</div>
34-
<h5>
35-
<span v-if="0 === totalLikes">
36-
no
37-
</span>
38-
<span v-else>
39-
{{totalLikes}}&nbsp;
40-
</span>egg<span v-if="1 < totalLikes">s</span> in the basket
41-
<span v-if="0 === totalLikes">
42-
yet
43-
</span>
44-
</h5>
45-
</div>
46-
<div class="author-link">
47-
<router-link :to="{name: 'user', params: {uid: this.sketch.createdByUid, username: this.sketch.createdBy.displayName.replace(/\s/g, '+')}}">{{this.sketch.createdBy.displayName}}</router-link>
48-
</div>
49-
<div class="created">{{creationDate}}</div>
50-
<div class="comments">
51-
<div class="create-comment">
52-
<v-btn icon color="primary" title="Write comment" v-scroll-to="'#comment-textfield'" @click="focusCommentTextfield">
53-
<v-icon>add</v-icon>
54-
</v-btn>
55-
</div>
56-
<h2>{{comments.length}} Comments</h2>
57-
<Comment v-for="comment in comments" :comment="comment" :key="comment.id"></Comment>
58-
<v-text-field
59-
id="comment-textfield"
60-
v-model="newCommentBody"
61-
label="Add a comment"
62-
hint="Please be polite ;)"
63-
ref="commentTextfield"
64-
multi-line
65-
></v-text-field>
66-
<v-btn class="submitComment" :disabled="this.newCommentBody.length === 0" small color="primary" @click="submitComment">Submit comment</v-btn>
67-
</div>
21+
<v-card>
22+
<v-card-text>
23+
<v-btn v-if="isModerator" @click="showFeatureThisDialog = true">Feature this</v-btn>
24+
<div class="likes">
25+
<v-icon v-if="didLike" large color="pink" :title="didLikeTitle">favorite</v-icon>
26+
<v-icon v-else large color="grey">favorite</v-icon>
27+
<v-progress-circular v-if="isLoading" class="wait-icon" indeterminate color="primary"></v-progress-circular>
28+
<div v-else class="like-interaction">
29+
<v-btn v-if="didLike" icon @click="invertLike" title="I want my egg back!">
30+
<v-icon>remove</v-icon>
31+
</v-btn>
32+
<v-btn v-else icon @click="invertLike" title="Add an egg to the basket">
33+
<v-icon>add</v-icon>
34+
</v-btn>
35+
</div>
36+
<h5>
37+
<span v-if="0 === totalLikes">
38+
no
39+
</span>
40+
<span v-else>
41+
{{totalLikes}}&nbsp;
42+
</span>egg<span v-if="1 < totalLikes">s</span> in the basket
43+
<span v-if="0 === totalLikes">
44+
yet
45+
</span>
46+
</h5>
47+
</div>
48+
<div class="author-link">
49+
Author: <router-link :to="{name: 'user', params: {uid: this.sketch.createdByUid, username: this.sketch.createdBy.displayName.replace(/\s/g, '+')}}">{{this.sketch.createdBy.displayName}}</router-link>
50+
</div>
51+
<div class="created">Date: {{creationDate}}</div>
52+
<div class="comments">
53+
<div class="create-comment">
54+
<v-btn icon color="primary" title="Write comment" v-scroll-to="'#comment-textfield'" @click="focusCommentTextfield">
55+
<v-icon>add</v-icon>
56+
</v-btn>
57+
</div>
58+
<h2>{{comments.length}} Comments</h2>
59+
<Comment v-for="comment in comments" :comment="comment" :key="comment.id"></Comment>
60+
<v-text-field
61+
id="comment-textfield"
62+
v-model="newCommentBody"
63+
label="Add a comment"
64+
hint="Please be polite ;)"
65+
ref="commentTextfield"
66+
multi-line
67+
></v-text-field>
68+
<v-btn class="submitComment" :disabled="this.newCommentBody.length === 0" small color="primary" @click="submitComment">Submit comment</v-btn>
69+
</div>
70+
</v-card-text>
71+
</v-card>
6872
</v-flex>
6973
</v-layout>
7074
</v-container>
@@ -255,7 +259,9 @@ export default {
255259

256260
<style lang="scss" scoped>
257261
.details {
258-
padding: 7px;
262+
.card {
263+
padding-bottom: 15px;
264+
}
259265
.likes {
260266
min-height: 60px;
261267
button {
@@ -284,6 +290,7 @@ export default {
284290
}
285291
.created {
286292
border-bottom: 1px solid #0a6aa6;
293+
padding-bottom: 20px;
287294
}
288295
.created,
289296
.comments {
@@ -297,16 +304,12 @@ export default {
297304
top: -5px;
298305
button {
299306
margin-right: 0;
307+
top: 0px;
300308
}
301309
}
302310
& h2 {
303311
margin-bottom: 10px;
304312
}
305-
.submitButton {
306-
float: right;
307-
margin-right: 0;
308-
margin-top: 0;
309-
}
310313
}
311314
}
312315
</style>
@@ -316,5 +319,7 @@ export default {
316319
float: right;
317320
margin-right: 0;
318321
margin-top: 0;
322+
position: relative;
323+
top: -12px;
319324
}
320325
</style>

0 commit comments

Comments
 (0)