Răsfoiți Sursa

하나로 통합

2DU 9 ani în urmă
părinte
comite
75796585ec
4 a modificat fișierele cu 56 adăugiri și 154 ștergeri
  1. 6 6
      app.py
  2. 0 69
      templates/edit.html
  3. 50 0
      templates/index.html
  4. 0 79
      templates/recentchanges.html

+ 6 - 6
app.py

@@ -45,9 +45,9 @@ def recentchanges():
     curs.execute("select * from rc order by date desc limit 50")
     rows = curs.fetchall()
     if(rows):
-        return render_template('recentchanges.html', logo = data['name'], rows = rows)
+        return render_template('index.html', logo = data['name'], rows = rows, tn = 3)
     else:
-         return render_template('recentchanges.html', logo = data['name'], rows = '')
+         return render_template('index.html', logo = data['name'], rows = '', tn = 3)
 
 @app.route('/search', methods=['POST', 'GET'])
 def search():
@@ -63,9 +63,9 @@ def w(name = None):
     rows = curs.fetchall()
     if(rows):
         for row in rows:
-            return render_template('index.html', title = name, logo = data['name'], page = parse.quote(name), data = parse.unquote(row['data']), license = data['license'])
+            return render_template('index.html', title = name, logo = data['name'], page = parse.quote(name), data = parse.unquote(row['data']), license = data['license'], tn = 1)
     else:
-        return render_template('index.html', title = name, logo = data['name'], page = parse.quote(name), data = '문서 없음', license = data['license'])
+        return render_template('index.html', title = name, logo = data['name'], page = parse.quote(name), data = '문서 없음', license = data['license'], tn = 1)
 
 @app.route('/edit/<name>', methods=['POST', 'GET'])
 def edit(name = None):
@@ -90,9 +90,9 @@ def edit(name = None):
         rows = curs.fetchall()
         if(rows):
             for row in rows:
-                return render_template('edit.html', title = name, logo = data['name'], page = parse.quote(name), data = parse.unquote(row['data']))
+                return render_template('index.html', title = name, logo = data['name'], page = parse.quote(name), data = parse.unquote(row['data']), tn = 2)
         else:
-            return render_template('edit.html', title = name, logo = data['name'], page = parse.quote(name), data = '')
+            return render_template('index.html', title = name, logo = data['name'], page = parse.quote(name), data = '', tn = 2)
 
 @app.route('/setup')
 def setup():

+ 0 - 69
templates/edit.html

@@ -1,69 +0,0 @@
-<html>
-	<head>
-		<title>{{title}}</title>
-		<link rel="stylesheet" href="{{url_for('static', filename='primer.css')}}">
-		<link rel="stylesheet" href="{{url_for('static', filename='style.css')}}">
-		<link rel="stylesheet" href="{{url_for('static', filename='font-awesome/css/font-awesome.min.css')}}">
-		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css">
-		<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.js"></script>
-		<link rel="shortcut icon" href="{{url_for('static', filename='images/on.ico')}}">
-		<meta name="viewport" content="width=device-width, initial-scale=1">
-	</head>
-	<body>
-		<br>
-		<div class="one-fifth column">
-			<div id="top">
-				<a href="/" id="logo">{{logo}}</a>
-				<div>
-					<a href="/RecentChanges" id="RecentChanges"><i class="fa fa-refresh" aria-hidden="true"></i><span id="is_mobile">최근 변경</span></a>
-					<a href="/RecentChanges" id="RecentChanges"><i class="fa fa-comment" aria-hidden="true"></i><span id="is_mobile">최근 토론</span></a>
-					<a href="/random" id="log"><i class="fa fa-random" aria-hidden="true"></i></a>
-					<a href="/user" id="log"><i class="fa fa-user" aria-hidden="true"></i></a>
-					<a href="/other" id="log"><i class="fa fa-cogs" aria-hidden="true"></i></a>
-				</div>
-				<form method="POST" action="/search" id="search">
-					<div class="input-group">
-						<input class="form-control" name="search" type="text">
-						<span class="input-group-button"><button class="btn"><i class="fa fa-long-arrow-left" aria-hidden="true"></i></button></span>
-					</div>
-				</form>
-			</div>
-		</div>
-		<div class="scroll-buttons">
-			<a class="scroll-toc" href="#toc"><i class="fa fa-list-alt" aria-hidden="true"></i></a>
-			<a class="scroll-button" href="#top" id="left"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
-			<a class="scroll-bottom" href="#powered" id="right"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
-		</div>
-		<div id="left_bar">
-			<a href="#">맨 위로</a>
-			<br>
-			<br>
-			<!-- 내용 넣는 자리 -->
-		</div>
-		<div class="four-fifths column">
-			<div id="tool">
-				<nav class="menu">
-					<a class="menu-item selected" href="#">수정</a>
-					<a class="menu-item" href="/w/{{page}}">문서</a>
-				</nav>
-			</div>
-			<h1 class="title">{{title}}</h1>
-			<h2 class="title"><span style="margin-left:5px"></span>(수정)</h2>
-			<form id="usrform" name="f1" method="POST" action="/edit/{{page}}">
-				<textarea rows="30" cols="100" name="content" form="usrform">{{data}}</textarea>
-				<input name="send" style="margin-top:10px;width:100%" type="text">
-				<br>
-				<br>
-				<div class="form-actions">
-					<button class="btn btn-primary" type="submit" onclick="f1.action='/edit/{{page}}';">저장</button>
-					<button class="btn" type="submit" onclick="f1.action='/preview/{{page}}';">미리보기</button>
-				</div>
-			</form>
-			<hr id="last">
-			<p>{{license}}</p>
-			<div id="powered">
-				<a href="https://github.com/2DU/Ownet"><img src="{{url_for('static', filename='images/on2.png')}}" width="100px"></a>
-			</div>
-		</div>
-	</body>
-</html>

