-
Notifications
You must be signed in to change notification settings - Fork 15
/
layout.vue
431 lines (411 loc) · 24.5 KB
/
layout.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
<template>
<div class="buma">
<div class="top-anchor"></div>
<nav :class="bulma('nav navbar')" role="navigation" aria-label="main navigation">
<div :class="bulma('navbar-brand')">
<nuxt-link to="/" :class="bulma('navbar-item')"
><img :src="$store.state.config['wiki.logo_url']" v-if="$store.state.config['wiki.logo_url']" />{{
$store.state.config['wiki.site_name']
}}</nuxt-link
>
<a :class="bulma({'navbar-burger': true, 'is-active': isNavbarActive})" @click.prevent="toggleNavbarBurger">
<span></span>
<span></span>
<span></span>
</a>
</div>
<div :class="bulma({'navbar-menu': true, 'is-active': isNavbarActive})" id="mainNavbar">
<div :class="bulma('navbar-start')">
<nuxt-link to="/RecentChanges" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-binoculars"></buma-font-awesome-icon> </span
> 최근 변경
</nuxt-link>
<nuxt-link to="/RecentDiscuss" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-regular fa-comments"></buma-font-awesome-icon> </span
> 최근 토론
</nuxt-link>
<b-dropdown icon="fa-solid fa-cogs" label="도구">
<nuxt-link :class="bulma('navbar-item')" to="/NeededPages">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-beer"></buma-font-awesome-icon> </span
> 작성이 필요한 문서
</nuxt-link>
<nuxt-link :class="bulma('navbar-item')" to="/OrphanedPages">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-regular fa-frown"></buma-font-awesome-icon> </span
> 고립된 문서
</nuxt-link>
<nuxt-link :class="bulma('navbar-item')" to="/UncategorizedPages">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-regular fa-question-circle"></buma-font-awesome-icon> </span
> 분류가 되지 않은 문서
</nuxt-link>
<nuxt-link :class="bulma('navbar-item')" to="/OldPages">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-pause"></buma-font-awesome-icon> </span
> 편집된 지 오래된 문서
</nuxt-link>
<nuxt-link :class="bulma('navbar-item')" to="/ShortestPages">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-regular fa-thumbs-down"></buma-font-awesome-icon> </span
> 내용이 짧은 문서
</nuxt-link>
<nuxt-link :class="bulma('navbar-item')" to="/LongestPages">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-regular fa-thumbs-up"></buma-font-awesome-icon> </span
> 내용이 긴 문서
</nuxt-link>
<nuxt-link :class="bulma('navbar-item')" to="/BlockHistory">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-ban"></buma-font-awesome-icon> </span
> 차단 내역
</nuxt-link>
<nuxt-link :class="bulma('navbar-item')" to="/RandomPage">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-random"></buma-font-awesome-icon> </span
> RandomPage
</nuxt-link>
<nuxt-link :class="bulma('navbar-item')" to="/Upload">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-cloud-upload-alt"></buma-font-awesome-icon> </span
> 파일 올리기
</nuxt-link>
<nuxt-link :class="bulma('navbar-item')" to="/License">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-regular fa-copyright"></buma-font-awesome-icon> </span
> 라이선스
</nuxt-link>
<template v-if="$store.state.session.menus.length">
<nuxt-link v-for="m in $store.state.session.menus" :to="m.l" v-bind:key="m.l" :class="bulma('navbar-item')" v-text="m.t" />
</template>
</b-dropdown>
</div>
<div :class="bulma('navbar-end')">
<div :class="bulma('navbar-item is-hidden-touch')">
<search-form />
</div>
<template v-if="$store.state.session.account.type === 1">
<b-dropdown right-dropdown icon="fa-solid fa-user" :label="$store.state.session.account.name">
<a href="#" @click.prevent="openSettingModal" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-wrench"></buma-font-awesome-icon>
</span>
스킨 설정
</a>
<nuxt-link to="/member/mypage" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-regular fa-user-circle"></buma-font-awesome-icon>
</span>
내 정보
</nuxt-link>
<nuxt-link :to="doc_action_link(user_doc($store.state.session.account.name), 'w')" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-regular fa-sticky-note"></buma-font-awesome-icon>
</span>
내 사용자 문서
</nuxt-link>
<div :class="bulma('navbar-divider')"></div>
<nuxt-link :to="contribution_link($store.state.session.account.uuid)" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-chart-line"></buma-font-awesome-icon>
</span>
내 문서 기여 목록
</nuxt-link>
<nuxt-link :to="contribution_link_discuss($store.state.session.account.uuid)" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-chart-bar"></buma-font-awesome-icon>
</span>
내 토론 기여 목록
</nuxt-link>
<nuxt-link to="/member/starred_documents" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-bookmark"></buma-font-awesome-icon>
</span>
별찜한 문서
</nuxt-link>
<div :class="bulma('navbar-divider')"></div>
<nuxt-link :to="{ path: '/member/logout', query: { redirect: $route.fullPath } }" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-sign-out-alt"></buma-font-awesome-icon>
</span>
로그아웃
</nuxt-link>
</b-dropdown>
</template>
<template v-else>
<b-dropdown right-dropdown icon="fa-solid fa-user-secret" label="익명">
<a href="#" @click.prevent="openSettingModal" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-wrench"></buma-font-awesome-icon>
</span>
스킨 설정
</a>
<nuxt-link :to="contribution_link($store.state.session.account.uuid)" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-chart-line"></buma-font-awesome-icon>
</span>
내 문서 기여 목록
</nuxt-link>
<nuxt-link :to="contribution_link_discuss($store.state.session.account.uuid)" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-chart-bar"></buma-font-awesome-icon>
</span>
내 토론 기여 목록
</nuxt-link>
<div :class="bulma('navbar-divider')"></div>
<nuxt-link :to="{ path: '/member/login', query: { redirect: $route.fullPath } }" :class="bulma('navbar-item')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-sign-in-alt"></buma-font-awesome-icon>
</span>
로그인
</nuxt-link>
</b-dropdown>
</template>
</div>
</div>
</nav>
<nav class="mobile-search-navbar" :class="bulma('nav navbar is-hidden-desktop')">
<div :class="bulma('navbar-brand')">
<div :class="bulma('navbar-item')">
<search-form />
</div>
</div>
</nav>
<section
id="wiki-main-title"
:class="bulma({ 'hero': true, [$store.state.page.data.error || $store.state.page.viewName == 'notfound' ? 'is-danger' : 'is-primary']: true })"
>
<div :class="bulma('hero-body')">
<div :class="bulma('container')">
<h1 :class="bulma('title')" v-text="$store.state.page.title" />
<h2 :class="bulma('subtitle')">
<span v-if="$store.state.page.viewName === 'wiki' && $store.state.page.data.date">
<local-date :date="$store.state.page.data.date" />에 마지막으로 수정됐습니다.
</span>
<span v-else-if="$store.state.page.viewName === 'notfound'"> 존재하지 않는 문서입니다. 직접 자유롭게 기여해보세요! </span>
<span v-else> Powered by the seed engine </span>
</h2>
</div>
</div>
<div :class="bulma('hero-foot')">
<nav :class="bulma('tabs is-left is-boxed')" id="wiki-article-menu">
<div :class="bulma('container')">
<ul v-if="$store.state.page.data.document">
<li v-bind:class="bulma({ 'is-active': $store.state.page.viewName === 'wiki' }, true)">
<nuxt-link :to="doc_action_link($store.state.page.data.document, 'w')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-eye"></buma-font-awesome-icon>
</span>
<span class="wiki-article-menu-text"> 읽기</span>
</nuxt-link>
</li>
<li v-bind:class="bulma({ 'is-active': $store.state.page.viewName === 'edit' || $store.state.page.viewName === 'edit_request' || $store.state.page.viewName === 'edit_edit_request' }, true)">
<nuxt-link :to="doc_action_link($store.state.page.data.document, 'edit')" class="edit-anchor">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-edit"></buma-font-awesome-icon>
</span>
<span class="wiki-article-menu-text"> 편집</span>
</nuxt-link>
</li>
<li v-bind:class="bulma({ 'is-active': ['thread', 'thread_list', 'thread_list_close'].includes($store.state.page.viewName) }, true)">
<nuxt-link :to="doc_action_link($store.state.page.data.document, 'discuss')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-regular fa-comments"></buma-font-awesome-icon>
</span>
<span class="wiki-article-menu-text"> 토론</span>
</nuxt-link>
</li>
<li v-bind:class="bulma({ 'is-active': $store.state.page.viewName === 'move' }, true)">
<nuxt-link :to="doc_action_link($store.state.page.data.document, 'move')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-arrow-right"></buma-font-awesome-icon>
</span>
<span class="wiki-article-menu-text"> 이동</span>
</nuxt-link>
</li>
<li v-bind:class="bulma({ 'is-active': $store.state.page.viewName === 'delete' }, true)">
<nuxt-link :to="doc_action_link($store.state.page.data.document, 'delete')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-regular fa-trash-alt"></buma-font-awesome-icon>
</span>
<span class="wiki-article-menu-text"> 삭제</span>
</nuxt-link>
</li>
<li v-bind:class="bulma({ 'is-active': $store.state.page.viewName === 'backlink' }, true)">
<nuxt-link :to="doc_action_link($store.state.page.data.document, 'backlink')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-random"></buma-font-awesome-icon>
</span>
<span class="wiki-article-menu-text"> 역링크</span>
</nuxt-link>
</li>
<li v-bind:class="bulma({ 'is-active': $store.state.page.viewName === 'history' }, true)">
<nuxt-link :to="doc_action_link($store.state.page.data.document, 'history')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-history"></buma-font-awesome-icon>
</span>
<span class="wiki-article-menu-text"> 역사</span>
</nuxt-link>
</li>
<li v-bind:class="bulma({ 'is-active': $store.state.page.viewName === 'acl' }, true)">
<nuxt-link :to="doc_action_link($store.state.page.data.document, 'acl')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-key"></buma-font-awesome-icon>
</span>
<span class="wiki-article-menu-text"> ACL</span>
</nuxt-link>
</li>
<!-- [나무위키] main.b9faec2b37c8d51a1d7e.js 참고함 -->
<li
v-if="$store.state.page.viewName === 'wiki'"
class="star-tab"
v-bind:class="{ starred: $store.state.page.data.starred }"
>
<nuxt-link
v-if="$store.state.page.data.starred"
:to="doc_action_link($store.state.page.data.document, 'member/unstar')"
>
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-star"></buma-font-awesome-icon>
</span>
<span class="wiki-article-menu-text"> 별찜 해제 (</span
><span class="star-count">{{ $store.state.page.data.star_count ? $store.state.page.data.star_count : '' }}</span
><span class="wiki-article-menu-text">)</span>
</nuxt-link>
<nuxt-link v-else :to="doc_action_link($store.state.page.data.document, 'member/star')">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-star"></buma-font-awesome-icon>
</span>
<span class="wiki-article-menu-text"> 별찜 (</span
><span class="star-count">{{ $store.state.page.data.star_count ? $store.state.page.data.star_count : '' }}</span
><span class="wiki-article-menu-text">)</span>
</nuxt-link>
</li>
<!-- [나무위키] main.a65ef46d6b3879416d5f.js 및 main.b9faec2b37c8d51a1d7e.js 참고함 -->
<li v-if="$store.state.page.data.user">
<nuxt-link :to="contribution_link($store.state.page.data.user.uuid)">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fas fa-chart-line"></buma-font-awesome-icon>
</span>
<span class="wiki-article-menu-text"> 기여 목록</span>
</nuxt-link>
</li>
</ul>
<ul v-else>
<li :class="bulma('is-active', true)">
<a href="#">
<span :class="bulma('icon')">
<buma-font-awesome-icon icon="fa-solid fa-cogs"></buma-font-awesome-icon>
</span>
<span class="wiki-article-menu-text"> 특수 문서</span>
</a>
</li>
</ul>
</div>
</nav>
</div>
</section>
<section :class="bulma('section')">
<div :class="bulma('container')">
<b-notification
v-if="
$store.state.session.user_document_discuss &&
$store.state.localConfig['wiki.hide_user_document_discuss'] !== $store.state.session.user_document_discuss
"
:class="bulma('is-link')"
>
<nuxt-link :to="doc_action_link(user_doc($store.state.session.account.name), 'discuss')">사용자 토론</nuxt-link>이 있습니다.
확인해주세요.
</b-notification>
<b-notification v-if="$store.state.config['wiki.sitenotice']">
<span v-html="$store.state.config['wiki.sitenotice']" />
</b-notification>
<div class="wiki-article" @dblclick="doBehaviorWhenDblClick">
<nuxt />
<!--<skin-license v-if="$store.state.page.viewName === 'license'"></skin-license>-->
</div>
</div>
</section>
<footer :class="bulma('footer')">
<div :class="bulma('container')">
<div :class="bulma('content has-text-centered')">
<p>
<span v-html="$store.state.config['wiki.copyright_text']" />
<span v-html="$store.state.config['wiki.footer_text']" />
theseed-skin-buma by LiteHell, the seed engine by theseed.io <br>
theseed-skin-buma is distributed under <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Public License Version 3</a>
</p>
</div>
</div>
</footer>
<jump-buttons />
</div>
</template>
<!-- 리버티 스킨 참고함 -->
<style>
@import './css/bulma.min.css';
@import './css/layout.min.css';
</style>
<script>
import Common from '~/mixins/common';
import SettingModal from './components/settingModal';
import LocalDate from '~/components/localDate';
import SearchForm from './components/searchForm';
import BNotification from './components/b-notification';
import JumpButtons from './components/jumpButtons';
import BDropdown from './components/b-dropdown';
import bulma from './src/bulma';
import bumaFontAwesomeIcon from './components/buma-font-awesome-icon.vue';
if (process.browser) {
try {
require('./js/all.min.js');
} catch (e) {
console.log(e.stack);
}
}
export default {
mixins: [Common],
components: {
bumaFontAwesomeIcon,
LocalDate,
SearchForm,
BNotification,
JumpButtons,
BDropdown
},
loadingBarColor(isDark) {
return isDark ? 'white' : 'black';
},
data: function () {
return {
isNavbarActive: false
};
},
methods: {
doBehaviorWhenDblClick() {
if (!this.$store.state.page.data.document) return;
const action = this.$store.state.localConfig['buma.behaviorWhenDblClick'];
switch (action) {
case 'edit':
case 'history':
const link = this.doc_action_link(this.$store.state.page.data.document, action);
this.$router.push(link);
break;
case 'doNothing':
case 'skinDefault':
default:
break;
}
},
toggleNavbarBurger() {
this.isNavbarActive = !this.isNavbarActive;
},
bulma,
openSettingModal() {
this.$vfm.show({ component: SettingModal });
}
}
};
</script>