Skip to content

Commit 725b6ef

Browse files
authored
Merge pull request #69 from segment-oj/add-icon-to-nav-ztl
Add icon to nav ztl
2 parents 6176c72 + 7003186 commit 725b6ef

File tree

10 files changed

+87
-17
lines changed

10 files changed

+87
-17
lines changed

public/favicon.ico

63.4 KB
Binary file not shown.

src/assets/css/basic.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ h3::before {
6363
content: "# ";
6464
}
6565

66+
.markdown-container img {
67+
max-width: 100%;
68+
}
69+
6670
.markdown-container h1,
6771
.cm-header-1 {
6872
font-size: 30px;
Lines changed: 34 additions & 0 deletions
Loading

src/components/home/page.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,3 @@ export default {
1212
}
1313
};
1414
</script>
15-
16-
<style scoped>
17-
18-
</style>

src/components/page/navbar.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
text-color="#fff"
1212
active-text-color="rgb(233, 233, 235)"
1313
>
14+
<el-menu-item index=""><img src="./../../assets/icon/SOJ-thick-white.svg" style="height: 40px;" /></el-menu-item>
1415
<el-menu-item index="/"><i class="el-icon-s-home" /> Home</el-menu-item>
1516
<el-menu-item index="/problem/list"><i class="el-icon-s-order" />Problem List</el-menu-item>
1617
<el-submenu index="2" id="user">

src/components/problem/content.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
<div class="tool-content">{{title}}</div>
5656
<el-divider class="divider">PID</el-divider>
5757
<div class="tool-content">#{{pid}}</div>
58+
<el-divider class="divider">Date Created</el-divider>
59+
<div class="tool-content">{{timeAdd}}</div>
5860
</el-card>
5961
<el-card shadow="never" class="margin-top">
6062
<div><i class="el-icon-menu" /> Limitation </div>
@@ -70,6 +72,7 @@
7072
</template>
7173

7274
<script>
75+
import timeFormat from './../../methods/time';
7376
import apiurl from './../../apiurl';
7477
import MarkdownContainer from './../lib/MarkdownContainer.vue';
7578
@@ -78,14 +81,15 @@ export default {
7881
data() {
7982
return {
8083
description: null,
81-
title: '-',
84+
title: 'Unknown',
8285
pid: this.$route.params.id,
8386
allowHTML: false,
8487
isWider: false,
8588
enable: true,
8689
hidden: false,
8790
time: '-',
8891
memery: '-',
92+
timeAdd: 'Unknown',
8993
problemLoading: true
9094
};
9195
},
@@ -102,6 +106,7 @@ export default {
102106
this.memery = data.memory_limit / 1000;
103107
this.time = data.time_limit;
104108
this.hidden = !data.enabled;
109+
this.timeAdd = timeFormat(data.date_added);
105110
this.problemLoading = false;
106111
})
107112
.catch(err => {

src/components/problem/list.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ export default {
4545
if (!x.enabled) {
4646
x.title = (
4747
<div>
48+
<router-link to={'/problem/' + String(x.pid)} class={color + ' text-normal'}>{ x.title } </router-link>
4849
<el-tag effect="dark" type="warning">Hidden</el-tag>
49-
<router-link to={'/problem/' + String(x.pid)} class={color + ' text-normal'}> { x.title }</router-link>
5050
</div>
5151
);
5252
} else {

src/components/problem/submit.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default {
3232
data() {
3333
return {
3434
code: '',
35-
lang_num: null,
35+
lang_num: '-',
3636
buttonLoading: false,
3737
options: [{
3838
value: '0',

src/components/user/content.vue

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<el-button @click="$router.go(-1);">Back</el-button>
1111
</el-card>
1212
</div>
13-
<div id="info">
13+
<div id="info" v-loading="userLoading">
1414
<el-row :gutter="20">
1515
<el-col :span="18">
1616
<el-card shadow="never">
@@ -25,10 +25,26 @@
2525
</el-card>
2626
</el-col>
2727
</el-row>
28-
<el-card shadow="never" class="item">
29-
<div slot="header" class="clearfix"><i class="el-icon-message" /> Email</div>
30-
{{email}}
31-
</el-card>
28+
<el-row :gutter="20">
29+
<el-col :span="12">
30+
<el-card shadow="never" class="item">
31+
<div slot="header" class="clearfix"><i class="el-icon-message" /> Email</div>
32+
{{email}}
33+
</el-card>
34+
</el-col>
35+
<el-col :span="6">
36+
<el-card shadow="never" class="item">
37+
<div slot="header" class="clearfix"><i class="el-icon-date" /> Time Joined</div>
38+
{{timeJoin}}
39+
</el-card>
40+
</el-col>
41+
<el-col :span="6">
42+
<el-card shadow="never" class="item">
43+
<div slot="header" class="clearfix"><i class="el-icon-time" /> Last Login</div>
44+
{{lastLogin}}
45+
</el-card>
46+
</el-col>
47+
</el-row>
3248
<el-row :gutter="20">
3349
<el-col :span="8">
3450
<el-card shadow="never" class="item">
@@ -39,7 +55,7 @@
3955
<el-col :span="8">
4056
<el-card shadow="never" class="item">
4157
<div slot="header" class="clearfix"><i class="el-icon-upload2" /> Submited</div>
42-
{{submit}} Problems
58+
{{submit}} Times
4359
</el-card>
4460
</el-col>
4561
<el-col :span="8">
@@ -58,21 +74,25 @@
5874
</template>
5975

6076
<script>
77+
import timeFormat from './../../methods/time';
6178
import apiurl from './../../apiurl';
6279
import MarkdownContainer from './../lib/MarkdownContainer.vue';
6380
6481
export default {
6582
name: 'UserHomepage',
6683
data() {
6784
return {
68-
username: '-',
85+
username: 'Unknown',
6986
userid: '-',
70-
email: '-',
87+
email: 'Unknown',
7188
introduction: null,
7289
solved: '-',
7390
submit: '-',
74-
rate: '-',
75-
ismine: false
91+
rate: 100,
92+
ismine: false,
93+
timeJoin: 'Unknown',
94+
lastLogin: 'Unknown',
95+
userLoading: true
7696
};
7797
},
7898
methods: {
@@ -87,6 +107,9 @@ export default {
87107
this.introduction = data.introduction;
88108
this.solved = data.solved;
89109
this.submit = data.submit_time;
110+
this.timeJoin = timeFormat(data.date_joined);
111+
this.lastLogin = timeFormat(data.last_login);
112+
this.userLoading = false;
90113
if (this.solved == 0) {
91114
this.rate = 100;
92115
} else {

src/methods/time.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
let timeFormat = (origin) => {
2+
let time = new Date(origin);
3+
let res = time.getFullYear() + '-' + (time.getMonth() + 1) + '-' + time.getDate();
4+
return res;
5+
};
6+
7+
export default timeFormat;

0 commit comments

Comments
 (0)