+ 50 - 0
templates/index.html

@@ -41,6 +41,7 @@
 			<!-- 내용 넣는 자리 -->
 		</div>
 		<div class="four-fifths column">
+			{% if tn == 1 %}
 			<div id="tool">
 				<nav class="menu">
 					<a class="menu-item selected" href="#" onclick="return false">문서</a>
@@ -59,6 +60,55 @@
 				<br>
 				{{data}}
 			</div>
+			{% elif tn == 2 %}
+			<div id="tool">
+				<nav class="menu">
+					<a class="menu-item selected" href="#">수정</a>
+					<a class="menu-item" href="/w/{{page}}">문서</a>
+				</nav>
+			</div>
+			<h1 class="title">{{title}}</h1>
+			<h2 class="title"><span style="margin-left:5px"></span>(수정)</h2>
+			<form id="usrform" name="f1" method="POST" action="/edit/{{page}}">
+				<textarea rows="30" cols="100" name="content" form="usrform">{{data}}</textarea>
+				<input name="send" style="margin-top:10px;width:100%" type="text">
+				<br>
+				<br>
+				<div class="form-actions">
+					<button class="btn btn-primary" type="submit" onclick="f1.action='/edit/{{page}}';">저장</button>
+					<button class="btn" type="submit" onclick="f1.action='/preview/{{page}}';">미리보기</button>
+				</div>
+			</form>
+			{% elif tn == 3 %}
+			<h1 class="title">최근 변경내역</h1>
+			<table style="width: 100%;">
+				<tbody>
+					<tr>
+						<td style="text-align: center;width:33.33%;font-size: 13px;">문서명</td>
+						<td style="text-align: center;width:33.33%;font-size: 13px;">기여자</td>
+						<td style="text-align: center;width:33.33%;font-size: 13px;">시간</td>
+					</tr>
+				</tbody>
+			</table>
+			{% for row in rows %}
+			<table style="width: 100%;">
+				<tbody>
+					<tr>
+						<td style="text-align: center;width:33.33%;font-size: 13px;"><a href="/w/{{row['title']}}">{{row['title']}}</a></td>
+						<td style="text-align: center;width:33.33%;font-size: 13px;">{{row['ip']}}</td>
+						<td style="text-align: center;width:33.33%;font-size: 13px;">{{row['date']}}</td>
+					</tr>
+					<tr>
+						{% if row['send'] %}
+						<td colspan="3" style="text-align: center;width:100%;font-size: 13px;">{{row['send']}}</td>
+						{% else %}
+						<td colspan="3" style="text-align: center;width:100%;font-size: 13px;"><br></td>
+						{% endif %}
+					</tr>
+				</tbody>
+			</table>
+			{% endfor %}
+			{% endif %}
 			<hr id="last">
 			<p>{{license}}</p>
 			<div id="powered">

