Skip to content

Commit

Permalink
feat: import template for ctb
Browse files Browse the repository at this point in the history
  • Loading branch information
holishing committed May 26, 2022
1 parent 950af57 commit 9dfa205
Show file tree
Hide file tree
Showing 12 changed files with 264 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
templates/
29 changes: 29 additions & 0 deletions templates/askover18.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

{{define "TOPBAR-CONTAINER"}}{{end}}

{{define "MAIN-CONTAINER"}}
<div class="bbs-screen bbs-content">
<div class="over18-notice">
<p>本網站已依網站內容分級規定處理</p>

<p>警告︰您即將進入之看板內容需滿十八歲方可瀏覽。</p>

<p>若您尚未年滿十八歲,請點選離開。若您已滿十八歲,亦不可將本區之內容派發、傳閱、出售、出租、交給或借予年齡未滿18歲的人士瀏覽,或將本網站內容向該人士出示、播放或放映。</p>
</div>
</div>

<div class="bbs-screen bbs-content center clear">
<form action="/ask/over18" method="post">
<input type="hidden" name="from" value="{{.From}}">
<div class="over18-button-container">
<button class="btn-big" type="submit" name="yes" value="yes">我同意,我已年滿十八歲<br><small>進入</small></button>
</div>
<div class="over18-button-container">
<button class="btn-big" type="submit" name="no" value="no">未滿十八歲或不同意本條款<br><small>離開</small></button>
</div>
</form>
</div>
{{end}}


{{define "TITLE"}}殼層體驗{{end}}
26 changes: 26 additions & 0 deletions templates/bbsarticle.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

{{define "TOPBAR-CONTAINER"}}<div id="topbar-container">
<div id="topbar" class="bbs-content">
<a id="logo" href="/bbs/">殼層體驗</a>
<span>&rsaquo;</span>
<a class="board" href="/bbs/{{.Board.BrdName}}/index.html"><span class="board-label">看板 </span>{{.Board.BrdName}}</a>
<a class="right small" href="/about.html">關於我們</a>
<a class="right small" href="/contact.html">聯絡資訊</a>
</div>
</div>
<div id="navigation-container">
<div id="navigation" class="bbs-content">
<a class="board" href="/bbs/{{.Board.BrdName}}/index.html">返回看板</a>
<div class="bar"></div>
</div>
</div>{{end}}

{{define "MAIN-CONTAINER"}}<div id="main-container">
<div id="main-content" class="bbs-screen bbs-content">{{.Content}}</div>

<div id="article-polling" data-pollurl="{{.PollUrl}}" data-longpollurl="{{.LongPollUrl}}" data-offset="{{.CurrOffset}}"></div>
{{.ContentTail}}
</div>{{end}}


{{define "TITLE"}}{{.Title}} - 看板 {{.Board.BrdName}} - 殼層體驗{{end}}
68 changes: 68 additions & 0 deletions templates/bbsindex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

{{define "TOPBAR-CONTAINER"}}<div id="topbar-container">
<div id="topbar" class="bbs-content">
<a id="logo" href="/bbs/">殼層體驗</a>
<span>&rsaquo;</span>
<a class="board" href="/bbs/{{.Board.BrdName}}/index.html"><span class="board-label">看板 </span>{{.Board.BrdName}}</a>
<a class="right small" href="/about.html">關於我們</a>
<a class="right small" href="/contact.html">聯絡資訊</a>
</div>
</div>{{end}}
{{define "MAIN-CONTAINER"}}<div class="main-container">
<div id="action-bar-container">
<div class="action-bar">
<div class="btn-group btn-group-dir">
<a class="btn selected" href="/bbs/{{.Board.BrdName}}/index.html">看板</a>
<a class="btn" href="/man/{{.Board.BrdName}}/index.html">精華區</a>
</div>
<div class="btn-group btn-group-paging">
<a class="btn wide" href="{{.FirstPage}}">最舊</a>
<a class="btn wide" href="{{.PrevPage}}">&lsaquo; 上頁</a>
<a class="btn wide disabled">下頁 &rsaquo;</a>
<a class="btn wide" href="{{.LastPage}}">最新</a>
</div>
</div>
</div>


<div class="r-list-container action-bar-margin bbs-screen">
<div class="search-bar">
<form type="get" action="search" id="search-bar">
<input class="query" type="text" name="q" value="" placeholder="搜尋文章&#x22ef;">
</form>
</div>

{{range $article := .Articles}}
<div class="r-ent">
<div class="nrec">{{colored_counter $article.Recommend}}</div>
<div class="title">

<a href="/bbs/{{$.Board.BrdName}}/{{$article.FileName}}.html">{{$article.Title}}</a>

</div>
<div class="meta">
<div class="author">{{$article.Owner}}</div>
<div class="article-menu">
<div class="trigger">&#x22ef;</div>
<div class="dropdown">
<div class="item"><a href="/bbs/{{.Board.BrdName}}/search?q={{route_search_thread $.Board $article.Title }}">搜尋同標題文章</a></div>

<div class="item"><a href="/bbs/{{.Board.BrdName}}/search?q={{route_search_author $.Board $article.Owner }}">搜尋看板內 {{$article.Owner}} 的文章</a></div>
</div>
</div>
<div class="date">{{$article.Date}}</div>
<div class="mark"></div>
</div>
</div>

{{end}}
</div>
</div>{{end}}

{{define "RECOMMOND"}}

{{.}}

{{end}}

{{define "TITLE"}}看板 {{.Board.BrdName}} 文章列表 - 殼層體驗{{end}}
Empty file added templates/captcha.html
Empty file.
39 changes: 39 additions & 0 deletions templates/classlist.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

{{define "TOPBAR-CONTAINER"}}<div id="topbar-container">
<div id="topbar" class="bbs-content">
<a id="logo" href="/bbs/">殼層體驗</a>
<a class="right small" href="/about.html">關於我們</a>
<a class="right small" href="/contact.html">聯絡資訊</a>
</div>
</div>{{end}}

{{define "MAIN-CONTAINER"}}<div id="main-container">
<div id="action-bar-container">
<div class="action-bar">
<div class="btn-group btn-group-cls">
<a class="btn" href="/bbs/hotboards.html">熱門看板</a>
<a class="btn selected" href="/cls/5">分類看板</a>
</div>
</div>
</div>

<div class="b-list-container action-bar-margin bbs-screen">
{{range $board := .Boards}}
<div class="b-ent">
<a class="board" href="{{if eq $board.IsBoard true}}
/bbs/{{$board.BrdName}}/index.html
{{else}}
/cls/{{$board.Bid}}
{{end}}
">
<div class="board-name">{{$board.BrdName}}</div>
<div class="board-nuser"></div>
<div class="board-class">{{$board.Class}}</div>
<div class="board-title">{{$board.Title}}</div>
</a>
</div>
{{end}}

</div>
</div>{{if .IsHotboardList}} hotboard {{else}} Not hotboard {{end}} {{end}}
{{define "TITLE"}}分類看板 - 殼層體驗{{end}}
1 change: 1 addition & 0 deletions templates/common.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMMON
6 changes: 6 additions & 0 deletions templates/error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

{{define "TOPBAR-CONTAINER"}}{{end}}
{{define "MAIN-CONTAINER"}}<div class="main-container">
<div class="bbs-screen bbs-content">{{.Content}}</div>
</div>{{end}}
{{define "TITLE"}}xx{{.Title}}xx{{end}}
24 changes: 24 additions & 0 deletions templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{define "ROOT"}}<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{template "TITLE" .}}</title>
<link rel="stylesheet" type="text/css" href="//www.clam.moe/resources/v2.27-ctb01/bbs-common.css">
<link rel="stylesheet" type="text/css" href="//www.clam.moe/resources/v2.27-ctb01/bbs-base.css" media="screen">
<link rel="stylesheet" type="text/css" href="//www.clam.moe/resources/v2.27-ctb01/bbs-custom.css">
<link rel="stylesheet" type="text/css" href="//www.clam.moe/resources/v2.27-ctb01/pushstream.css" media="screen">
<link rel="stylesheet" type="text/css" href="//www.clam.moe/resources/v2.27-ctb01/bbs-print.css" media="print">
</head>
<body>