+ 0 - 79
templates/recentchanges.html

@@ -1,79 +0,0 @@
-<html>
-	<head>
-		<title>{{title}}</title>
-		<link rel="stylesheet" href="{{url_for('static', filename='primer.css')}}">
-		<link rel="stylesheet" href="{{url_for('static', filename='style.css')}}">
-		<link rel="stylesheet" href="{{url_for('static', filename='font-awesome/css/font-awesome.min.css')}}">
-		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css">
-		<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.js"></script>
-		<link rel="shortcut icon" href="{{url_for('static', filename='images/on.ico')}}">
-		<meta name="viewport" content="width=device-width, initial-scale=1">
-	</head>
-	<body>
-		<br>
-		<div class="one-fifth column">
-			<div id="top">
-				<a href="/" id="logo">{{logo}}</a>
-				<div>
-					<a href="/RecentChanges" id="RecentChanges"><i class="fa fa-refresh" aria-hidden="true"></i><span id="is_mobile">최근 변경</span></a>
-					<a href="/RecentChanges" id="RecentChanges"><i class="fa fa-comment" aria-hidden="true"></i><span id="is_mobile">최근 토론</span></a>
-					<a href="/random" id="log"><i class="fa fa-random" aria-hidden="true"></i></a>
-					<a href="/user" id="log"><i class="fa fa-user" aria-hidden="true"></i></a>
-					<a href="/other" id="log"><i class="fa fa-cogs" aria-hidden="true"></i></a>
-				</div>
-				<form method="POST" action="/search" id="search">
-					<div class="input-group">
-						<input class="form-control" name="search" type="text">
-						<span class="input-group-button"><button class="btn"><i class="fa fa-long-arrow-left" aria-hidden="true"></i></button></span>
-					</div>
-				</form>
-			</div>
-		</div>
-		<div class="scroll-buttons">
-			<a class="scroll-toc" href="#toc"><i class="fa fa-list-alt" aria-hidden="true"></i></a>
-			<a class="scroll-button" href="#top" id="left"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
-			<a class="scroll-bottom" href="#powered" id="right"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
-		</div>
-		<div id="left_bar">
-			<a href="#">맨 위로</a>
-			<br>
-			<br>
-			<!-- 내용 넣는 자리 -->
-		</div>
-		<div class="four-fifths column">
-			<h1 class="title">최근 변경내역</h1>
-			<table style="width: 100%;">
-				<tbody>
-					<tr>
-						<td style="text-align: center;width:33.33%;font-size: 13px;">문서명</td>
-						<td style="text-align: center;width:33.33%;font-size: 13px;">기여자</td>
-						<td style="text-align: center;width:33.33%;font-size: 13px;">시간</td>
-					</tr>
-				</tbody>
-			</table>
-			{% for row in rows %}
-			<table style="width: 100%;">
-				<tbody>
-					<tr>
-						<td style="text-align: center;width:33.33%;font-size: 13px;"><a href="/w/{{row['title']}}">{{row['title']}}</a></td>
-						<td style="text-align: center;width:33.33%;font-size: 13px;">{{row['ip']}}</td>
-						<td style="text-align: center;width:33.33%;font-size: 13px;">{{row['date']}}</td>
-					</tr>
-					<tr>
-						{% if row['send'] %}
-						<td colspan="3" style="text-align: center;width:100%;font-size: 13px;">{{row['send']}}</td>
-						{% else %}
-						<td colspan="3" style="text-align: center;width:100%;font-size: 13px;"><br></td>
-						{% endif %}
-					</tr>
-				</tbody>
-			</table>
-			{% endfor %}
-			<hr id="last">
-			<p>{{license}}</p>
-			<div id="powered">
-				<a href="https://github.com/2DU/Ownet"><img src="{{url_for('static', filename='images/on2.png')}}" width="100px"></a>
-			</div>
-		</div>
-	</body>
-</html>