{{template "TOPBAR-CONTAINER" .}}
{{template "MAIN-CONTAINER" .}}
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="//www.clam.moe/resources/v2.27-ctb01/bbs.js"></script>
<!-- Google Analytics -->
</body>
</html>
{{end}}

{{define "XX"}}{{.Title}}{{end}}
24 changes: 24 additions & 0 deletions templates/manarticle.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

{{define "TOPBAR-CONTAINER"}}<div id="topbar-container">
<div id="topbar" class="bbs-content">
<a id="logo" href="/bbs/">殼層體驗</a>
<span>&rsaquo;</span>
<a class="board" href="/man/{{.Board.BrdName}}/index.html"><span class="board-label">精華區<sup>beta</sup></span>{{.Board.BrdName}}</a>
<a class="right small" href="/about.html">關於我們</a>
<a class="right small" href="/contact.html">聯絡資訊</a>
</div>
</div>
<div id="navigation-container">
<div id="navigation" class="bbs-content">
<a class="board" href="/man/{{.Board.BrdName}}/{{.Path}}/../index.html">返回上層</a>
<div class="bar"></div>
</div>
</div>{{end}}

{{define "MAIN-CONTAINER"}}<div id="main-container">
<div id="main-content" class="bbs-screen bbs-content">{{.Content}}</div>
{{.ContentTail}}
</div>{{end}}


{{define "TITLE"}}{{.Title}} - 看板 {{.Board.BrdName}} - 殼層體驗{{end}}
41 changes: 41 additions & 0 deletions templates/manindex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

{{define "TOPBAR-CONTAINER"}}<div id="topbar-container">
<div id="topbar" class="bbs-content">
<a id="logo" href="/bbs/">殼層體驗</a>
<span>&rsaquo;</span>
<a class="board" href="/man/{{.Board.BrdName}}/index.html"><span class="board-label">精華區<sup>beta</sup></span>{{.Board.BrdName}}</a>
<a class="right small" href="/about.html">關於我們</a>
<a class="right small" href="/contact.html">聯絡資訊</a>
</div>
</div>
<div id="navigation-container">
<div id="navigation" class="bbs-content">
<a class="board" href="/man/{{.Board.BrdName}}/{{.Path}}/../index.html">返回上層</a>
<div class="bar"></div>
</div>
</div>{{end}}

{{define "MAIN-CONTAINER"}}<div id="main-container">
<div id="action-bar-container">
<div class="action-bar">
<div class="btn-group btn-group-dir">
<a class="btn" href="/bbs/{{.Board.BrdName}}/index.html">看板</a>
<a class="btn selected" href="/man/{{.Board.BrdName}}/index.html">精華區</a>
</div>
</div>
</div>
{{.Path}}
<div class="m-list-container bbs-screen">

{{range $entry := .Entries}}
<div class="m-ent">
<div class="title">
<a href="{{if $entry.IsDir}}/man/{{$entry.BoardName}}/{{$entry.Path}}/index.html{{else}}/man/{{$entry.BoardName}}/{{$entry.Path}}.html{{end}}">{{$entry.Title}}</a>
</div>
</div>
{{end}}
</div>
</div>{{end}}


{{define "TITLE"}}精華區 {{.Board.BrdName}} 文章列表 - 殼層體驗{{end}}
6 changes: 6 additions & 0 deletions templates/notfound.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

{{define "TOPBAR-CONTAINER"}}{{end}}
{{define "MAIN-CONTAINER"}}<div class="main-container">
<div class="bbs-screen bbs-content">404 - Not Found.</div>
</div>{{end}}
{{define "TITLE"}}404{{end}}

0 comments on commit 9dfa205

Please sign in to comment.