From 051e1846e30b7264f12d1f26fd028a656c5a3749 Mon Sep 17 00:00:00 2001
From: debiru <main.coeurl@gmail.com>
Date: Fri, 16 Aug 2019 03:06:00 +0900
Subject: [PATCH 001/336] remove traling spaces, add newline at EOF

---
 app/app.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/app.py b/app/app.py
index d612189..2a87197 100644
--- a/app/app.py
+++ b/app/app.py
@@ -84,7 +84,7 @@ def oauth_callback():
     )
 
     profile=oauth_session.get('account/verify_credentials.json').json()
-    
+
     twitter_id=str(profile.get('id'))
     username=str(profile.get('name'))
     description=str(profile.get('description'))
@@ -100,7 +100,7 @@ def oauth_callback():
         description=description,
         user_image_url=profile_image_url)
         db.session.add(user)
-    
+
     db.session.commit()
     login_user(user,True)
     return redirect(url_for('index'))
@@ -116,4 +116,4 @@ def initdb_command():
 
 
 if __name__=="__main__":
-    app.run(debug=True)
\ No newline at end of file
+    app.run(debug=True)

From dafae87c33f8b459ffed84af6d2800504789811f Mon Sep 17 00:00:00 2001
From: debiru <main.coeurl@gmail.com>
Date: Fri, 16 Aug 2019 03:14:21 +0900
Subject: [PATCH 002/336] keep two blank lines at global context

---
 app/app.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/app/app.py b/app/app.py
index 2a87197..4b9bccd 100644
--- a/app/app.py
+++ b/app/app.py
@@ -4,9 +4,9 @@
 from flask_login import UserMixin,LoginManager,login_user,logout_user,current_user
 from datetime import datetime
 from rauth import OAuth1Service
-
 from config import app,db,service,login_manager
 
+
 class User(UserMixin,db.Model):
     id=db.Column(db.Integer,primary_key=True)
     username=db.Column(db.String(64),index=True)
@@ -15,6 +15,7 @@ class User(UserMixin,db.Model):
     date_published=db.Column(db.DateTime,nullable=False,default=datetime.utcnow)
     twitter_id=db.Column(db.String(64),nullable=False,unique=True)
 
+
 class Editorial(db.Model):
     id=db.Column(db.Integer,primary_key=True)
     username=db.Column(db.String(64))
@@ -46,6 +47,7 @@ def contest_get():
     else:
         return render_template('error.html',message="Error:指定されたコンテストが見つかりません、もう一度お確かめください。")
 
+
 @app.route('/submited',methods=["POST"])
 def submit():
     if (request.form.get('description',None)!=None or request.form.get('url',None)!=None) and request.form.get('title',None):
@@ -65,6 +67,7 @@ def logout():
     logout_user()
     return redirect(url_for('index'))
 
+
 @app.route('/oauth/twitter')
 def oauth_authorize():
     if not current_user.is_anonymous:
@@ -74,6 +77,7 @@ def oauth_authorize():
         session['request_token']=request_token
         return redirect(service.get_authorize_url(request_token[0]))
 
+
 @app.route('/oauth/twitter/callback')
 def oauth_callback():
     request_token=session.pop('request_token')
@@ -110,6 +114,7 @@ def oauth_callback():
 def load_user(id):
     return User.query.get(int(id))
 
+
 @app.cli.command('initdb')
 def initdb_command():
     db.create_all()

From fc97ee4bb7716e55ce566f920df156d28c0a592b Mon Sep 17 00:00:00 2001
From: debiru <main.coeurl@gmail.com>
Date: Fri, 16 Aug 2019 03:16:49 +0900
Subject: [PATCH 003/336] keep a space after a comma

---
 app/app.py | 46 +++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/app/app.py b/app/app.py
index 4b9bccd..941ed9a 100644
--- a/app/app.py
+++ b/app/app.py
@@ -1,30 +1,30 @@
-from flask import Flask,render_template,request,url_for,redirect,session
+from flask import Flask, render_template, request,url_for, redirect,session
 from flask_sqlalchemy import SQLAlchemy
 from flask_migrate import Migrate
-from flask_login import UserMixin,LoginManager,login_user,logout_user,current_user
+from flask_login import UserMixin, LoginManager, login_user, logout_user, current_user
 from datetime import datetime
 from rauth import OAuth1Service
-from config import app,db,service,login_manager
+from config import app, db, service, login_manager
 
 
 class User(UserMixin,db.Model):
-    id=db.Column(db.Integer,primary_key=True)
-    username=db.Column(db.String(64),index=True)
-    description=db.Column(db.String(1024),index=True)
-    user_image_url=db.Column(db.String(1024),index=True)
-    date_published=db.Column(db.DateTime,nullable=False,default=datetime.utcnow)
-    twitter_id=db.Column(db.String(64),nullable=False,unique=True)
+    id=db.Column(db.Integer, primary_key=True)
+    username=db.Column(db.String(64), index=True)
+    description=db.Column(db.String(1024), index=True)
+    user_image_url=db.Column(db.String(1024), index=True)
+    date_published=db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
+    twitter_id=db.Column(db.String(64), nullable=False, unique=True)
 
 
 class Editorial(db.Model):
-    id=db.Column(db.Integer,primary_key=True)
+    id=db.Column(db.Integer, primary_key=True)
     username=db.Column(db.String(64))
     contestname=db.Column(db.String(64))
     title=db.Column(db.String(64))
     url=db.Column(db.String(120))
     description=db.Column(db.String(1024))
     like=db.Column(db.Integer)
-    user_image_url=db.Column(db.String(1024),index=True)
+    user_image_url=db.Column(db.String(1024), index=True)
 
 
 @app.route('/')
@@ -32,34 +32,34 @@ def index():
     return render_template('index.html')
 
 
-@app.route('/search',methods=["GET"])
+@app.route('/search', methods=["GET"])
 def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest',methods=["POST"])
+@app.route('/search/contest', methods=["POST"])
 def contest_get():
     if request.form['contestname']:
         #データベースからコンテスト名と等しいものを取得する
         editorials=Editorial.query.filter_by(contestname=request.form['contestname']).all()
 
-        return render_template('contest.html',contestname=request.form.get('contestname',None),editorials=editorials)
+        return render_template('contest.html', contestname=request.form.get('contestname', None), editorials=editorials)
     else:
-        return render_template('error.html',message="Error:指定されたコンテストが見つかりません、もう一度お確かめください。")
+        return render_template('error.html', message="Error:指定されたコンテストが見つかりません、もう一度お確かめください。")
 
 
-@app.route('/submited',methods=["POST"])
+@app.route('/submited', methods=["POST"])
 def submit():
-    if (request.form.get('description',None)!=None or request.form.get('url',None)!=None) and request.form.get('title',None):
-        newEditorial=Editorial(title=request.form.get('title',None),description=request.form.get('description',None),contestname=request.form.get('contestname',None),url=request.form.get('url',None),user_image_url=current_user.user_image_url,username=current_user.username)
+    if (request.form.get('description', None)!=None or request.form.get('url', None)!=None) and request.form.get('title', None):
+        newEditorial=Editorial(title=request.form.get('title', None), description=request.form.get('description', None), contestname=request.form.get('contestname', None), url=request.form.get('url', None), user_image_url=current_user.user_image_url, username=current_user.username)
         db.session.add(newEditorial)
         db.session.commit()
         return render_template("submited.html")
     else:
-        if request.form.get('title',None)==None:
-            return render_template("error.html",message="Error:タイトルを入力して下さい。")
+        if request.form.get('title', None)==None:
+            return render_template("error.html", message="Error:タイトルを入力して下さい。")
         else:
-            return render_template("error.html",message="Error:URLまたは解説文を入力して下さい。")
+            return render_template("error.html", message="Error:URLまたは解説文を入力して下さい。")
 
 
 @app.route('/logout')
@@ -73,7 +73,7 @@ def oauth_authorize():
     if not current_user.is_anonymous:
         return redirect(url_for('index'))
     else:
-        request_token=service.get_request_token(params={'oauth_callback':url_for('oauth_callback',provider='twitter',_external=True)})
+        request_token=service.get_request_token(params={'oauth_callback':url_for('oauth_callback', provider='twitter', _external=True)})
         session['request_token']=request_token
         return redirect(service.get_authorize_url(request_token[0]))
 
@@ -106,7 +106,7 @@ def oauth_callback():
         db.session.add(user)
 
     db.session.commit()
-    login_user(user,True)
+    login_user(user, True)
     return redirect(url_for('index'))
 
 

From b0cf547b8cfcbc7e36713558dcb0c474de251390 Mon Sep 17 00:00:00 2001
From: debiru <main.coeurl@gmail.com>
Date: Fri, 16 Aug 2019 03:22:25 +0900
Subject: [PATCH 004/336] keep a space on both sides of a operator excluding
 kwargs

---
 app/app.py | 64 +++++++++++++++++++++++++++---------------------------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/app/app.py b/app/app.py
index 941ed9a..5b1b4b7 100644
--- a/app/app.py
+++ b/app/app.py
@@ -8,23 +8,23 @@
 
 
 class User(UserMixin,db.Model):
-    id=db.Column(db.Integer, primary_key=True)
-    username=db.Column(db.String(64), index=True)
-    description=db.Column(db.String(1024), index=True)
-    user_image_url=db.Column(db.String(1024), index=True)
-    date_published=db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
-    twitter_id=db.Column(db.String(64), nullable=False, unique=True)
+    id = db.Column(db.Integer, primary_key=True)
+    username = db.Column(db.String(64), index=True)
+    description = db.Column(db.String(1024), index=True)
+    user_image_url = db.Column(db.String(1024), index=True)
+    date_published = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
+    twitter_id = db.Column(db.String(64), nullable=False, unique=True)
 
 
 class Editorial(db.Model):
-    id=db.Column(db.Integer, primary_key=True)
-    username=db.Column(db.String(64))
-    contestname=db.Column(db.String(64))
-    title=db.Column(db.String(64))
-    url=db.Column(db.String(120))
-    description=db.Column(db.String(1024))
-    like=db.Column(db.Integer)
-    user_image_url=db.Column(db.String(1024), index=True)
+    id = db.Column(db.Integer, primary_key=True)
+    username = db.Column(db.String(64))
+    contestname = db.Column(db.String(64))
+    title = db.Column(db.String(64))
+    url = db.Column(db.String(120))
+    description = db.Column(db.String(1024))
+    like = db.Column(db.Integer)
+    user_image_url = db.Column(db.String(1024), index=True)
 
 
 @app.route('/')
@@ -41,7 +41,7 @@ def contest_search():
 def contest_get():
     if request.form['contestname']:
         #データベースからコンテスト名と等しいものを取得する
-        editorials=Editorial.query.filter_by(contestname=request.form['contestname']).all()
+        editorials = Editorial.query.filter_by(contestname=request.form['contestname']).all()
 
         return render_template('contest.html', contestname=request.form.get('contestname', None), editorials=editorials)
     else:
@@ -50,13 +50,13 @@ def contest_get():
 
 @app.route('/submited', methods=["POST"])
 def submit():
-    if (request.form.get('description', None)!=None or request.form.get('url', None)!=None) and request.form.get('title', None):
-        newEditorial=Editorial(title=request.form.get('title', None), description=request.form.get('description', None), contestname=request.form.get('contestname', None), url=request.form.get('url', None), user_image_url=current_user.user_image_url, username=current_user.username)
+    if (request.form.get('description', None) != None or request.form.get('url', None) != None) and request.form.get('title', None):
+        newEditorial = Editorial(title=request.form.get('title', None), description=request.form.get('description', None), contestname=request.form.get('contestname', None), url=request.form.get('url', None), user_image_url=current_user.user_image_url, username=current_user.username)
         db.session.add(newEditorial)
         db.session.commit()
         return render_template("submited.html")
     else:
-        if request.form.get('title', None)==None:
+        if request.form.get('title', None) == None:
             return render_template("error.html", message="Error:タイトルを入力して下さい。")
         else:
             return render_template("error.html", message="Error:URLまたは解説文を入力して下さい。")
@@ -73,33 +73,33 @@ def oauth_authorize():
     if not current_user.is_anonymous:
         return redirect(url_for('index'))
     else:
-        request_token=service.get_request_token(params={'oauth_callback':url_for('oauth_callback', provider='twitter', _external=True)})
-        session['request_token']=request_token
+        request_token = service.get_request_token(params={'oauth_callback':url_for('oauth_callback', provider='twitter', _external=True)})
+        session['request_token'] = request_token
         return redirect(service.get_authorize_url(request_token[0]))
 
 
 @app.route('/oauth/twitter/callback')
 def oauth_callback():
-    request_token=session.pop('request_token')
-    oauth_session=service.get_auth_session(
+    request_token = session.pop('request_token')
+    oauth_session = service.get_auth_session(
         request_token[0],
         request_token[1],
         data={'oauth_verifier':request.args['oauth_verifier']}
     )
 
-    profile=oauth_session.get('account/verify_credentials.json').json()
+    profile = oauth_session.get('account/verify_credentials.json').json()
 
-    twitter_id=str(profile.get('id'))
-    username=str(profile.get('name'))
-    description=str(profile.get('description'))
-    profile_image_url=str(profile.get('profile_image_url'))
-    user=db.session.query(User).filter(User.twitter_id==twitter_id).first()
+    twitter_id = str(profile.get('id'))
+    username = str(profile.get('name'))
+    description = str(profile.get('description'))
+    profile_image_url = str(profile.get('profile_image_url'))
+    user = db.session.query(User).filter(User.twitter_id == twitter_id).first()
 
     if user:
-        user.twitter_id=twitter_id
-        user.username=username
+        user.twitter_id = twitter_id
+        user.username = username
     else:
-        user=User(twitter_id=twitter_id,
+        user = User(twitter_id=twitter_id,
         username=username,
         description=description,
         user_image_url=profile_image_url)
@@ -120,5 +120,5 @@ def initdb_command():
     db.create_all()
 
 
-if __name__=="__main__":
+if __name__ == "__main__":
     app.run(debug=True)

From c37965698ec677c54d965ff401812f359aa6acb2 Mon Sep 17 00:00:00 2001
From: debiru <main.coeurl@gmail.com>
Date: Fri, 16 Aug 2019 03:33:05 +0900
Subject: [PATCH 005/336] text wrap in long params

---
 app/app.py | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/app/app.py b/app/app.py
index 5b1b4b7..1d61c49 100644
--- a/app/app.py
+++ b/app/app.py
@@ -51,7 +51,14 @@ def contest_get():
 @app.route('/submited', methods=["POST"])
 def submit():
     if (request.form.get('description', None) != None or request.form.get('url', None) != None) and request.form.get('title', None):
-        newEditorial = Editorial(title=request.form.get('title', None), description=request.form.get('description', None), contestname=request.form.get('contestname', None), url=request.form.get('url', None), user_image_url=current_user.user_image_url, username=current_user.username)
+        newEditorial = Editorial(
+            title=request.form.get('title', None),
+            description=request.form.get('description', None),
+            contestname=request.form.get('contestname', None),
+            url=request.form.get('url', None),
+            user_image_url=current_user.user_image_url,
+            username=current_user.username
+        )
         db.session.add(newEditorial)
         db.session.commit()
         return render_template("submited.html")
@@ -73,7 +80,9 @@ def oauth_authorize():
     if not current_user.is_anonymous:
         return redirect(url_for('index'))
     else:
-        request_token = service.get_request_token(params={'oauth_callback':url_for('oauth_callback', provider='twitter', _external=True)})
+        request_token = service.get_request_token(params={
+            'oauth_callback': url_for('oauth_callback', provider='twitter', _external=True)
+        })
         session['request_token'] = request_token
         return redirect(service.get_authorize_url(request_token[0]))
 
@@ -84,7 +93,9 @@ def oauth_callback():
     oauth_session = service.get_auth_session(
         request_token[0],
         request_token[1],
-        data={'oauth_verifier':request.args['oauth_verifier']}
+        data={
+            'oauth_verifier': request.args['oauth_verifier']
+        }
     )
 
     profile = oauth_session.get('account/verify_credentials.json').json()
@@ -99,10 +110,12 @@ def oauth_callback():
         user.twitter_id = twitter_id
         user.username = username
     else:
-        user = User(twitter_id=twitter_id,
-        username=username,
-        description=description,
-        user_image_url=profile_image_url)
+        user = User(
+            twitter_id=twitter_id,
+            username=username,
+            description=description,
+            user_image_url=profile_image_url
+        )
         db.session.add(user)
 
     db.session.commit()

From e81d497b479e3dff0865199b695692c6482d0785 Mon Sep 17 00:00:00 2001
From: debiru <main.coeurl@gmail.com>
Date: Fri, 16 Aug 2019 03:36:28 +0900
Subject: [PATCH 006/336] remove the value "None" in second argument of
 dict.get()

---
 app/app.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/app/app.py b/app/app.py
index 1d61c49..fa03fc4 100644
--- a/app/app.py
+++ b/app/app.py
@@ -43,19 +43,19 @@ def contest_get():
         #データベースからコンテスト名と等しいものを取得する
         editorials = Editorial.query.filter_by(contestname=request.form['contestname']).all()
 
-        return render_template('contest.html', contestname=request.form.get('contestname', None), editorials=editorials)
+        return render_template('contest.html', contestname=request.form.get('contestname'), editorials=editorials)
     else:
         return render_template('error.html', message="Error:指定されたコンテストが見つかりません、もう一度お確かめください。")
 
 
 @app.route('/submited', methods=["POST"])
 def submit():
-    if (request.form.get('description', None) != None or request.form.get('url', None) != None) and request.form.get('title', None):
+    if (request.form.get('description') != None or request.form.get('url') != None) and request.form.get('title'):
         newEditorial = Editorial(
-            title=request.form.get('title', None),
-            description=request.form.get('description', None),
-            contestname=request.form.get('contestname', None),
-            url=request.form.get('url', None),
+            title=request.form.get('title'),
+            description=request.form.get('description'),
+            contestname=request.form.get('contestname'),
+            url=request.form.get('url'),
             user_image_url=current_user.user_image_url,
             username=current_user.username
         )
@@ -63,7 +63,7 @@ def submit():
         db.session.commit()
         return render_template("submited.html")
     else:
-        if request.form.get('title', None) == None:
+        if request.form.get('title') == None:
             return render_template("error.html", message="Error:タイトルを入力して下さい。")
         else:
             return render_template("error.html", message="Error:URLまたは解説文を入力して下さい。")

From 6a7c56db6a29b1ed985376a521ee9fada54a8a87 Mon Sep 17 00:00:00 2001
From: debiru <main.coeurl@gmail.com>
Date: Fri, 16 Aug 2019 03:39:52 +0900
Subject: [PATCH 007/336] use "is / is not" instead of "== / !=" to compare to
 "None"

---
 app/app.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/app.py b/app/app.py
index fa03fc4..da4902d 100644
--- a/app/app.py
+++ b/app/app.py
@@ -50,7 +50,7 @@ def contest_get():
 
 @app.route('/submited', methods=["POST"])
 def submit():
-    if (request.form.get('description') != None or request.form.get('url') != None) and request.form.get('title'):
+    if (request.form.get('description') is not None or request.form.get('url') is not None) and request.form.get('title'):
         newEditorial = Editorial(
             title=request.form.get('title'),
             description=request.form.get('description'),
@@ -63,7 +63,7 @@ def submit():
         db.session.commit()
         return render_template("submited.html")
     else:
-        if request.form.get('title') == None:
+        if request.form.get('title') is None:
             return render_template("error.html", message="Error:タイトルを入力して下さい。")
         else:
             return render_template("error.html", message="Error:URLまたは解説文を入力して下さい。")

From de08ad636f257038692ddca2be60c2defc4ef4a2 Mon Sep 17 00:00:00 2001
From: debiru <main.coeurl@gmail.com>
Date: Fri, 16 Aug 2019 03:43:10 +0900
Subject: [PATCH 008/336] use single-quotation for a string literal

---
 app/app.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/app/app.py b/app/app.py
index da4902d..51183dc 100644
--- a/app/app.py
+++ b/app/app.py
@@ -32,12 +32,12 @@ def index():
     return render_template('index.html')
 
 
-@app.route('/search', methods=["GET"])
+@app.route('/search', methods=['GET'])
 def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest', methods=["POST"])
+@app.route('/search/contest', methods=['POST'])
 def contest_get():
     if request.form['contestname']:
         #データベースからコンテスト名と等しいものを取得する
@@ -45,10 +45,10 @@ def contest_get():
 
         return render_template('contest.html', contestname=request.form.get('contestname'), editorials=editorials)
     else:
-        return render_template('error.html', message="Error:指定されたコンテストが見つかりません、もう一度お確かめください。")
+        return render_template('error.html', message='Error:指定されたコンテストが見つかりません、もう一度お確かめください。')
 
 
-@app.route('/submited', methods=["POST"])
+@app.route('/submited', methods=['POST'])
 def submit():
     if (request.form.get('description') is not None or request.form.get('url') is not None) and request.form.get('title'):
         newEditorial = Editorial(
@@ -61,12 +61,12 @@ def submit():
         )
         db.session.add(newEditorial)
         db.session.commit()
-        return render_template("submited.html")
+        return render_template('submited.html')
     else:
         if request.form.get('title') is None:
-            return render_template("error.html", message="Error:タイトルを入力して下さい。")
+            return render_template('error.html', message='Error:タイトルを入力して下さい。')
         else:
-            return render_template("error.html", message="Error:URLまたは解説文を入力して下さい。")
+            return render_template('error.html', message='Error:URLまたは解説文を入力して下さい。')
 
 
 @app.route('/logout')
@@ -133,5 +133,5 @@ def initdb_command():
     db.create_all()
 
 
-if __name__ == "__main__":
+if __name__ == '__main__':
     app.run(debug=True)

From 6f914dd1f50556088fd7f3a8b8042ebee3c6f61e Mon Sep 17 00:00:00 2001
From: debiru <main.coeurl@gmail.com>
Date: Fri, 16 Aug 2019 03:46:28 +0900
Subject: [PATCH 009/336] keep a space after a comment delimiter

---
 app/app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/app.py b/app/app.py
index 51183dc..9dc5b09 100644
--- a/app/app.py
+++ b/app/app.py
@@ -40,7 +40,7 @@ def contest_search():
 @app.route('/search/contest', methods=['POST'])
 def contest_get():
     if request.form['contestname']:
-        #データベースからコンテスト名と等しいものを取得する
+        # データベースからコンテスト名と等しいものを取得する
         editorials = Editorial.query.filter_by(contestname=request.form['contestname']).all()
 
         return render_template('contest.html', contestname=request.form.get('contestname'), editorials=editorials)

From d153b5d032ec4e1c79ae494ad0f0b06856fe4c3c Mon Sep 17 00:00:00 2001
From: debiru <main.coeurl@gmail.com>
Date: Fri, 16 Aug 2019 04:08:23 +0900
Subject: [PATCH 010/336] avoid direct access to request.form['contestname']

---
 app/app.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/app.py b/app/app.py
index 9dc5b09..b2419f8 100644
--- a/app/app.py
+++ b/app/app.py
@@ -39,11 +39,13 @@ def contest_search():
 
 @app.route('/search/contest', methods=['POST'])
 def contest_get():
-    if request.form['contestname']:
+    contestname = request.form.get('contestname')
+
+    if contestname is not None:
         # データベースからコンテスト名と等しいものを取得する
-        editorials = Editorial.query.filter_by(contestname=request.form['contestname']).all()
+        editorials = Editorial.query.filter_by(contestname=contestname).all()
 
-        return render_template('contest.html', contestname=request.form.get('contestname'), editorials=editorials)
+        return render_template('contest.html', contestname=contestname, editorials=editorials)
     else:
         return render_template('error.html', message='Error:指定されたコンテストが見つかりません、もう一度お確かめください。')
 

From 8ab6b601c75875bcfff37c7fdc45510cc3efdc43 Mon Sep 17 00:00:00 2001
From: debiru <main.coeurl@gmail.com>
Date: Fri, 16 Aug 2019 04:44:07 +0900
Subject: [PATCH 011/336] uniformed params checking in submit method

---
 app/app.py | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/app/app.py b/app/app.py
index b2419f8..bf2feda 100644
--- a/app/app.py
+++ b/app/app.py
@@ -52,20 +52,22 @@ def contest_get():
 
 @app.route('/submited', methods=['POST'])
 def submit():
-    if (request.form.get('description') is not None or request.form.get('url') is not None) and request.form.get('title'):
-        newEditorial = Editorial(
-            title=request.form.get('title'),
-            description=request.form.get('description'),
-            contestname=request.form.get('contestname'),
-            url=request.form.get('url'),
-            user_image_url=current_user.user_image_url,
-            username=current_user.username
-        )
+    params = {
+        title: request.form.get('title'),
+        description: request.form.get('description'),
+        contestname: request.form.get('contestname'),
+        url: request.form.get('url'),
+        user_image_url: current_user.user_image_url,
+        username: current_user.username
+    }
+
+    if (params['description'] is not None or params['url'] is not None) and params['title'] is not None:
+        newEditorial = Editorial(**params)
         db.session.add(newEditorial)
         db.session.commit()
         return render_template('submited.html')
     else:
-        if request.form.get('title') is None:
+        if params['title'] is None:
             return render_template('error.html', message='Error:タイトルを入力して下さい。')
         else:
             return render_template('error.html', message='Error:URLまたは解説文を入力して下さい。')

From 62babce121599efc013a22743dc29aedc89335f7 Mon Sep 17 00:00:00 2001
From: debiru <main.coeurl@gmail.com>
Date: Fri, 16 Aug 2019 04:46:22 +0900
Subject: [PATCH 012/336] add _normalize_contestname method

---
 app/app.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/app/app.py b/app/app.py
index bf2feda..ccc84ea 100644
--- a/app/app.py
+++ b/app/app.py
@@ -27,6 +27,12 @@ class Editorial(db.Model):
     user_image_url = db.Column(db.String(1024), index=True)
 
 
+def _normalize_contestname(contestname):
+    if isinstance(contestname, str):
+        contestname = contestname.strip()
+    return contestname
+
+
 @app.route('/')
 def index():
     return render_template('index.html')
@@ -39,7 +45,7 @@ def contest_search():
 
 @app.route('/search/contest', methods=['POST'])
 def contest_get():
-    contestname = request.form.get('contestname')
+    contestname = _normalize_contestname(request.form.get('contestname'))
 
     if contestname is not None:
         # データベースからコンテスト名と等しいものを取得する
@@ -55,7 +61,7 @@ def submit():
     params = {
         title: request.form.get('title'),
         description: request.form.get('description'),
-        contestname: request.form.get('contestname'),
+        contestname: _normalize_contestname(request.form.get('contestname')),
         url: request.form.get('url'),
         user_image_url: current_user.user_image_url,
         username: current_user.username

From 884051bb25583feb523de6e92a7e9ef93e1bca4e Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 16 Aug 2019 14:35:41 +0900
Subject: [PATCH 013/336] fix params

---
 app/app.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/app/app.py b/app/app.py
index ccc84ea..4e348d0 100644
--- a/app/app.py
+++ b/app/app.py
@@ -59,14 +59,16 @@ def contest_get():
 @app.route('/submited', methods=['POST'])
 def submit():
     params = {
-        title: request.form.get('title'),
-        description: request.form.get('description'),
-        contestname: _normalize_contestname(request.form.get('contestname')),
-        url: request.form.get('url'),
-        user_image_url: current_user.user_image_url,
-        username: current_user.username
+        'title': request.form.get('title'),
+        'description': request.form.get('description'),
+        'contestname': _normalize_contestname(request.form.get('contestname')),
+        'url': request.form.get('url'),
+        'user_image_url': current_user.user_image_url,
+        'username': current_user.username
     }
 
+    print(params)
+
     if (params['description'] is not None or params['url'] is not None) and params['title'] is not None:
         newEditorial = Editorial(**params)
         db.session.add(newEditorial)

From 8ce3609bb6045ebc9a023c2ab6b93e1be44b8fd4 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 16 Aug 2019 18:34:58 +0900
Subject: [PATCH 014/336] add pagination

---
 .gitignore                     |  2 +-
 app/app.py                     | 10 +++++-----
 app/static/style.css           | 17 +++++++++++++++++
 app/templates/_pagination.html | 25 -------------------------
 app/templates/contest.html     | 33 +++++++++++++++++----------------
 app/templates/search.html      |  2 +-
 6 files changed, 41 insertions(+), 48 deletions(-)
 delete mode 100644 app/templates/_pagination.html

diff --git a/.gitignore b/.gitignore
index de5f9a2..b444d08 100644
--- a/.gitignore
+++ b/.gitignore
@@ -130,4 +130,4 @@ include/
 migrations/
 config.py
 lib64
-
+favicon.ico
\ No newline at end of file
diff --git a/app/app.py b/app/app.py
index 4e348d0..82af4cc 100644
--- a/app/app.py
+++ b/app/app.py
@@ -43,13 +43,13 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest', methods=['POST'])
-def contest_get():
+@app.route('/search/contest/<int:page>', methods=['GET','POST'])
+def contest_get(page=1):
     contestname = _normalize_contestname(request.form.get('contestname'))
 
-    if contestname is not None:
-        # データベースからコンテスト名と等しいものを取得する
-        editorials = Editorial.query.filter_by(contestname=contestname).all()
+    if contestname is not None or page is not 1:
+        per_page = 10
+        editorials = Editorial.query.order_by(Editorial.like).paginate(page, per_page, error_out=False)
 
         return render_template('contest.html', contestname=contestname, editorials=editorials)
     else:
diff --git a/app/static/style.css b/app/static/style.css
index e5ae75e..94775e0 100644
--- a/app/static/style.css
+++ b/app/static/style.css
@@ -16,4 +16,21 @@ input:focus {
 input::-moz-focus-inner,
 button::-moz-focus-inner {
     border: none;
+}
+
+.pagination-page-info {
+    padding: .6em;
+    padding-left: 0;
+    width: 40em;
+    margin: .5em;
+    margin-left: 0;
+    font-size: 12px;
+}
+
+.pagination-page-info b {
+    color: black;
+    background: #6aa6ed;
+    padding-left: 2px;
+    padding: .1em .25em;
+    font-size: 150%;
 }
\ No newline at end of file
diff --git a/app/templates/_pagination.html b/app/templates/_pagination.html
deleted file mode 100644
index 7524b1f..0000000
--- a/app/templates/_pagination.html
+++ /dev/null
@@ -1,25 +0,0 @@
-{% macro pagination_widget(pagination, endpoint, fragment='') %}
-<ul class="pagination">
-    <li{% if not pagination.has_prev %} class="disabled" {% endif %}>
-        <a href="{% if pagination.has_prev %}{{ url_for(endpoint, page=pagination.prev_num, **kwargs) }}{{ fragment }}{% else %}#{% endif %}">
-            &laquo;
-        </a>
-        </li>
-        {% for p in pagination.iter_pages() %} {% if p %} {% if p == pagination.page %}
-        <li class="active">
-            <a href="{{ url_for(endpoint, page = p, **kwargs) }}{{ fragment }}">{{ p }}</a>
-        </li>
-        {% else %}
-        <li>
-            <a href="{{ url_for(endpoint, page = p, **kwargs) }}{{ fragment }}">{{ p }}</a>
-        </li>
-        {% endif %} {% else %}
-        <li class="disabled"><a href="#">&hellip;</a></li>
-        {% endif %} {% endfor %}
-        <li{% if not pagination.has_next %} class="disabled" {% endif %}>
-            <a href="{% if pagination.has_next %}{{ url_for(endpoint, page=pagination.next_num, **kwargs) }}{{ fragment }}{% else %}#{% endif %}">
-                &raquo;
-            </a>
-            </li>
-</ul>
-{% endmacro %}
\ No newline at end of file
diff --git a/app/templates/contest.html b/app/templates/contest.html
index aafa2e7..8a9e7ee 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -55,29 +55,23 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
         </div>
     </div>
     {% else %}
-    <h4>投稿をするにはログインが必要です</h4>
+    <div class="container-fluid">
+        <h4>投稿をするにはログインが必要です</h4>
+    </div>
     {%endif%}
     <br>
 
 
     <div>
-        {% if editorials|length==0 %}
-        <h4>まだ投稿がありません</h4>
-        {%else%}
 
         <div class="container-fluid">
             <div id="editorial-card">
 
-                {% for edit in editorials %}
-                <div class="row">
-                    <div></div>
-                    <div>
-                        <img class="img-thumbnail" style="min-width: 40px" src={{edit.user_image_url}}/>
-                    </div>
-                    <div>
-                        <h5>{{edit.username}}</h5>
-                    </div>
-                </div>
+                {% for edit in editorials.items %}
+                <img src={{edit.user_image_url}} alt='' style="width:36px;height:36px;vertical-align:middle;">
+                <span class="h4" style="vertical-align:middle;">{{edit.username}}</span>
+
+
                 <div class="card col-6 border-0">
                     <h4 class="card-header text-light bg-dark col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
                         {{edit.title}}
@@ -99,17 +93,24 @@ <h4 class="card-header text-light bg-dark col-10" data-toggle="collapse" data-ta
                 <br>
                 <br> {% endfor %}
             </div>
-            {%endif%}
 
 
         </div>
     </div>
 
+    <div class="container-fluid">
+        {% if editorials.has_prev and page!=1 %}
+        <a href="{{ url_for('contest_get', page=editorials.prev_num) }}">
+            << 前のページ</a>
+                {% else %}
+                << 前のページ {% endif %} | {% if editorials.has_next %} <a href="{{ url_for('contest_get', page=editorials.next_num) }}">次のページ >></a>
+        {% else %} 次のページ >> {% endif %}
+    </div>
+
 
     <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js " integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo " crossorigin="anonymous "></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
 </body>
 
-
 </html>
\ No newline at end of file
diff --git a/app/templates/search.html b/app/templates/search.html
index 6debb9b..3bf15d2 100644
--- a/app/templates/search.html
+++ b/app/templates/search.html
@@ -32,7 +32,7 @@
     <div class="container-fluid">
         <h3>コンテスト名を記入し、下の候補からコンテストを選んで下さい</h3>
         <br>
-        <form id="search" method="POST" action="/search/contest">
+        <form id="search" method="POST" action="/search/contest/1">
             <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" />
         </form>
 

From d86e979d5949a156a3bd60e3b54bc2df32d09d45 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 16 Aug 2019 22:56:43 +0900
Subject: [PATCH 015/336] pagination

---
 app/app.py                 | 9 +++------
 app/templates/contest.html | 4 ++--
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/app/app.py b/app/app.py
index 82af4cc..e019f1c 100644
--- a/app/app.py
+++ b/app/app.py
@@ -47,13 +47,10 @@ def contest_search():
 def contest_get(page=1):
     contestname = _normalize_contestname(request.form.get('contestname'))
 
-    if contestname is not None or page is not 1:
-        per_page = 10
-        editorials = Editorial.query.order_by(Editorial.like).paginate(page, per_page, error_out=False)
+    per_page = 10
+    editorials = Editorial.query.order_by(Editorial.like).paginate(page, per_page, error_out=False)
 
-        return render_template('contest.html', contestname=contestname, editorials=editorials)
-    else:
-        return render_template('error.html', message='Error:指定されたコンテストが見つかりません、もう一度お確かめください。')
+    return render_template('contest.html', contestname=contestname, editorials=editorials)
 
 
 @app.route('/submited', methods=['POST'])
diff --git a/app/templates/contest.html b/app/templates/contest.html
index 8a9e7ee..5e32d42 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -98,8 +98,8 @@ <h4 class="card-header text-light bg-dark col-10" data-toggle="collapse" data-ta
         </div>
     </div>
 
-    <div class="container-fluid">
-        {% if editorials.has_prev and page!=1 %}
+    <div class="container-fluid h4">
+        {% if editorials.has_prev %}
         <a href="{{ url_for('contest_get', page=editorials.prev_num) }}">
             << 前のページ</a>
                 {% else %}

From 28e27fecf773fd5e87720d53d7d4e792ff952ea9 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 16 Aug 2019 23:04:42 +0900
Subject: [PATCH 016/336] add database_like and database_twitter-id

---
 app/app.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/app.py b/app/app.py
index e019f1c..0207880 100644
--- a/app/app.py
+++ b/app/app.py
@@ -25,6 +25,7 @@ class Editorial(db.Model):
     description = db.Column(db.String(1024))
     like = db.Column(db.Integer)
     user_image_url = db.Column(db.String(1024), index=True)
+    twitter_id=db.Column(db.String(64))
 
 
 def _normalize_contestname(contestname):
@@ -60,8 +61,10 @@ def submit():
         'description': request.form.get('description'),
         'contestname': _normalize_contestname(request.form.get('contestname')),
         'url': request.form.get('url'),
+        'like':int(0)
         'user_image_url': current_user.user_image_url,
-        'username': current_user.username
+        'username': current_user.username,
+        'twitter_id':current_user.id
     }
 
     print(params)

From eb4bc27c014670efce0d1f163cd84f4ac88183ef Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 16 Aug 2019 23:20:19 +0900
Subject: [PATCH 017/336] fix database

---
 app/app.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/app/app.py b/app/app.py
index 0207880..00d1aee 100644
--- a/app/app.py
+++ b/app/app.py
@@ -25,8 +25,7 @@ class Editorial(db.Model):
     description = db.Column(db.String(1024))
     like = db.Column(db.Integer)
     user_image_url = db.Column(db.String(1024), index=True)
-    twitter_id=db.Column(db.String(64))
-
+    user_id=db.Column(db.Integer)
 
 def _normalize_contestname(contestname):
     if isinstance(contestname, str):
@@ -61,11 +60,11 @@ def submit():
         'description': request.form.get('description'),
         'contestname': _normalize_contestname(request.form.get('contestname')),
         'url': request.form.get('url'),
-        'like':int(0)
+        'like':int(0),
         'user_image_url': current_user.user_image_url,
         'username': current_user.username,
-        'twitter_id':current_user.id
-    }
+        'user_id':current_user.id
+    }   
 
     print(params)
 

From 7a02d88b21374f048bb10026460be923d751c2b5 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 16 Aug 2019 23:34:59 +0900
Subject: [PATCH 018/336] fix logout button

---
 app/app.py                  |  2 +-
 app/templates/contest.html  |  2 +-
 app/templates/error.html    |  2 +-
 app/templates/index.html    |  2 +-
 app/templates/login.html    |  2 +-
 app/templates/ranking.html  | 39 +++++++++++++++++++++++++++++++++++++
 app/templates/search.html   |  2 +-
 app/templates/submited.html |  2 +-
 app/templates/user.html     | 39 +++++++++++++++++++++++++++++++++++++
 9 files changed, 85 insertions(+), 7 deletions(-)
 create mode 100644 app/templates/ranking.html
 create mode 100644 app/templates/user.html

diff --git a/app/app.py b/app/app.py
index 00d1aee..3d5f086 100644
--- a/app/app.py
+++ b/app/app.py
@@ -48,7 +48,7 @@ def contest_get(page=1):
     contestname = _normalize_contestname(request.form.get('contestname'))
 
     per_page = 10
-    editorials = Editorial.query.order_by(Editorial.like).paginate(page, per_page, error_out=False)
+    editorials = Editorial.query.filter_by(contestname=contestname).paginate(page, per_page, error_out=False)
 
     return render_template('contest.html', contestname=contestname, editorials=editorials)
 
diff --git a/app/templates/contest.html b/app/templates/contest.html
index 5e32d42..9c9d12d 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -25,7 +25,7 @@
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
-            <span class="navbar-text"><a href="/logout" class="btn btn-info">ログアウト</a></span> {%endif%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
         </div>
     </nav>
 
diff --git a/app/templates/error.html b/app/templates/error.html
index 413a9f3..6fe58d9 100644
--- a/app/templates/error.html
+++ b/app/templates/error.html
@@ -25,7 +25,7 @@
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
-            <span class="navbar-text"><a href="/logout" class="btn btn-info">ログアウト</a></span> {%endif%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
         </div>
     </nav>
 
diff --git a/app/templates/index.html b/app/templates/index.html
index 5c5d341..ea88e8e 100644
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -25,7 +25,7 @@
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
-            <span class="navbar-text"><a href="/logout" class="btn btn-info">ログアウト</a></span> {%endif%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
         </div>
     </nav>
 
diff --git a/app/templates/login.html b/app/templates/login.html
index 2ba0738..14cf121 100644
--- a/app/templates/login.html
+++ b/app/templates/login.html
@@ -25,7 +25,7 @@
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
-            <span class="navbar-text"><a href="/logout" class="btn btn-info">ログアウト</a></span> {%endif%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
         </div>
     </nav>
 
diff --git a/app/templates/ranking.html b/app/templates/ranking.html
new file mode 100644
index 0000000..14cf121
--- /dev/null
+++ b/app/templates/ranking.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html lang="ja">
+
+<head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <title>AtCoder Editorials</title>
+</head>
+
+<body style="padding-top:5rem">
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+
+    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
+        <a href="/" class="navbar-brand">AtCoder Editorials</a>
+
+        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse" id="nav1">
+            <ul class="navbar-nav">
+                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+            </ul>
+            {% if current_user.is_authenticated==False %}
+            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
+        </div>
+    </nav>
+
+
+    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+</body>
+
+
+</html>
\ No newline at end of file
diff --git a/app/templates/search.html b/app/templates/search.html
index 3bf15d2..194bee4 100644
--- a/app/templates/search.html
+++ b/app/templates/search.html
@@ -25,7 +25,7 @@
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
-            <span class="navbar-text"><a href="/logout" class="btn btn-info">ログアウト</a></span> {%endif%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
         </div>
     </nav>
 
diff --git a/app/templates/submited.html b/app/templates/submited.html
index 945460d..c0d1900 100644
--- a/app/templates/submited.html
+++ b/app/templates/submited.html
@@ -25,7 +25,7 @@
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
-            <span class="navbar-text"><a href="/logout" class="btn btn-info">ログアウト</a></span> {%endif%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
         </div>
     </nav>
 
diff --git a/app/templates/user.html b/app/templates/user.html
new file mode 100644
index 0000000..14cf121
--- /dev/null
+++ b/app/templates/user.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html lang="ja">
+
+<head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <title>AtCoder Editorials</title>
+</head>
+
+<body style="padding-top:5rem">
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+
+    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
+        <a href="/" class="navbar-brand">AtCoder Editorials</a>
+
+        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse" id="nav1">
+            <ul class="navbar-nav">
+                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+            </ul>
+            {% if current_user.is_authenticated==False %}
+            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
+        </div>
+    </nav>
+
+
+    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+</body>
+
+
+</html>
\ No newline at end of file

From 9dc68f37896ff28fe127c772f268a1c5350d10d6 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 16 Aug 2019 23:54:31 +0900
Subject: [PATCH 019/336] add ranking.html and user.html

---
 app/templates/contest.html  |  4 ++++
 app/templates/error.html    |  4 ++++
 app/templates/index.html    | 12 ++++++++----
 app/templates/login.html    |  4 ++++
 app/templates/ranking.html  |  4 ++++
 app/templates/search.html   |  4 ++++
 app/templates/submited.html |  4 ++++
 app/templates/user.html     |  4 ++++
 8 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/app/templates/contest.html b/app/templates/contest.html
index 9c9d12d..a17692e 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -22,6 +22,10 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item active"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/ranking" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
diff --git a/app/templates/error.html b/app/templates/error.html
index 6fe58d9..3f560de 100644
--- a/app/templates/error.html
+++ b/app/templates/error.html
@@ -22,6 +22,10 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/ranking" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
diff --git a/app/templates/index.html b/app/templates/index.html
index ea88e8e..d2511b5 100644
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -22,6 +22,10 @@
             <ul class="navbar-nav">
                 <li class="nav-item active"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item "><a href="/ranking" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
@@ -52,14 +56,14 @@ <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#
                 <div class="collapse　show" id="action2" data-parent="#events-imfo">
                     <div class="card-body">
                         <h4>AtCoderEditorialsはAtCoderの解法を集めるサイトです。</h4>
-                        <h5>主な機能は　解法の閲覧・投稿　の2つです</h5>
+                        <h5>主な機能は、解法の閲覧・投稿・いいね・ランキングの４つです。</h5>
                         <br>
                         <h5>投稿方法は以下の２つです。</h5>
-                        ・AtCoderEditorialsに直接書き込む
+                        <br>・AtCoderEditorialsに直接書き込む
                         <br> ・外部サイトのリンクを貼る
                         <br>
-                        <br> 解法の投稿にはTwitter認証でのログインが必要です。
-                        <br> 解法の閲覧にはログインは必要ありません。
+                        <br> 解法の投稿・いいね機能の使用にはTwitter認証でのログインが必要です。
+                        <br> 解法の閲覧にログインは必要ありません。
                     </div>
                 </div>
             </div>
diff --git a/app/templates/login.html b/app/templates/login.html
index 14cf121..82df961 100644
--- a/app/templates/login.html
+++ b/app/templates/login.html
@@ -22,6 +22,10 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/ranking" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
diff --git a/app/templates/ranking.html b/app/templates/ranking.html
index 14cf121..279e3a0 100644
--- a/app/templates/ranking.html
+++ b/app/templates/ranking.html
@@ -22,6 +22,10 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item active"><a href="/ranking" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
diff --git a/app/templates/search.html b/app/templates/search.html
index 194bee4..527c5e2 100644
--- a/app/templates/search.html
+++ b/app/templates/search.html
@@ -22,6 +22,10 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item active"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item "><a href="/ranking" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
diff --git a/app/templates/submited.html b/app/templates/submited.html
index c0d1900..085637a 100644
--- a/app/templates/submited.html
+++ b/app/templates/submited.html
@@ -22,6 +22,10 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item active"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item "><a href="/ranking" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
diff --git a/app/templates/user.html b/app/templates/user.html
index 14cf121..82df961 100644
--- a/app/templates/user.html
+++ b/app/templates/user.html
@@ -22,6 +22,10 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/ranking" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
             <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}

From b49cd3ab28d795da7665a118bdfd42eb8c3db487 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 17 Aug 2019 13:18:42 +0900
Subject: [PATCH 020/336] fix

---
 app/app.py                                  | 10 ++++++++
 app/templates/contest.html                  | 26 ++++++++++++++-------
 app/templates/{login.html => template.html} |  0
 3 files changed, 28 insertions(+), 8 deletions(-)
 rename app/templates/{login.html => template.html} (100%)

diff --git a/app/app.py b/app/app.py
index 3d5f086..5251179 100644
--- a/app/app.py
+++ b/app/app.py
@@ -66,6 +66,7 @@ def submit():
         'user_id':current_user.id
     }   
 
+    params['description']=params['description'].replace('\r\n','<br>')
     print(params)
 
     if (params['description'] is not None or params['url'] is not None) and params['title'] is not None:
@@ -80,6 +81,15 @@ def submit():
             return render_template('error.html', message='Error:URLまたは解説文を入力して下さい。')
 
 
+@app.route('/user')
+def user():
+    return render_template('user.html')
+
+@app.route('/ranking')
+def ranking():
+    return render_template('ranking.html')
+
+
 @app.route('/logout')
 def logout():
     logout_user()
diff --git a/app/templates/contest.html b/app/templates/contest.html
index a17692e..e0ec960 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -33,10 +33,15 @@
         </div>
     </nav>
 
-
+    {%if contestname == None%}
+    <div class="container-fluid">
+        <h1>{{request.args.get('contestname','')}}</h1>
+    </div>
+    {%else%}
     <div class="container-fluid">
         <h1>{{contestname}}</h1>
     </div>
+    {%endif%}
 
 
     <br> {% if current_user.is_authenticated== True %}
@@ -52,8 +57,10 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
-                    <textarea placeholder=" 解説文 " name="description" rows=15 cols=55></textarea>
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}} ">投稿</button>
+                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre" rows=15 cols=55></textarea> {%if contestname==None%}
+                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}} ">投稿</button> {%else%}
+                    <button type="submit" class="btn btn-info" name="contestname" value="request.args.get('contestname','') ">投稿</button>{%endif%}
+
                 </form>
             </div>
         </div>
@@ -72,8 +79,11 @@ <h4>投稿をするにはログインが必要です</h4>
             <div id="editorial-card">
 
                 {% for edit in editorials.items %}
-                <img src={{edit.user_image_url}} alt='' style="width:36px;height:36px;vertical-align:middle;">
-                <span class="h4" style="vertical-align:middle;">{{edit.username}}</span>
+                <div>
+                    <img src={{edit.user_image_url}} alt='' style="width:36px;height:36px;vertical-align:middle;">
+                    <span class="h4" style="vertical-align:middle;">{{edit.username}}</span>
+                    <span class="mx-auto" style="vertical-align:middle;">113いいね</span>
+                </div>
 
 
                 <div class="card col-6 border-0">
@@ -87,10 +97,10 @@ <h4 class="card-header text-light bg-dark col-10" data-toggle="collapse" data-ta
                     </div>
 
                     <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
-                        {%if edit.description!=None%}
+                        {% autoescape false %} {%if edit.description!=None%}
                         <br>
                         <p>{{edit.description}}</p>
-                        {%endif%}
+                        {%endif%} {% endautoescape %}
                     </div>
 
                 </div>
@@ -107,7 +117,7 @@ <h4 class="card-header text-light bg-dark col-10" data-toggle="collapse" data-ta
         <a href="{{ url_for('contest_get', page=editorials.prev_num) }}">
             << 前のページ</a>
                 {% else %}
-                << 前のページ {% endif %} | {% if editorials.has_next %} <a href="{{ url_for('contest_get', page=editorials.next_num) }}">次のページ >></a>
+                << 前のページ {% endif %} | {% if editorials.has_next %} <a href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname) }}">次のページ >></a>
         {% else %} 次のページ >> {% endif %}
     </div>
 
diff --git a/app/templates/login.html b/app/templates/template.html
similarity index 100%
rename from app/templates/login.html
rename to app/templates/template.html

From ed0ad652ffb94340fdfb4b989eeed9e0cee74dc7 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 17 Aug 2019 13:55:31 +0900
Subject: [PATCH 021/336] fix

---
 app/templates/contest.html | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/app/templates/contest.html b/app/templates/contest.html
index e0ec960..25aedd7 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -58,8 +58,8 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
                     <textarea placeholder=" 解説文 " name="description" style="white-space:pre" rows=15 cols=55></textarea> {%if contestname==None%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}} ">投稿</button> {%else%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="request.args.get('contestname','') ">投稿</button>{%endif%}
+                    <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname','')}}">投稿</button> {%else%}
+                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
 
                 </form>
             </div>
@@ -113,12 +113,17 @@ <h4 class="card-header text-light bg-dark col-10" data-toggle="collapse" data-ta
     </div>
 
     <div class="container-fluid h4">
-        {% if editorials.has_prev %}
-        <a href="{{ url_for('contest_get', page=editorials.prev_num) }}">
-            << 前のページ</a>
-                {% else %}
-                << 前のページ {% endif %} | {% if editorials.has_next %} <a href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname) }}">次のページ >></a>
-        {% else %} 次のページ >> {% endif %}
+        {% if editorials.has_prev %} {%if contestname==None%}
+        <a href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',''))}}">
+        {%else%}
+        <a href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname)}}">
+        {%endif%}
+        << 前のページ</a> {% else %}
+        << 前のページ {% endif %} | {% if editorials.has_next %} {%if contestname==None%} <a href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname','')) }}">
+            {%else%}
+            <a href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname) }}">
+        {%endif%}
+         次のページ >></a> {% else %} 次のページ >> {% endif %}
     </div>
 
 

From 89564af916bcf1804618803f2e775f9c151c4117 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 17 Aug 2019 14:19:57 +0900
Subject: [PATCH 022/336] fix

---
 app/templates/contest.html | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/templates/contest.html b/app/templates/contest.html
index 25aedd7..9f6f45a 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -74,6 +74,7 @@ <h4>投稿をするにはログインが必要です</h4>
 
 
     <div>
+        {% if editorials.items|length >0 %}
 
         <div class="container-fluid">
             <div id="editorial-card">
@@ -107,8 +108,9 @@ <h4 class="card-header text-light bg-dark col-10" data-toggle="collapse" data-ta
                 <br>
                 <br> {% endfor %}
             </div>
-
-
+            {%else%}
+            <h4 class='container-fluid'>まだ投稿がありません</h4>
+            <br> {%endif%}
         </div>
     </div>
 

From e5f97ef0e1f9b2d981b19238564da6d64c192c33 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 17 Aug 2019 15:30:50 +0900
Subject: [PATCH 023/336] fix

---
 app/app.py                 | 6 +++++-
 app/templates/contest.html | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/app/app.py b/app/app.py
index 5251179..644016c 100644
--- a/app/app.py
+++ b/app/app.py
@@ -46,6 +46,9 @@ def contest_search():
 @app.route('/search/contest/<int:page>', methods=['GET','POST'])
 def contest_get(page=1):
     contestname = _normalize_contestname(request.form.get('contestname'))
+    
+    if contestname==None:
+        contestname=request.args.get('contestname','')
 
     per_page = 10
     editorials = Editorial.query.filter_by(contestname=contestname).paginate(page, per_page, error_out=False)
@@ -69,7 +72,8 @@ def submit():
     params['description']=params['description'].replace('\r\n','<br>')
     print(params)
 
-    if (params['description'] is not None or params['url'] is not None) and params['title'] is not None:
+    if ((params['description'] is not None and params['description'] is not '') or (params['url'] is not None and params['url'] is not ''))\
+          and params['title'] is not None and params['title'] is not '':
         newEditorial = Editorial(**params)
         db.session.add(newEditorial)
         db.session.commit()
diff --git a/app/templates/contest.html b/app/templates/contest.html
index 9f6f45a..9353fac 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -123,7 +123,7 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
         << 前のページ</a> {% else %}
         << 前のページ {% endif %} | {% if editorials.has_next %} {%if contestname==None%} <a href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname','')) }}">
             {%else%}
-            <a href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname) }}">
+            <a href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname)}}">
         {%endif%}
          次のページ >></a> {% else %} 次のページ >> {% endif %}
     </div>

From 87f172b7760e377798024a4a0fed2e030882ac52 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 17 Aug 2019 23:16:29 +0900
Subject: [PATCH 024/336] fix

---
 app/app.py                 |  3 +-
 app/templates/contest.html | 77 ++++++++++++++++++++------------------
 2 files changed, 42 insertions(+), 38 deletions(-)

diff --git a/app/app.py b/app/app.py
index 644016c..daea406 100644
--- a/app/app.py
+++ b/app/app.py
@@ -1,4 +1,4 @@
-from flask import Flask, render_template, request,url_for, redirect,session
+from flask import Flask, render_template, request,url_for, redirect,session,Response
 from flask_sqlalchemy import SQLAlchemy
 from flask_migrate import Migrate
 from flask_login import UserMixin, LoginManager, login_user, logout_user, current_user
@@ -147,7 +147,6 @@ def oauth_callback():
     login_user(user, True)
     return redirect(url_for('index'))
 
-
 @login_manager.user_loader
 def load_user(id):
     return User.query.get(int(id))
diff --git a/app/templates/contest.html b/app/templates/contest.html
index 9353fac..9eb02d1 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -76,56 +76,61 @@ <h4>投稿をするにはログインが必要です</h4>
     <div>
         {% if editorials.items|length >0 %}
 
-        <div class="container-fluid">
-            <div id="editorial-card">
-
-                {% for edit in editorials.items %}
-                <div>
-                    <img src={{edit.user_image_url}} alt='' style="width:36px;height:36px;vertical-align:middle;">
-                    <span class="h4" style="vertical-align:middle;">{{edit.username}}</span>
-                    <span class="mx-auto" style="vertical-align:middle;">113いいね</span>
-                </div>
+        <div id="editorial-card">
 
+            {% for edit in editorials.items %}
+            <div class="row col-3">
+                <h5 class="col-1"></h5>
+                <form class='ajax_submit' style="vertical-align:middle;" method="POST" action="/like">
+                    <button id="like_button" class="btn btn-outline-info">{{edit.like}}いいね</button>
+                </form>
+                <h5 class="col-1"></h5>
+                <img src={{edit.user_image_url}} alt='No Image' style="width:36px;height:36px;vertical-align:middle;">
+                <span class="h4" style="vertical-align:middle;">{{edit.username}}</span>
+            </div>
 
-                <div class="card col-6 border-0">
-                    <h4 class="card-header text-light bg-dark col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
-                        {{edit.title}}
-                    </h4>
 
-                    <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
-                        {% if edit.url!=None%}
-                        <a href={{edit.url}}>{{edit.url}}</a> {%endif%}
-                    </div>
+            <div class="card col-6 border-0">
+                <h4 class="card-header text-light bg-dark col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
+                    {{edit.title}}
+                </h4>
 
-                    <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
-                        {% autoescape false %} {%if edit.description!=None%}
-                        <br>
-                        <p>{{edit.description}}</p>
-                        {%endif%} {% endautoescape %}
-                    </div>
+                <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
+                    {% if edit.url!=None%}
+                    <a href={{edit.url}}>{{edit.url}}</a> {%endif%}
+                </div>
 
+                <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
+                    {% autoescape false %} {%if edit.description!=None%}
+                    <br>
+                    <p>{{edit.description}}</p>
+                    {%endif%} {% endautoescape %}
                 </div>
-                <br>
-                <br> {% endfor %}
             </div>
-            {%else%}
-            <h4 class='container-fluid'>まだ投稿がありません</h4>
-            <br> {%endif%}
+            <br>
+            <br> {% endfor %}
         </div>
+        {%else%}
+        <h4 class='container-fluid'>まだ投稿がありません</h4>
+        <br> {%endif%}
+    </div>
     </div>
 
     <div class="container-fluid h4">
-        {% if editorials.has_prev %} {%if contestname==None%}
-        <a href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',''))}}">
+
+        <ul class="pagination">
+            {% if editorials.has_prev %} {%if contestname==None%}
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',''))}}">
         {%else%}
-        <a href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname)}}">
+        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname)}}">
         {%endif%}
-        << 前のページ</a> {% else %}
-        << 前のページ {% endif %} | {% if editorials.has_next %} {%if contestname==None%} <a href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname','')) }}">
-            {%else%}
-            <a href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname)}}">
+        << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname','')) }}">
+                {%else%}
+                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname)}}">
         {%endif%}
-         次のページ >></a> {% else %} 次のページ >> {% endif %}
+         次のページ >></a></li>{% endif %}
+        </ul>
     </div>
 
 

From 8f8a115ce86825198e9ede956c59287a38499b8d Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 17 Aug 2019 23:16:45 +0900
Subject: [PATCH 025/336] fix

---
 app/app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/app.py b/app/app.py
index daea406..b4e5de6 100644
--- a/app/app.py
+++ b/app/app.py
@@ -1,4 +1,4 @@
-from flask import Flask, render_template, request,url_for, redirect,session,Response
+from flask import Flask, render_template, request,url_for, redirect,session
 from flask_sqlalchemy import SQLAlchemy
 from flask_migrate import Migrate
 from flask_login import UserMixin, LoginManager, login_user, logout_user, current_user

From 23e10cb7934aca40ba3df0372c9bfd84daeaf17b Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 18 Aug 2019 17:24:37 +0900
Subject: [PATCH 026/336] add like

---
 app/app.py                 | 20 ++++++++++++++++++--
 app/like.py                | 28 ++++++++++++++++++++++++++++
 app/templates/contest.html | 34 +++++++++++++++++++++++++++++++---
 app/templates/search.html  |  1 -
 4 files changed, 77 insertions(+), 6 deletions(-)
 create mode 100644 app/like.py

diff --git a/app/app.py b/app/app.py
index b4e5de6..b704ab9 100644
--- a/app/app.py
+++ b/app/app.py
@@ -14,6 +14,7 @@ class User(UserMixin,db.Model):
     user_image_url = db.Column(db.String(1024), index=True)
     date_published = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
     twitter_id = db.Column(db.String(64), nullable=False, unique=True)
+    like_sum=db.Column(db.Integer)
 
 
 class Editorial(db.Model):
@@ -27,6 +28,11 @@ class Editorial(db.Model):
     user_image_url = db.Column(db.String(1024), index=True)
     user_id=db.Column(db.Integer)
 
+class Like(db.Model):
+    id=db.Column(db.Integer,primary_key=True)
+    user_id=db.Column(db.Integer)
+    edit_id=db.Column(db.Integer)
+
 def _normalize_contestname(contestname):
     if isinstance(contestname, str):
         contestname = contestname.strip()
@@ -53,7 +59,16 @@ def contest_get(page=1):
     per_page = 10
     editorials = Editorial.query.filter_by(contestname=contestname).paginate(page, per_page, error_out=False)
 
-    return render_template('contest.html', contestname=contestname, editorials=editorials)
+    flag={}
+    for edit in editorials.items:
+        like=db.session.query(Like).filter(Like.edit_id==edit.id,Like.user_id==current_user.id).first()
+        print(like)
+        if like:
+            flag[edit.id]=True
+        else:
+            flag[edit.id]=False
+
+    return render_template('contest.html', contestname=contestname, editorials=editorials,flag=flag)
 
 
 @app.route('/submited', methods=['POST'])
@@ -139,7 +154,8 @@ def oauth_callback():
             twitter_id=twitter_id,
             username=username,
             description=description,
-            user_image_url=profile_image_url
+            user_image_url=profile_image_url,
+            like_sum=0
         )
         db.session.add(user)
 
diff --git a/app/like.py b/app/like.py
new file mode 100644
index 0000000..e191143
--- /dev/null
+++ b/app/like.py
@@ -0,0 +1,28 @@
+from flask_sqlalchemy import SQLAlchemy,request
+from flask_login import  current_user
+from config import app, db
+from app import Like,Editorial,User
+
+id=request.form['id']
+like_list=Like.query.filter_by(edit_id=id)
+edit=db.session.query(Editorial).filter(Editorial.id==id)
+user=db.session.query(User).filter(User.id==current_user.id).first()
+
+flag=False
+for like in like_list:
+    if like.user_id==current_user.id:
+        flag=True
+
+#いいねされていた場合
+newLike=Like(user_id=current_user.id,edit_id=id)
+
+if flag==True:
+    edit.like-=1
+    user.like_sum-=1
+    db.session.delete(newLike)
+else:
+    edit.like+=1
+    user.like_sum+=1
+    db.session.add(newLike)
+
+db.session.commit()
\ No newline at end of file
diff --git a/app/templates/contest.html b/app/templates/contest.html
index 9eb02d1..be4c184 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -81,9 +81,15 @@ <h4>投稿をするにはログインが必要です</h4>
             {% for edit in editorials.items %}
             <div class="row col-3">
                 <h5 class="col-1"></h5>
-                <form class='ajax_submit' style="vertical-align:middle;" method="POST" action="/like">
-                    <button id="like_button" class="btn btn-outline-info">{{edit.like}}いいね</button>
+                {% if flag[edit.id]==False%}
+                <form>
+                    <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
                 </form>
+                {%else%}
+                <form>
+                    <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
+                </form>
+                {%endif%}
                 <h5 class="col-1"></h5>
                 <img src={{edit.user_image_url}} alt='No Image' style="width:36px;height:36px;vertical-align:middle;">
                 <span class="h4" style="vertical-align:middle;">{{edit.username}}</span>
@@ -137,6 +143,28 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
     <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js " integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo " crossorigin="anonymous "></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
-</body>
+
+    <script type="text/javascript">
+        $('.like_button').on('click', function() {
+            $(this).toggleClass('active');
+
+            if ($(this).hasClass('active')) {
+                var text = $(this).data('btn btn-info');
+            } else {
+                var text = $(this).data('btn btn-outline-info');
+            }
+
+            $(this).html(text);
+
+            event.preventDefault();
+            $.ajax({
+                url: 'app/like.py',
+                type: 'post',
+                data: {
+                    id: $("[name=id]").val(),
+                },
+            })
+        })
+    </script>
 
 </html>
\ No newline at end of file
diff --git a/app/templates/search.html b/app/templates/search.html
index 527c5e2..43785d4 100644
--- a/app/templates/search.html
+++ b/app/templates/search.html
@@ -43,7 +43,6 @@ <h3>コンテスト名を記入し、下の候補からコンテストを選ん
 
     </div>
 
-
     <script src="http://code.jquery.com/jquery-3.2.1.min.js " integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin=" anonymous "></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>

From e93686cb7609ad9bf49e767b7a83e1632e50037b Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 18 Aug 2019 17:39:58 +0900
Subject: [PATCH 027/336] fix like

---
 app/like.py | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/app/like.py b/app/like.py
index e191143..09bbf34 100644
--- a/app/like.py
+++ b/app/like.py
@@ -4,18 +4,12 @@
 from app import Like,Editorial,User
 
 id=request.form['id']
-like_list=Like.query.filter_by(edit_id=id)
-edit=db.session.query(Editorial).filter(Editorial.id==id)
+flag=db.session.query(Like).filter(edit_id=id,user_id=current_user.id).first()
+edit=db.session.query(Editorial).filter(Editorial.id==id).first()
 user=db.session.query(User).filter(User.id==current_user.id).first()
 
-flag=False
-for like in like_list:
-    if like.user_id==current_user.id:
-        flag=True
-
-#いいねされていた場合
+ #いいねされていた場合
 newLike=Like(user_id=current_user.id,edit_id=id)
-
 if flag==True:
     edit.like-=1
     user.like_sum-=1

From 9569d5bd955154629c2ec5c3f2408dbd323d729b Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 18 Aug 2019 23:03:38 +0900
Subject: [PATCH 028/336] add like

---
 app/app.py                 | 49 ++++++++++++++++++++++++++++----------
 app/like.py                | 22 -----------------
 app/templates/contest.html | 27 +++++++++++++--------
 3 files changed, 54 insertions(+), 44 deletions(-)
 delete mode 100644 app/like.py

diff --git a/app/app.py b/app/app.py
index b704ab9..3ccca8e 100644
--- a/app/app.py
+++ b/app/app.py
@@ -59,16 +59,19 @@ def contest_get(page=1):
     per_page = 10
     editorials = Editorial.query.filter_by(contestname=contestname).paginate(page, per_page, error_out=False)
 
-    flag={}
-    for edit in editorials.items:
-        like=db.session.query(Like).filter(Like.edit_id==edit.id,Like.user_id==current_user.id).first()
-        print(like)
-        if like:
-            flag[edit.id]=True
-        else:
-            flag[edit.id]=False
-
-    return render_template('contest.html', contestname=contestname, editorials=editorials,flag=flag)
+    if current_user.is_authenticated==True:
+        flag={}
+        for edit in editorials.items:
+            like=db.session.query(Like).filter(Like.edit_id==edit.id,Like.user_id==current_user.id).first()
+            print(like)
+            if like:
+                flag[edit.id]=True
+            else:
+                flag[edit.id]=False
+
+        return render_template('contest.html', contestname=contestname, editorials=editorials,flag=flag)
+    else:
+        return render_template('contest.html',contestname=contestname,editorials=editorials)
 
 
 @app.route('/submited', methods=['POST'])
@@ -85,7 +88,6 @@ def submit():
     }   
 
     params['description']=params['description'].replace('\r\n','<br>')
-    print(params)
 
     if ((params['description'] is not None and params['description'] is not '') or (params['url'] is not None and params['url'] is not ''))\
           and params['title'] is not None and params['title'] is not '':
@@ -155,7 +157,7 @@ def oauth_callback():
             username=username,
             description=description,
             user_image_url=profile_image_url,
-            like_sum=0
+            like_sum=int(0)
         )
         db.session.add(user)
 
@@ -163,6 +165,29 @@ def oauth_callback():
     login_user(user, True)
     return redirect(url_for('index'))
 
+@app.route('/like',methods=['POST'])
+def like():
+    id=request.form['id']
+    print(id)
+    flag=db.session.query(Like).filter(Like.edit_id==id ).filter(Like.user_id==current_user.id).first()
+    edit=db.session.query(Editorial).filter(Editorial.id==id).first()
+    user=db.session.query(User).filter(User.id==current_user.id).first()
+
+    #いいねされていた場合
+    newLike=Like(user_id=current_user.id,edit_id=id)
+    if flag==True:
+        edit.like-=1
+        user.like_sum-=1
+        db.session.delete(newLike)
+    else:
+        edit.like+=1
+        user.like_sum+=1
+        db.session.add(newLike)
+
+    db.session.commit()
+
+    return 'hoge'
+
 @login_manager.user_loader
 def load_user(id):
     return User.query.get(int(id))
diff --git a/app/like.py b/app/like.py
deleted file mode 100644
index 09bbf34..0000000
--- a/app/like.py
+++ /dev/null
@@ -1,22 +0,0 @@
-from flask_sqlalchemy import SQLAlchemy,request
-from flask_login import  current_user
-from config import app, db
-from app import Like,Editorial,User
-
-id=request.form['id']
-flag=db.session.query(Like).filter(edit_id=id,user_id=current_user.id).first()
-edit=db.session.query(Editorial).filter(Editorial.id==id).first()
-user=db.session.query(User).filter(User.id==current_user.id).first()
-
- #いいねされていた場合
-newLike=Like(user_id=current_user.id,edit_id=id)
-if flag==True:
-    edit.like-=1
-    user.like_sum-=1
-    db.session.delete(newLike)
-else:
-    edit.like+=1
-    user.like_sum+=1
-    db.session.add(newLike)
-
-db.session.commit()
\ No newline at end of file
diff --git a/app/templates/contest.html b/app/templates/contest.html
index be4c184..cf830d5 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -81,7 +81,7 @@ <h4>投稿をするにはログインが必要です</h4>
             {% for edit in editorials.items %}
             <div class="row col-3">
                 <h5 class="col-1"></h5>
-                {% if flag[edit.id]==False%}
+                {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
                 <form>
                     <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
                 </form>
@@ -89,7 +89,8 @@ <h5 class="col-1"></h5>
                 <form>
                     <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
                 </form>
-                {%endif%}
+                {%endif%} {%else%}
+                <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
                 <h5 class="col-1"></h5>
                 <img src={{edit.user_image_url}} alt='No Image' style="width:36px;height:36px;vertical-align:middle;">
                 <span class="h4" style="vertical-align:middle;">{{edit.username}}</span>
@@ -139,8 +140,7 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
         </ul>
     </div>
 
-
-    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js " integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo " crossorigin="anonymous "></script>
+    <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
 
@@ -158,12 +158,19 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
 
             event.preventDefault();
             $.ajax({
-                url: 'app/like.py',
-                type: 'post',
-                data: {
-                    id: $("[name=id]").val(),
-                },
-            })
+                    url: '/like',
+                    type: 'post',
+                    dataType: 'text',
+                    data: {
+                        id: $("[name=id]").val(),
+                    },
+                }).done(function(response) {
+                    console.log('success');
+                })
+                .fail(function() {
+                    console.log('fail');
+                });
+
         })
     </script>
 

From a7053f1ace0306f9acfd1708c1fede7bd71b76d0 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 19 Aug 2019 08:33:51 +0900
Subject: [PATCH 029/336] fix

---
 app/templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/templates/contest.html b/app/templates/contest.html
index cf830d5..ec8ec49 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -162,7 +162,7 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
                     type: 'post',
                     dataType: 'text',
                     data: {
-                        id: $("[name=id]").val(),
+                        id: $(this).val(),
                     },
                 }).done(function(response) {
                     console.log('success');

From 711f3204f813c4dd53e906b0c85d7f5f4d27cfaf Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 19 Aug 2019 09:44:56 +0900
Subject: [PATCH 030/336] color change

---
 app/templates/contest.html | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/app/templates/contest.html b/app/templates/contest.html
index ec8ec49..96ed87d 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -8,7 +8,7 @@
     <title>AtCoder Editorials</title>
 </head>
 
-<body style="padding-top:5rem">
+<body style="padding-top:5rem" class="bg-white">
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
@@ -33,15 +33,13 @@
         </div>
     </nav>
 
+    <div class="container-fluid"></div>
     {%if contestname == None%}
-    <div class="container-fluid">
-        <h1>{{request.args.get('contestname','')}}</h1>
-    </div>
+    <h1>{{request.args.get('contestname','')}}</h1>
     {%else%}
-    <div class="container-fluid">
-        <h1>{{contestname}}</h1>
-    </div>
+    <h1>{{contestname}}</h1>
     {%endif%}
+    </div>
 
 
     <br> {% if current_user.is_authenticated== True %}
@@ -98,7 +96,7 @@ <h5 class="col-1"></h5>
 
 
             <div class="card col-6 border-0">
-                <h4 class="card-header text-light bg-dark col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
+                <h4 class="card-header text-light bg-secondary col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
                     {{edit.title}}
                 </h4>
 
@@ -121,7 +119,6 @@ <h4 class="card-header text-light bg-dark col-10" data-toggle="collapse" data-ta
         <h4 class='container-fluid'>まだ投稿がありません</h4>
         <br> {%endif%}
     </div>
-    </div>
 
     <div class="container-fluid h4">
 
@@ -173,5 +170,6 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
 
         })
     </script>
+</body>
 
 </html>
\ No newline at end of file

From d5b6eb8ea6290953ffba175aafa75eb2ba4f19ab Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 19 Aug 2019 09:46:51 +0900
Subject: [PATCH 031/336] fix

---
 app/templates/contest.html | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/app/templates/contest.html b/app/templates/contest.html
index 96ed87d..8e7b5ea 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -8,7 +8,7 @@
     <title>AtCoder Editorials</title>
 </head>
 
-<body style="padding-top:5rem" class="bg-white">
+<body style="padding-top:5rem">
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
@@ -33,13 +33,15 @@
         </div>
     </nav>
 
-    <div class="container-fluid"></div>
     {%if contestname == None%}
-    <h1>{{request.args.get('contestname','')}}</h1>
+    <div class="container-fluid">
+        <h1>{{request.args.get('contestname','')}}</h1>
+    </div>
     {%else%}
-    <h1>{{contestname}}</h1>
-    {%endif%}
+    <div class="container-fluid">
+        <h1>{{contestname}}</h1>
     </div>
+    {%endif%}
 
 
     <br> {% if current_user.is_authenticated== True %}

From 37be8726293b301bf17e7ac9180be22a2e3011d8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 19 Aug 2019 16:37:47 +0900
Subject: [PATCH 032/336] add ranking

---
 app/app.py                  | 21 +++++++++++--------
 app/templates/contest.html  |  6 +++---
 app/templates/error.html    |  4 ++--
 app/templates/index.html    |  4 ++--
 app/templates/ranking.html  | 40 +++++++++++++++++++++++++++++++++++--
 app/templates/search.html   |  4 ++--
 app/templates/submited.html |  4 ++--
 app/templates/template.html |  4 ++--
 app/templates/user.html     |  4 ++--
 9 files changed, 66 insertions(+), 25 deletions(-)

diff --git a/app/app.py b/app/app.py
index 3ccca8e..d851204 100644
--- a/app/app.py
+++ b/app/app.py
@@ -1,5 +1,6 @@
 from flask import Flask, render_template, request,url_for, redirect,session
 from flask_sqlalchemy import SQLAlchemy
+from sqlalchemy import desc
 from flask_migrate import Migrate
 from flask_login import UserMixin, LoginManager, login_user, logout_user, current_user
 from datetime import datetime
@@ -102,13 +103,16 @@ def submit():
             return render_template('error.html', message='Error:URLまたは解説文を入力して下さい。')
 
 
-@app.route('/user')
-def user():
+@app.route('/user/<int:id>',methods=['GET'])
+def user(id):
     return render_template('user.html')
 
-@app.route('/ranking')
-def ranking():
-    return render_template('ranking.html')
+@app.route('/ranking/<int:page>')
+def ranking(page=1):
+    per_page = 30
+    users=db.session.query(User).order_by(desc(User.like_sum)).paginate(page, per_page, error_out=False)
+
+    return render_template('ranking.html',users=users,page=page,per_page=per_page)
 
 
 @app.route('/logout')
@@ -168,17 +172,18 @@ def oauth_callback():
 @app.route('/like',methods=['POST'])
 def like():
     id=request.form['id']
-    print(id)
     flag=db.session.query(Like).filter(Like.edit_id==id ).filter(Like.user_id==current_user.id).first()
     edit=db.session.query(Editorial).filter(Editorial.id==id).first()
     user=db.session.query(User).filter(User.id==current_user.id).first()
 
+    print(id,flag,edit,user)
+
     #いいねされていた場合
     newLike=Like(user_id=current_user.id,edit_id=id)
-    if flag==True:
+    if flag!=None:
         edit.like-=1
         user.like_sum-=1
-        db.session.delete(newLike)
+        db.session.delete(flag)
     else:
         edit.like+=1
         user.like_sum+=1
diff --git a/app/templates/contest.html b/app/templates/contest.html
index 8e7b5ea..f5215be 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -22,9 +22,9 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item active"><a href="/search" class="nav-link">コンテスト</a></li>
-                <li class="nav-item"><a href="/ranking" class="nav-link">ランキング</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
@@ -150,7 +150,7 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
             if ($(this).hasClass('active')) {
                 var text = $(this).data('btn btn-info');
             } else {
-                var text = $(this).data('btn btn-outline-info');
+                var text = $(this).data('btn btnconsole.log($(this).val);-outline-info');
             }
 
             $(this).html(text);
diff --git a/app/templates/error.html b/app/templates/error.html
index 3f560de..72ad3b2 100644
--- a/app/templates/error.html
+++ b/app/templates/error.html
@@ -22,9 +22,9 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
-                <li class="nav-item"><a href="/ranking" class="nav-link">ランキング</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
diff --git a/app/templates/index.html b/app/templates/index.html
index d2511b5..9baeea6 100644
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -22,9 +22,9 @@
             <ul class="navbar-nav">
                 <li class="nav-item active"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
-                <li class="nav-item "><a href="/ranking" class="nav-link">ランキング</a></li>
+                <li class="nav-item "><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
diff --git a/app/templates/ranking.html b/app/templates/ranking.html
index 279e3a0..248cc39 100644
--- a/app/templates/ranking.html
+++ b/app/templates/ranking.html
@@ -22,9 +22,9 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
-                <li class="nav-item active"><a href="/ranking" class="nav-link">ランキング</a></li>
+                <li class="nav-item active"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
@@ -32,6 +32,42 @@
             <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
         </div>
     </nav>
+    <div>
+        <table class="table">
+            <thead>
+                <tr>
+                    <th scope="col">順位</th>
+                    <th scope="col">名前</th>
+                    <th scope="col">総いいね数</th>
+                </tr>
+            </thead {% for user in users.items%} <tbody>
+            <tr>
+                <th scope="row">{{loop.index+(page-1)*per_page}}</th>
+                <td><img src={{user.user_image_url}} alt='' style="width:36px;height:36px;vertical-align:middle;"> {{user.username}}
+                </td>
+                <td>{{user.like_sum}}</td>
+            </tr>
+            {%endfor%}
+            </tbody>
+
+        </table>
+    </div>
+    <div>
+        <div class="container-fluid h4">
+
+            <ul class="pagination">
+                {% if users.has_prev %}
+                <li class="page-item">
+                    <a class="page-link" href="{{ url_for('ranking', page=users.prev_num)}}">前のページ</a>
+                </li>
+                {% endif %} {% if users.has_next %}
+                <li class="page-item">
+                    <a class="page-link" href="{{ url_for('ranking', page=users.next_num)}}">次のページ</a>
+                </li>
+                {% endif %}
+            </ul>
+        </div>
+    </div>
 
 
     <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
diff --git a/app/templates/search.html b/app/templates/search.html
index 43785d4..6f9e6aa 100644
--- a/app/templates/search.html
+++ b/app/templates/search.html
@@ -22,9 +22,9 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item active"><a href="/search" class="nav-link">コンテスト</a></li>
-                <li class="nav-item "><a href="/ranking" class="nav-link">ランキング</a></li>
+                <li class="nav-item "><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
diff --git a/app/templates/submited.html b/app/templates/submited.html
index 085637a..fdaf6a6 100644
--- a/app/templates/submited.html
+++ b/app/templates/submited.html
@@ -22,9 +22,9 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item active"><a href="/search" class="nav-link">コンテスト</a></li>
-                <li class="nav-item "><a href="/ranking" class="nav-link">ランキング</a></li>
+                <li class="nav-item "><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
diff --git a/app/templates/template.html b/app/templates/template.html
index 82df961..303a2fd 100644
--- a/app/templates/template.html
+++ b/app/templates/template.html
@@ -22,9 +22,9 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
-                <li class="nav-item"><a href="/ranking" class="nav-link">ランキング</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
diff --git a/app/templates/user.html b/app/templates/user.html
index 82df961..303a2fd 100644
--- a/app/templates/user.html
+++ b/app/templates/user.html
@@ -22,9 +22,9 @@
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
-                <li class="nav-item"><a href="/ranking" class="nav-link">ランキング</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}

From b5b5a3a0530ed5139db6269370312232b41be921 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 19 Aug 2019 17:18:57 +0900
Subject: [PATCH 033/336] commit

---
 app/app.py                |  4 ++--
 app/templates/index.html  | 20 +++++++++++++-------
 app/templates/search.html |  9 ++++++++-
 3 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/app/app.py b/app/app.py
index d851204..726a117 100644
--- a/app/app.py
+++ b/app/app.py
@@ -24,7 +24,7 @@ class Editorial(db.Model):
     contestname = db.Column(db.String(64))
     title = db.Column(db.String(64))
     url = db.Column(db.String(120))
-    description = db.Column(db.String(1024))
+    description = db.Column(db.String(2048))
     like = db.Column(db.Integer)
     user_image_url = db.Column(db.String(1024), index=True)
     user_id=db.Column(db.Integer)
@@ -109,7 +109,7 @@ def user(id):
 
 @app.route('/ranking/<int:page>')
 def ranking(page=1):
-    per_page = 30
+    per_page = 50
     users=db.session.query(User).order_by(desc(User.like_sum)).paginate(page, per_page, error_out=False)
 
     return render_template('ranking.html',users=users,page=page,per_page=per_page)
diff --git a/app/templates/index.html b/app/templates/index.html
index 9baeea6..93252f1 100644
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -55,15 +55,21 @@ <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#
                 </h5>
                 <div class="collapse　show" id="action2" data-parent="#events-imfo">
                     <div class="card-body">
-                        <h4>AtCoderEditorialsはAtCoderの解法を集めるサイトです。</h4>
-                        <h5>主な機能は、解法の閲覧・投稿・いいね・ランキングの４つです。</h5>
+                        <h3>AtCoderEditorialsはAtCoderの解法を集めるWebアプリです。</h3>
+                        <h5>主な機能は、解法の閲覧・投稿・いいね機能・ランキングの４つです。</h5>
                         <br>
-                        <h5>投稿方法は以下の２つです。</h5>
-                        <br>・AtCoderEditorialsに直接書き込む
-                        <br> ・外部サイトのリンクを貼る
+                        <h4> 投稿方法</h4>
+                        ・AtCoderEditorialsに直接書き込む。
+                        <br>・外部サイトのURLを貼る。
                         <br>
-                        <br> 解法の投稿・いいね機能の使用にはTwitter認証でのログインが必要です。
-                        <br> 解法の閲覧にログインは必要ありません。
+                        <br>
+                        <h5>注意</h5>
+                        ・自分以外が書いた解法の投稿は、許可を貰ってからお願いします。
+                        <br>
+                        <br>
+                        <h4>ログインについて</h4>
+                        ・解法の投稿・いいね機能の使用にはTwitter認証でのログインが必要です。
+                        <br> ・解法の閲覧にログインは必要ありません。
                     </div>
                 </div>
             </div>
diff --git a/app/templates/search.html b/app/templates/search.html
index 6f9e6aa..eccd02a 100644
--- a/app/templates/search.html
+++ b/app/templates/search.html
@@ -34,7 +34,14 @@
     </nav>
 
     <div class="container-fluid">
-        <h3>コンテスト名を記入し、下の候補からコンテストを選んで下さい</h3>
+        <div class="jumbotron jumbotron-fluid">
+            <div class="container">
+                <h4 class="display-4">コンテスト検索</h4>
+                <br>
+                <h5>解法の見たいコンテスト名を入力し、下の候補から選択して下さい。</h5>
+            </div>
+        </div>
+
         <br>
         <form id="search" method="POST" action="/search/contest/1">
             <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" />

From c5d1dd8d4c865fcaa07afa0fa787a49c80b86440 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 19 Aug 2019 17:30:06 +0900
Subject: [PATCH 034/336] word-wrap

---
 app/templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/templates/contest.html b/app/templates/contest.html
index f5215be..ca96ff5 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -57,7 +57,7 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
-                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre" rows=15 cols=55></textarea> {%if contestname==None%}
+                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=55></textarea> {%if contestname==None%}
                     <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname','')}}">投稿</button> {%else%}
                     <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
 

From be49e3c9afa577528d52e01873d7dadadc145ca8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 20 Aug 2019 16:21:29 +0900
Subject: [PATCH 035/336] commit

---
 app/app.py                  |  24 +++++--
 app/templates/contest.html  | 135 ++++++++++++++++++------------------
 app/templates/error.html    |   2 +-
 app/templates/index.html    |   4 +-
 app/templates/ranking.html  |  21 +++---
 app/templates/search.html   |   4 +-
 app/templates/submited.html |   2 +-
 app/templates/template.html |   2 +-
 app/templates/user.html     |  60 +++++++++++++++-
 9 files changed, 164 insertions(+), 90 deletions(-)

diff --git a/app/app.py b/app/app.py
index 726a117..1194a9d 100644
--- a/app/app.py
+++ b/app/app.py
@@ -103,15 +103,29 @@ def submit():
             return render_template('error.html', message='Error:URLまたは解説文を入力して下さい。')
 
 
-@app.route('/user/<int:id>',methods=['GET'])
-def user(id):
-    return render_template('user.html')
+@app.route('/user/<int:id>/<int:page>',methods=['GET'])
+def user(id,page=1):
+    per_page=10
+
+    user=User.query.filter_by(id=id).first()
+    edit=Editorial.query.filter_by(user_id=id).paginate(page, per_page, error_out=False)
+
+    edit_num=Editorial.query.filter_by(user_id=id).all()
+    num=len(edit_num)
+
+    rank=1
+    all_edit=db.session.query(User).order_by(desc(User.like_sum)).all()
+    for i in range(0,len(all_edit)):
+        if all_edit[i].id==id:
+            rank=i+1
+            break
+
+    return render_template('user.html',user=user,edit=edit,num=num,rank=rank)
 
 @app.route('/ranking/<int:page>')
 def ranking(page=1):
-    per_page = 50
+    per_page = 100
     users=db.session.query(User).order_by(desc(User.like_sum)).paginate(page, per_page, error_out=False)
-
     return render_template('ranking.html',users=users,page=page,per_page=per_page)
 
 
diff --git a/app/templates/contest.html b/app/templates/contest.html
index ca96ff5..3fd548f 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -24,7 +24,7 @@
                 <li class="nav-item active"><a href="/search" class="nav-link">コンテスト</a></li>
                 <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
@@ -79,8 +79,7 @@ <h4>投稿をするにはログインが必要です</h4>
         <div id="editorial-card">
 
             {% for edit in editorials.items %}
-            <div class="row col-3">
-                <h5 class="col-1"></h5>
+            <div class="row container-fluid">
                 {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
                 <form>
                     <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
@@ -90,88 +89,90 @@ <h5 class="col-1"></h5>
                     <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
                 </form>
                 {%endif%} {%else%}
-                <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
-                <h5 class="col-1"></h5>
-                <img src={{edit.user_image_url}} alt='No Image' style="width:36px;height:36px;vertical-align:middle;">
-                <span class="h4" style="vertical-align:middle;">{{edit.username}}</span>
-            </div>
+                <div>
+                    <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
+                    <h5 class="col-1"></h5>
+                    <img src={{edit.user_image_url}} alt='No Image' style="width:36px;height:36px;vertical-align:middle;">
+                    <a href="/user/{{edit.user_id}}/1" class="h4" style="vertical-align:middle;">{{edit.username}}</a>
+                    </a>
+                </div>
 
 
-            <div class="card col-6 border-0">
-                <h4 class="card-header text-light bg-secondary col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
-                    {{edit.title}}
-                </h4>
+                <div class="card col-6 border-0">
+                    <h4 class="card-header text-light bg-light text-dark col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
+                        {{edit.title}}
+                    </h4>
 
-                <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
-                    {% if edit.url!=None%}
-                    <a href={{edit.url}}>{{edit.url}}</a> {%endif%}
-                </div>
+                    <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
+                        {% if edit.url!=None%}
+                        <a href={{edit.url}}>{{edit.url}}</a> {%endif%}
+                    </div>
 
-                <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
-                    {% autoescape false %} {%if edit.description!=None%}
-                    <br>
-                    <p>{{edit.description}}</p>
-                    {%endif%} {% endautoescape %}
+                    <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
+                        {% autoescape false %} {%if edit.description!=None%}
+                        <br>
+                        <p>{{edit.description}}</p>
+                        {%endif%} {% endautoescape %}
+                    </div>
                 </div>
+                <br>
+                <br> {% endfor %}
             </div>
-            <br>
-            <br> {% endfor %}
+            {%else%}
+            <h4 class='container-fluid'>まだ投稿がありません</h4>
+            <br> {%endif%}
         </div>
-        {%else%}
-        <h4 class='container-fluid'>まだ投稿がありません</h4>
-        <br> {%endif%}
-    </div>
 
-    <div class="container-fluid h4">
+        <div class="container-fluid h4">
 
-        <ul class="pagination">
-            {% if editorials.has_prev %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',''))}}">
+            <ul class="pagination">
+                {% if editorials.has_prev %} {%if contestname==None%}
+                <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',''))}}">
         {%else%}
         <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname)}}">
         {%endif%}
         << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname','')) }}">
+                <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname','')) }}">
                 {%else%}
                 <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname)}}">
         {%endif%}
          次のページ >></a></li>{% endif %}
-        </ul>
-    </div>
+            </ul>
+        </div>
 
-    <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
-    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
-    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
-
-    <script type="text/javascript">
-        $('.like_button').on('click', function() {
-            $(this).toggleClass('active');
-
-            if ($(this).hasClass('active')) {
-                var text = $(this).data('btn btn-info');
-            } else {
-                var text = $(this).data('btn btnconsole.log($(this).val);-outline-info');
-            }
-
-            $(this).html(text);
-
-            event.preventDefault();
-            $.ajax({
-                    url: '/like',
-                    type: 'post',
-                    dataType: 'text',
-                    data: {
-                        id: $(this).val(),
-                    },
-                }).done(function(response) {
-                    console.log('success');
-                })
-                .fail(function() {
-                    console.log('fail');
-                });
-
-        })
-    </script>
+        <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
+        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
+        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
+
+        <script type="text/javascript">
+            $('.like_button').on('click', function() {
+                $(this).toggleClass('active');
+
+                if ($(this).hasClass('active')) {
+                    var text = $(this).data('btn btn-info');
+                } else {
+                    var text = $(this).data('btn btnconsole.log($(this).val);-outline-info');
+                }
+
+                $(this).html(text);
+
+                event.preventDefault();
+                $.ajax({
+                        url: '/like',
+                        type: 'post',
+                        dataType: 'text',
+                        data: {
+                            id: $(this).val(),
+                        },
+                    }).done(function(response) {
+                        console.log('success');
+                    })
+                    .fail(function() {
+                        console.log('fail');
+                    });
+
+            })
+        </script>
 </body>
 
 </html>
\ No newline at end of file
diff --git a/app/templates/error.html b/app/templates/error.html
index 72ad3b2..04dc16b 100644
--- a/app/templates/error.html
+++ b/app/templates/error.html
@@ -24,7 +24,7 @@
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
                 <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
diff --git a/app/templates/index.html b/app/templates/index.html
index 93252f1..c42136c 100644
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -24,7 +24,7 @@
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
                 <li class="nav-item "><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
@@ -50,7 +50,7 @@ <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#
             <br>
 
             <div class="card">
-                <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#action2">
+                <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-target="#action2">
                     このサイトについて
                 </h5>
                 <div class="collapse　show" id="action2" data-parent="#events-imfo">
diff --git a/app/templates/ranking.html b/app/templates/ranking.html
index 248cc39..f39b747 100644
--- a/app/templates/ranking.html
+++ b/app/templates/ranking.html
@@ -24,7 +24,7 @@
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
                 <li class="nav-item active"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
@@ -38,16 +38,17 @@
                 <tr>
                     <th scope="col">順位</th>
                     <th scope="col">名前</th>
-                    <th scope="col">総いいね数</th>
+                    <th scope="col">いいね数</th>
                 </tr>
-            </thead {% for user in users.items%} <tbody>
-            <tr>
-                <th scope="row">{{loop.index+(page-1)*per_page}}</th>
-                <td><img src={{user.user_image_url}} alt='' style="width:36px;height:36px;vertical-align:middle;"> {{user.username}}
-                </td>
-                <td>{{user.like_sum}}</td>
-            </tr>
-            {%endfor%}
+            </thead> {% for user in users.items%}
+            <tbody>
+                <tr>
+                    <th scope="row">{{loop.index+(page-1)*per_page}}</th>
+                    <td><img src={{user.user_image_url}} alt='' style="width:36px;height:36px;vertical-align:middle;"> {{user.username}}
+                    </td>
+                    <td>{{user.like_sum}}</td>
+                </tr>
+                {%endfor%}
             </tbody>
 
         </table>
diff --git a/app/templates/search.html b/app/templates/search.html
index eccd02a..ec346ce 100644
--- a/app/templates/search.html
+++ b/app/templates/search.html
@@ -24,7 +24,7 @@
                 <li class="nav-item active"><a href="/search" class="nav-link">コンテスト</a></li>
                 <li class="nav-item "><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
@@ -38,7 +38,7 @@
             <div class="container">
                 <h4 class="display-4">コンテスト検索</h4>
                 <br>
-                <h5>解法の見たいコンテスト名を入力し、下の候補から選択して下さい。</h5>
+                <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の候補から選択して下さい。</h5>
             </div>
         </div>
 
diff --git a/app/templates/submited.html b/app/templates/submited.html
index fdaf6a6..5df4c00 100644
--- a/app/templates/submited.html
+++ b/app/templates/submited.html
@@ -24,7 +24,7 @@
                 <li class="nav-item active"><a href="/search" class="nav-link">コンテスト</a></li>
                 <li class="nav-item "><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
diff --git a/app/templates/template.html b/app/templates/template.html
index 303a2fd..a136707 100644
--- a/app/templates/template.html
+++ b/app/templates/template.html
@@ -24,7 +24,7 @@
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
                 <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
diff --git a/app/templates/user.html b/app/templates/user.html
index 303a2fd..c530817 100644
--- a/app/templates/user.html
+++ b/app/templates/user.html
@@ -24,7 +24,7 @@
                 <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
                 <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user/{{current_user.id}}" class="nav-link">ユーザーページ</a></li>
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
                 {%endif%}
             </ul>
             {% if current_user.is_authenticated==False %}
@@ -33,6 +33,64 @@
         </div>
     </nav>
 
+    <div class="container-fluid">
+        <div class="jumbotron jumbotron-fluid text-dark">
+            <h1>{{user.username}}</h1>
+            <div>
+                <h4>登録日時：{{user.date_published}}</h4>
+            </div>
+            <div>
+                <h4>順位　　：{{rank}}位</h4>
+            </div>
+            <div>
+                <h4> いいね数 :{{user.like_sum}}</h4>
+            </div>
+            <div>
+                <h4> 投稿数　 :{{num}}</h4>
+            </div>
+        </div>
+    </div>
+
+    <div>
+        {%for e in edit.items %}
+        <div id="editorial-card">
+            <div class="card col-6 border-0">
+                <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
+                    {{e.title}}
+                </h4>
+
+                <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
+                    {% if e.url!=None%}
+                    <a href={{edit.url}}>{{e.url}}</a> {%endif%}
+                </div>
+
+                <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
+                    {% autoescape false %} {%if e.description!=None%}
+                    <br>
+                    <p>{{e.description}}</p>
+                    {%endif%} {% endautoescape %}
+                </div>
+            </div>
+            <br>
+            <br> {% endfor %}
+        </div>
+
+    </div>
+
+    <div class="container-fluid">
+        <ul class="pagination">
+            {% if edit.has_prev %}
+            <li class="page-item">
+                <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=current_user.id)}}">前のページ</a>
+            </li>
+            {% endif %} {% if edit.has_next %}
+            <li class="page-item">
+                <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=current_user.id)}}">次のページ</a>
+            </li>
+            {% endif %}
+        </ul>
+    </div>
+
 
     <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>

From 46ac29397607e34f77f1230980984b7a76bfe2e1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 20 Aug 2019 16:44:22 +0900
Subject: [PATCH 036/336] fix html

---
 app/templates/contest.html | 132 ++++++++++++++++++-------------------
 1 file changed, 65 insertions(+), 67 deletions(-)

diff --git a/app/templates/contest.html b/app/templates/contest.html
index 3fd548f..af6db6a 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -89,90 +89,88 @@ <h4>投稿をするにはログインが必要です</h4>
                     <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
                 </form>
                 {%endif%} {%else%}
-                <div>
-                    <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
-                    <h5 class="col-1"></h5>
-                    <img src={{edit.user_image_url}} alt='No Image' style="width:36px;height:36px;vertical-align:middle;">
-                    <a href="/user/{{edit.user_id}}/1" class="h4" style="vertical-align:middle;">{{edit.username}}</a>
-                    </a>
-                </div>
-
+                <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
+                <h5 class="col-1"></h5>
+                <img src={{edit.user_image_url}} alt='No Image' style="width:36px;height:36px;vertical-align:middle;">
+                <a href="/user/{{edit.user_id}}/1" class="h4" style="vertical-align:middle;">{{edit.username}}</a>
+                </a>
+            </div>
 
-                <div class="card col-6 border-0">
-                    <h4 class="card-header text-light bg-light text-dark col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
-                        {{edit.title}}
-                    </h4>
+            <div class="card col-6 border-0">
+                <h4 class="card-header text-light bg-light text-dark col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
+                    {{edit.title}}
+                </h4>
 
-                    <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
-                        {% if edit.url!=None%}
-                        <a href={{edit.url}}>{{edit.url}}</a> {%endif%}
-                    </div>
+                <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
+                    {% if edit.url!=None%}
+                    <a href={{edit.url}}>{{edit.url}}</a> {%endif%}
+                </div>
 
-                    <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
-                        {% autoescape false %} {%if edit.description!=None%}
-                        <br>
-                        <p>{{edit.description}}</p>
-                        {%endif%} {% endautoescape %}
-                    </div>
+                <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
+                    {% autoescape false %} {%if edit.description!=None%}
+                    <br>
+                    <p>{{edit.description}}</p>
+                    {%endif%} {% endautoescape %}
                 </div>
-                <br>
-                <br> {% endfor %}
             </div>
-            {%else%}
-            <h4 class='container-fluid'>まだ投稿がありません</h4>
-            <br> {%endif%}
+            <br>
+            <br> {% endfor %}
         </div>
+        {%else%}
+        <h4 class='container-fluid'>まだ投稿がありません</h4>
+        <br> {%endif%}
+    </div>
 
-        <div class="container-fluid h4">
+    <div class="container-fluid h4">
 
-            <ul class="pagination">
-                {% if editorials.has_prev %} {%if contestname==None%}
-                <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',''))}}">
+        <ul class="pagination">
+            {% if editorials.has_prev %} {%if contestname==None%}
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',''))}}">
         {%else%}
         <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname)}}">
         {%endif%}
         << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
-                <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname','')) }}">
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname','')) }}">
                 {%else%}
                 <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname)}}">
         {%endif%}
          次のページ >></a></li>{% endif %}
-            </ul>
-        </div>
+        </ul>
+    </div>
 
-        <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
-        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
-        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
-
-        <script type="text/javascript">
-            $('.like_button').on('click', function() {
-                $(this).toggleClass('active');
-
-                if ($(this).hasClass('active')) {
-                    var text = $(this).data('btn btn-info');
-                } else {
-                    var text = $(this).data('btn btnconsole.log($(this).val);-outline-info');
-                }
-
-                $(this).html(text);
-
-                event.preventDefault();
-                $.ajax({
-                        url: '/like',
-                        type: 'post',
-                        dataType: 'text',
-                        data: {
-                            id: $(this).val(),
-                        },
-                    }).done(function(response) {
-                        console.log('success');
-                    })
-                    .fail(function() {
-                        console.log('fail');
-                    });
-
-            })
-        </script>
+    <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
+
+    <script type="text/javascript">
+        $('.like_button').on('click', function() {
+            $(this).toggleClass('active');
+
+            if ($(this).hasClass('active')) {
+                var text = $(this).data('btn btn-info');
+            } else {
+                var text = $(this).data('btn btnconsole.log($(this).val);-outline-info');
+            }
+
+            $(this).html(text);
+
+            event.preventDefault();
+            $.ajax({
+                    url: '/like',
+                    type: 'post',
+                    dataType: 'text',
+                    data: {
+                        id: $(this).val(),
+                    },
+                }).done(function(response) {
+                    console.log('success');
+                })
+                .fail(function() {
+                    console.log('fail');
+                });
+
+        })
+    </script>
 </body>
 
 </html>
\ No newline at end of file

From 6d262c505c4c79207d0fb90304718e03b2330da1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 20 Aug 2019 17:39:41 +0900
Subject: [PATCH 037/336] fix like-count

---
 app/app.py                  | 2 +-
 app/templates/index.html    | 2 +-
 app/templates/ranking.html  | 3 +--
 app/templates/submited.html | 4 +++-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/app/app.py b/app/app.py
index 1194a9d..554ce90 100644
--- a/app/app.py
+++ b/app/app.py
@@ -188,7 +188,7 @@ def like():
     id=request.form['id']
     flag=db.session.query(Like).filter(Like.edit_id==id ).filter(Like.user_id==current_user.id).first()
     edit=db.session.query(Editorial).filter(Editorial.id==id).first()
-    user=db.session.query(User).filter(User.id==current_user.id).first()
+    user=db.session.query(User).filter(User.id==edit.id).first()
 
     print(id,flag,edit,user)
 
diff --git a/app/templates/index.html b/app/templates/index.html
index c42136c..f48b38b 100644
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -56,7 +56,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 <div class="collapse　show" id="action2" data-parent="#events-imfo">
                     <div class="card-body">
                         <h3>AtCoderEditorialsはAtCoderの解法を集めるWebアプリです。</h3>
-                        <h5>主な機能は、解法の閲覧・投稿・いいね機能・ランキングの４つです。</h5>
+                        <h5>主な機能は、閲覧・投稿・いいね・ランキングの４つです。</h5>
                         <br>
                         <h4> 投稿方法</h4>
                         ・AtCoderEditorialsに直接書き込む。
diff --git a/app/templates/ranking.html b/app/templates/ranking.html
index f39b747..ea870f1 100644
--- a/app/templates/ranking.html
+++ b/app/templates/ranking.html
@@ -44,8 +44,7 @@
             <tbody>
                 <tr>
                     <th scope="row">{{loop.index+(page-1)*per_page}}</th>
-                    <td><img src={{user.user_image_url}} alt='' style="width:36px;height:36px;vertical-align:middle;"> {{user.username}}
-                    </td>
+                    <td><img src={{user.user_image_url}} alt='' style="width:36px;height:36px;vertical-align:middle;"> <a href="/user/{{user.id}}/1">{{user.username}}</a></td>
                     <td>{{user.like_sum}}</td>
                 </tr>
                 {%endfor%}
diff --git a/app/templates/submited.html b/app/templates/submited.html
index 5df4c00..c14d996 100644
--- a/app/templates/submited.html
+++ b/app/templates/submited.html
@@ -33,7 +33,9 @@
         </div>
     </nav>
 
-    <h2>提出が完了しました。</h2>
+    <div class="jumbotron jumbotron-fluid">
+        <h2>投稿が完了しました。</h2>
+    </div>
 
     <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>

From fddca8509d775c2c36b225bd1876d0c1df5643c1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 20 Aug 2019 18:05:14 +0900
Subject: [PATCH 038/336] add CSRF

---
 app/app.py                 | 2 +-
 app/templates/contest.html | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/app.py b/app/app.py
index 554ce90..b7a1ccb 100644
--- a/app/app.py
+++ b/app/app.py
@@ -5,7 +5,7 @@
 from flask_login import UserMixin, LoginManager, login_user, logout_user, current_user
 from datetime import datetime
 from rauth import OAuth1Service
-from config import app, db, service, login_manager
+from config import app, db, service, login_manager,csrf
 
 
 class User(UserMixin,db.Model):
diff --git a/app/templates/contest.html b/app/templates/contest.html
index af6db6a..fe1bd90 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -53,6 +53,7 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
             </h4>
             <div class="collapse" id="sub1" data-parent="#submit-card">
                 <form action="/submited " method='POST'>
+                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
                     <input type="text" placeholder="タイトル" name="title" style="width:535px" />
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />

From 6a0770d4a48f97615554ffd0a73913ec842f463e Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 20 Aug 2019 18:41:53 +0900
Subject: [PATCH 039/336] add errorhandler

---
 app/app.py                 | 18 ++++++++++++----
 app/templates/401.html     | 44 ++++++++++++++++++++++++++++++++++++++
 app/templates/404.html     | 44 ++++++++++++++++++++++++++++++++++++++
 app/templates/500.html     | 44 ++++++++++++++++++++++++++++++++++++++
 app/templates/contest.html |  1 -
 5 files changed, 146 insertions(+), 5 deletions(-)
 create mode 100644 app/templates/401.html
 create mode 100644 app/templates/404.html
 create mode 100644 app/templates/500.html

diff --git a/app/app.py b/app/app.py
index b7a1ccb..e52821b 100644
--- a/app/app.py
+++ b/app/app.py
@@ -5,7 +5,7 @@
 from flask_login import UserMixin, LoginManager, login_user, logout_user, current_user
 from datetime import datetime
 from rauth import OAuth1Service
-from config import app, db, service, login_manager,csrf
+from config import app, db, service, login_manager
 
 
 class User(UserMixin,db.Model):
@@ -188,9 +188,7 @@ def like():
     id=request.form['id']
     flag=db.session.query(Like).filter(Like.edit_id==id ).filter(Like.user_id==current_user.id).first()
     edit=db.session.query(Editorial).filter(Editorial.id==id).first()
-    user=db.session.query(User).filter(User.id==edit.id).first()
-
-    print(id,flag,edit,user)
+    user=db.session.query(User).filter(User.id==id).first()
 
     #いいねされていた場合
     newLike=Like(user_id=current_user.id,edit_id=id)
@@ -207,6 +205,18 @@ def like():
 
     return 'hoge'
 
+@app.errorhandler(401)
+def authentication_failed(error):
+    return render_template('401.html'),401
+
+@app.errorhandler(404)
+def page_not_found(error):
+    return render_template('404.html'),404
+
+@app.errorhandler(500)
+def page_not_found(error):
+    return render_template('500.html'),500
+
 @login_manager.user_loader
 def load_user(id):
     return User.query.get(int(id))
diff --git a/app/templates/401.html b/app/templates/401.html
new file mode 100644
index 0000000..a6f8af4
--- /dev/null
+++ b/app/templates/401.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html lang="ja">
+
+<head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <title>AtCoder Editorials</title>
+</head>
+
+<body style="padding-top:5rem">
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+
+    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
+        <a href="/" class="navbar-brand">AtCoder Editorials</a>
+
+        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse" id="nav1">
+            <ul class="navbar-nav">
+                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
+            </ul>
+            {% if current_user.is_authenticated==False %}
+            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
+        </div>
+    </nav>
+
+    <h1>401 Unauthorized</h1>
+
+    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+</body>
+
+
+</html>
\ No newline at end of file
diff --git a/app/templates/404.html b/app/templates/404.html
new file mode 100644
index 0000000..e2d8b0a
--- /dev/null
+++ b/app/templates/404.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html lang="ja">
+
+<head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <title>AtCoder Editorials</title>
+</head>
+
+<body style="padding-top:5rem">
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+
+    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
+        <a href="/" class="navbar-brand">AtCoder Editorials</a>
+
+        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse" id="nav1">
+            <ul class="navbar-nav">
+                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
+            </ul>
+            {% if current_user.is_authenticated==False %}
+            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
+        </div>
+    </nav>
+
+    <h1>404 Not Found</h1>
+
+    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+</body>
+
+
+</html>
\ No newline at end of file
diff --git a/app/templates/500.html b/app/templates/500.html
new file mode 100644
index 0000000..122d866
--- /dev/null
+++ b/app/templates/500.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html lang="ja">
+
+<head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <title>AtCoder Editorials</title>
+</head>
+
+<body style="padding-top:5rem">
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+
+    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
+        <a href="/" class="navbar-brand">AtCoder Editorials</a>
+
+        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse" id="nav1">
+            <ul class="navbar-nav">
+                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
+            </ul>
+            {% if current_user.is_authenticated==False %}
+            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
+        </div>
+    </nav>
+
+    <h1>500 Internal Server Error</h1>
+
+    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+</body>
+
+
+</html>
\ No newline at end of file
diff --git a/app/templates/contest.html b/app/templates/contest.html
index fe1bd90..af6db6a 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -53,7 +53,6 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
             </h4>
             <div class="collapse" id="sub1" data-parent="#submit-card">
                 <form action="/submited " method='POST'>
-                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
                     <input type="text" placeholder="タイトル" name="title" style="width:535px" />
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />

From b0931743769d1caa2a657e625caaa65b340934a2 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 20 Aug 2019 19:45:41 +0900
Subject: [PATCH 040/336] add delete-button

---
 app/app.py                 |  7 +++++++
 app/static/script.js       | 10 +++++++++-
 app/templates/contest.html | 22 +++++++++++++++++++++-
 3 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/app/app.py b/app/app.py
index e52821b..1662bfb 100644
--- a/app/app.py
+++ b/app/app.py
@@ -205,6 +205,13 @@ def like():
 
     return 'hoge'
 
+@app.route('/delete',methods=['POST'])
+def delete():
+    edit=db.session.query(Editorial).filter(Editorial.id==request.form['id']).first()
+    db.session.delete(edit)
+    db.session.commit()
+    return 'hoge'
+
 @app.errorhandler(401)
 def authentication_failed(error):
     return render_template('401.html'),401
diff --git a/app/static/script.js b/app/static/script.js
index ee51048..f852c76 100644
--- a/app/static/script.js
+++ b/app/static/script.js
@@ -35,4 +35,12 @@ $(function() {
     $(document).on("keypress", "input:not(.allow_submit)", function(event) {
         return event.which !== 13;
     });
-});
\ No newline at end of file
+});
+
+$.ajaxSetup({
+    beforeSend: function(xhr, settings) {
+        if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type) && !this.crossDomain) {
+            xhr.setRequestHeader("X-CSRFToken", "{{ form.csrf_token._value() }}")
+        }
+    }
+})
\ No newline at end of file
diff --git a/app/templates/contest.html b/app/templates/contest.html
index af6db6a..5ca88c5 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -88,11 +88,17 @@ <h4>投稿をするにはログインが必要です</h4>
                 <form>
                     <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
                 </form>
-                {%endif%} {%else%}
+                {%endif%}{%else%}
                 <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
                 <h5 class="col-1"></h5>
                 <img src={{edit.user_image_url}} alt='No Image' style="width:36px;height:36px;vertical-align:middle;">
                 <a href="/user/{{edit.user_id}}/1" class="h4" style="vertical-align:middle;">{{edit.username}}</a>
+                <h5 class="col-1"></h5>
+                {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
+                <form>
+                    <button class="delete_button btn btn-danger" name="delete_id" value={{edit.id}}>削除</button>
+                </form>
+                {%endif%}
                 </a>
             </div>
 
@@ -168,7 +174,21 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
                 .fail(function() {
                     console.log('fail');
                 });
+        })
 
+        $('.delete_button').on('click', function() {
+            flag = window.confirm("本当に削除してもよろしいでしょうか？")
+            event.preventDefault();
+            if (flag === true) {
+                $.ajax({
+                    url: '/delete',
+                    type: 'post',
+                    dataType: 'text',
+                    data: {
+                        id: $(this).val(),
+                    }
+                })
+            }
         })
     </script>
 </body>

From 6dc18690d1e02e326ed614270568d0c66fbd952a Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 20 Aug 2019 20:07:42 +0900
Subject: [PATCH 041/336] fix like_bug

---
 app/app.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/app.py b/app/app.py
index 1662bfb..9d1355d 100644
--- a/app/app.py
+++ b/app/app.py
@@ -188,7 +188,7 @@ def like():
     id=request.form['id']
     flag=db.session.query(Like).filter(Like.edit_id==id ).filter(Like.user_id==current_user.id).first()
     edit=db.session.query(Editorial).filter(Editorial.id==id).first()
-    user=db.session.query(User).filter(User.id==id).first()
+    user=db.session.query(User).filter(User.id==edit.user_id).first()
 
     #いいねされていた場合
     newLike=Like(user_id=current_user.id,edit_id=id)
@@ -210,6 +210,7 @@ def delete():
     edit=db.session.query(Editorial).filter(Editorial.id==request.form['id']).first()
     db.session.delete(edit)
     db.session.commit()
+
     return 'hoge'
 
 @app.errorhandler(401)

From 82f8ba599b16d7fa786f45b3f0fb15f0d8f5436a Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 20 Aug 2019 21:34:44 +0900
Subject: [PATCH 042/336] fix order

---
 app/app.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/app.py b/app/app.py
index 9d1355d..ae80e62 100644
--- a/app/app.py
+++ b/app/app.py
@@ -58,7 +58,8 @@ def contest_get(page=1):
         contestname=request.args.get('contestname','')
 
     per_page = 10
-    editorials = Editorial.query.filter_by(contestname=contestname).paginate(page, per_page, error_out=False)
+    editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
+    print(type(editorials))
 
     if current_user.is_authenticated==True:
         flag={}

From 08d0546c2e4c5802bfff4fc4797fecf057f4c7a1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 20 Aug 2019 21:55:43 +0900
Subject: [PATCH 043/336] fix delete

---
 app/app.py           |  8 ++++++++
 app/static/script.js | 10 +---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/app/app.py b/app/app.py
index ae80e62..08b8ca8 100644
--- a/app/app.py
+++ b/app/app.py
@@ -209,6 +209,14 @@ def like():
 @app.route('/delete',methods=['POST'])
 def delete():
     edit=db.session.query(Editorial).filter(Editorial.id==request.form['id']).first()
+
+    user=db.session.query(User).filter(User.id==edit.user_id).first()
+    user.like_sum-=edit.like
+
+    like=db.session.query(Like).filter(Like.edit_id==edit.id).all()
+    for i in like:
+        db.session.delete(i)
+
     db.session.delete(edit)
     db.session.commit()
 
diff --git a/app/static/script.js b/app/static/script.js
index f852c76..ee51048 100644
--- a/app/static/script.js
+++ b/app/static/script.js
@@ -35,12 +35,4 @@ $(function() {
     $(document).on("keypress", "input:not(.allow_submit)", function(event) {
         return event.which !== 13;
     });
-});
-
-$.ajaxSetup({
-    beforeSend: function(xhr, settings) {
-        if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type) && !this.crossDomain) {
-            xhr.setRequestHeader("X-CSRFToken", "{{ form.csrf_token._value() }}")
-        }
-    }
-})
\ No newline at end of file
+});
\ No newline at end of file

From 2994be1b705ea90d45e33dca6d50343473699601 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 20 Aug 2019 22:06:59 +0900
Subject: [PATCH 044/336] commit

---
 app/templates/contest.html | 7 +++++++
 app/templates/user.html    | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/app/templates/contest.html b/app/templates/contest.html
index 5ca88c5..39ed48d 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -190,6 +190,13 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
                 })
             }
         })
+
+        //input内でのEnter無効化
+        $(function() {
+            $(document).on("keypress", "input:not(.allow_submit)", function(event) {
+                return event.which !== 13;
+            });
+        });
     </script>
 </body>
 
diff --git a/app/templates/user.html b/app/templates/user.html
index c530817..59e7fb8 100644
--- a/app/templates/user.html
+++ b/app/templates/user.html
@@ -50,7 +50,7 @@ <h4> 投稿数　 :{{num}}</h4>
             </div>
         </div>
     </div>
-
+    <h3>投稿一覧</h3>
     <div>
         {%for e in edit.items %}
         <div id="editorial-card">

From 9278cda6b8de4602febb8c07ed3f3673ee33b149 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 14:46:58 +0900
Subject: [PATCH 045/336] fix user_rank

---
 app/app.py                 | 30 +++++++++++++++++++++++++-----
 app/templates/ranking.html |  2 +-
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/app/app.py b/app/app.py
index 08b8ca8..eb2f58a 100644
--- a/app/app.py
+++ b/app/app.py
@@ -114,20 +114,40 @@ def user(id,page=1):
     edit_num=Editorial.query.filter_by(user_id=id).all()
     num=len(edit_num)
 
+    like_set=set([])
+    users=db.session.query(User).all()
+    for  i in users:
+        like_set.add(i.like_sum)
+    
+    like_set=list(like_set)
+    like_set=sorted(like_set,reverse=True)
+    
     rank=1
-    all_edit=db.session.query(User).order_by(desc(User.like_sum)).all()
-    for i in range(0,len(all_edit)):
-        if all_edit[i].id==id:
+    for i in range(0,len(like_set)):
+        if like_set[i]==user.like_sum:
             rank=i+1
             break
-
+    
     return render_template('user.html',user=user,edit=edit,num=num,rank=rank)
 
 @app.route('/ranking/<int:page>')
 def ranking(page=1):
     per_page = 100
     users=db.session.query(User).order_by(desc(User.like_sum)).paginate(page, per_page, error_out=False)
-    return render_template('ranking.html',users=users,page=page,per_page=per_page)
+
+    rank=dict({})
+    like_set=set([])
+    user=db.session.query(User).all()
+    for  i in user:
+        like_set.add(i.like_sum)
+    
+    like_set=list(like_set)
+    like_set=sorted(like_set,reverse=True)
+    
+    for i in range(0,len(like_set)):
+        rank[like_set[i]]=i+1
+
+    return render_template('ranking.html',users=users,page=page,per_page=per_page,rank=rank)
 
 
 @app.route('/logout')
diff --git a/app/templates/ranking.html b/app/templates/ranking.html
index ea870f1..b6e4402 100644
--- a/app/templates/ranking.html
+++ b/app/templates/ranking.html
@@ -43,7 +43,7 @@
             </thead> {% for user in users.items%}
             <tbody>
                 <tr>
-                    <th scope="row">{{loop.index+(page-1)*per_page}}</th>
+                    <th scope="row">{{rank[user.like_sum]}}</th>
                     <td><img src={{user.user_image_url}} alt='' style="width:36px;height:36px;vertical-align:middle;"> <a href="/user/{{user.id}}/1">{{user.username}}</a></td>
                     <td>{{user.like_sum}}</td>
                 </tr>

From e7e393ea2d1301d8c53224c06890fbc108a1b3a3 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 15:14:22 +0900
Subject: [PATCH 046/336] add CSRF

---
 app/app.py                 | 10 +++++----
 app/static/script.js       | 12 ++++++++++-
 app/templates/contest.html | 15 +++++++++++++
 app/templates/search.html  |  3 +++
 app/templates/user.html    | 44 ++++++++++++++++++++------------------
 5 files changed, 58 insertions(+), 26 deletions(-)

diff --git a/app/app.py b/app/app.py
index eb2f58a..e8dbff1 100644
--- a/app/app.py
+++ b/app/app.py
@@ -5,7 +5,7 @@
 from flask_login import UserMixin, LoginManager, login_user, logout_user, current_user
 from datetime import datetime
 from rauth import OAuth1Service
-from config import app, db, service, login_manager
+from config import app, db, service, login_manager,csrf
 
 
 class User(UserMixin,db.Model):
@@ -44,7 +44,6 @@ def _normalize_contestname(contestname):
 def index():
     return render_template('index.html')
 
-
 @app.route('/search', methods=['GET'])
 def contest_search():
     return render_template('search.html')
@@ -121,14 +120,17 @@ def user(id,page=1):
     
     like_set=list(like_set)
     like_set=sorted(like_set,reverse=True)
-    
+
     rank=1
     for i in range(0,len(like_set)):
         if like_set[i]==user.like_sum:
             rank=i+1
             break
     
-    return render_template('user.html',user=user,edit=edit,num=num,rank=rank)
+    date_published=str(user.date_published)
+    date_published=date_published.split(' ')[0]
+
+    return render_template('user.html',user=user,edit=edit,num=num,rank=rank,date_published=date_published)
 
 @app.route('/ranking/<int:page>')
 def ranking(page=1):
diff --git a/app/static/script.js b/app/static/script.js
index ee51048..8f8d944 100644
--- a/app/static/script.js
+++ b/app/static/script.js
@@ -35,4 +35,14 @@ $(function() {
     $(document).on("keypress", "input:not(.allow_submit)", function(event) {
         return event.which !== 13;
     });
-});
\ No newline at end of file
+});
+
+var csrftoken = $('meta[name=csrf-token]').attr('content')
+
+$.ajaxSetup({
+    beforeSend: function(xhr, settings) {
+        if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type)) {
+            xhr.setRequestHeader("X-CSRFToken", csrftoken)
+        }
+    }
+})
\ No newline at end of file
diff --git a/app/templates/contest.html b/app/templates/contest.html
index 39ed48d..083259a 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -4,6 +4,7 @@
 <head>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta name="csrf-token" content="{{ csrf_token() }}">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>
@@ -53,6 +54,7 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
             </h4>
             <div class="collapse" id="sub1" data-parent="#submit-card">
                 <form action="/submited " method='POST'>
+                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
                     <input type="text" placeholder="タイトル" name="title" style="width:535px" />
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
@@ -82,10 +84,12 @@ <h4>投稿をするにはログインが必要です</h4>
             <div class="row container-fluid">
                 {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
                 <form>
+                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
                     <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
                 </form>
                 {%else%}
                 <form>
+                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
                     <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
                 </form>
                 {%endif%}{%else%}
@@ -96,6 +100,7 @@ <h5 class="col-1"></h5>
                 <h5 class="col-1"></h5>
                 {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
                 <form>
+                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
                     <button class="delete_button btn btn-danger" name="delete_id" value={{edit.id}}>削除</button>
                 </form>
                 {%endif%}
@@ -197,6 +202,16 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
                 return event.which !== 13;
             });
         });
+
+        var csrftoken = $('meta[name=csrf-token]').attr('content')
+
+        $.ajaxSetup({
+            beforeSend: function(xhr, settings) {
+                if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type)) {
+                    xhr.setRequestHeader("X-CSRFToken", csrftoken)
+                }
+            }
+        })
     </script>
 </body>
 
diff --git a/app/templates/search.html b/app/templates/search.html
index ec346ce..620bc20 100644
--- a/app/templates/search.html
+++ b/app/templates/search.html
@@ -4,6 +4,7 @@
 <head>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta name="csrf-token" content="{{ csrf_token() }}">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>
@@ -43,7 +44,9 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
         </div>
 
         <br>
+
         <form id="search" method="POST" action="/search/contest/1">
+            <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
             <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" />
         </form>
 
diff --git a/app/templates/user.html b/app/templates/user.html
index 59e7fb8..436f6da 100644
--- a/app/templates/user.html
+++ b/app/templates/user.html
@@ -37,7 +37,7 @@
         <div class="jumbotron jumbotron-fluid text-dark">
             <h1>{{user.username}}</h1>
             <div>
-                <h4>登録日時：{{user.date_published}}</h4>
+                <h4>登録日時：{{date_published}}</h4>
             </div>
             <div>
                 <h4>順位　　：{{rank}}位</h4>
@@ -50,31 +50,33 @@ <h4> 投稿数　 :{{num}}</h4>
             </div>
         </div>
     </div>
-    <h3>投稿一覧</h3>
-    <div>
-        {%for e in edit.items %}
-        <div id="editorial-card">
-            <div class="card col-6 border-0">
-                <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
-                    {{e.title}}
-                </h4>
+    <div class="container-fluid">
+        <h3>投稿一覧</h3>
+        <div>
+            {%for e in edit.items %}
+            <div id="editorial-card">
+                <div class="card col-6 border-0">
+                    <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
+                        {{e.title}}
+                    </h4>
 
-                <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
-                    {% if e.url!=None%}
-                    <a href={{edit.url}}>{{e.url}}</a> {%endif%}
-                </div>
+                    <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
+                        {% if e.url!=None%}
+                        <a href={{edit.url}}>{{e.url}}</a> {%endif%}
+                    </div>
 
-                <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
-                    {% autoescape false %} {%if e.description!=None%}
-                    <br>
-                    <p>{{e.description}}</p>
-                    {%endif%} {% endautoescape %}
+                    <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
+                        {% autoescape false %} {%if e.description!=None%}
+                        <br>
+                        <p>{{e.description}}</p>
+                        {%endif%} {% endautoescape %}
+                    </div>
                 </div>
+                <br>
+                <br> {% endfor %}
             </div>
-            <br>
-            <br> {% endfor %}
-        </div>
 
+        </div>
     </div>
 
     <div class="container-fluid">

From ab03ee3b56127887eaeb07a7e8582de3835f3da7 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 17:11:32 +0900
Subject: [PATCH 047/336] fix color

---
 app/templates/contest.html |  4 ++--
 app/templates/index.html   | 44 ++++++++++++++++++++++----------------
 app/templates/ranking.html |  2 +-
 3 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/app/templates/contest.html b/app/templates/contest.html
index 083259a..f216e10 100644
--- a/app/templates/contest.html
+++ b/app/templates/contest.html
@@ -96,12 +96,12 @@ <h4>投稿をするにはログインが必要です</h4>
                 <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
                 <h5 class="col-1"></h5>
                 <img src={{edit.user_image_url}} alt='No Image' style="width:36px;height:36px;vertical-align:middle;">
-                <a href="/user/{{edit.user_id}}/1" class="h4" style="vertical-align:middle;">{{edit.username}}</a>
+                <a href="/user/{{edit.user_id}}/1" class="h4 text-dark" style="vertical-align:middle;">{{edit.username}}</a>
                 <h5 class="col-1"></h5>
                 {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
                 <form>
                     <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
-                    <button class="delete_button btn btn-danger" name="delete_id" value={{edit.id}}>削除</button>
+                    <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>
                 </form>
                 {%endif%}
                 </a>
diff --git a/app/templates/index.html b/app/templates/index.html
index f48b38b..5cc9edf 100644
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -37,7 +37,7 @@
         <div id="events-imfo">
 
             <div class="card">
-                <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#action1">
+                <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-target="#action1">
                     インフォメーション
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
@@ -50,30 +50,36 @@ <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#
             <br>
 
             <div class="card">
-                <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-target="#action2">
-                    このサイトについて
+                <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#action2">
+                    お問い合わせ
                 </h5>
-                <div class="collapse　show" id="action2" data-parent="#events-imfo">
+                <div class="collapse" id="action2" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        <h3>AtCoderEditorialsはAtCoderの解法を集めるWebアプリです。</h3>
-                        <h5>主な機能は、閲覧・投稿・いいね・ランキングの４つです。</h5>
-                        <br>
-                        <h4> 投稿方法</h4>
-                        ・AtCoderEditorialsに直接書き込む。
-                        <br>・外部サイトのURLを貼る。
-                        <br>
-                        <br>
-                        <h5>注意</h5>
-                        ・自分以外が書いた解法の投稿は、許可を貰ってからお願いします。
-                        <br>
-                        <br>
-                        <h4>ログインについて</h4>
-                        ・解法の投稿・いいね機能の使用にはTwitter認証でのログインが必要です。
-                        <br> ・解法の閲覧にログインは必要ありません。
+                        改善案、バグなどございましたら、ぬるぬる(@__Null_Null_)までご連絡お願いします。
                     </div>
                 </div>
             </div>
 
+            <br>
+
+            <div class="container-fluid">
+                <h3>AtCoderEditorialsはAtCoderの解法を集めるWebアプリです。</h3>
+                <h5>主な機能は、閲覧・投稿・いいね・ランキングの４つです。</h5>
+                <br>
+                <h4> 投稿方法</h4>
+                ・AtCoderEditorialsに直接書き込む。
+                <br>・外部サイトのURLを貼る。
+                <br>
+                <br>
+                <h5>注意</h5>
+                ・自分以外が書いた解法の投稿は、許可を貰ってからお願いします。
+                <br>
+                <br>
+                <h4>ログインについて</h4>
+                ・解法の投稿・いいね機能の使用にはTwitter認証でのログインが必要です。
+                <br> ・解法の閲覧にログインは必要ありません。
+            </div>
+
         </div>
 
     </div>
diff --git a/app/templates/ranking.html b/app/templates/ranking.html
index b6e4402..7db366d 100644
--- a/app/templates/ranking.html
+++ b/app/templates/ranking.html
@@ -44,7 +44,7 @@
             <tbody>
                 <tr>
                     <th scope="row">{{rank[user.like_sum]}}</th>
-                    <td><img src={{user.user_image_url}} alt='' style="width:36px;height:36px;vertical-align:middle;"> <a href="/user/{{user.id}}/1">{{user.username}}</a></td>
+                    <td><img src={{user.user_image_url}} alt='' style="width:36px;height:36px;vertical-align:middle;"> <a href="/user/{{user.id}}/1" class="text-dark">{{user.username}}</a></td>
                     <td>{{user.like_sum}}</td>
                 </tr>
                 {%endfor%}

From 9b810dabbb3e27409083fae1bc48949227c0695f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 18:10:06 +0900
Subject: [PATCH 048/336] update

---
 app/templates/index.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/templates/index.html b/app/templates/index.html
index 5cc9edf..512f5c3 100644
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -43,6 +43,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
                         AtCoderEditorialsが誕生しました。
+
                     </div>
                 </div>
             </div>

From ee4ce96f609c76119ed7ed15a8ebdf6658c3c564 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 21:11:04 +0900
Subject: [PATCH 049/336] add requirements.txt

---
 requirements.txt | 52 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 requirements.txt

diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..ed28990
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,52 @@
+appdirs==1.4.3
+astroid==2.2.5
+attrs==19.1.0
+btrfsutil==1.1.1
+CacheControl==0.12.5
+chardet==3.0.4
+colorama==0.4.1
+cupshelpers==1.0
+distlib==0.2.9
+distro==1.4.0
+docopt==0.6.2
+Guake==3.6.3
+html5lib==1.0.1
+idna==2.8
+isort==4.3.21
+Jade-Application-Kit==2.0.9
+keyutils==0.5
+lazy-object-proxy==1.4.1
+lockfile==0.12.2
+louis==3.10.0
+mccabe==0.6.1
+msgpack==0.6.1
+npyscreen==4.10.5
+packaging==19.1
+pacman-mirrors==4.14.2
+pbr==5.4.2
+pep517==0.5.0
+Pillow==6.1.0
+progress==1.5
+psycopg2-binary==2.8.3
+pwquality==1.4.0
+pycairo==1.18.1
+pycups==1.9.74
+pycurl==7.43.0.3
+PyGObject==3.32.2
+pylint==2.3.1
+pyparsing==2.4.2
+PyQt5==5.13.0
+PyQt5-sip==4.19.18
+pysmbc==1.0.16
+pytoml==0.1.21
+PyYAML==5.1.1
+reportlab==3.5.23
+requests==2.22.0
+retrying==1.3.3
+six==1.12.0
+team==1.0
+typed-ast==1.4.0
+udiskie==1.7.7
+urllib3==1.25.3
+webencodings==0.5.1
+wrapt==1.11.2

From 352f92bef99fc84eca11a39245e1fdc1e2fb21db Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 21:25:11 +0900
Subject: [PATCH 050/336] commit

---
 requirements.txt | 72 +++++++++++++++++-------------------------------
 1 file changed, 26 insertions(+), 46 deletions(-)

diff --git a/requirements.txt b/requirements.txt
index ed28990..993a61f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,52 +1,32 @@
-appdirs==1.4.3
-astroid==2.2.5
-attrs==19.1.0
-btrfsutil==1.1.1
-CacheControl==0.12.5
+alembic==1.0.11
+certifi==2019.6.16
 chardet==3.0.4
-colorama==0.4.1
-cupshelpers==1.0
-distlib==0.2.9
-distro==1.4.0
-docopt==0.6.2
-Guake==3.6.3
-html5lib==1.0.1
+Click==7.0
+Flask==1.1.1
+Flask-Login==0.4.1
+Flask-Migrate==2.5.2
+flask-paginate==0.5.3
+Flask-SQLAlchemy==2.4.0
+Flask-WTF==0.14.2
+get==2019.4.13
+gunicorn==19.9.0
 idna==2.8
-isort==4.3.21
-Jade-Application-Kit==2.0.9
-keyutils==0.5
-lazy-object-proxy==1.4.1
-lockfile==0.12.2
-louis==3.10.0
-mccabe==0.6.1
-msgpack==0.6.1
-npyscreen==4.10.5
-packaging==19.1
-pacman-mirrors==4.14.2
-pbr==5.4.2
-pep517==0.5.0
-Pillow==6.1.0
-progress==1.5
+itsdangerous==1.1.0
+Jinja2==2.10.1
+Mako==1.1.0
+MarkupSafe==1.1.1
+post==2019.4.13
+psycopg2==2.8.3
 psycopg2-binary==2.8.3
-pwquality==1.4.0
-pycairo==1.18.1
-pycups==1.9.74
-pycurl==7.43.0.3
-PyGObject==3.32.2
-pylint==2.3.1
-pyparsing==2.4.2
-PyQt5==5.13.0
-PyQt5-sip==4.19.18
-pysmbc==1.0.16
-pytoml==0.1.21
-PyYAML==5.1.1
-reportlab==3.5.23
+public==2019.4.13
+python-dateutil==2.8.0
+python-editor==1.0.4
+query-string==2019.4.13
+rauth==0.7.3
+request==2019.4.13
 requests==2.22.0
-retrying==1.3.3
 six==1.12.0
-team==1.0
-typed-ast==1.4.0
-udiskie==1.7.7
+SQLAlchemy==1.3.6
 urllib3==1.25.3
-webencodings==0.5.1
-wrapt==1.11.2
+Werkzeug==0.15.5
+WTForms==2.2.1

From 304644d3ddb2bef27cdd1dd0984f19a0fb1093d1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 22:13:05 +0900
Subject: [PATCH 051/336] set environ

---
 .gitignore         |  1 -
 app/config.py      | 28 ++++++++++++++++++++++++++++
 atcoder-editorials |  1 +
 3 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 app/config.py
 create mode 160000 atcoder-editorials

diff --git a/.gitignore b/.gitignore
index b444d08..da6e3b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -128,6 +128,5 @@ bin/
 include/
 *.cfg
 migrations/
-config.py
 lib64
 favicon.ico
\ No newline at end of file
diff --git a/app/config.py b/app/config.py
new file mode 100644
index 0000000..2ed5113
--- /dev/null
+++ b/app/config.py
@@ -0,0 +1,28 @@
+from flask import Flask,render_template,request,url_for,redirect,session
+from flask_sqlalchemy import SQLAlchemy
+from flask_migrate import Migrate
+from flask_login import UserMixin,LoginManager,login_user,logout_user,current_user
+from datetime import datetime
+from flask_wtf.csrf import CSRFProtect
+from rauth import OAuth1Service
+import ossaudiodev
+
+app=Flask(__name__)
+app.secret_key=os.environ['SECRET_KEY']
+app.config['SQLALCHEMY_TRACK_MODIFICATIONS']=False
+app.config['SQLALCHEMY_DATABASE_URI']=os.environ['SQLALCHEMY_DATABASE_URI']
+db=SQLAlchemy(app)
+login_manager=LoginManager(app)
+login_manager.login_view='index'
+migrate=Migrate(app,db)
+csrf=CSRFProtect(app)
+
+service=OAuth1Service(
+    name='twitter',
+    consumer_key=os.environ['CONSUMER_KEY'],
+    consumer_secret=os.environ['CONSUMER_SECRET'],
+    request_token_url=os.environ['REQUEST_TOKEN_URI'],
+    authorize_url=os.environ['AUTHORIZE_URI'],
+    access_token_url=os.environ['ACCESS_TOKEN_URI'],
+    base_url=os.environ['BASE_URI']
+)
\ No newline at end of file
diff --git a/atcoder-editorials b/atcoder-editorials
new file mode 160000
index 0000000..352f92b
--- /dev/null
+++ b/atcoder-editorials
@@ -0,0 +1 @@
+Subproject commit 352f92bef99fc84eca11a39245e1fdc1e2fb21db

From 5e6d3d1ce9cffb25e8b72061a0b3b2c40130baa9 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 22:15:48 +0900
Subject: [PATCH 052/336] fix

---
 atcoder-editorials | 1 -
 1 file changed, 1 deletion(-)
 delete mode 160000 atcoder-editorials

diff --git a/atcoder-editorials b/atcoder-editorials
deleted file mode 160000
index 352f92b..0000000
--- a/atcoder-editorials
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 352f92bef99fc84eca11a39245e1fdc1e2fb21db

From 804df5d66b849d2202dd24350c174561b67ab820 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 22:24:58 +0900
Subject: [PATCH 053/336] commit

---
 app/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/config.py b/app/config.py
index 2ed5113..bf3a099 100644
--- a/app/config.py
+++ b/app/config.py
@@ -5,7 +5,7 @@
 from datetime import datetime
 from flask_wtf.csrf import CSRFProtect
 from rauth import OAuth1Service
-import ossaudiodev
+import os
 
 app=Flask(__name__)
 app.secret_key=os.environ['SECRET_KEY']

From ff8ae345041d91ce0bef0003e2f5476bd59b9edf Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 22:37:14 +0900
Subject: [PATCH 054/336] commit

---
 Procfile | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 Procfile

diff --git a/Procfile b/Procfile
new file mode 100644
index 0000000..d190ed9
--- /dev/null
+++ b/Procfile
@@ -0,0 +1 @@
+web: gunicorn app:app --log-file - 

From 0bdea4f5670900156624d1c7102c5a0f54282ff9 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 22:41:56 +0900
Subject: [PATCH 055/336] fix

---
 Procfile => Procfile.txt | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename Procfile => Procfile.txt (100%)

diff --git a/Procfile b/Procfile.txt
similarity index 100%
rename from Procfile
rename to Procfile.txt

From 1e0bf6d1b301c25dfbb13bb8ebf4465a64aa9e0e Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 22:44:19 +0900
Subject: [PATCH 056/336] fix

---
 Procfile     | 1 +
 Procfile.txt | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
 create mode 100644 Procfile
 delete mode 100644 Procfile.txt

diff --git a/Procfile b/Procfile
new file mode 100644
index 0000000..ca6e941
--- /dev/null
+++ b/Procfile
@@ -0,0 +1 @@
+web: gunicorn app:app
diff --git a/Procfile.txt b/Procfile.txt
deleted file mode 100644
index d190ed9..0000000
--- a/Procfile.txt
+++ /dev/null
@@ -1 +0,0 @@
-web: gunicorn app:app --log-file - 

From 7b673f23784f47957ffb688f5de628f4b18b85b6 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 22:52:08 +0900
Subject: [PATCH 057/336] commit

---
 Procfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Procfile b/Procfile
index ca6e941..47a27c0 100644
--- a/Procfile
+++ b/Procfile
@@ -1 +1 @@
-web: gunicorn app:app
+web: gunicorn gettingstarted.wsgi --log-file -

From 8032d13b8b12b8a824f921948868ce4a43a70470 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 22:55:01 +0900
Subject: [PATCH 058/336] commit :

---
 Procfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Procfile b/Procfile
index 47a27c0..ca6e941 100644
--- a/Procfile
+++ b/Procfile
@@ -1 +1 @@
-web: gunicorn gettingstarted.wsgi --log-file -
+web: gunicorn app:app

From 1ebbd19f1da54cd2239826cb2fd130dbf57572b5 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 22:57:42 +0900
Subject: [PATCH 059/336] file name change

---
 {app => app_file}/app.py                  | 0
 {app => app_file}/config.py               | 0
 {app => app_file}/static/script.js        | 0
 {app => app_file}/static/style.css        | 0
 {app => app_file}/templates/401.html      | 0
 {app => app_file}/templates/404.html      | 0
 {app => app_file}/templates/500.html      | 0
 {app => app_file}/templates/contest.html  | 0
 {app => app_file}/templates/error.html    | 0
 {app => app_file}/templates/index.html    | 0
 {app => app_file}/templates/ranking.html  | 0
 {app => app_file}/templates/search.html   | 0
 {app => app_file}/templates/submited.html | 0
 {app => app_file}/templates/template.html | 0
 {app => app_file}/templates/user.html     | 0
 15 files changed, 0 insertions(+), 0 deletions(-)
 rename {app => app_file}/app.py (100%)
 rename {app => app_file}/config.py (100%)
 rename {app => app_file}/static/script.js (100%)
 rename {app => app_file}/static/style.css (100%)
 rename {app => app_file}/templates/401.html (100%)
 rename {app => app_file}/templates/404.html (100%)
 rename {app => app_file}/templates/500.html (100%)
 rename {app => app_file}/templates/contest.html (100%)
 rename {app => app_file}/templates/error.html (100%)
 rename {app => app_file}/templates/index.html (100%)
 rename {app => app_file}/templates/ranking.html (100%)
 rename {app => app_file}/templates/search.html (100%)
 rename {app => app_file}/templates/submited.html (100%)
 rename {app => app_file}/templates/template.html (100%)
 rename {app => app_file}/templates/user.html (100%)

diff --git a/app/app.py b/app_file/app.py
similarity index 100%
rename from app/app.py
rename to app_file/app.py
diff --git a/app/config.py b/app_file/config.py
similarity index 100%
rename from app/config.py
rename to app_file/config.py
diff --git a/app/static/script.js b/app_file/static/script.js
similarity index 100%
rename from app/static/script.js
rename to app_file/static/script.js
diff --git a/app/static/style.css b/app_file/static/style.css
similarity index 100%
rename from app/static/style.css
rename to app_file/static/style.css
diff --git a/app/templates/401.html b/app_file/templates/401.html
similarity index 100%
rename from app/templates/401.html
rename to app_file/templates/401.html
diff --git a/app/templates/404.html b/app_file/templates/404.html
similarity index 100%
rename from app/templates/404.html
rename to app_file/templates/404.html
diff --git a/app/templates/500.html b/app_file/templates/500.html
similarity index 100%
rename from app/templates/500.html
rename to app_file/templates/500.html
diff --git a/app/templates/contest.html b/app_file/templates/contest.html
similarity index 100%
rename from app/templates/contest.html
rename to app_file/templates/contest.html
diff --git a/app/templates/error.html b/app_file/templates/error.html
similarity index 100%
rename from app/templates/error.html
rename to app_file/templates/error.html
diff --git a/app/templates/index.html b/app_file/templates/index.html
similarity index 100%
rename from app/templates/index.html
rename to app_file/templates/index.html
diff --git a/app/templates/ranking.html b/app_file/templates/ranking.html
similarity index 100%
rename from app/templates/ranking.html
rename to app_file/templates/ranking.html
diff --git a/app/templates/search.html b/app_file/templates/search.html
similarity index 100%
rename from app/templates/search.html
rename to app_file/templates/search.html
diff --git a/app/templates/submited.html b/app_file/templates/submited.html
similarity index 100%
rename from app/templates/submited.html
rename to app_file/templates/submited.html
diff --git a/app/templates/template.html b/app_file/templates/template.html
similarity index 100%
rename from app/templates/template.html
rename to app_file/templates/template.html
diff --git a/app/templates/user.html b/app_file/templates/user.html
similarity index 100%
rename from app/templates/user.html
rename to app_file/templates/user.html

From d344cba4699318c9bd315416bc93d343ba65dbf5 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 23:01:21 +0900
Subject: [PATCH 060/336] commit

---
 app_file/__init__.py | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 app_file/__init__.py

diff --git a/app_file/__init__.py b/app_file/__init__.py
new file mode 100644
index 0000000..e69de29

From 213a440742695e83f152073507ee81707d2374c5 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 23:06:52 +0900
Subject: [PATCH 061/336] commit

---
 app_file/app.py => app.py                       | 0
 app_file/__init__.py                            | 0
 app_file/config.py => config.py                 | 0
 {app_file/static => static}/script.js           | 0
 {app_file/static => static}/style.css           | 0
 {app_file/templates => templates}/401.html      | 0
 {app_file/templates => templates}/404.html      | 0
 {app_file/templates => templates}/500.html      | 0
 {app_file/templates => templates}/contest.html  | 0
 {app_file/templates => templates}/error.html    | 0
 {app_file/templates => templates}/index.html    | 0
 {app_file/templates => templates}/ranking.html  | 0
 {app_file/templates => templates}/search.html   | 0
 {app_file/templates => templates}/submited.html | 0
 {app_file/templates => templates}/template.html | 0
 {app_file/templates => templates}/user.html     | 0
 16 files changed, 0 insertions(+), 0 deletions(-)
 rename app_file/app.py => app.py (100%)
 delete mode 100644 app_file/__init__.py
 rename app_file/config.py => config.py (100%)
 rename {app_file/static => static}/script.js (100%)
 rename {app_file/static => static}/style.css (100%)
 rename {app_file/templates => templates}/401.html (100%)
 rename {app_file/templates => templates}/404.html (100%)
 rename {app_file/templates => templates}/500.html (100%)
 rename {app_file/templates => templates}/contest.html (100%)
 rename {app_file/templates => templates}/error.html (100%)
 rename {app_file/templates => templates}/index.html (100%)
 rename {app_file/templates => templates}/ranking.html (100%)
 rename {app_file/templates => templates}/search.html (100%)
 rename {app_file/templates => templates}/submited.html (100%)
 rename {app_file/templates => templates}/template.html (100%)
 rename {app_file/templates => templates}/user.html (100%)

diff --git a/app_file/app.py b/app.py
similarity index 100%
rename from app_file/app.py
rename to app.py
diff --git a/app_file/__init__.py b/app_file/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/app_file/config.py b/config.py
similarity index 100%
rename from app_file/config.py
rename to config.py
diff --git a/app_file/static/script.js b/static/script.js
similarity index 100%
rename from app_file/static/script.js
rename to static/script.js
diff --git a/app_file/static/style.css b/static/style.css
similarity index 100%
rename from app_file/static/style.css
rename to static/style.css
diff --git a/app_file/templates/401.html b/templates/401.html
similarity index 100%
rename from app_file/templates/401.html
rename to templates/401.html
diff --git a/app_file/templates/404.html b/templates/404.html
similarity index 100%
rename from app_file/templates/404.html
rename to templates/404.html
diff --git a/app_file/templates/500.html b/templates/500.html
similarity index 100%
rename from app_file/templates/500.html
rename to templates/500.html
diff --git a/app_file/templates/contest.html b/templates/contest.html
similarity index 100%
rename from app_file/templates/contest.html
rename to templates/contest.html
diff --git a/app_file/templates/error.html b/templates/error.html
similarity index 100%
rename from app_file/templates/error.html
rename to templates/error.html
diff --git a/app_file/templates/index.html b/templates/index.html
similarity index 100%
rename from app_file/templates/index.html
rename to templates/index.html
diff --git a/app_file/templates/ranking.html b/templates/ranking.html
similarity index 100%
rename from app_file/templates/ranking.html
rename to templates/ranking.html
diff --git a/app_file/templates/search.html b/templates/search.html
similarity index 100%
rename from app_file/templates/search.html
rename to templates/search.html
diff --git a/app_file/templates/submited.html b/templates/submited.html
similarity index 100%
rename from app_file/templates/submited.html
rename to templates/submited.html
diff --git a/app_file/templates/template.html b/templates/template.html
similarity index 100%
rename from app_file/templates/template.html
rename to templates/template.html
diff --git a/app_file/templates/user.html b/templates/user.html
similarity index 100%
rename from app_file/templates/user.html
rename to templates/user.html

From 7e417aa499ab8526d78513086ccf571a345e3b26 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 23:24:51 +0900
Subject: [PATCH 062/336] commit

---
 Procfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Procfile b/Procfile
index ca6e941..635305f 100644
--- a/Procfile
+++ b/Procfile
@@ -1 +1 @@
-web: gunicorn app:app
+web: gunicorn AtCoderEditorials:app

From 608ab40680f7353c5a01b2bc8e30b3a1335875d3 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 23:29:14 +0900
Subject: [PATCH 063/336] commit

---
 Procfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Procfile b/Procfile
index 635305f..ca6e941 100644
--- a/Procfile
+++ b/Procfile
@@ -1 +1 @@
-web: gunicorn AtCoderEditorials:app
+web: gunicorn app:app

From 3fae9b35e3a37b9ce23685bbecc7648310cf9d3a Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 23:42:31 +0900
Subject: [PATCH 064/336] commit

---
 static/script.js      | 32 --------------------------------
 templates/index.html  |  1 +
 templates/search.html | 34 +++++++++++++++++++++++++++++++++-
 3 files changed, 34 insertions(+), 33 deletions(-)

diff --git a/static/script.js b/static/script.js
index 8f8d944..6a616ee 100644
--- a/static/script.js
+++ b/static/script.js
@@ -1,35 +1,3 @@
-(async function() {
-
-    const contestName = [];
-    $.ajax({
-        type: 'GET',
-        url: 'https://kenkoooo.com/atcoder/resources/contests.json',
-        dataType: 'json',
-        success: function(json) {
-            var len = json.length;
-            for (var i = 0; i < len; i++) {
-                contestName.push(json[i].title);
-            }
-        }
-    });
-
-    //検索候補を表示する。
-    $('#autocomplete_search').autocomplete({
-        source: contestName,
-        autoFocus: true,
-        delay: 100,
-        minLength: 2,
-        appendTo: "menu",
-
-        //候補をクリックすることでsubmitできるようにする
-        select: function(event, ui) {
-            $("#autocomplete_search").val(ui.item.label);
-            $("#search").submit();
-        }
-    });
-
-})();
-
 //input内でのEnter無効化
 $(function() {
     $(document).on("keypress", "input:not(.allow_submit)", function(event) {
diff --git a/templates/index.html b/templates/index.html
index 512f5c3..ff633d3 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -64,6 +64,7 @@ <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#
             <br>
 
             <div class="container-fluid">
+                <h1>注意：このアプリはまだ未完成です。</h1>
                 <h3>AtCoderEditorialsはAtCoderの解法を集めるWebアプリです。</h3>
                 <h5>主な機能は、閲覧・投稿・いいね・ランキングの４つです。</h5>
                 <br>
diff --git a/templates/search.html b/templates/search.html
index 620bc20..9bc336d 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -57,7 +57,39 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
     <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js "></script>
-    <script src="../static/script.js "></script>
+    <script type="text/javascript">
+        (async function() {
+
+            const contestName = [];
+            $.ajax({
+                type: 'GET',
+                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
+                dataType: 'json',
+                success: function(json) {
+                    var len = json.length;
+                    for (var i = 0; i < len; i++) {
+                        contestName.push(json[i].title);
+                    }
+                }
+            });
+
+            //検索候補を表示する。
+            $('#autocomplete_search').autocomplete({
+                source: contestName,
+                autoFocus: true,
+                delay: 100,
+                minLength: 2,
+                appendTo: "menu",
+
+                //候補をクリックすることでsubmitできるようにする
+                select: function(event, ui) {
+                    $("#autocomplete_search").val(ui.item.label);
+                    $("#search").submit();
+                }
+            });
+
+        })();
+    </script>
 </body>
 
 

From de42b8cb48d4cf50b1571fc5b85758cbfe26142f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 23:50:17 +0900
Subject: [PATCH 065/336] fix

---
 templates/search.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 9bc336d..999a573 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -53,10 +53,10 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
 
     </div>
 
-    <script src="http://code.jquery.com/jquery-3.2.1.min.js " integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin=" anonymous "></script>
+    <script src="https://code.jquery.com/jquery-3.2.1.min.js " integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin=" anonymous "></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
-    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js "></script>
+    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js "></script>
     <script type="text/javascript">
         (async function() {
 

From ae419ec2692d8f6e59aeb0952a91363694358ac7 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 21 Aug 2019 23:52:43 +0900
Subject: [PATCH 066/336] commit

---
 templates/index.html | 1 -
 1 file changed, 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index ff633d3..512f5c3 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -64,7 +64,6 @@ <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#
             <br>
 
             <div class="container-fluid">
-                <h1>注意：このアプリはまだ未完成です。</h1>
                 <h3>AtCoderEditorialsはAtCoderの解法を集めるWebアプリです。</h3>
                 <h5>主な機能は、閲覧・投稿・いいね・ランキングの４つです。</h5>
                 <br>

From 71522cdbd297fc709a0903d6075effd7a1efff58 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 14:21:52 +0900
Subject: [PATCH 067/336] add google analytics

---
 templates/401.html      | 23 +++++++++++++++++++++++
 templates/404.html      | 23 +++++++++++++++++++++++
 templates/500.html      | 22 ++++++++++++++++++++++
 templates/contest.html  | 22 ++++++++++++++++++++++
 templates/error.html    | 22 ++++++++++++++++++++++
 templates/index.html    | 22 ++++++++++++++++++++++
 templates/ranking.html  | 22 ++++++++++++++++++++++
 templates/search.html   | 22 ++++++++++++++++++++++
 templates/submited.html | 22 ++++++++++++++++++++++
 templates/template.html | 22 ++++++++++++++++++++++
 templates/user.html     | 22 ++++++++++++++++++++++
 11 files changed, 244 insertions(+)

diff --git a/templates/401.html b/templates/401.html
index a6f8af4..2c60906 100644
--- a/templates/401.html
+++ b/templates/401.html
@@ -2,6 +2,25 @@
 <html lang="ja">
 
 <head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
+
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
@@ -9,6 +28,10 @@
 </head>
 
 <body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
diff --git a/templates/404.html b/templates/404.html
index e2d8b0a..7a2e022 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -2,6 +2,25 @@
 <html lang="ja">
 
 <head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
+
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
@@ -9,6 +28,10 @@
 </head>
 
 <body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
diff --git a/templates/500.html b/templates/500.html
index 122d866..9b57cb2 100644
--- a/templates/500.html
+++ b/templates/500.html
@@ -2,6 +2,24 @@
 <html lang="ja">
 
 <head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
@@ -9,6 +27,10 @@
 </head>
 
 <body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
diff --git a/templates/contest.html b/templates/contest.html
index f216e10..7c66de4 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -2,6 +2,24 @@
 <html lang="ja">
 
 <head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta name="csrf-token" content="{{ csrf_token() }}">
@@ -10,6 +28,10 @@
 </head>
 
 <body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
diff --git a/templates/error.html b/templates/error.html
index 04dc16b..5d7ea1f 100644
--- a/templates/error.html
+++ b/templates/error.html
@@ -2,6 +2,24 @@
 <html lang="ja">
 
 <head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
@@ -9,6 +27,10 @@
 </head>
 
 <body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
diff --git a/templates/index.html b/templates/index.html
index 512f5c3..18c7d1f 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -2,6 +2,24 @@
 <html lang="ja">
 
 <head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
@@ -9,6 +27,10 @@
 </head>
 
 <body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
diff --git a/templates/ranking.html b/templates/ranking.html
index 7db366d..9bb52cc 100644
--- a/templates/ranking.html
+++ b/templates/ranking.html
@@ -2,6 +2,24 @@
 <html lang="ja">
 
 <head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
@@ -9,6 +27,10 @@
 </head>
 
 <body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
diff --git a/templates/search.html b/templates/search.html
index 999a573..286c5ec 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -2,6 +2,24 @@
 <html lang="ja">
 
 <head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta name="csrf-token" content="{{ csrf_token() }}">
@@ -10,6 +28,10 @@
 </head>
 
 <body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
diff --git a/templates/submited.html b/templates/submited.html
index c14d996..f043766 100644
--- a/templates/submited.html
+++ b/templates/submited.html
@@ -2,6 +2,24 @@
 <html lang="ja">
 
 <head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
@@ -9,6 +27,10 @@
 </head>
 
 <body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
diff --git a/templates/template.html b/templates/template.html
index a136707..750ce1a 100644
--- a/templates/template.html
+++ b/templates/template.html
@@ -2,6 +2,24 @@
 <html lang="ja">
 
 <head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
@@ -9,6 +27,10 @@
 </head>
 
 <body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
diff --git a/templates/user.html b/templates/user.html
index 436f6da..473ebb4 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -2,6 +2,24 @@
 <html lang="ja">
 
 <head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
@@ -9,6 +27,10 @@
 </head>
 
 <body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
     <noscript>You need to enable JavaScript to run this app.</noscript>
 
     <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">

From 9452163ff8337ac7e7bb08ae7232f724de2cf000 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 14:38:55 +0900
Subject: [PATCH 068/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 7c66de4..16c1126 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -81,7 +81,7 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
-                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=55></textarea> {%if contestname==None%}
+                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=60></textarea> {%if contestname==None%}
                     <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname','')}}">投稿</button> {%else%}
                     <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
 

From d46318c339ee6ec63f677fbd6e71a2a8b49b8e25 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 14:40:39 +0900
Subject: [PATCH 069/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 16c1126..e0969e8 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -81,7 +81,7 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
-                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=60></textarea> {%if contestname==None%}
+                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea> {%if contestname==None%}
                     <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname','')}}">投稿</button> {%else%}
                     <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
 

From 3b8234cd2023eeee2592812ad5d350cbf388a896 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 15:25:31 +0900
Subject: [PATCH 070/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index e0969e8..2e15d36 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -74,7 +74,7 @@ <h1>{{contestname}}</h1>
             <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-target="#sub1">
                 投稿する
             </h4>
-            <div class="collapse" id="sub1" data-parent="#submit-card">
+            <div class="collapse" id="sub1" data-parent="#submit-card" style="cursor: pointer;">
                 <form action="/submited " method='POST'>
                     <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
                     <input type="text" placeholder="タイトル" name="title" style="width:535px" />

From cfb7e49ca6013543a991a2b3f9048e4d478fa3ee Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 15:30:10 +0900
Subject: [PATCH 071/336] fix

---
 templates/index.html | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index 18c7d1f..3e1299f 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -62,7 +62,7 @@
                 <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-target="#action1">
                     インフォメーション
                 </h5>
-                <div class="collapse" id="action1" 　data-parent="#events-imfo">
+                <div class="collapse" id="action1" 　data-parent="#events-imfo" style="cursor: pointer;">
                     <div class="card-body">
                         AtCoderEditorialsが誕生しました。
 
@@ -76,7 +76,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#action2">
                     お問い合わせ
                 </h5>
-                <div class="collapse" id="action2" 　data-parent="#events-imfo">
+                <div class="collapse" id="action2" 　data-parent="#events-imfo" style="cursor: pointer;">
                     <div class="card-body">
                         改善案、バグなどございましたら、ぬるぬる(@__Null_Null_)までご連絡お願いします。
                     </div>
@@ -101,6 +101,9 @@ <h5>注意</h5>
                 <h4>ログインについて</h4>
                 ・解法の投稿・いいね機能の使用にはTwitter認証でのログインが必要です。
                 <br> ・解法の閲覧にログインは必要ありません。
+                <br>
+                <br>
+                <br>
             </div>
 
         </div>

From 9f8833c383f226b88587566622f12cdd831168b2 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 15:32:48 +0900
Subject: [PATCH 072/336] fix

---
 templates/index.html | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index 3e1299f..cc39555 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -58,11 +58,11 @@
     <div class="container-fluid">
         <div id="events-imfo">
 
-            <div class="card">
+            <div class="card" style="cursor: pointer;">
                 <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-target="#action1">
                     インフォメーション
                 </h5>
-                <div class="collapse" id="action1" 　data-parent="#events-imfo" style="cursor: pointer;">
+                <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
                         AtCoderEditorialsが誕生しました。
 
@@ -72,12 +72,12 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
 
             <br>
 
-            <div class="card">
+            <div class="card" style="cursor: pointer;">
                 <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#action2">
                     お問い合わせ
                 </h5>
-                <div class="collapse" id="action2" 　data-parent="#events-imfo" style="cursor: pointer;">
-                    <div class="card-body">
+                <div class="collapse" id="action2" 　data-parent="#events-imfo" ">
+                    <div class="card-body ">
                         改善案、バグなどございましたら、ぬるぬる(@__Null_Null_)までご連絡お願いします。
                     </div>
                 </div>
@@ -85,7 +85,7 @@ <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#
 
             <br>
 
-            <div class="container-fluid">
+            <div class="container-fluid ">
                 <h3>AtCoderEditorialsはAtCoderの解法を集めるWebアプリです。</h3>
                 <h5>主な機能は、閲覧・投稿・いいね・ランキングの４つです。</h5>
                 <br>
@@ -111,9 +111,9 @@ <h4>ログインについて</h4>
     </div>
 
 
-    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
-    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
-    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js " integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo " crossorigin="anonymous "></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
 </body>
 
 

From 74ee9b93ce0299e6d00fcc544e694651765dd978 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 15:36:27 +0900
Subject: [PATCH 073/336] fix

---
 templates/contest.html  | 4 ++--
 templates/error.html    | 1 +
 templates/submited.html | 1 +
 templates/user.html     | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 2e15d36..9256dc4 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -70,7 +70,7 @@ <h1>{{contestname}}</h1>
     <br> {% if current_user.is_authenticated== True %}
     <div id="submit-card">
 
-        <div class="card col-6 border-0">
+        <div class="card col-6 border-0" style="cursor: pointer;">
             <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-target="#sub1">
                 投稿する
             </h4>
@@ -129,7 +129,7 @@ <h5 class="col-1"></h5>
                 </a>
             </div>
 
-            <div class="card col-6 border-0">
+            <div class="card col-6 border-0" style="cursor: pointer;">
                 <h4 class="card-header text-light bg-light text-dark col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
                     {{edit.title}}
                 </h4>
diff --git a/templates/error.html b/templates/error.html
index 5d7ea1f..b8b87a8 100644
--- a/templates/error.html
+++ b/templates/error.html
@@ -20,6 +20,7 @@
         })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
     </script>
     <!-- End Google Tag Manager -->
+
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
diff --git a/templates/submited.html b/templates/submited.html
index f043766..5edfefc 100644
--- a/templates/submited.html
+++ b/templates/submited.html
@@ -20,6 +20,7 @@
         })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
     </script>
     <!-- End Google Tag Manager -->
+
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
diff --git a/templates/user.html b/templates/user.html
index 473ebb4..2526756 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -77,7 +77,7 @@ <h3>投稿一覧</h3>
         <div>
             {%for e in edit.items %}
             <div id="editorial-card">
-                <div class="card col-6 border-0">
+                <div class="card col-6 border-0" style="cursor: pointer;">
                     <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
                         {{e.title}}
                     </h4>

From 0200f539be1c67470accd1e16587f116f43c1eba Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 15:49:45 +0900
Subject: [PATCH 074/336] jquery ui cdn update to 1.12

---
 templates/search.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index 286c5ec..59a953f 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -78,7 +78,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
     <script src="https://code.jquery.com/jquery-3.2.1.min.js " integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin=" anonymous "></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
-    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js "></script>
+    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js" integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin="anonymous"></script>
     <script type="text/javascript">
         (async function() {
 

From ac3b0f5e2f90e22fe0d021bcbf0c13db4a6de404 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 15:56:47 +0900
Subject: [PATCH 075/336] jquery update

---
 templates/contest.html  | 2 +-
 templates/error.html    | 2 +-
 templates/index.html    | 2 +-
 templates/ranking.html  | 2 +-
 templates/search.html   | 2 +-
 templates/submited.html | 2 +-
 templates/template.html | 2 +-
 templates/user.html     | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 9256dc4..f83135f 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -171,7 +171,7 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
         </ul>
     </div>
 
-    <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
 
diff --git a/templates/error.html b/templates/error.html
index b8b87a8..1bfec4c 100644
--- a/templates/error.html
+++ b/templates/error.html
@@ -58,7 +58,7 @@
 
     <h1>{{message}}</h1>
 
-    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
diff --git a/templates/index.html b/templates/index.html
index cc39555..d116293 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -111,7 +111,7 @@ <h4>ログインについて</h4>
     </div>
 
 
-    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js " integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo " crossorigin="anonymous "></script>
+    <script src="https://code.jquery.com/jquery-3.4.1.js " integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="crossorigin=" anonymous "></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
 </body>
diff --git a/templates/ranking.html b/templates/ranking.html
index 9bb52cc..4a05329 100644
--- a/templates/ranking.html
+++ b/templates/ranking.html
@@ -92,7 +92,7 @@
     </div>
 
 
-    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
diff --git a/templates/search.html b/templates/search.html
index 59a953f..547ab0b 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -75,7 +75,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
 
     </div>
 
-    <script src="https://code.jquery.com/jquery-3.2.1.min.js " integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin=" anonymous "></script>
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
     <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js" integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin="anonymous"></script>
diff --git a/templates/submited.html b/templates/submited.html
index 5edfefc..89e56a3 100644
--- a/templates/submited.html
+++ b/templates/submited.html
@@ -60,7 +60,7 @@
         <h2>投稿が完了しました。</h2>
     </div>
 
-    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
diff --git a/templates/template.html b/templates/template.html
index 750ce1a..9b929d7 100644
--- a/templates/template.html
+++ b/templates/template.html
@@ -56,7 +56,7 @@
     </nav>
 
 
-    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
diff --git a/templates/user.html b/templates/user.html
index 2526756..3de36e1 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -116,7 +116,7 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
     </div>
 
 
-    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>

From f76de7be9973e162621323ecca5c479da063a01b Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 16:03:15 +0900
Subject: [PATCH 076/336] fix

---
 static/script.js       | 42 +++++++++++++++++++++++++++++
 templates/contest.html | 61 +-----------------------------------------
 templates/search.html  |  7 +++++
 3 files changed, 50 insertions(+), 60 deletions(-)

diff --git a/static/script.js b/static/script.js
index 6a616ee..eebf05b 100644
--- a/static/script.js
+++ b/static/script.js
@@ -1,3 +1,45 @@
+$('.like_button').on('click', function() {
+    $(this).toggleClass('active');
+
+    if ($(this).hasClass('active')) {
+        var text = $(this).data('btn btn-info');
+    } else {
+        var text = $(this).data('btn btnconsole.log($(this).val);-outline-info');
+    }
+
+    $(this).html(text);
+
+    event.preventDefault();
+    $.ajax({
+            url: '/like',
+            type: 'post',
+            dataType: 'text',
+            data: {
+                id: $(this).val(),
+            },
+        }).done(function(response) {
+            console.log('success');
+        })
+        .fail(function() {
+            console.log('fail');
+        });
+})
+
+$('.delete_button').on('click', function() {
+    flag = window.confirm("本当に削除してもよろしいでしょうか？")
+    event.preventDefault();
+    if (flag === true) {
+        $.ajax({
+            url: '/delete',
+            type: 'post',
+            dataType: 'text',
+            data: {
+                id: $(this).val(),
+            }
+        })
+    }
+})
+
 //input内でのEnter無効化
 $(function() {
     $(document).on("keypress", "input:not(.allow_submit)", function(event) {
diff --git a/templates/contest.html b/templates/contest.html
index f83135f..1180b74 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -174,66 +174,7 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
     <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
-
-    <script type="text/javascript">
-        $('.like_button').on('click', function() {
-            $(this).toggleClass('active');
-
-            if ($(this).hasClass('active')) {
-                var text = $(this).data('btn btn-info');
-            } else {
-                var text = $(this).data('btn btnconsole.log($(this).val);-outline-info');
-            }
-
-            $(this).html(text);
-
-            event.preventDefault();
-            $.ajax({
-                    url: '/like',
-                    type: 'post',
-                    dataType: 'text',
-                    data: {
-                        id: $(this).val(),
-                    },
-                }).done(function(response) {
-                    console.log('success');
-                })
-                .fail(function() {
-                    console.log('fail');
-                });
-        })
-
-        $('.delete_button').on('click', function() {
-            flag = window.confirm("本当に削除してもよろしいでしょうか？")
-            event.preventDefault();
-            if (flag === true) {
-                $.ajax({
-                    url: '/delete',
-                    type: 'post',
-                    dataType: 'text',
-                    data: {
-                        id: $(this).val(),
-                    }
-                })
-            }
-        })
-
-        //input内でのEnter無効化
-        $(function() {
-            $(document).on("keypress", "input:not(.allow_submit)", function(event) {
-                return event.which !== 13;
-            });
-        });
-
-        var csrftoken = $('meta[name=csrf-token]').attr('content')
-
-        $.ajaxSetup({
-            beforeSend: function(xhr, settings) {
-                if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type)) {
-                    xhr.setRequestHeader("X-CSRFToken", csrftoken)
-                }
-            }
-        })
+    <script src="static/script.js">
     </script>
 </body>
 
diff --git a/templates/search.html b/templates/search.html
index 547ab0b..dbada6b 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -110,6 +110,13 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 }
             });
 
+            //input内でのEnter無効化
+            $(function() {
+                $(document).on("keypress", "input:not(.allow_submit)", function(event) {
+                    return event.which !== 13;
+                });
+            });
+
         })();
     </script>
 </body>

From 3b391448fb9febe40132de4ec3d5050915f7e4f3 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 16:12:24 +0900
Subject: [PATCH 077/336] commit

---
 static/script.js       | 42 -----------------------------
 templates/contest.html | 61 +++++++++++++++++++++++++++++++++++++++++-
 templates/search.html  | 13 +++++----
 3 files changed, 66 insertions(+), 50 deletions(-)

diff --git a/static/script.js b/static/script.js
index eebf05b..6a616ee 100644
--- a/static/script.js
+++ b/static/script.js
@@ -1,45 +1,3 @@
-$('.like_button').on('click', function() {
-    $(this).toggleClass('active');
-
-    if ($(this).hasClass('active')) {
-        var text = $(this).data('btn btn-info');
-    } else {
-        var text = $(this).data('btn btnconsole.log($(this).val);-outline-info');
-    }
-
-    $(this).html(text);
-
-    event.preventDefault();
-    $.ajax({
-            url: '/like',
-            type: 'post',
-            dataType: 'text',
-            data: {
-                id: $(this).val(),
-            },
-        }).done(function(response) {
-            console.log('success');
-        })
-        .fail(function() {
-            console.log('fail');
-        });
-})
-
-$('.delete_button').on('click', function() {
-    flag = window.confirm("本当に削除してもよろしいでしょうか？")
-    event.preventDefault();
-    if (flag === true) {
-        $.ajax({
-            url: '/delete',
-            type: 'post',
-            dataType: 'text',
-            data: {
-                id: $(this).val(),
-            }
-        })
-    }
-})
-
 //input内でのEnter無効化
 $(function() {
     $(document).on("keypress", "input:not(.allow_submit)", function(event) {
diff --git a/templates/contest.html b/templates/contest.html
index 1180b74..f83135f 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -174,7 +174,66 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
     <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
-    <script src="static/script.js">
+
+    <script type="text/javascript">
+        $('.like_button').on('click', function() {
+            $(this).toggleClass('active');
+
+            if ($(this).hasClass('active')) {
+                var text = $(this).data('btn btn-info');
+            } else {
+                var text = $(this).data('btn btnconsole.log($(this).val);-outline-info');
+            }
+
+            $(this).html(text);
+
+            event.preventDefault();
+            $.ajax({
+                    url: '/like',
+                    type: 'post',
+                    dataType: 'text',
+                    data: {
+                        id: $(this).val(),
+                    },
+                }).done(function(response) {
+                    console.log('success');
+                })
+                .fail(function() {
+                    console.log('fail');
+                });
+        })
+
+        $('.delete_button').on('click', function() {
+            flag = window.confirm("本当に削除してもよろしいでしょうか？")
+            event.preventDefault();
+            if (flag === true) {
+                $.ajax({
+                    url: '/delete',
+                    type: 'post',
+                    dataType: 'text',
+                    data: {
+                        id: $(this).val(),
+                    }
+                })
+            }
+        })
+
+        //input内でのEnter無効化
+        $(function() {
+            $(document).on("keypress", "input:not(.allow_submit)", function(event) {
+                return event.which !== 13;
+            });
+        });
+
+        var csrftoken = $('meta[name=csrf-token]').attr('content')
+
+        $.ajaxSetup({
+            beforeSend: function(xhr, settings) {
+                if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type)) {
+                    xhr.setRequestHeader("X-CSRFToken", csrftoken)
+                }
+            }
+        })
     </script>
 </body>
 
diff --git a/templates/search.html b/templates/search.html
index dbada6b..9bbbad4 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -109,15 +109,14 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                     $("#search").submit();
                 }
             });
+        })();
 
-            //input内でのEnter無効化
-            $(function() {
-                $(document).on("keypress", "input:not(.allow_submit)", function(event) {
-                    return event.which !== 13;
-                });
+        //input内でのEnter無効化
+        $(function() {
+            $(document).on("keypress", "input:not(.allow_submit)", function(event) {
+                return event.which !== 13;
             });
-
-        })();
+        });
     </script>
 </body>
 

From 7930dcb1bde5c9838afd2d8cf9d3554b7e13a07a Mon Sep 17 00:00:00 2001
From: Null-Null <52847048+null-null-programming@users.noreply.github.com>
Date: Thu, 22 Aug 2019 16:51:20 +0900
Subject: [PATCH 078/336] Update README.md

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 4a32af2..27c706d 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # AtCoderEditorials
 
-　AtCoderのWebアプリです。
+　AtCoderの非公式Webアプリです。
 
 # 説明
 

From 1727c554c39792f75336f0941921033c642fc084 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 17:02:10 +0900
Subject: [PATCH 079/336] add favicon

---
 templates/index.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/templates/index.html b/templates/index.html
index d116293..19715b9 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -23,6 +23,7 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 

From e245885f805d28ef90710df85b6e8f647c0049cb Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 17:05:40 +0900
Subject: [PATCH 080/336] fix

---
 templates/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index 19715b9..d32ad4b 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -23,7 +23,7 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="/favicon.ico">
+    <link rel="icon" href="templates/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 

From 9f87a9189109947e493c652b3a846578e4dee9b3 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 17:07:35 +0900
Subject: [PATCH 081/336] fix

---
 templates/index.html | 1 -
 1 file changed, 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index d32ad4b..d116293 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -23,7 +23,6 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="templates/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 

From a7ee05c8162d825d2b809ada354ac5ffe6a213c6 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 17:16:40 +0900
Subject: [PATCH 082/336] fix

---
 templates/index.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index d116293..7347eef 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -62,7 +62,7 @@
                 <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-target="#action1">
                     インフォメーション
                 </h5>
-                <div class="collapse" id="action1" 　data-parent="#events-imfo">
+                <div class="collapse show" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
                         AtCoderEditorialsが誕生しました。
 
@@ -76,7 +76,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#action2">
                     お問い合わせ
                 </h5>
-                <div class="collapse" id="action2" 　data-parent="#events-imfo" ">
+                <div class="collapse show" id="action2" 　data-parent="#events-imfo" ">
                     <div class="card-body ">
                         改善案、バグなどございましたら、ぬるぬる(@__Null_Null_)までご連絡お願いします。
                     </div>

From 929b2671506ec422a3c35929b5f29615a6719c33 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 17:24:01 +0900
Subject: [PATCH 083/336] commit

---
 templates/index.html | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index 7347eef..8c2a478 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -87,11 +87,14 @@ <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#
 
             <div class="container-fluid ">
                 <h3>AtCoderEditorialsはAtCoderの解法を集めるWebアプリです。</h3>
-                <h5>主な機能は、閲覧・投稿・いいね・ランキングの４つです。</h5>
+                <br><h5>主な機能は、閲覧・投稿・いいね・ランキングの４つです。</h5>
                 <br>
-                <h4> 投稿方法</h4>
+                <h4>良い解法をより見つけやすく</h4>
+                <br>・いいね順に解法を並び替えることで、良い解法を見つけやすくしています。
+                <br>
+                <h4>投稿方法</h4>
                 ・AtCoderEditorialsに直接書き込む。
-                <br>・外部サイトのURLを貼る。
+                <br>・解法ブログの記事などのURLを貼る。
                 <br>
                 <br>
                 <h5>注意</h5>
@@ -104,6 +107,7 @@ <h4>ログインについて</h4>
                 <br>
                 <br>
                 <br>
+                <br>
             </div>
 
         </div>

From 68ed53a1913d9f0714a3ff2707789db2db5abf3e Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 17:26:11 +0900
Subject: [PATCH 084/336] fix

---
 templates/index.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index 8c2a478..e1589b5 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -87,10 +87,10 @@ <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#
 
             <div class="container-fluid ">
                 <h3>AtCoderEditorialsはAtCoderの解法を集めるWebアプリです。</h3>
-                <br><h5>主な機能は、閲覧・投稿・いいね・ランキングの４つです。</h5>
+                <h5>主な機能は、閲覧・投稿・いいね・ランキングの４つです。</h5>
                 <br>
                 <h4>良い解法をより見つけやすく</h4>
-                <br>・いいね順に解法を並び替えることで、良い解法を見つけやすくしています。
+                ・いいね順に解法を並び替えることで、良い解法を見つけやすくしています。
                 <br>
                 <h4>投稿方法</h4>
                 ・AtCoderEditorialsに直接書き込む。

From 6489cf11213717d39e81e77f1aa7b7a334d749a3 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 17:28:07 +0900
Subject: [PATCH 085/336] fix

---
 templates/index.html | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index e1589b5..91b1393 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -92,16 +92,16 @@ <h5>主な機能は、閲覧・投稿・いいね・ランキングの４つで
                 <h4>良い解法をより見つけやすく</h4>
                 ・いいね順に解法を並び替えることで、良い解法を見つけやすくしています。
                 <br>
+                <br>
                 <h4>投稿方法</h4>
                 ・AtCoderEditorialsに直接書き込む。
                 <br>・解法ブログの記事などのURLを貼る。
                 <br>
-                <br>
-                <h5>注意</h5>
+                <h5>＊注意＊</h5>
                 ・自分以外が書いた解法の投稿は、許可を貰ってからお願いします。
                 <br>
                 <br>
-                <h4>ログインについて</h4>
+                <h4>ログイ＊ンについて</h4>
                 ・解法の投稿・いいね機能の使用にはTwitter認証でのログインが必要です。
                 <br> ・解法の閲覧にログインは必要ありません。
                 <br>

From 781f338fed9362f6d1d23b3b42d7c5ee0ae13195 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 17:31:02 +0900
Subject: [PATCH 086/336] fix

---
 templates/index.html | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index 91b1393..701764b 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -96,12 +96,10 @@ <h4>良い解法をより見つけやすく</h4>
                 <h4>投稿方法</h4>
                 ・AtCoderEditorialsに直接書き込む。
                 <br>・解法ブログの記事などのURLを貼る。
+                <br>・自分以外が書いた解法の投稿は、許可を貰ってからお願いします。
                 <br>
-                <h5>＊注意＊</h5>
-                ・自分以外が書いた解法の投稿は、許可を貰ってからお願いします。
                 <br>
-                <br>
-                <h4>ログイ＊ンについて</h4>
+                <h4>ログインについて</h4>
                 ・解法の投稿・いいね機能の使用にはTwitter認証でのログインが必要です。
                 <br> ・解法の閲覧にログインは必要ありません。
                 <br>

From 51b0ad1e7482fd27f9ba65f4cc24d35eb07a4bd1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 18:00:48 +0900
Subject: [PATCH 087/336] add copyright

---
 templates/index.html | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index 701764b..5b6ba62 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -117,6 +117,8 @@ <h4>ログインについて</h4>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
 </body>
-
+<hooter>
+    <p>Copyright &copy; Null_Null All Rights Reserved.</p>
+</hooter>
 
 </html>
\ No newline at end of file

From a039bdc8ee4673304cdf14bb6e1aa725e8b281e8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 18:02:57 +0900
Subject: [PATCH 088/336] fix

---
 templates/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index 5b6ba62..0d0865b 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -118,7 +118,7 @@ <h4>ログインについて</h4>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
 </body>
 <hooter>
-    <p>Copyright &copy; Null_Null All Rights Reserved.</p>
+    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
 </hooter>
 
 </html>
\ No newline at end of file

From ead18bde17a9de5da2739f7e05c834842cd936e5 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 18:05:25 +0900
Subject: [PATCH 089/336] fix

---
 templates/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index 0d0865b..5000273 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -118,7 +118,7 @@ <h4>ログインについて</h4>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
 </body>
 <hooter>
-    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
+    <p class="container-fluid ">Copyright &copy; Null_Null All Rights Reserved.</p>
 </hooter>
 
 </html>
\ No newline at end of file

From bd9e60e857ceb5b72d3ede736ca3d6a1c981eed5 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 18:06:59 +0900
Subject: [PATCH 090/336] fix

---
 templates/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index 5000273..0d0865b 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -118,7 +118,7 @@ <h4>ログインについて</h4>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
 </body>
 <hooter>
-    <p class="container-fluid ">Copyright &copy; Null_Null All Rights Reserved.</p>
+    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
 </hooter>
 
 </html>
\ No newline at end of file

From 2b8e9b5ff0eaf61752d3468b95f21306de11c0e9 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 18:09:31 +0900
Subject: [PATCH 091/336] add copyrights

---
 templates/401.html      | 4 +++-
 templates/404.html      | 4 +++-
 templates/500.html      | 4 +++-
 templates/contest.html  | 3 +++
 templates/error.html    | 4 +++-
 templates/ranking.html  | 4 +++-
 templates/search.html   | 4 +++-
 templates/submited.html | 4 +++-
 templates/template.html | 4 +++-
 templates/user.html     | 4 +++-
 10 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/templates/401.html b/templates/401.html
index 2c60906..333951c 100644
--- a/templates/401.html
+++ b/templates/401.html
@@ -62,6 +62,8 @@ <h1>401 Unauthorized</h1>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-
+<hooter>
+    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
+</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/404.html b/templates/404.html
index 7a2e022..9f30552 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -62,6 +62,8 @@ <h1>404 Not Found</h1>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-
+<hooter>
+    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
+</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/500.html b/templates/500.html
index 9b57cb2..56db285 100644
--- a/templates/500.html
+++ b/templates/500.html
@@ -61,6 +61,8 @@ <h1>500 Internal Server Error</h1>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-
+<hooter>
+    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
+</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/contest.html b/templates/contest.html
index f83135f..4ef145e 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -236,5 +236,8 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
         })
     </script>
 </body>
+<hooter>
+    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
+</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/error.html b/templates/error.html
index 1bfec4c..e6e34d6 100644
--- a/templates/error.html
+++ b/templates/error.html
@@ -62,6 +62,8 @@ <h1>{{message}}</h1>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-
+<hooter>
+    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
+</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/ranking.html b/templates/ranking.html
index 4a05329..8c7d965 100644
--- a/templates/ranking.html
+++ b/templates/ranking.html
@@ -96,6 +96,8 @@
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-
+<hooter>
+    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
+</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/search.html b/templates/search.html
index 9bbbad4..bf41241 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -119,6 +119,8 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
         });
     </script>
 </body>
-
+<hooter>
+    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
+</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/submited.html b/templates/submited.html
index 89e56a3..0d6c4cd 100644
--- a/templates/submited.html
+++ b/templates/submited.html
@@ -64,6 +64,8 @@ <h2>投稿が完了しました。</h2>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-
+<hooter>
+    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
+</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/template.html b/templates/template.html
index 9b929d7..d2a7ac4 100644
--- a/templates/template.html
+++ b/templates/template.html
@@ -60,6 +60,8 @@
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-
+<hooter>
+    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
+</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/user.html b/templates/user.html
index 3de36e1..f9094bc 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -120,6 +120,8 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-
+<hooter>
+    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
+</hooter>
 
 </html>
\ No newline at end of file

From d00f9f9f4f82d0ad6722977068d081d80c0a24fb Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 18:14:07 +0900
Subject: [PATCH 092/336] commit

---
 templates/401.html      | 4 +---
 templates/404.html      | 4 +---
 templates/500.html      | 4 +---
 templates/contest.html  | 3 ---
 templates/error.html    | 4 +---
 templates/ranking.html  | 3 ---
 templates/search.html   | 4 +---
 templates/submited.html | 3 ---
 templates/template.html | 3 ---
 templates/user.html     | 4 +---
 10 files changed, 6 insertions(+), 30 deletions(-)

diff --git a/templates/401.html b/templates/401.html
index 333951c..2c60906 100644
--- a/templates/401.html
+++ b/templates/401.html
@@ -62,8 +62,6 @@ <h1>401 Unauthorized</h1>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-<hooter>
-    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
-</hooter>
+
 
 </html>
\ No newline at end of file
diff --git a/templates/404.html b/templates/404.html
index 9f30552..7a2e022 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -62,8 +62,6 @@ <h1>404 Not Found</h1>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-<hooter>
-    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
-</hooter>
+
 
 </html>
\ No newline at end of file
diff --git a/templates/500.html b/templates/500.html
index 56db285..9b57cb2 100644
--- a/templates/500.html
+++ b/templates/500.html
@@ -61,8 +61,6 @@ <h1>500 Internal Server Error</h1>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-<hooter>
-    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
-</hooter>
+
 
 </html>
\ No newline at end of file
diff --git a/templates/contest.html b/templates/contest.html
index 4ef145e..f83135f 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -236,8 +236,5 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
         })
     </script>
 </body>
-<hooter>
-    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
-</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/error.html b/templates/error.html
index e6e34d6..1bfec4c 100644
--- a/templates/error.html
+++ b/templates/error.html
@@ -62,8 +62,6 @@ <h1>{{message}}</h1>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-<hooter>
-    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
-</hooter>
+
 
 </html>
\ No newline at end of file
diff --git a/templates/ranking.html b/templates/ranking.html
index 8c7d965..562e8a4 100644
--- a/templates/ranking.html
+++ b/templates/ranking.html
@@ -96,8 +96,5 @@
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-<hooter>
-    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
-</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/search.html b/templates/search.html
index bf41241..9bbbad4 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -119,8 +119,6 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
         });
     </script>
 </body>
-<hooter>
-    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
-</hooter>
+
 
 </html>
\ No newline at end of file
diff --git a/templates/submited.html b/templates/submited.html
index 0d6c4cd..3b1a7ef 100644
--- a/templates/submited.html
+++ b/templates/submited.html
@@ -64,8 +64,5 @@ <h2>投稿が完了しました。</h2>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-<hooter>
-    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
-</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/template.html b/templates/template.html
index d2a7ac4..0b8bedb 100644
--- a/templates/template.html
+++ b/templates/template.html
@@ -60,8 +60,5 @@
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-<hooter>
-    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
-</hooter>
 
 </html>
\ No newline at end of file
diff --git a/templates/user.html b/templates/user.html
index f9094bc..3de36e1 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -120,8 +120,6 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 </body>
-<hooter>
-    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
-</hooter>
+
 
 </html>
\ No newline at end of file

From 52b48e046dd4bc669884fcd6255c186cbf595cec Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 18:22:56 +0900
Subject: [PATCH 093/336] commit

---
 templates/index.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index 0d0865b..33afe0b 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -62,7 +62,7 @@
                 <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-target="#action1">
                     インフォメーション
                 </h5>
-                <div class="collapse show" id="action1" 　data-parent="#events-imfo">
+                <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
                         AtCoderEditorialsが誕生しました。
 
@@ -76,7 +76,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#action2">
                     お問い合わせ
                 </h5>
-                <div class="collapse show" id="action2" 　data-parent="#events-imfo" ">
+                <div class="collapse" id="action2" 　data-parent="#events-imfo" ">
                     <div class="card-body ">
                         改善案、バグなどございましたら、ぬるぬる(@__Null_Null_)までご連絡お願いします。
                     </div>

From 45ae8d9572b3b2fafd20f5a7ce8f03570894ad0d Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 19:08:37 +0900
Subject: [PATCH 094/336] add tweet button

---
 templates/user.html | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/templates/user.html b/templates/user.html
index 3de36e1..79c1471 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -70,6 +70,13 @@ <h4> いいね数 :{{user.like_sum}}</h4>
             <div>
                 <h4> 投稿数　 :{{num}}</h4>
             </div>
+            <div>
+                <div class="twitter">
+                    <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{rank}}位になりました！" data-url="https://atcoder-editorials.herokuapp.com/user/{{user.id}}/1" data-lang="ja">
+                        順位をTweet
+                    </a>
+                </div>
+            </div>
         </div>
     </div>
     <div class="container-fluid">
@@ -119,6 +126,7 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
     <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+    <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
 </body>
 
 

From d53a3ab76f592d8eaa301ab4280b802051400b61 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 19:12:53 +0900
Subject: [PATCH 095/336] commit

---
 templates/user.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index 79c1471..d747e93 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -73,7 +73,7 @@ <h4> 投稿数　 :{{num}}</h4>
             <div>
                 <div class="twitter">
                     <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{rank}}位になりました！" data-url="https://atcoder-editorials.herokuapp.com/user/{{user.id}}/1" data-lang="ja">
-                        順位をTweet
+                        Tweet
                     </a>
                 </div>
             </div>

From 52a7cd085265e0ed8d36819d3460e05c4ef2d162 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 19:38:27 +0900
Subject: [PATCH 096/336] add meta tag

---
 templates/401.html      | 1 +
 templates/404.html      | 1 +
 templates/500.html      | 1 +
 templates/contest.html  | 1 +
 templates/error.html    | 1 +
 templates/index.html    | 2 ++
 templates/ranking.html  | 1 +
 templates/search.html   | 3 ++-
 templates/template.html | 1 +
 templates/user.html     | 1 +
 10 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/templates/401.html b/templates/401.html
index 2c60906..028506d 100644
--- a/templates/401.html
+++ b/templates/401.html
@@ -23,6 +23,7 @@
 
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>
diff --git a/templates/404.html b/templates/404.html
index 7a2e022..88b5661 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -23,6 +23,7 @@
 
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>
diff --git a/templates/500.html b/templates/500.html
index 9b57cb2..309268d 100644
--- a/templates/500.html
+++ b/templates/500.html
@@ -22,6 +22,7 @@
     <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>
diff --git a/templates/contest.html b/templates/contest.html
index f83135f..feb131d 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -22,6 +22,7 @@
     <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="csrf-token" content="{{ csrf_token() }}">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
diff --git a/templates/error.html b/templates/error.html
index 1bfec4c..137489f 100644
--- a/templates/error.html
+++ b/templates/error.html
@@ -23,6 +23,7 @@
 
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>
diff --git a/templates/index.html b/templates/index.html
index 33afe0b..4bd6a8d 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -22,6 +22,8 @@
     <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="description" content="AtCoderEditorialsは、AtCoderの解法を投稿できるWebアプリです。良い解法をより見つけやすく出来るようなアプリを目指しています。" />
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>
diff --git a/templates/ranking.html b/templates/ranking.html
index 562e8a4..c59ceee 100644
--- a/templates/ranking.html
+++ b/templates/ranking.html
@@ -22,6 +22,7 @@
     <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>
diff --git a/templates/search.html b/templates/search.html
index 9bbbad4..c36a274 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -22,6 +22,7 @@
     <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="csrf-token" content="{{ csrf_token() }}">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
@@ -103,7 +104,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 minLength: 2,
                 appendTo: "menu",
 
-                //候補をクリックすることでsubmitできるようにする
+                //候補をクリックすることでsubmitできるようにする<meta http-equiv="X-UA-Compatible" content="IE=edge">
                 select: function(event, ui) {
                     $("#autocomplete_search").val(ui.item.label);
                     $("#search").submit();
diff --git a/templates/template.html b/templates/template.html
index 0b8bedb..d3d5f81 100644
--- a/templates/template.html
+++ b/templates/template.html
@@ -22,6 +22,7 @@
     <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>
diff --git a/templates/user.html b/templates/user.html
index d747e93..e7314d8 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -22,6 +22,7 @@
     <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>

From e88605266e9dcdaa6d6755324303dbe6ec310e8f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 19:40:06 +0900
Subject: [PATCH 097/336] fix

---
 templates/user.html | 1 -
 1 file changed, 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index e7314d8..544f383 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -74,7 +74,6 @@ <h4> 投稿数　 :{{num}}</h4>
             <div>
                 <div class="twitter">
                     <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{rank}}位になりました！" data-url="https://atcoder-editorials.herokuapp.com/user/{{user.id}}/1" data-lang="ja">
-                        Tweet
                     </a>
                 </div>
             </div>

From 4b3cc6e0d5858a7b6be9924b3edeaa72be858aa3 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 20:51:20 +0900
Subject: [PATCH 098/336] add favicon

---
 templates/401.html      | 1 +
 templates/404.html      | 1 +
 templates/500.html      | 1 +
 templates/contest.html  | 1 +
 templates/error.html    | 1 +
 templates/index.html    | 1 +
 templates/ranking.html  | 1 +
 templates/search.html   | 1 +
 templates/submited.html | 1 +
 templates/template.html | 1 +
 templates/user.html     | 1 +
 11 files changed, 11 insertions(+)

diff --git a/templates/401.html b/templates/401.html
index 028506d..f18bec9 100644
--- a/templates/401.html
+++ b/templates/401.html
@@ -25,6 +25,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" href="favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/404.html b/templates/404.html
index 88b5661..e7aa2a3 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -25,6 +25,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" href="favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/500.html b/templates/500.html
index 309268d..f12e107 100644
--- a/templates/500.html
+++ b/templates/500.html
@@ -24,6 +24,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" href="favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/contest.html b/templates/contest.html
index feb131d..d2d4c9b 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -25,6 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="csrf-token" content="{{ csrf_token() }}">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" href="favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/error.html b/templates/error.html
index 137489f..4ab0833 100644
--- a/templates/error.html
+++ b/templates/error.html
@@ -25,6 +25,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" href="favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/index.html b/templates/index.html
index 4bd6a8d..3639a73 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -25,6 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="description" content="AtCoderEditorialsは、AtCoderの解法を投稿できるWebアプリです。良い解法をより見つけやすく出来るようなアプリを目指しています。" />
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" href="favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/ranking.html b/templates/ranking.html
index c59ceee..3e5c6b3 100644
--- a/templates/ranking.html
+++ b/templates/ranking.html
@@ -24,6 +24,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" href="favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/search.html b/templates/search.html
index c36a274..2918adf 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -25,6 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="csrf-token" content="{{ csrf_token() }}">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" href="favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/submited.html b/templates/submited.html
index 3b1a7ef..7e0696a 100644
--- a/templates/submited.html
+++ b/templates/submited.html
@@ -24,6 +24,7 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" href="favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/template.html b/templates/template.html
index d3d5f81..1e764da 100644
--- a/templates/template.html
+++ b/templates/template.html
@@ -24,6 +24,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" href="favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/user.html b/templates/user.html
index 544f383..d341c94 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -23,6 +23,7 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <link rel="icon" href="favicon.ico">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>

From 5f0a3cd97101417afbf40c2cb7a133267ecc6e62 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 21:02:12 +0900
Subject: [PATCH 099/336] fix

---
 templates/401.html      | 2 +-
 templates/404.html      | 2 +-
 templates/500.html      | 2 +-
 templates/contest.html  | 2 +-
 templates/error.html    | 2 +-
 templates/index.html    | 2 +-
 templates/ranking.html  | 2 +-
 templates/search.html   | 2 +-
 templates/submited.html | 2 +-
 templates/template.html | 2 +-
 templates/user.html     | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/templates/401.html b/templates/401.html
index f18bec9..93a9d2c 100644
--- a/templates/401.html
+++ b/templates/401.html
@@ -25,7 +25,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="favicon.ico">
+    <link rel="icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/404.html b/templates/404.html
index e7aa2a3..eda32a4 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -25,7 +25,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="favicon.ico">
+    <link rel="icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/500.html b/templates/500.html
index f12e107..2f05dfc 100644
--- a/templates/500.html
+++ b/templates/500.html
@@ -24,7 +24,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="favicon.ico">
+    <link rel="icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/contest.html b/templates/contest.html
index d2d4c9b..daeaa61 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -25,7 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="csrf-token" content="{{ csrf_token() }}">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="favicon.ico">
+    <link rel="icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/error.html b/templates/error.html
index 4ab0833..6a1a30f 100644
--- a/templates/error.html
+++ b/templates/error.html
@@ -25,7 +25,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="favicon.ico">
+    <link rel="icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/index.html b/templates/index.html
index 3639a73..aca83f3 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -25,7 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="description" content="AtCoderEditorialsは、AtCoderの解法を投稿できるWebアプリです。良い解法をより見つけやすく出来るようなアプリを目指しています。" />
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="favicon.ico">
+    <link rel="icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/ranking.html b/templates/ranking.html
index 3e5c6b3..1c22c07 100644
--- a/templates/ranking.html
+++ b/templates/ranking.html
@@ -24,7 +24,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="favicon.ico">
+    <link rel="icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/search.html b/templates/search.html
index 2918adf..bc5896c 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -25,7 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="csrf-token" content="{{ csrf_token() }}">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="favicon.ico">
+    <link rel="icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/submited.html b/templates/submited.html
index 7e0696a..177b80f 100644
--- a/templates/submited.html
+++ b/templates/submited.html
@@ -24,7 +24,7 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="favicon.ico">
+    <link rel="icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/template.html b/templates/template.html
index 1e764da..cafc1a6 100644
--- a/templates/template.html
+++ b/templates/template.html
@@ -24,7 +24,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="favicon.ico">
+    <link rel="icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/user.html b/templates/user.html
index d341c94..f1cb812 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -23,7 +23,7 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <link rel="icon" href="favicon.ico">
+    <link rel="icon" href="/favicon.ico">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>

From d0dd2cc99fb49a307db524c60884df2813de2ee0 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 21:14:42 +0900
Subject: [PATCH 100/336] fix

---
 templates/401.html      | 2 +-
 templates/404.html      | 2 +-
 templates/500.html      | 2 +-
 templates/contest.html  | 2 +-
 templates/error.html    | 3 ++-
 templates/index.html    | 2 +-
 templates/ranking.html  | 2 +-
 templates/search.html   | 2 +-
 templates/submited.html | 2 +-
 templates/template.html | 2 +-
 templates/user.html     | 2 +-
 11 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/templates/401.html b/templates/401.html
index 93a9d2c..e59dc40 100644
--- a/templates/401.html
+++ b/templates/401.html
@@ -25,7 +25,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/404.html b/templates/404.html
index eda32a4..b90e9cf 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -25,7 +25,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/500.html b/templates/500.html
index 2f05dfc..987847c 100644
--- a/templates/500.html
+++ b/templates/500.html
@@ -24,7 +24,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/contest.html b/templates/contest.html
index daeaa61..5efba68 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -25,7 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="csrf-token" content="{{ csrf_token() }}">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/error.html b/templates/error.html
index 6a1a30f..221ad97 100644
--- a/templates/error.html
+++ b/templates/error.html
@@ -25,7 +25,8 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
+
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/index.html b/templates/index.html
index aca83f3..ebcbf02 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -25,7 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="description" content="AtCoderEditorialsは、AtCoderの解法を投稿できるWebアプリです。良い解法をより見つけやすく出来るようなアプリを目指しています。" />
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/ranking.html b/templates/ranking.html
index 1c22c07..5d50f55 100644
--- a/templates/ranking.html
+++ b/templates/ranking.html
@@ -24,7 +24,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/search.html b/templates/search.html
index bc5896c..61a6152 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -25,7 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="csrf-token" content="{{ csrf_token() }}">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/submited.html b/templates/submited.html
index 177b80f..81e0d40 100644
--- a/templates/submited.html
+++ b/templates/submited.html
@@ -24,7 +24,7 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/template.html b/templates/template.html
index cafc1a6..e21d69d 100644
--- a/templates/template.html
+++ b/templates/template.html
@@ -24,7 +24,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/user.html b/templates/user.html
index f1cb812..e51c921 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -23,7 +23,7 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <link rel="icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>
 </head>

From 9813ab3a81ee88f246aa4cfc8d35d8f250ff4b6f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 21:20:13 +0900
Subject: [PATCH 101/336] fix

---
 .gitignore  |   3 +--
 favicon.ico | Bin 0 -> 3638 bytes
 2 files changed, 1 insertion(+), 2 deletions(-)
 create mode 100644 favicon.ico

diff --git a/.gitignore b/.gitignore
index da6e3b1..d3597ee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -128,5 +128,4 @@ bin/
 include/
 *.cfg
 migrations/
-lib64
-favicon.ico
\ No newline at end of file
+lib64
\ No newline at end of file
diff --git a/favicon.ico b/favicon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..4213ce6331b1f2c863a214f4aaaa2efd96ca8d40
GIT binary patch

From 80bde01d65e83b59633428e226bacc4e37d532b8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 21:32:36 +0900
Subject: [PATCH 102/336] fix

---
 templates/401.html   | 2 +-
 templates/error.html | 1 -
 templates/index.html | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/templates/401.html b/templates/401.html
index e59dc40..d5489d7 100644
--- a/templates/401.html
+++ b/templates/401.html
@@ -25,7 +25,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="https://atcoder-editorials.herokuapp.com/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/error.html b/templates/error.html
index 221ad97..b876509 100644
--- a/templates/error.html
+++ b/templates/error.html
@@ -26,7 +26,6 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <link rel="icon" type="image/x-icon" href="/favicon.ico">
-
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/index.html b/templates/index.html
index ebcbf02..254b1bb 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -25,7 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="description" content="AtCoderEditorialsは、AtCoderの解法を投稿できるWebアプリです。良い解法をより見つけやすく出来るようなアプリを目指しています。" />
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="https://atcoder-editorials.herokuapp.com/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 

From e85eb13ab80f6654a7f697ef1e66f6cdd6066abe Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 21:41:40 +0900
Subject: [PATCH 103/336] fix copyright

---
 templates/401.html   | 2 +-
 templates/index.html | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/templates/401.html b/templates/401.html
index d5489d7..e59dc40 100644
--- a/templates/401.html
+++ b/templates/401.html
@@ -25,7 +25,7 @@
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" type="image/x-icon" href="https://atcoder-editorials.herokuapp.com/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
diff --git a/templates/index.html b/templates/index.html
index 254b1bb..11b3398 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -25,7 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="description" content="AtCoderEditorialsは、AtCoderの解法を投稿できるWebアプリです。良い解法をより見つけやすく出来るようなアプリを目指しています。" />
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" type="image/x-icon" href="https://atcoder-editorials.herokuapp.com/favicon.ico">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <title>AtCoder Editorials</title>
 </head>
 
@@ -121,7 +121,7 @@ <h4>ログインについて</h4>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
 </body>
 <hooter>
-    <p style="text-align:center; ">Copyright &copy; Null_Null All Rights Reserved.</p>
+    <p style="text-align:center; ">Copyright &copy;2019 Null_Null All Rights Reserved.</p>
 </hooter>
 
 </html>
\ No newline at end of file

From 3c3adf04e39e9f341fa11eb10e0bb50ad46d725e Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 21:47:02 +0900
Subject: [PATCH 104/336] fix

---
 templates/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index 11b3398..03f0b8f 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -121,7 +121,7 @@ <h4>ログインについて</h4>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
 </body>
 <hooter>
-    <p style="text-align:center; ">Copyright &copy;2019 Null_Null All Rights Reserved.</p>
+    <p style="text-align:center; ">&copy;2019 Null_Null All Rights Reserved.</p>
 </hooter>
 
 </html>
\ No newline at end of file

From 6b9b858f900164f48ac55b5890a4a6064424466b Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 21:54:55 +0900
Subject: [PATCH 105/336] fix

---
 templates/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index 03f0b8f..55bfbbf 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -25,7 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="description" content="AtCoderEditorialsは、AtCoderの解法を投稿できるWebアプリです。良い解法をより見つけやすく出来るようなアプリを目指しています。" />
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
     <title>AtCoder Editorials</title>
 </head>
 

From 71b1d0fe60a89a43852201a31fd4c0ab68d64bd6 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 22 Aug 2019 21:57:47 +0900
Subject: [PATCH 106/336] fix

---
 templates/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index 55bfbbf..285c86e 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -25,7 +25,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="description" content="AtCoderEditorialsは、AtCoderの解法を投稿できるWebアプリです。良い解法をより見つけやすく出来るようなアプリを目指しています。" />
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
+    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
     <title>AtCoder Editorials</title>
 </head>
 

From a1f4f171dadf27ad865eefc6e7c5583177f2d3b5 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 11:19:14 +0900
Subject: [PATCH 107/336] fix table

---
 requirements.txt       | 3 +++
 templates/ranking.html | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/requirements.txt b/requirements.txt
index 993a61f..917c5bc 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -15,16 +15,19 @@ itsdangerous==1.1.0
 Jinja2==2.10.1
 Mako==1.1.0
 MarkupSafe==1.1.1
+numpy==1.17.0
 post==2019.4.13
 psycopg2==2.8.3
 psycopg2-binary==2.8.3
 public==2019.4.13
 python-dateutil==2.8.0
+python-dotenv==0.10.3
 python-editor==1.0.4
 query-string==2019.4.13
 rauth==0.7.3
 request==2019.4.13
 requests==2.22.0
+scipy==1.3.1
 six==1.12.0
 SQLAlchemy==1.3.6
 urllib3==1.25.3
diff --git a/templates/ranking.html b/templates/ranking.html
index 5d50f55..5d8f820 100644
--- a/templates/ranking.html
+++ b/templates/ranking.html
@@ -57,7 +57,7 @@
         </div>
     </nav>
     <div>
-        <table class="table">
+        <table class="table table-striped table-borderd">
             <thead>
                 <tr>
                     <th scope="col">順位</th>

From feb93d9f711922a8bd9075ed90ebdad7ba4d2981 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 11:46:00 +0900
Subject: [PATCH 108/336] fix ranking

---
 app.py | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/app.py b/app.py
index e8dbff1..fe4959c 100644
--- a/app.py
+++ b/app.py
@@ -138,16 +138,15 @@ def ranking(page=1):
     users=db.session.query(User).order_by(desc(User.like_sum)).paginate(page, per_page, error_out=False)
 
     rank=dict({})
-    like_set=set([])
-    user=db.session.query(User).all()
+    user=db.session.query(User).order_by(desc(User.like_sum)).all()
     for  i in user:
-        like_set.add(i.like_sum)
+        rank[i.like_sum]=-1
     
-    like_set=list(like_set)
-    like_set=sorted(like_set,reverse=True)
-    
-    for i in range(0,len(like_set)):
-        rank[like_set[i]]=i+1
+    for i in range(0,len(user)):
+        if rank[user[i].like_sum]!=-1:
+            continue
+        else:
+            rank[user[i].like_sum]=i+1
 
     return render_template('ranking.html',users=users,page=page,per_page=per_page,rank=rank)
 

From 59389451c6754cc08780d59cea1df8fd744bdf61 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 11:49:16 +0900
Subject: [PATCH 109/336] fix rank

---
 app.py | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/app.py b/app.py
index fe4959c..26f543e 100644
--- a/app.py
+++ b/app.py
@@ -113,19 +113,18 @@ def user(id,page=1):
     edit_num=Editorial.query.filter_by(user_id=id).all()
     num=len(edit_num)
 
-    like_set=set([])
-    users=db.session.query(User).all()
-    for  i in users:
-        like_set.add(i.like_sum)
-    
-    like_set=list(like_set)
-    like_set=sorted(like_set,reverse=True)
-
-    rank=1
-    for i in range(0,len(like_set)):
-        if like_set[i]==user.like_sum:
-            rank=i+1
-            break
+    rank_list=dict({})
+    user=db.session.query(User).order_by(desc(User.like_sum)).all()
+
+    for  i in user:
+        rank_list[i.like_sum]=-1
+        
+    for i in range(0,len(user)):
+        if rank_list[user[i].like_sum]!=-1:
+            continue
+        else:
+            rank_list[user[i].like_sum]=i+1
+    rank=rank_list[user.like_sum]
     
     date_published=str(user.date_published)
     date_published=date_published.split(' ')[0]

From fefe93279f9ac61034db5d2bb366c0afc479cbe7 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 11:56:04 +0900
Subject: [PATCH 110/336] fix

---
 app.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/app.py b/app.py
index 26f543e..89ecd5d 100644
--- a/app.py
+++ b/app.py
@@ -113,18 +113,18 @@ def user(id,page=1):
     edit_num=Editorial.query.filter_by(user_id=id).all()
     num=len(edit_num)
 
-    rank_list=dict({})
-    user=db.session.query(User).order_by(desc(User.like_sum)).all()
+    rank_dict=dict({})
+    user_list=db.session.query(User).order_by(desc(User.like_sum)).all()
 
-    for  i in user:
-        rank_list[i.like_sum]=-1
+    for  i in user_list:
+        rank_dict[i.like_sum]=-1
         
-    for i in range(0,len(user)):
-        if rank_list[user[i].like_sum]!=-1:
+    for i in range(0,len(user_list)):
+        if rank_dict[user_list[i].like_sum]!=-1:
             continue
         else:
-            rank_list[user[i].like_sum]=i+1
-    rank=rank_list[user.like_sum]
+            rank_dict[user_list[i].like_sum]=i+1
+    rank=rank_dict[user.like_sum]
     
     date_published=str(user.date_published)
     date_published=date_published.split(' ')[0]

From 56e5701017735179fe841dd951f3a3e148d119b8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 12:15:36 +0900
Subject: [PATCH 111/336] add comment

---
 app.py | 41 ++++++++++++++++++++++++++++++++---------
 1 file changed, 32 insertions(+), 9 deletions(-)

diff --git a/app.py b/app.py
index 89ecd5d..2172386 100644
--- a/app.py
+++ b/app.py
@@ -7,7 +7,7 @@
 from rauth import OAuth1Service
 from config import app, db, service, login_manager,csrf
 
-
+#ユーザー情報
 class User(UserMixin,db.Model):
     id = db.Column(db.Integer, primary_key=True)
     username = db.Column(db.String(64), index=True)
@@ -17,7 +17,7 @@ class User(UserMixin,db.Model):
     twitter_id = db.Column(db.String(64), nullable=False, unique=True)
     like_sum=db.Column(db.Integer)
 
-
+#解法情報
 class Editorial(db.Model):
     id = db.Column(db.Integer, primary_key=True)
     username = db.Column(db.String(64))
@@ -29,11 +29,13 @@ class Editorial(db.Model):
     user_image_url = db.Column(db.String(1024), index=True)
     user_id=db.Column(db.Integer)
 
+#いいね情報
 class Like(db.Model):
     id=db.Column(db.Integer,primary_key=True)
     user_id=db.Column(db.Integer)
     edit_id=db.Column(db.Integer)
 
+#コンテスト名に含まれる空白などを取り除く
 def _normalize_contestname(contestname):
     if isinstance(contestname, str):
         contestname = contestname.strip()
@@ -56,15 +58,15 @@ def contest_get(page=1):
     if contestname==None:
         contestname=request.args.get('contestname','')
 
+    #ページネーション
     per_page = 10
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
-    print(type(editorials))
 
+    #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
     if current_user.is_authenticated==True:
         flag={}
         for edit in editorials.items:
             like=db.session.query(Like).filter(Like.edit_id==edit.id,Like.user_id==current_user.id).first()
-            print(like)
             if like:
                 flag[edit.id]=True
             else:
@@ -77,6 +79,7 @@ def contest_get(page=1):
 
 @app.route('/submited', methods=['POST'])
 def submit():
+    #DBに挿入する解法情報
     params = {
         'title': request.form.get('title'),
         'description': request.form.get('description'),
@@ -90,6 +93,7 @@ def submit():
 
     params['description']=params['description'].replace('\r\n','<br>')
 
+    #必要量記入されているかチェック
     if ((params['description'] is not None and params['description'] is not '') or (params['url'] is not None and params['url'] is not ''))\
           and params['title'] is not None and params['title'] is not '':
         newEditorial = Editorial(**params)
@@ -105,14 +109,17 @@ def submit():
 
 @app.route('/user/<int:id>/<int:page>',methods=['GET'])
 def user(id,page=1):
-    per_page=10
-
     user=User.query.filter_by(id=id).first()
+
+    #ページネーション
+    per_page=10
     edit=Editorial.query.filter_by(user_id=id).paginate(page, per_page, error_out=False)
 
+    #投稿数
     edit_num=Editorial.query.filter_by(user_id=id).all()
     num=len(edit_num)
 
+    #順位計算（繰り上がり処理付き）
     rank_dict=dict({})
     user_list=db.session.query(User).order_by(desc(User.like_sum)).all()
 
@@ -126,6 +133,7 @@ def user(id,page=1):
             rank_dict[user_list[i].like_sum]=i+1
     rank=rank_dict[user.like_sum]
     
+    #登録日(何時何分何秒は除いている)
     date_published=str(user.date_published)
     date_published=date_published.split(' ')[0]
 
@@ -133,9 +141,11 @@ def user(id,page=1):
 
 @app.route('/ranking/<int:page>')
 def ranking(page=1):
+    #ページネーション
     per_page = 100
     users=db.session.query(User).order_by(desc(User.like_sum)).paginate(page, per_page, error_out=False)
 
+    #順位計算（繰り上がり処理付き）
     rank=dict({})
     user=db.session.query(User).order_by(desc(User.like_sum)).all()
     for  i in user:
@@ -149,13 +159,13 @@ def ranking(page=1):
 
     return render_template('ranking.html',users=users,page=page,per_page=per_page,rank=rank)
 
-
+#Twitterログアウト処理
 @app.route('/logout')
 def logout():
     logout_user()
     return redirect(url_for('index'))
 
-
+#Twitterログイン処理
 @app.route('/oauth/twitter')
 def oauth_authorize():
     if not current_user.is_anonymous:
@@ -204,20 +214,29 @@ def oauth_callback():
     login_user(user, True)
     return redirect(url_for('index'))
 
+#いいね処理
 @app.route('/like',methods=['POST'])
 def like():
     id=request.form['id']
+
+    #いいねを既にされているかどうか
     flag=db.session.query(Like).filter(Like.edit_id==id ).filter(Like.user_id==current_user.id).first()
+    #解法情報
     edit=db.session.query(Editorial).filter(Editorial.id==id).first()
+    #ユーザー情報
     user=db.session.query(User).filter(User.id==edit.user_id).first()
 
-    #いいねされていた場合
+    #既にいいねされていた場合
     newLike=Like(user_id=current_user.id,edit_id=id)
     if flag!=None:
+        #解法情報のいいね数と投稿者の総いいね数を減らす
         edit.like-=1
         user.like_sum-=1
         db.session.delete(flag)
+
+    #まだいいねされていなかった場合
     else:
+        #解法情報のいいね数と投稿者の総いいね数を増やす
         edit.like+=1
         user.like_sum+=1
         db.session.add(newLike)
@@ -226,13 +245,16 @@ def like():
 
     return 'hoge'
 
+#解法消去処理
 @app.route('/delete',methods=['POST'])
 def delete():
     edit=db.session.query(Editorial).filter(Editorial.id==request.form['id']).first()
 
+    #投稿者の総いいね数から、消去する解法のいいね数を減らす
     user=db.session.query(User).filter(User.id==edit.user_id).first()
     user.like_sum-=edit.like
 
+    #いいねテーブルから消去する記事の情報を全て消す
     like=db.session.query(Like).filter(Like.edit_id==edit.id).all()
     for i in like:
         db.session.delete(i)
@@ -242,6 +264,7 @@ def delete():
 
     return 'hoge'
 
+#エラー処理
 @app.errorhandler(401)
 def authentication_failed(error):
     return render_template('401.html'),401

From cb6cfd07177b2d2c8023c8f856824dd2acd6025d Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 12:30:38 +0900
Subject: [PATCH 112/336] fix url

---
 README.md              |  8 ++++----
 app.py                 | 11 ++++-------
 templates/contest.html | 11 ++---------
 templates/search.html  | 21 +++++++++++----------
 4 files changed, 21 insertions(+), 30 deletions(-)

diff --git a/README.md b/README.md
index 27c706d..8e59c13 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,16 @@
 # AtCoderEditorials
 
-　AtCoderの非公式Webアプリです。
+　AtCoderのWebアプリです。
 
 # 説明
 
 　閲覧機能・投稿機能・いいね機能・ランキング機能を持ったWebアプリを目指します。<br>
 
 ・解法の投稿・解法ブログのURLの投稿<br>
-ー＞バラバラだった多くの解法が、１箇所に集まることを目指します。<br>
+->バラバラだった多くの解法が、１箇所に集まることを目指します。<br>
 
 ・いいね機能<br>
-ー＞いいね順に並び替えることで、より質の高い解法が探しやすくなることを目指します。<br>
+->いいね順に並び替えることで、より質の高い解法が探しやすくなることを目指します。<br>
 
 ・ランキング機能<br>
-ー＞最もわかりやすい解説者は誰なのかをハッキリさせることを目指します。<br>
+->最もわかりやすい解説者は誰なのかをハッキリさせることを目指します。<br>
diff --git a/app.py b/app.py
index 2172386..b4a3efb 100644
--- a/app.py
+++ b/app.py
@@ -51,15 +51,12 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest/<int:page>', methods=['GET','POST'])
-def contest_get(page=1):
-    contestname = _normalize_contestname(request.form.get('contestname'))
-    
-    if contestname==None:
-        contestname=request.args.get('contestname','')
+@app.route('/search/contest/<contestname>/<int:page>', methods=['GET','POST'])
+def contest_get(contestname,page=1):
+    contestname = _normalize_contestname(contestname)
 
     #ページネーション
-    per_page = 10
+    per_page = 1
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
 
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
diff --git a/templates/contest.html b/templates/contest.html
index 5efba68..9948f03 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -58,15 +58,9 @@
         </div>
     </nav>
 
-    {%if contestname == None%}
-    <div class="container-fluid">
-        <h1>{{request.args.get('contestname','')}}</h1>
-    </div>
-    {%else%}
     <div class="container-fluid">
         <h1>{{contestname}}</h1>
     </div>
-    {%endif%}
 
 
     <br> {% if current_user.is_authenticated== True %}
@@ -83,9 +77,8 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
-                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea> {%if contestname==None%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname','')}}">投稿</button> {%else%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
+                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea>
+                    <button type="submit" class="btn btn-info">投稿</button>{%endif%}
 
                 </form>
             </div>
diff --git a/templates/search.html b/templates/search.html
index 61a6152..679c9d6 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -69,19 +69,20 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
 
         <br>
 
-        <form id="search" method="POST" action="/search/contest/1">
+        <form id="search" method="POST" action="/search/contest/{{contest_name}}/1">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-            <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" />
+            <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" v-model="contest_name/>
         </form>
 
 
     </div>
 
-    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
+    <script src=" https://code.jquery.com/jquery-3.4.1.js " integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin=" anonymous "></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
-    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js" integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin="anonymous"></script>
-    <script type="text/javascript">
+    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js " integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin=" anonymous "></script>
+    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.0 "></script>
+    <script type="text/javascript ">
         (async function() {
 
             const contestName = [];
@@ -103,19 +104,19 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 autoFocus: true,
                 delay: 100,
                 minLength: 2,
-                appendTo: "menu",
+                appendTo: "menu ",
 
-                //候補をクリックすることでsubmitできるようにする<meta http-equiv="X-UA-Compatible" content="IE=edge">
+                //候補をクリックすることでsubmitできるようにする
                 select: function(event, ui) {
-                    $("#autocomplete_search").val(ui.item.label);
-                    $("#search").submit();
+                    $("#autocomplete_search ").val(ui.item.label);
+                    $("#search ").submit();
                 }
             });
         })();
 
         //input内でのEnter無効化
         $(function() {
-            $(document).on("keypress", "input:not(.allow_submit)", function(event) {
+            $(document).on("keypress ", "input:not(.allow_submit) ", function(event) {
                 return event.which !== 13;
             });
         });

From 829594e349dcdf7e154c785eb06779dbff5c5d12 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 12:32:08 +0900
Subject: [PATCH 113/336] fix

---
 templates/search.html | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/templates/search.html b/templates/search.html
index 679c9d6..9a10a54 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -120,6 +120,13 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 return event.which !== 13;
             });
         });
+
+        var app= new Vue({
+            el:'#app',
+            data:{
+                contest_name:'huga'
+            }
+        })
     </script>
 </body>
 

From 1b391083a994e5d8848f801529ea3ba953528a25 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 12:36:03 +0900
Subject: [PATCH 114/336] fix

---
 templates/search.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index 9a10a54..74259cc 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -121,12 +121,13 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             });
         });
 
+        })
+        
         var app= new Vue({
             el:'#app',
             data:{
                 contest_name:'huga'
             }
-        })
     </script>
 </body>
 

From 6063b384c2d598af83b849cc5588f3a0e7f913ad Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 12:39:31 +0900
Subject: [PATCH 115/336] fix

---
 templates/search.html | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 74259cc..9ab5751 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -83,7 +83,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
     <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js " integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin=" anonymous "></script>
     <script src="https://cdn.jsdelivr.net/npm/vue@2.6.0 "></script>
     <script type="text/javascript ">
-        (async function() {
+        (async function($) {
 
             const contestName = [];
             $.ajax({
@@ -112,7 +112,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                     $("#search ").submit();
                 }
             });
-        })();
+        })(jQuery);
 
         //input内でのEnter無効化
         $(function() {
@@ -121,13 +121,13 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             });
         });
 
-        })
         
         var app= new Vue({
             el:'#app',
             data:{
                 contest_name:'huga'
             }
+        )}
     </script>
 </body>
 

From d65d429da7d03f4fe2ea62d37870c8c996556cf1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 12:43:47 +0900
Subject: [PATCH 116/336] fix

---
 templates/search.html | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 9ab5751..49d359a 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -83,7 +83,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
     <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js " integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin=" anonymous "></script>
     <script src="https://cdn.jsdelivr.net/npm/vue@2.6.0 "></script>
     <script type="text/javascript ">
-        (async function($) {
+        (async function() {
 
             const contestName = [];
             $.ajax({
@@ -112,7 +112,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                     $("#search ").submit();
                 }
             });
-        })(jQuery);
+        })();
 
         //input内でのEnter無効化
         $(function() {
@@ -127,7 +127,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             data:{
                 contest_name:'huga'
             }
-        )}
+        })
     </script>
 </body>
 

From f34be37db67ab99687ad8d495dada5381d54a14f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 12:50:22 +0900
Subject: [PATCH 117/336] fix

---
 templates/search.html | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 49d359a..1e34ba3 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -71,12 +71,11 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
 
         <form id="search" method="POST" action="/search/contest/{{contest_name}}/1">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-            <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" v-model="contest_name/>
+            <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" v-model="contest_name" />
         </form>
 
 
     </div>
-
     <script src=" https://code.jquery.com/jquery-3.4.1.js " integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin=" anonymous "></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
@@ -121,11 +120,11 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             });
         });
 
-        
-        var app= new Vue({
-            el:'#app',
-            data:{
-                contest_name:'huga'
+
+        var app = new Vue({
+            el: '#app',
+            data: {
+                contest_name: 'huga'
             }
         })
     </script>

From 516214ecea0de84a4e354c0621bf0230b0d72216 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 12:55:39 +0900
Subject: [PATCH 118/336] fix

---
 app.py                 | 13 ++++++++-----
 templates/contest.html | 11 +++++++++--
 templates/search.html  | 28 ++++++++++------------------
 3 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/app.py b/app.py
index b4a3efb..fe4445e 100644
--- a/app.py
+++ b/app.py
@@ -51,12 +51,15 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest/<contestname>/<int:page>', methods=['GET','POST'])
-def contest_get(contestname,page=1):
-    contestname = _normalize_contestname(contestname)
+@app.route('/search/contest/<int:page>', methods=['GET','POST'])
+def contest_get(page=1):
+    contestname = _normalize_contestname(request.form.get('contestname'))
+    
+    if contestname==None:
+        contestname=request.args.get('contestname','')
 
     #ページネーション
-    per_page = 1
+    per_page = 10
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
 
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
@@ -156,7 +159,7 @@ def ranking(page=1):
 
     return render_template('ranking.html',users=users,page=page,per_page=per_page,rank=rank)
 
-#Twitterログアウト処理
+#Twitterログアウト
 @app.route('/logout')
 def logout():
     logout_user()
diff --git a/templates/contest.html b/templates/contest.html
index 9948f03..5efba68 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -58,9 +58,15 @@
         </div>
     </nav>
 
+    {%if contestname == None%}
+    <div class="container-fluid">
+        <h1>{{request.args.get('contestname','')}}</h1>
+    </div>
+    {%else%}
     <div class="container-fluid">
         <h1>{{contestname}}</h1>
     </div>
+    {%endif%}
 
 
     <br> {% if current_user.is_authenticated== True %}
@@ -77,8 +83,9 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
-                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea>
-                    <button type="submit" class="btn btn-info">投稿</button>{%endif%}
+                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea> {%if contestname==None%}
+                    <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname','')}}">投稿</button> {%else%}
+                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
 
                 </form>
             </div>
diff --git a/templates/search.html b/templates/search.html
index 1e34ba3..b62245b 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -69,19 +69,19 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
 
         <br>
 
-        <form id="search" method="POST" action="/search/contest/{{contest_name}}/1">
+        <form id="search" method="POST" action="/search/contest/1">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-            <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" v-model="contest_name" />
+            <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" />
         </form>
 
 
     </div>
-    <script src=" https://code.jquery.com/jquery-3.4.1.js " integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin=" anonymous "></script>
+
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
-    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js " integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin=" anonymous "></script>
-    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.0 "></script>
-    <script type="text/javascript ">
+    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js" integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin="anonymous"></script>
+    <script type="text/javascript">
         (async function() {
 
             const contestName = [];
@@ -103,30 +103,22 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 autoFocus: true,
                 delay: 100,
                 minLength: 2,
-                appendTo: "menu ",
+                appendTo: "menu",
 
                 //候補をクリックすることでsubmitできるようにする
                 select: function(event, ui) {
-                    $("#autocomplete_search ").val(ui.item.label);
-                    $("#search ").submit();
+                    $("#autocomplete_search").val(ui.item.label);
+                    $("#search").submit();
                 }
             });
         })();
 
         //input内でのEnter無効化
         $(function() {
-            $(document).on("keypress ", "input:not(.allow_submit) ", function(event) {
+            $(document).on("keypress", "input:not(.allow_submit)", function(event) {
                 return event.which !== 13;
             });
         });
-
-
-        var app = new Vue({
-            el: '#app',
-            data: {
-                contest_name: 'huga'
-            }
-        })
     </script>
 </body>
 

From c9d8244e623d46e14c8a10df3bb6b943b8999e66 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 17:09:42 +0900
Subject: [PATCH 119/336] fix url

---
 app.py                 |  9 +++------
 templates/contest.html | 24 ++++++++----------------
 templates/search.html  |  7 ++++++-
 templates/user.html    |  2 ++
 4 files changed, 19 insertions(+), 23 deletions(-)

diff --git a/app.py b/app.py
index fe4445e..c99657f 100644
--- a/app.py
+++ b/app.py
@@ -51,12 +51,9 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest/<int:page>', methods=['GET','POST'])
-def contest_get(page=1):
-    contestname = _normalize_contestname(request.form.get('contestname'))
-    
-    if contestname==None:
-        contestname=request.args.get('contestname','')
+@app.route('/search/contest/<str:contestname>/<int:page>', methods=['GET','POST'])
+def contest_get(contestname,page=1):
+    contestname = _normalize_contestname(contestname)
 
     #ページネーション
     per_page = 10
diff --git a/templates/contest.html b/templates/contest.html
index 5efba68..5b4d2f7 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -58,15 +58,9 @@
         </div>
     </nav>
 
-    {%if contestname == None%}
-    <div class="container-fluid">
-        <h1>{{request.args.get('contestname','')}}</h1>
-    </div>
-    {%else%}
     <div class="container-fluid">
         <h1>{{contestname}}</h1>
     </div>
-    {%endif%}
 
 
     <br> {% if current_user.is_authenticated== True %}
@@ -159,16 +153,14 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
     <div class="container-fluid h4">
 
         <ul class="pagination">
-            {% if editorials.has_prev %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',''))}}">
-        {%else%}
-        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname)}}">
-        {%endif%}
-        << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname','')) }}">
-                {%else%}
-                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname)}}">
-        {%endif%}
+            {% if editorials.has_prev %}
+            <li class="page-item">
+                <a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num)}}">
+
+                    << 前のページ</a>
+            </li> {% endif %}{% if editorials.has_next %}
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num)}}">
+
          次のページ >></a></li>{% endif %}
         </ul>
     </div>
diff --git a/templates/search.html b/templates/search.html
index b62245b..5bf71a3 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -69,7 +69,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
 
         <br>
 
-        <form id="search" method="POST" action="/search/contest/1">
+        <form id="search" method="POST" action="">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
             <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" />
         </form>
@@ -119,6 +119,11 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 return event.which !== 13;
             });
         });
+
+        function check() {
+            document.ansform.action = "/search/contest/" + document.ans.value + "/1";
+            document.ansform.submit();
+        }
     </script>
 </body>
 
diff --git a/templates/user.html b/templates/user.html
index e51c921..f4960fa 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -73,10 +73,12 @@ <h4> いいね数 :{{user.like_sum}}</h4>
                 <h4> 投稿数　 :{{num}}</h4>
             </div>
             <div>
+                {%if current_user.is_authenticated==True%}
                 <div class="twitter">
                     <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{rank}}位になりました！" data-url="https://atcoder-editorials.herokuapp.com/user/{{user.id}}/1" data-lang="ja">
                     </a>
                 </div>
+                {%endif%}
             </div>
         </div>
     </div>

From 6559e00619b5c91be7184ec6431ab54d6f09690e Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 17:21:27 +0900
Subject: [PATCH 120/336] fix

---
 templates/search.html | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 5bf71a3..fd9d99e 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -69,9 +69,9 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
 
         <br>
 
-        <form id="search" method="POST" action="">
+        <form id="search" name="form" method="POST" action="" onsubmit="check()">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-            <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" />
+            <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" value="" />
         </form>
 
 
@@ -121,8 +121,8 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
         });
 
         function check() {
-            document.ansform.action = "/search/contest/" + document.ans.value + "/1";
-            document.ansform.submit();
+            document.form.action = "/search/contest/" + document.contestname.value + "/1";
+            document.form.submit();
         }
     </script>
 </body>

From e22f11cd8442c2b93793d822c92c081f660f43f8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 17:24:06 +0900
Subject: [PATCH 121/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index c99657f..7e748b0 100644
--- a/app.py
+++ b/app.py
@@ -51,7 +51,7 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest/<str:contestname>/<int:page>', methods=['GET','POST'])
+@app.route('/search/contest/<contestname>/<int:page>', methods=['GET','POST'])
 def contest_get(contestname,page=1):
     contestname = _normalize_contestname(contestname)
 

From 1ca4b38539e440b8348ee4210ae96f4b7835aadf Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 17:30:27 +0900
Subject: [PATCH 122/336] fix

---
 templates/search.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index fd9d99e..5c7045c 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -121,7 +121,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
         });
 
         function check() {
-            document.form.action = "/search/contest/" + document.contestname.value + "/1";
+            document.form.action = "/search/contest/" + document.form.value + "/1";
             document.form.submit();
         }
     </script>

From 3c1b5a09ba535876c6ff06d3db98e21b5c65e9ef Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 17:37:00 +0900
Subject: [PATCH 123/336] fix

---
 templates/search.html | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index 5c7045c..efc6182 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -121,7 +121,9 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
         });
 
         function check() {
-            document.form.action = "/search/contest/" + document.form.value + "/1";
+            let contest_name = document.getElementById('autocomplete_search').innerText;
+            document.form.action = "/search/contest/" + contest_name + "/1";
+            console.log(document.form.value)
             document.form.submit();
         }
     </script>

From f64a31e8f1f3cb06f901ff064ec104cf61d8ad90 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 17:44:14 +0900
Subject: [PATCH 124/336] fix

---
 app.py                | 2 +-
 templates/search.html | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/app.py b/app.py
index 7e748b0..09a9eeb 100644
--- a/app.py
+++ b/app.py
@@ -51,7 +51,7 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest/<contestname>/<int:page>', methods=['GET','POST'])
+@app.route('/search/contest/<contestname>/<int:page>', methods=['GET'])
 def contest_get(contestname,page=1):
     contestname = _normalize_contestname(contestname)
 
diff --git a/templates/search.html b/templates/search.html
index efc6182..dc9daf9 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -69,7 +69,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
 
         <br>
 
-        <form id="search" name="form" method="POST" action="" onsubmit="check()">
+        <form id="search" name="form" method="GET" action="" onsubmit="check()">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
             <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" value="" />
         </form>
@@ -123,8 +123,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
         function check() {
             let contest_name = document.getElementById('autocomplete_search').innerText;
             document.form.action = "/search/contest/" + contest_name + "/1";
-            console.log(document.form.value)
-            document.form.submit();
+            console.log(document.form.action)
         }
     </script>
 </body>

From 1b2db1a329d380ca9a280ffa4b8961ab1e79dee5 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 17:47:41 +0900
Subject: [PATCH 125/336] fix

---
 app.py                 |  9 ++++++---
 templates/contest.html | 24 ++++++++++++++++--------
 templates/search.html  | 10 ++--------
 3 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/app.py b/app.py
index 09a9eeb..fe4445e 100644
--- a/app.py
+++ b/app.py
@@ -51,9 +51,12 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest/<contestname>/<int:page>', methods=['GET'])
-def contest_get(contestname,page=1):
-    contestname = _normalize_contestname(contestname)
+@app.route('/search/contest/<int:page>', methods=['GET','POST'])
+def contest_get(page=1):
+    contestname = _normalize_contestname(request.form.get('contestname'))
+    
+    if contestname==None:
+        contestname=request.args.get('contestname','')
 
     #ページネーション
     per_page = 10
diff --git a/templates/contest.html b/templates/contest.html
index 5b4d2f7..5efba68 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -58,9 +58,15 @@
         </div>
     </nav>
 
+    {%if contestname == None%}
+    <div class="container-fluid">
+        <h1>{{request.args.get('contestname','')}}</h1>
+    </div>
+    {%else%}
     <div class="container-fluid">
         <h1>{{contestname}}</h1>
     </div>
+    {%endif%}
 
 
     <br> {% if current_user.is_authenticated== True %}
@@ -153,14 +159,16 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
     <div class="container-fluid h4">
 
         <ul class="pagination">
-            {% if editorials.has_prev %}
-            <li class="page-item">
-                <a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num)}}">
-
-                    << 前のページ</a>
-            </li> {% endif %}{% if editorials.has_next %}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num)}}">
-
+            {% if editorials.has_prev %} {%if contestname==None%}
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',''))}}">
+        {%else%}
+        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname)}}">
+        {%endif%}
+        << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname','')) }}">
+                {%else%}
+                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname)}}">
+        {%endif%}
          次のページ >></a></li>{% endif %}
         </ul>
     </div>
diff --git a/templates/search.html b/templates/search.html
index dc9daf9..b62245b 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -69,9 +69,9 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
 
         <br>
 
-        <form id="search" name="form" method="GET" action="" onsubmit="check()">
+        <form id="search" method="POST" action="/search/contest/1">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-            <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" value="" />
+            <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" />
         </form>
 
 
@@ -119,12 +119,6 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 return event.which !== 13;
             });
         });
-
-        function check() {
-            let contest_name = document.getElementById('autocomplete_search').innerText;
-            document.form.action = "/search/contest/" + contest_name + "/1";
-            console.log(document.form.action)
-        }
     </script>
 </body>
 

From 543794fa6331efc2140bc95bc77f94150bbdbff6 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 20:57:27 +0900
Subject: [PATCH 126/336] fix

---
 templates/search.html | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index b62245b..2e2e963 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -111,14 +111,14 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                     $("#search").submit();
                 }
             });
-        })();
 
-        //input内でのEnter無効化
-        $(function() {
-            $(document).on("keypress", "input:not(.allow_submit)", function(event) {
-                return event.which !== 13;
+            //input内でのEnter無効化
+            $(function() {
+                $(document).on("keypress", "input:not(.allow_submit)", function(event) {
+                    return event.which !== 13;
+                });
             });
-        });
+        })();
     </script>
 </body>
 

From 356be62b4e5d72d43fa00c75a6bf8e760e51844d Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 21:04:47 +0900
Subject: [PATCH 127/336] fix

---
 templates/search.html | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 2e2e963..ce7a19f 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -104,12 +104,6 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 delay: 100,
                 minLength: 2,
                 appendTo: "menu",
-
-                //候補をクリックすることでsubmitできるようにする
-                select: function(event, ui) {
-                    $("#autocomplete_search").val(ui.item.label);
-                    $("#search").submit();
-                }
             });
 
             //input内でのEnter無効化
@@ -118,6 +112,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                     return event.which !== 13;
                 });
             });
+
         })();
     </script>
 </body>

From e210c1e0e6f03e5ca39303653031ece6acefe1dd Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 23 Aug 2019 21:09:39 +0900
Subject: [PATCH 128/336] fix

---
 templates/search.html | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index ce7a19f..f9f8c17 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -80,7 +80,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
     <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
-    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js" integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin="anonymous"></script>
+    <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js" integrity="sha256-DI6NdAhhFRnO2k51mumYeDShet3I8AKCQf/tf7ARNhI=" crossorigin="anonymous"></script>
     <script type="text/javascript">
         (async function() {
 
@@ -104,6 +104,12 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 delay: 100,
                 minLength: 2,
                 appendTo: "menu",
+
+                //候補をクリックすることでsubmitできるようにする
+                select: function(event, ui) {
+                    $("#autocomplete_search").val(ui.item.label);
+                    $("#search").submit();
+                }
             });
 
             //input内でのEnter無効化

From bac90c13e2bb88b2cc33f70ea8ab61c5f30be31b Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 12:05:34 +0900
Subject: [PATCH 129/336] fix DB

---
 app.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index fe4445e..62a10a1 100644
--- a/app.py
+++ b/app.py
@@ -23,8 +23,8 @@ class Editorial(db.Model):
     username = db.Column(db.String(64))
     contestname = db.Column(db.String(64))
     title = db.Column(db.String(64))
-    url = db.Column(db.String(120))
-    description = db.Column(db.String(2048))
+    url = db.Column(db.String(1024))
+    description = db.Column(db.String(3000))
     like = db.Column(db.Integer)
     user_image_url = db.Column(db.String(1024), index=True)
     user_id=db.Column(db.Integer)

From 51db6825c54872a7e9d7b100327516ab123343c7 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 13:51:53 +0900
Subject: [PATCH 130/336] fix url

---
 templates/user.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index f4960fa..7d94d50 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -94,7 +94,7 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
 
                     <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
                         {% if e.url!=None%}
-                        <a href={{edit.url}}>{{e.url}}</a> {%endif%}
+                        <a href={{e.url}}>{{e.url}}</a> {%endif%}
                     </div>
 
                     <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">

From 1f86db2b8ac86e5522aeb3f3eab4fa20539bd89a Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 14:09:39 +0900
Subject: [PATCH 131/336] fix

---
 templates/user.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/user.html b/templates/user.html
index 7d94d50..a0a0ab8 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -115,11 +115,11 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
         <ul class="pagination">
             {% if edit.has_prev %}
             <li class="page-item">
-                <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=current_user.id)}}">前のページ</a>
+                <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=edit.user_id)}}">前のページ</a>
             </li>
             {% endif %} {% if edit.has_next %}
             <li class="page-item">
-                <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=current_user.id)}}">次のページ</a>
+                <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=edit.user_id)}}">次のページ</a>
             </li>
             {% endif %}
         </ul>

From d48f28517f286fec75d6e8d3b7f0b6afacbd6201 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 14:11:02 +0900
Subject: [PATCH 132/336] fix

---
 templates/user.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/user.html b/templates/user.html
index a0a0ab8..7d94d50 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -115,11 +115,11 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
         <ul class="pagination">
             {% if edit.has_prev %}
             <li class="page-item">
-                <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=edit.user_id)}}">前のページ</a>
+                <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=current_user.id)}}">前のページ</a>
             </li>
             {% endif %} {% if edit.has_next %}
             <li class="page-item">
-                <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=edit.user_id)}}">次のページ</a>
+                <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=current_user.id)}}">次のページ</a>
             </li>
             {% endif %}
         </ul>

From ce5cbec5eb4b3754d20171c722f2a56bce50a26b Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 17:32:15 +0900
Subject: [PATCH 133/336] fix

---
 .gitignore | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index d3597ee..8f78f5b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -128,4 +128,4 @@ bin/
 include/
 *.cfg
 migrations/
-lib64
\ No newline at end of file
+lib64

From 37f802876675142db11932f7a066ffd21f760f59 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 18:12:29 +0900
Subject: [PATCH 134/336] fix

---
 config.py           | 4 ++++
 templates/user.html | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/config.py b/config.py
index bf3a099..a16cdb9 100644
--- a/config.py
+++ b/config.py
@@ -5,8 +5,12 @@
 from datetime import datetime
 from flask_wtf.csrf import CSRFProtect
 from rauth import OAuth1Service
+from dotenv import load_dotenv
+from os.path import join, dirname
 import os
 
+load_dotenv('.env')
+
 app=Flask(__name__)
 app.secret_key=os.environ['SECRET_KEY']
 app.config['SQLALCHEMY_TRACK_MODIFICATIONS']=False
diff --git a/templates/user.html b/templates/user.html
index 7d94d50..a82f4bb 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -115,11 +115,11 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
         <ul class="pagination">
             {% if edit.has_prev %}
             <li class="page-item">
-                <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=current_user.id)}}">前のページ</a>
+                <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=user.id)}}">前のページ</a>
             </li>
             {% endif %} {% if edit.has_next %}
             <li class="page-item">
-                <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=current_user.id)}}">次のページ</a>
+                <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=user.id)}}">次のページ</a>
             </li>
             {% endif %}
         </ul>

From 4ec51d943c9eaa67e8e37105b8477ed96b0e6199 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 18:33:21 +0900
Subject: [PATCH 135/336] color change

---
 templates/ranking.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/ranking.html b/templates/ranking.html
index 5d8f820..d6acd9e 100644
--- a/templates/ranking.html
+++ b/templates/ranking.html
@@ -57,7 +57,7 @@
         </div>
     </nav>
     <div>
-        <table class="table table-striped table-borderd">
+        <table class="table table-borderd">
             <thead>
                 <tr>
                     <th scope="col">順位</th>

From 8017d84f85edb662ee727c23841eae528c9aac8d Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 18:36:11 +0900
Subject: [PATCH 136/336] color change

---
 templates/ranking.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/ranking.html b/templates/ranking.html
index d6acd9e..a550bb7 100644
--- a/templates/ranking.html
+++ b/templates/ranking.html
@@ -58,7 +58,7 @@
     </nav>
     <div>
         <table class="table table-borderd">
-            <thead>
+            <thead class="thead-light">
                 <tr>
                     <th scope="col">順位</th>
                     <th scope="col">名前</th>

From ae35276160024195f3d5acdd2d5c506847b2ec3b Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 19:27:38 +0900
Subject: [PATCH 137/336] change search : contest_base -> problem_base

---
 templates/search.html | 40 +++++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 15 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index f9f8c17..566cd50 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -87,7 +87,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             const contestName = [];
             $.ajax({
                 type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
+                url: 'https://kenkoooo.com/atcoder/resources/problems.json',
                 dataType: 'json',
                 success: function(json) {
                     var len = json.length;
@@ -97,20 +97,30 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 }
             });
 
-            //検索候補を表示する。
-            $('#autocomplete_search').autocomplete({
-                source: contestName,
-                autoFocus: true,
-                delay: 100,
-                minLength: 2,
-                appendTo: "menu",
-
-                //候補をクリックすることでsubmitできるようにする
-                select: function(event, ui) {
-                    $("#autocomplete_search").val(ui.item.label);
-                    $("#search").submit();
-                }
-            });
+            $(function() {
+                $('#autocomplete_search').autocomplete({
+                    source: contestName,
+                    autoFocus: true,
+                    delay: 100,
+                    minLength: 2,
+                    appendTo: "menu",
+
+                    //候補をクリックすることでsubmitできるようにする
+                    select: function(event, ui) {
+                        $("#autocomplete_search").val(ui.item.label);
+                        $("#search").submit();
+                    }
+                });
+
+                $('#autocomplete_search').on('compositionstart', function() {
+                    $('#autocomplete_search').autocomplete('disable');
+                });
+
+                //日本語入力が確定したら有効化
+                $('#autocomplete_search').on('compositionend', function() {
+                    $('#autocomplete_search').autocomplete('enable').autocomplete('search');
+                });
+            })
 
             //input内でのEnter無効化
             $(function() {

From 506acff451f1e0f6be262d48693b093f6775fa9e Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 19:31:23 +0900
Subject: [PATCH 138/336] fix

---
 templates/search.html | 40 +++++++++++++++-------------------------
 1 file changed, 15 insertions(+), 25 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 566cd50..f9f8c17 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -87,7 +87,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             const contestName = [];
             $.ajax({
                 type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/problems.json',
+                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
                 dataType: 'json',
                 success: function(json) {
                     var len = json.length;
@@ -97,30 +97,20 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 }
             });
 
-            $(function() {
-                $('#autocomplete_search').autocomplete({
-                    source: contestName,
-                    autoFocus: true,
-                    delay: 100,
-                    minLength: 2,
-                    appendTo: "menu",
-
-                    //候補をクリックすることでsubmitできるようにする
-                    select: function(event, ui) {
-                        $("#autocomplete_search").val(ui.item.label);
-                        $("#search").submit();
-                    }
-                });
-
-                $('#autocomplete_search').on('compositionstart', function() {
-                    $('#autocomplete_search').autocomplete('disable');
-                });
-
-                //日本語入力が確定したら有効化
-                $('#autocomplete_search').on('compositionend', function() {
-                    $('#autocomplete_search').autocomplete('enable').autocomplete('search');
-                });
-            })
+            //検索候補を表示する。
+            $('#autocomplete_search').autocomplete({
+                source: contestName,
+                autoFocus: true,
+                delay: 100,
+                minLength: 2,
+                appendTo: "menu",
+
+                //候補をクリックすることでsubmitできるようにする
+                select: function(event, ui) {
+                    $("#autocomplete_search").val(ui.item.label);
+                    $("#search").submit();
+                }
+            });
 
             //input内でのEnter無効化
             $(function() {

From f3479722d24d2819604de87db47a0f1463bb40d6 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 19:40:47 +0900
Subject: [PATCH 139/336] fix

---
 templates/search.html | 37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index f9f8c17..4d96bcf 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -87,7 +87,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             const contestName = [];
             $.ajax({
                 type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
+                url: 'https://kenkoooo.com/atcoder/resources/problems.json',
                 dataType: 'json',
                 success: function(json) {
                     var len = json.length;
@@ -97,20 +97,27 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 }
             });
 
-            //検索候補を表示する。
-            $('#autocomplete_search').autocomplete({
-                source: contestName,
-                autoFocus: true,
-                delay: 100,
-                minLength: 2,
-                appendTo: "menu",
-
-                //候補をクリックすることでsubmitできるようにする
-                select: function(event, ui) {
-                    $("#autocomplete_search").val(ui.item.label);
-                    $("#search").submit();
-                }
-            });
+            $(function() {
+                $('#autocomplete_search').autocomplete({
+                    source: contestName,
+                    autoFocus: true,
+                    delay: 100,
+                    minLength: 2,
+                    appendTo: "menu",
+                    //候補をクリックすることでsubmitできるようにする
+                    select: function(event, ui) {
+                        $("#autocomplete_search").val(ui.item.label);
+                        $("#search").submit();
+                    }
+                });
+                $('#autocomplete_search').on('compositionstart', function() {
+                    $('#autocomplete_search').autocomplete('disable');
+                });
+                //日本語入力が確定したら有効化
+                $('#autocomplete_search').on('compositionend', function() {
+                    $('#autocomplete_search').autocomplete('enable').autocomplete('search');
+                });
+            })
 
             //input内でのEnter無効化
             $(function() {

From 4d877fe74539e77d320814183af442aa46f4a4b1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 19:42:54 +0900
Subject: [PATCH 140/336] fix

---
 templates/search.html | 37 +++++++++++++++----------------------
 1 file changed, 15 insertions(+), 22 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 4d96bcf..f9f8c17 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -87,7 +87,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             const contestName = [];
             $.ajax({
                 type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/problems.json',
+                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
                 dataType: 'json',
                 success: function(json) {
                     var len = json.length;
@@ -97,27 +97,20 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 }
             });
 
-            $(function() {
-                $('#autocomplete_search').autocomplete({
-                    source: contestName,
-                    autoFocus: true,
-                    delay: 100,
-                    minLength: 2,
-                    appendTo: "menu",
-                    //候補をクリックすることでsubmitできるようにする
-                    select: function(event, ui) {
-                        $("#autocomplete_search").val(ui.item.label);
-                        $("#search").submit();
-                    }
-                });
-                $('#autocomplete_search').on('compositionstart', function() {
-                    $('#autocomplete_search').autocomplete('disable');
-                });
-                //日本語入力が確定したら有効化
-                $('#autocomplete_search').on('compositionend', function() {
-                    $('#autocomplete_search').autocomplete('enable').autocomplete('search');
-                });
-            })
+            //検索候補を表示する。
+            $('#autocomplete_search').autocomplete({
+                source: contestName,
+                autoFocus: true,
+                delay: 100,
+                minLength: 2,
+                appendTo: "menu",
+
+                //候補をクリックすることでsubmitできるようにする
+                select: function(event, ui) {
+                    $("#autocomplete_search").val(ui.item.label);
+                    $("#search").submit();
+                }
+            });
 
             //input内でのEnter無効化
             $(function() {

From 517e249f536247acce333a3b2d0dc2c2e1bfd201 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 19:53:46 +0900
Subject: [PATCH 141/336] fix

---
 templates/search.html | 51 ++++++++++++++++++++++++-------------------
 1 file changed, 29 insertions(+), 22 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index f9f8c17..87b16e2 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -85,34 +85,41 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
         (async function() {
 
             const contestName = [];
-            $.ajax({
-                type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
-                dataType: 'json',
-                success: function(json) {
+
+            fetch('https://kenkoooo.com/atcoder/resources/problems.json')
+                .then(function(response) {
+                    return response.json();
+                })
+                .then(function(json) {
                     var len = json.length;
                     for (var i = 0; i < len; i++) {
                         contestName.push(json[i].title);
                     }
-                }
-            });
+                });
 
             //検索候補を表示する。
-            $('#autocomplete_search').autocomplete({
-                source: contestName,
-                autoFocus: true,
-                delay: 100,
-                minLength: 2,
-                appendTo: "menu",
-
-                //候補をクリックすることでsubmitできるようにする
-                select: function(event, ui) {
-                    $("#autocomplete_search").val(ui.item.label);
-                    $("#search").submit();
-                }
-            });
-
-            //input内でのEnter無効化
+            $(function() {
+                    $('#autocomplete_search').autocomplete({
+                        source: contestName,
+                        autoFocus: true,
+                        delay: 100,
+                        minLength: 2,
+                        appendTo: "menu",
+                        //候補をクリックすることでsubmitできるようにする
+                        select: function(event, ui) {
+                            $("#autocomplete_search").val(ui.item.label);
+                            $("#search").submit();
+                        }
+                    });
+                    $('#autocomplete_search').on('compositionstart', function() {
+                        $('#autocomplete_search').autocomplete('disable');
+                    });
+                    //日本語入力が確定したら有効化
+                    $('#autocomplete_search').on('compositionend', function() {
+                        $('#autocomplete_search').autocomplete('enable').autocomplete('search');
+                    });
+                })
+                //input内でのEnter無効化
             $(function() {
                 $(document).on("keypress", "input:not(.allow_submit)", function(event) {
                     return event.which !== 13;

From 0d8f57b27f6ea5efd32e3df1eefafd7a59e6cebe Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 19:55:12 +0900
Subject: [PATCH 142/336] fix

---
 templates/search.html | 51 +++++++++++++++++++------------------------
 1 file changed, 22 insertions(+), 29 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 87b16e2..f9f8c17 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -85,41 +85,34 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
         (async function() {
 
             const contestName = [];
-
-            fetch('https://kenkoooo.com/atcoder/resources/problems.json')
-                .then(function(response) {
-                    return response.json();
-                })
-                .then(function(json) {
+            $.ajax({
+                type: 'GET',
+                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
+                dataType: 'json',
+                success: function(json) {
                     var len = json.length;
                     for (var i = 0; i < len; i++) {
                         contestName.push(json[i].title);
                     }
-                });
+                }
+            });
 
             //検索候補を表示する。
-            $(function() {
-                    $('#autocomplete_search').autocomplete({
-                        source: contestName,
-                        autoFocus: true,
-                        delay: 100,
-                        minLength: 2,
-                        appendTo: "menu",
-                        //候補をクリックすることでsubmitできるようにする
-                        select: function(event, ui) {
-                            $("#autocomplete_search").val(ui.item.label);
-                            $("#search").submit();
-                        }
-                    });
-                    $('#autocomplete_search').on('compositionstart', function() {
-                        $('#autocomplete_search').autocomplete('disable');
-                    });
-                    //日本語入力が確定したら有効化
-                    $('#autocomplete_search').on('compositionend', function() {
-                        $('#autocomplete_search').autocomplete('enable').autocomplete('search');
-                    });
-                })
-                //input内でのEnter無効化
+            $('#autocomplete_search').autocomplete({
+                source: contestName,
+                autoFocus: true,
+                delay: 100,
+                minLength: 2,
+                appendTo: "menu",
+
+                //候補をクリックすることでsubmitできるようにする
+                select: function(event, ui) {
+                    $("#autocomplete_search").val(ui.item.label);
+                    $("#search").submit();
+                }
+            });
+
+            //input内でのEnter無効化
             $(function() {
                 $(document).on("keypress", "input:not(.allow_submit)", function(event) {
                     return event.which !== 13;

From 07f92aaab31d6f59de9e98632b046e56571f74dc Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 21:45:50 +0900
Subject: [PATCH 143/336] fix

---
 templates/search.html | 55 ++++++++++++++++++++++++-------------------
 1 file changed, 31 insertions(+), 24 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index f9f8c17..82b9892 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -85,32 +85,39 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
         (async function() {
 
             const contestName = [];
-            $.ajax({
-                type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
-                dataType: 'json',
-                success: function(json) {
-                    var len = json.length;
-                    for (var i = 0; i < len; i++) {
-                        contestName.push(json[i].title);
-                    }
+            $.getJSON('https://kenkoooo.com/atcoder/resources/problems.json', function(json) {
+                var len = json.length;
+                for (var i = 0; i < len; i++) {
+                    contestName.push(json[i].title);
                 }
-            });
+            })
 
-            //検索候補を表示する。
-            $('#autocomplete_search').autocomplete({
-                source: contestName,
-                autoFocus: true,
-                delay: 100,
-                minLength: 2,
-                appendTo: "menu",
-
-                //候補をクリックすることでsubmitできるようにする
-                select: function(event, ui) {
-                    $("#autocomplete_search").val(ui.item.label);
-                    $("#search").submit();
-                }
-            });
+            $(function() {
+                //検索候補を表示する。
+                $('#autocomplete_search').autocomplete({
+                    source: contestName,
+                    autoFocus: true,
+                    delay: 100,
+                    minLength: 2,
+                    appendTo: "menu",
+
+                    //候補をクリックすることでsubmitできるようにする
+                    select: function(event, ui) {
+                        $("#autocomplete_search").val(ui.item.label);
+                        $("#search").submit();
+                    }
+                });
+
+                //日本語入力をスタートしたら無効化
+                $('#autocomplete_search').on('compositionstart', function() {
+                    $('#autocomplete_search').autocomplete('disable');
+                });
+
+                //日本語入力が確定したら有効化
+                $('#autocomplete_search').on('compositionend', function() {
+                    $('#autocomplete_search').autocomplete('enable').autocomplete('search');
+                });
+            })
 
             //input内でのEnter無効化
             $(function() {

From 6ffdc6e2658a4f7032b9255fbfba1f94fbc333e2 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 21:47:34 +0900
Subject: [PATCH 144/336] fix

---
 templates/search.html | 55 +++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 31 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 82b9892..6b46dd4 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -85,39 +85,32 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
         (async function() {
 
             const contestName = [];
-            $.getJSON('https://kenkoooo.com/atcoder/resources/problems.json', function(json) {
-                var len = json.length;
-                for (var i = 0; i < len; i++) {
-                    contestName.push(json[i].title);
-                }
-            })
-
-            $(function() {
-                //検索候補を表示する。
-                $('#autocomplete_search').autocomplete({
-                    source: contestName,
-                    autoFocus: true,
-                    delay: 100,
-                    minLength: 2,
-                    appendTo: "menu",
-
-                    //候補をクリックすることでsubmitできるようにする
-                    select: function(event, ui) {
-                        $("#autocomplete_search").val(ui.item.label);
-                        $("#search").submit();
+            $.ajax({
+                type: 'GET',
+                url: 'https://kenkoooo.com/atcoder/resources/problems.json',
+                dataType: 'json',
+                success: function(json) {
+                    var len = json.length;
+                    for (var i = 0; i < len; i++) {
+                        contestName.push(json[i].title);
                     }
-                });
-
-                //日本語入力をスタートしたら無効化
-                $('#autocomplete_search').on('compositionstart', function() {
-                    $('#autocomplete_search').autocomplete('disable');
-                });
+                }
+            });
 
-                //日本語入力が確定したら有効化
-                $('#autocomplete_search').on('compositionend', function() {
-                    $('#autocomplete_search').autocomplete('enable').autocomplete('search');
-                });
-            })
+            //検索候補を表示する。
+            $('#autocomplete_search').autocomplete({
+                source: contestName,
+                autoFocus: true,
+                delay: 100,
+                minLength: 2,
+                appendTo: "menu",
+
+                //候補をクリックすることでsubmitできるようにする
+                select: function(event, ui) {
+                    $("#autocomplete_search").val(ui.item.label);
+                    $("#search").submit();
+                }
+            });
 
             //input内でのEnter無効化
             $(function() {

From 45f4fed97f4a44c2ec8d9f35d1b87c1b292c8aae Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 21:51:37 +0900
Subject: [PATCH 145/336] fix

---
 templates/search.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index 6b46dd4..f9f8c17 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -87,7 +87,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             const contestName = [];
             $.ajax({
                 type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/problems.json',
+                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
                 dataType: 'json',
                 success: function(json) {
                     var len = json.length;

From 45d77997aa8701c6b575977935534b5570682d6c Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 22:03:44 +0900
Subject: [PATCH 146/336] fix

---
 templates/.htaccess   |  1 +
 templates/search.html | 28 +++++++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 templates/.htaccess

diff --git a/templates/.htaccess b/templates/.htaccess
new file mode 100644
index 0000000..8203d39
--- /dev/null
+++ b/templates/.htaccess
@@ -0,0 +1 @@
+Header append Access-Control-Allow-Origin: "*"
\ No newline at end of file
diff --git a/templates/search.html b/templates/search.html
index f9f8c17..c2edfca 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -87,7 +87,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             const contestName = [];
             $.ajax({
                 type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
+                url: 'https://kenkoooo.com/atcoder/resources/problems.json',
                 dataType: 'json',
                 success: function(json) {
                     var len = json.length;
@@ -112,6 +112,32 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 }
             });
 
+            //検索候補を表示する。
+            $('#autocomplete_search').autocomplete({
+                source: contestName,
+                autoFocus: true,
+                delay: 100,
+                minLength: 2,
+                appendTo: "menu",
+
+                //候補をクリックすることでsubmitできるようにする
+                select: function(event, ui) {
+                    $("#autocomplete_search").val(ui.item.label);
+                    $("#search").submit();
+                }
+            });
+
+            //日本語入力をスタートしたら無効化
+            $('#autocomplete_search').on('compositionstart', function() {
+                $('#autocomplete_search').autocomplete('disable');
+            });
+
+            //日本語入力が確定したら有効化
+            $('#autocomplete_search').on('compositionend', function() {
+                $('#autocomplete_search').autocomplete('enable').autocomplete('search');
+            });
+
+
             //input内でのEnter無効化
             $(function() {
                 $(document).on("keypress", "input:not(.allow_submit)", function(event) {

From bbf0c03244bf9f5a62de98a58bea99f0ac1e0b91 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 22:05:13 +0900
Subject: [PATCH 147/336] fix

---
 templates/search.html | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index c2edfca..6b46dd4 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -112,32 +112,6 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 }
             });
 
-            //検索候補を表示する。
-            $('#autocomplete_search').autocomplete({
-                source: contestName,
-                autoFocus: true,
-                delay: 100,
-                minLength: 2,
-                appendTo: "menu",
-
-                //候補をクリックすることでsubmitできるようにする
-                select: function(event, ui) {
-                    $("#autocomplete_search").val(ui.item.label);
-                    $("#search").submit();
-                }
-            });
-
-            //日本語入力をスタートしたら無効化
-            $('#autocomplete_search').on('compositionstart', function() {
-                $('#autocomplete_search').autocomplete('disable');
-            });
-
-            //日本語入力が確定したら有効化
-            $('#autocomplete_search').on('compositionend', function() {
-                $('#autocomplete_search').autocomplete('enable').autocomplete('search');
-            });
-
-
             //input内でのEnter無効化
             $(function() {
                 $(document).on("keypress", "input:not(.allow_submit)", function(event) {

From 0a48761c0860978600deffb5c85060e888663296 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 22:05:46 +0900
Subject: [PATCH 148/336] fix

---
 templates/search.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index 6b46dd4..f9f8c17 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -87,7 +87,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             const contestName = [];
             $.ajax({
                 type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/problems.json',
+                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
                 dataType: 'json',
                 success: function(json) {
                     var len = json.length;

From 138e72ce9f2e771a23ffbfb8f2bd089550c1c43f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 22:28:28 +0900
Subject: [PATCH 149/336] fix

---
 templates/.htaccess   | 1 -
 templates/search.html | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
 delete mode 100644 templates/.htaccess

diff --git a/templates/.htaccess b/templates/.htaccess
deleted file mode 100644
index 8203d39..0000000
--- a/templates/.htaccess
+++ /dev/null
@@ -1 +0,0 @@
-Header append Access-Control-Allow-Origin: "*"
\ No newline at end of file
diff --git a/templates/search.html b/templates/search.html
index f9f8c17..bf05a1b 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -64,6 +64,8 @@
                 <h4 class="display-4">コンテスト検索</h4>
                 <br>
                 <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の候補から選択して下さい。</h5>
+                <h4 class="text-muted">コンテスト終了とコンテスト検索ができるようになるまでの間に<br> 時間差があるかもしれないです。申し訳ないです・・・
+                </h4>
             </div>
         </div>
 

From 468cffe9110f94ba137bb926ec78d6e70bdb3d24 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 23:02:58 +0900
Subject: [PATCH 150/336] fix

---
 templates/search.html | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index bf05a1b..ced7776 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -64,7 +64,8 @@
                 <h4 class="display-4">コンテスト検索</h4>
                 <br>
                 <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の候補から選択して下さい。</h5>
-                <h4 class="text-muted">コンテスト終了とコンテスト検索ができるようになるまでの間に<br> 時間差があるかもしれないです。申し訳ないです・・・
+                <h4>更新にかかる時間が想定していたよりも長いので、手動入力を出来るようにしました。<br> キーワードは「第一回日本最強プログラマー学生選手権-予選-」で検索お願いします。
+                    <br> （一字一句間違えないように注意して下さい！すみません！）
                 </h4>
             </div>
         </div>
@@ -114,11 +115,14 @@ <h4 class="text-muted">コンテスト終了とコンテスト検索ができる
                 }
             });
 
-            //input内でのEnter無効化
-            $(function() {
-                $(document).on("keypress", "input:not(.allow_submit)", function(event) {
-                    return event.which !== 13;
-                });
+            //日本語入力をスタートしたら無効化
+            $('#autocomplete_search').on('compositionstart', function() {
+                $('#autocomplete_search').autocomplete('disable');
+            });
+
+            //日本語入力が確定したら有効化
+            $('#autocomplete_search').on('compositionend', function() {
+                $('#autocomplete_search').autocomplete('enable').autocomplete('search');
             });
 
         })();

From 38b82580e18b9676628877b6cb372cd2b9732d37 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sat, 24 Aug 2019 23:26:27 +0900
Subject: [PATCH 151/336] fix

---
 templates/search.html | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index ced7776..626437e 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -64,9 +64,6 @@
                 <h4 class="display-4">コンテスト検索</h4>
                 <br>
                 <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の候補から選択して下さい。</h5>
-                <h4>更新にかかる時間が想定していたよりも長いので、手動入力を出来るようにしました。<br> キーワードは「第一回日本最強プログラマー学生選手権-予選-」で検索お願いします。
-                    <br> （一字一句間違えないように注意して下さい！すみません！）
-                </h4>
             </div>
         </div>
 
@@ -100,6 +97,8 @@ <h4>更新にかかる時間が想定していたよりも長いので、手動
                 }
             });
 
+            contestName.push('第一回日本最強プログラマー学生選手権-予選-');
+
             //検索候補を表示する。
             $('#autocomplete_search').autocomplete({
                 source: contestName,
@@ -115,6 +114,13 @@ <h4>更新にかかる時間が想定していたよりも長いので、手動
                 }
             });
 
+            //input内でのEnter無効化
+            $(function() {
+                $(document).on("keypress", "input:not(.allow_submit)", function(event) {
+                    return event.which !== 13;
+                });
+            });
+
             //日本語入力をスタートしたら無効化
             $('#autocomplete_search').on('compositionstart', function() {
                 $('#autocomplete_search').autocomplete('disable');

From 60b95af6dcaa0e06040758a926a9c853773c13c9 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 12:28:03 +0900
Subject: [PATCH 152/336] add comment

---
 templates/index.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index 285c86e..a1b8bfd 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -81,7 +81,8 @@ <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#
                 </h5>
                 <div class="collapse" id="action2" 　data-parent="#events-imfo" ">
                     <div class="card-body ">
-                        改善案、バグなどございましたら、ぬるぬる(@__Null_Null_)までご連絡お願いします。
+                        改善案、バグなどございましたら、ぬるぬる(@__Null_Null_)までご連絡お願いします。<br>
+                        Github: https://github.com/null-null-programming/AtCoder-Editorials
                     </div>
                 </div>
             </div>

From bb8513a081fc08a7b8216d1a1c929352a6421163 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 13:15:56 +0900
Subject: [PATCH 153/336] fix url

---
 app.py                | 9 +++------
 templates/search.html | 9 +++++++--
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/app.py b/app.py
index 62a10a1..9b8cae5 100644
--- a/app.py
+++ b/app.py
@@ -51,12 +51,9 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest/<int:page>', methods=['GET','POST'])
-def contest_get(page=1):
-    contestname = _normalize_contestname(request.form.get('contestname'))
-    
-    if contestname==None:
-        contestname=request.args.get('contestname','')
+@app.route('/search/contest/<contestname>/<int:page>', methods=['GET','POST'])
+def contest_get(contestname,page=1):
+    contestname = _normalize_contestname(contestname)
 
     #ページネーション
     per_page = 10
diff --git a/templates/search.html b/templates/search.html
index 626437e..c556cc8 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -63,13 +63,13 @@
             <div class="container">
                 <h4 class="display-4">コンテスト検索</h4>
                 <br>
-                <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の候補から選択して下さい。</h5>
+                <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の候補から選択して下さい。<br> Google Chromeで検索障害が発生していることお詫び申し上げます。</h5>
             </div>
         </div>
 
         <br>
 
-        <form id="search" method="POST" action="/search/contest/1">
+        <form id="search" method="POST" action="">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
             <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" />
         </form>
@@ -81,6 +81,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
     <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js" integrity="sha256-DI6NdAhhFRnO2k51mumYeDShet3I8AKCQf/tf7ARNhI=" crossorigin="anonymous"></script>
+
     <script type="text/javascript">
         (async function() {
 
@@ -110,6 +111,10 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 //候補をクリックすることでsubmitできるようにする
                 select: function(event, ui) {
                     $("#autocomplete_search").val(ui.item.label);
+
+                    var url = '/search/contest/' + ui.item.label + '/1'
+
+                    $('form').attr('action', url)
                     $("#search").submit();
                 }
             });

From 590f809c2fbb958353a9658698380283de62b549 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 13:23:28 +0900
Subject: [PATCH 154/336] fix

---
 templates/search.html | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index c556cc8..5bb4976 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -111,9 +111,8 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 //候補をクリックすることでsubmitできるようにする
                 select: function(event, ui) {
                     $("#autocomplete_search").val(ui.item.label);
-
-                    var url = '/search/contest/' + ui.item.label + '/1'
-
+                    var preurl = '/search/contest/' + ui.item.label + '/1'
+                    var url = preurl.replace(/\s+/g, "");
                     $('form').attr('action', url)
                     $("#search").submit();
                 }

From 0a15850989ee8003c6bd6a4dfd5ad93f0d351afc Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 13:26:02 +0900
Subject: [PATCH 155/336] fix

---
 templates/search.html | 2 --
 1 file changed, 2 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 5bb4976..6d695a7 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -98,8 +98,6 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 }
             });
 
-            contestName.push('第一回日本最強プログラマー学生選手権-予選-');
-
             //検索候補を表示する。
             $('#autocomplete_search').autocomplete({
                 source: contestName,

From f8e67ca0549f4c76fc79b8fa6fd7257f0aa72ff4 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 13:30:39 +0900
Subject: [PATCH 156/336] fix

---
 templates/search.html | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 6d695a7..0bc070e 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -109,8 +109,9 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 //候補をクリックすることでsubmitできるようにする
                 select: function(event, ui) {
                     $("#autocomplete_search").val(ui.item.label);
-                    var preurl = '/search/contest/' + ui.item.label + '/1'
-                    var url = preurl.replace(/\s+/g, "");
+
+                    var url = '/search/contest/' + ui.item.label + '/1'
+
                     $('form').attr('action', url)
                     $("#search").submit();
                 }

From 4dd5dc13a4f795f7a1120dcea8d0d1b84d03292a Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 13:38:11 +0900
Subject: [PATCH 157/336] fix

---
 app.py                | 2 +-
 templates/index.html  | 3 +--
 templates/search.html | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/app.py b/app.py
index 9b8cae5..ec47f6f 100644
--- a/app.py
+++ b/app.py
@@ -51,7 +51,7 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest/<contestname>/<int:page>', methods=['GET','POST'])
+@app.route('/search/<contestname>/<int:page>', methods=['GET','POST'])
 def contest_get(contestname,page=1):
     contestname = _normalize_contestname(contestname)
 
diff --git a/templates/index.html b/templates/index.html
index a1b8bfd..c18f3b3 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -67,8 +67,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        AtCoderEditorialsが誕生しました。
-
+                        ・URLの改良をしました。
                     </div>
                 </div>
             </div>
diff --git a/templates/search.html b/templates/search.html
index 0bc070e..08e4a19 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -110,7 +110,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 select: function(event, ui) {
                     $("#autocomplete_search").val(ui.item.label);
 
-                    var url = '/search/contest/' + ui.item.label + '/1'
+                    var url = '/search/' + ui.item.label + '/1'
 
                     $('form').attr('action', url)
                     $("#search").submit();

From 8f4f8cd4ae8c790fba61625a9712929afa7d3f25 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 13:56:30 +0900
Subject: [PATCH 158/336] add tweet btn to contest_page

---
 templates/contest.html | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 5efba68..ea050a6 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -127,8 +127,12 @@ <h5 class="col-1"></h5>
                     <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
                     <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>
                 </form>
+                <h5 class="col-1"></h5>
+                <div class="twitter">
+                    <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を投稿しました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
+                    </a>
+                </div>
                 {%endif%}
-                </a>
             </div>
 
             <div class="card col-6 border-0" style="cursor: pointer;">

From 1f2bd2eff45cd6fe371be500c62ab0c06376ea00 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 13:59:58 +0900
Subject: [PATCH 159/336] fix

---
 templates/contest.html | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index ea050a6..7417380 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -127,11 +127,6 @@ <h5 class="col-1"></h5>
                     <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
                     <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>
                 </form>
-                <h5 class="col-1"></h5>
-                <div class="twitter">
-                    <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を投稿しました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
-                    </a>
-                </div>
                 {%endif%}
             </div>
 

From f6362dca7e0f1a17a2e9f144d9c66dae8a742fe9 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 14:05:28 +0900
Subject: [PATCH 160/336] fix

---
 templates/contest.html | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/templates/contest.html b/templates/contest.html
index 7417380..94df278 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -123,6 +123,11 @@ <h5 class="col-1"></h5>
                 <a href="/user/{{edit.user_id}}/1" class="h4 text-dark" style="vertical-align:middle;">{{edit.username}}</a>
                 <h5 class="col-1"></h5>
                 {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
+                <div class="twitter">
+                    <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を投稿しました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
+                    </a>
+                </div>
+                <h5 class="col-1"></h5>
                 <form>
                     <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
                     <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>

From 81504e92c8c16b8aeb5a3afa45a9a24499f1a937 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 14:08:25 +0900
Subject: [PATCH 161/336] fix

---
 templates/contest.html | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 94df278..7417380 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -123,11 +123,6 @@ <h5 class="col-1"></h5>
                 <a href="/user/{{edit.user_id}}/1" class="h4 text-dark" style="vertical-align:middle;">{{edit.username}}</a>
                 <h5 class="col-1"></h5>
                 {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
-                <div class="twitter">
-                    <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を投稿しました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
-                    </a>
-                </div>
-                <h5 class="col-1"></h5>
                 <form>
                     <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
                     <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>

From 81a1a3be5bb4fdb1a25ca329ff60d560f9bd91a8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 17:46:25 +0900
Subject: [PATCH 162/336] change contest_base -> problems_base

---
 app.py                |  9 ++++++++-
 config.py             |  2 ++
 templates/search.html | 24 +++++++++++++++---------
 3 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/app.py b/app.py
index ec47f6f..f43ecb8 100644
--- a/app.py
+++ b/app.py
@@ -1,10 +1,12 @@
-from flask import Flask, render_template, request,url_for, redirect,session
+from flask import Flask, render_template, request,url_for, redirect,session,jsonify,abort, make_response, current_app
 from flask_sqlalchemy import SQLAlchemy
 from sqlalchemy import desc
 from flask_migrate import Migrate
 from flask_login import UserMixin, LoginManager, login_user, logout_user, current_user
 from datetime import datetime
 from rauth import OAuth1Service
+import requests
+import json
 from config import app, db, service, login_manager,csrf
 
 #ユーザー情報
@@ -261,6 +263,11 @@ def delete():
 
     return 'hoge'
 
+@app.route('/getName',methods=['GET'])
+def getName():
+    res=requests.get('https://kenkoooo.com/atcoder/resources/problems.json')
+    return jsonify(res.json())
+
 #エラー処理
 @app.errorhandler(401)
 def authentication_failed(error):
diff --git a/config.py b/config.py
index a16cdb9..f640818 100644
--- a/config.py
+++ b/config.py
@@ -7,11 +7,13 @@
 from rauth import OAuth1Service
 from dotenv import load_dotenv
 from os.path import join, dirname
+from flask_cors import CORS 
 import os
 
 load_dotenv('.env')
 
 app=Flask(__name__)
+CORS(app)
 app.secret_key=os.environ['SECRET_KEY']
 app.config['SQLALCHEMY_TRACK_MODIFICATIONS']=False
 app.config['SQLALCHEMY_DATABASE_URI']=os.environ['SQLALCHEMY_DATABASE_URI']
diff --git a/templates/search.html b/templates/search.html
index 08e4a19..0ae1f85 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -87,16 +87,22 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
 
             const contestName = [];
             $.ajax({
-                type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
-                dataType: 'json',
-                success: function(json) {
-                    var len = json.length;
-                    for (var i = 0; i < len; i++) {
-                        contestName.push(json[i].title);
+                    type: 'GET',
+                    url: '/getName',
+                    dataType: 'json',
+                    success: function(json) {
+                        console.log(json)
+                        var len = json.length;
+                        for (var i = 0; i < len; i++) {
+                            contestName.push(json[i].title);
+                        }
                     }
-                }
-            });
+                }).done(function() {
+                    console.log('success');
+                })
+                .fail(function() {
+                    console.log('fail');
+                });
 
             //検索候補を表示する。
             $('#autocomplete_search').autocomplete({

From 981b27297cb220293f9dd4fa7473f92ff8c34928 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 17:52:14 +0900
Subject: [PATCH 163/336] fix

---
 app.py                | 18 +++++++-----------
 templates/search.html | 24 +++++++++---------------
 2 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/app.py b/app.py
index f43ecb8..62a10a1 100644
--- a/app.py
+++ b/app.py
@@ -1,12 +1,10 @@
-from flask import Flask, render_template, request,url_for, redirect,session,jsonify,abort, make_response, current_app
+from flask import Flask, render_template, request,url_for, redirect,session
 from flask_sqlalchemy import SQLAlchemy
 from sqlalchemy import desc
 from flask_migrate import Migrate
 from flask_login import UserMixin, LoginManager, login_user, logout_user, current_user
 from datetime import datetime
 from rauth import OAuth1Service
-import requests
-import json
 from config import app, db, service, login_manager,csrf
 
 #ユーザー情報
@@ -53,9 +51,12 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/<contestname>/<int:page>', methods=['GET','POST'])
-def contest_get(contestname,page=1):
-    contestname = _normalize_contestname(contestname)
+@app.route('/search/contest/<int:page>', methods=['GET','POST'])
+def contest_get(page=1):
+    contestname = _normalize_contestname(request.form.get('contestname'))
+    
+    if contestname==None:
+        contestname=request.args.get('contestname','')
 
     #ページネーション
     per_page = 10
@@ -263,11 +264,6 @@ def delete():
 
     return 'hoge'
 
-@app.route('/getName',methods=['GET'])
-def getName():
-    res=requests.get('https://kenkoooo.com/atcoder/resources/problems.json')
-    return jsonify(res.json())
-
 #エラー処理
 @app.errorhandler(401)
 def authentication_failed(error):
diff --git a/templates/search.html b/templates/search.html
index 0ae1f85..08e4a19 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -87,22 +87,16 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
 
             const contestName = [];
             $.ajax({
-                    type: 'GET',
-                    url: '/getName',
-                    dataType: 'json',
-                    success: function(json) {
-                        console.log(json)
-                        var len = json.length;
-                        for (var i = 0; i < len; i++) {
-                            contestName.push(json[i].title);
-                        }
+                type: 'GET',
+                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
+                dataType: 'json',
+                success: function(json) {
+                    var len = json.length;
+                    for (var i = 0; i < len; i++) {
+                        contestName.push(json[i].title);
                     }
-                }).done(function() {
-                    console.log('success');
-                })
-                .fail(function() {
-                    console.log('fail');
-                });
+                }
+            });
 
             //検索候補を表示する。
             $('#autocomplete_search').autocomplete({

From 27c4b66dc5aa994b891a6349ad98876d064c4036 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 17:57:25 +0900
Subject: [PATCH 164/336] fix

---
 config.py              | 2 --
 templates/contest.html | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/config.py b/config.py
index f640818..a16cdb9 100644
--- a/config.py
+++ b/config.py
@@ -7,13 +7,11 @@
 from rauth import OAuth1Service
 from dotenv import load_dotenv
 from os.path import join, dirname
-from flask_cors import CORS 
 import os
 
 load_dotenv('.env')
 
 app=Flask(__name__)
-CORS(app)
 app.secret_key=os.environ['SECRET_KEY']
 app.config['SQLALCHEMY_TRACK_MODIFICATIONS']=False
 app.config['SQLALCHEMY_DATABASE_URI']=os.environ['SQLALCHEMY_DATABASE_URI']
diff --git a/templates/contest.html b/templates/contest.html
index 7417380..5efba68 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -128,6 +128,7 @@ <h5 class="col-1"></h5>
                     <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>
                 </form>
                 {%endif%}
+                </a>
             </div>
 
             <div class="card col-6 border-0" style="cursor: pointer;">

From ab7d21788184534011064778fb7574c4b2232584 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 18:07:25 +0900
Subject: [PATCH 165/336] fix

---
 app.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/app.py b/app.py
index 62a10a1..ec47f6f 100644
--- a/app.py
+++ b/app.py
@@ -51,12 +51,9 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest/<int:page>', methods=['GET','POST'])
-def contest_get(page=1):
-    contestname = _normalize_contestname(request.form.get('contestname'))
-    
-    if contestname==None:
-        contestname=request.args.get('contestname','')
+@app.route('/search/<contestname>/<int:page>', methods=['GET','POST'])
+def contest_get(contestname,page=1):
+    contestname = _normalize_contestname(contestname)
 
     #ページネーション
     per_page = 10

From 0cf79cd372208e93e5b7f082d4c863600baba384 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 18:41:59 +0900
Subject: [PATCH 166/336] fix

---
 app.py                | 10 +++++++++-
 config.py             |  2 ++
 templates/search.html |  2 +-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index ec47f6f..3774133 100644
--- a/app.py
+++ b/app.py
@@ -1,10 +1,12 @@
-from flask import Flask, render_template, request,url_for, redirect,session
+from flask import Flask, render_template, request,url_for, redirect,session,jsonify,abort, make_response, current_app
 from flask_sqlalchemy import SQLAlchemy
 from sqlalchemy import desc
 from flask_migrate import Migrate
 from flask_login import UserMixin, LoginManager, login_user, logout_user, current_user
 from datetime import datetime
 from rauth import OAuth1Service
+import requests
+import json
 from config import app, db, service, login_manager,csrf
 
 #ユーザー情報
@@ -261,6 +263,12 @@ def delete():
 
     return 'hoge'
 
+@app.route('/getName',methods=['GET'])
+def getName():
+    res=requests.get('https://kenkoooo.com/atcoder/resources/problems.json')
+    return jsonify(res.json())
+
+
 #エラー処理
 @app.errorhandler(401)
 def authentication_failed(error):
diff --git a/config.py b/config.py
index a16cdb9..f640818 100644
--- a/config.py
+++ b/config.py
@@ -7,11 +7,13 @@
 from rauth import OAuth1Service
 from dotenv import load_dotenv
 from os.path import join, dirname
+from flask_cors import CORS 
 import os
 
 load_dotenv('.env')
 
 app=Flask(__name__)
+CORS(app)
 app.secret_key=os.environ['SECRET_KEY']
 app.config['SQLALCHEMY_TRACK_MODIFICATIONS']=False
 app.config['SQLALCHEMY_DATABASE_URI']=os.environ['SQLALCHEMY_DATABASE_URI']
diff --git a/templates/search.html b/templates/search.html
index 08e4a19..3ee22f6 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -88,7 +88,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             const contestName = [];
             $.ajax({
                 type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
+                url: '/getName',
                 dataType: 'json',
                 success: function(json) {
                     var len = json.length;

From 7aadb18fd6a6ee0f811bdec0a14f7f9e4bd4a4ab Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 18:43:46 +0900
Subject: [PATCH 167/336] fix

---
 app.py                | 16 ++++------------
 templates/search.html |  4 ++--
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/app.py b/app.py
index 3774133..2fa586f 100644
--- a/app.py
+++ b/app.py
@@ -1,12 +1,10 @@
-from flask import Flask, render_template, request,url_for, redirect,session,jsonify,abort, make_response, current_app
+from flask import Flask, render_template, request,url_for, redirect,session
 from flask_sqlalchemy import SQLAlchemy
 from sqlalchemy import desc
 from flask_migrate import Migrate
 from flask_login import UserMixin, LoginManager, login_user, logout_user, current_user
 from datetime import datetime
 from rauth import OAuth1Service
-import requests
-import json
 from config import app, db, service, login_manager,csrf
 
 #ユーザー情報
@@ -53,9 +51,9 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/<contestname>/<int:page>', methods=['GET','POST'])
-def contest_get(contestname,page=1):
-    contestname = _normalize_contestname(contestname)
+@app.route('/search/contest/<int:page>', methods=['GET','POST'])
+def contest_get(page=1):
+    contestname = _normalize_contestname(request.form.get('contestname'))
 
     #ページネーション
     per_page = 10
@@ -263,12 +261,6 @@ def delete():
 
     return 'hoge'
 
-@app.route('/getName',methods=['GET'])
-def getName():
-    res=requests.get('https://kenkoooo.com/atcoder/resources/problems.json')
-    return jsonify(res.json())
-
-
 #エラー処理
 @app.errorhandler(401)
 def authentication_failed(error):
diff --git a/templates/search.html b/templates/search.html
index 3ee22f6..2a914e3 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -88,7 +88,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             const contestName = [];
             $.ajax({
                 type: 'GET',
-                url: '/getName',
+                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
                 dataType: 'json',
                 success: function(json) {
                     var len = json.length;
@@ -110,7 +110,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 select: function(event, ui) {
                     $("#autocomplete_search").val(ui.item.label);
 
-                    var url = '/search/' + ui.item.label + '/1'
+                    var url = '/search' + ui.item.label + '/1'
 
                     $('form').attr('action', url)
                     $("#search").submit();

From d6640d66cf98547c152587c1b238621145b5831c Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 18:44:21 +0900
Subject: [PATCH 168/336] fix

---
 templates/search.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index 2a914e3..08e4a19 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -110,7 +110,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
                 select: function(event, ui) {
                     $("#autocomplete_search").val(ui.item.label);
 
-                    var url = '/search' + ui.item.label + '/1'
+                    var url = '/search/' + ui.item.label + '/1'
 
                     $('form').attr('action', url)
                     $("#search").submit();

From 6c8f9ec927c0095aa43b0bc50d783b124eab1164 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 18:54:21 +0900
Subject: [PATCH 169/336] fix

---
 app.py    | 4 ++--
 config.py | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/app.py b/app.py
index 2fa586f..d5b8e4a 100644
--- a/app.py
+++ b/app.py
@@ -51,8 +51,8 @@ def contest_search():
     return render_template('search.html')
 
 
-@app.route('/search/contest/<int:page>', methods=['GET','POST'])
-def contest_get(page=1):
+@app.route('/search/<contestname>/<int:page>', methods=['GET','POST'])
+def contest_get(contestname,page=1):
     contestname = _normalize_contestname(request.form.get('contestname'))
 
     #ページネーション
diff --git a/config.py b/config.py
index f640818..a16cdb9 100644
--- a/config.py
+++ b/config.py
@@ -7,13 +7,11 @@
 from rauth import OAuth1Service
 from dotenv import load_dotenv
 from os.path import join, dirname
-from flask_cors import CORS 
 import os
 
 load_dotenv('.env')
 
 app=Flask(__name__)
-CORS(app)
 app.secret_key=os.environ['SECRET_KEY']
 app.config['SQLALCHEMY_TRACK_MODIFICATIONS']=False
 app.config['SQLALCHEMY_DATABASE_URI']=os.environ['SQLALCHEMY_DATABASE_URI']

From c59a0976c430ab2d6729890b83efd082606cd7cd Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 19:20:06 +0900
Subject: [PATCH 170/336] fix

---
 app.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/app.py b/app.py
index d5b8e4a..94ba8b0 100644
--- a/app.py
+++ b/app.py
@@ -1,10 +1,12 @@
-from flask import Flask, render_template, request,url_for, redirect,session
+from flask import Flask, render_template, request,url_for, redirect,session,jsonify,abort, make_response, current_app
 from flask_sqlalchemy import SQLAlchemy
 from sqlalchemy import desc
 from flask_migrate import Migrate
 from flask_login import UserMixin, LoginManager, login_user, logout_user, current_user
 from datetime import datetime
 from rauth import OAuth1Service
+import requests
+import json
 from config import app, db, service, login_manager,csrf
 
 #ユーザー情報
@@ -261,6 +263,12 @@ def delete():
 
     return 'hoge'
 
+@app.route('/getName',methods=['GET'])
+def getName():
+    res=requests.get('https://kenkoooo.com/atcoder/resources/problems.json')
+    return jsonify(res.json())
+
+
 #エラー処理
 @app.errorhandler(401)
 def authentication_failed(error):

From 05f7d8560cc8cdbc545ef63a91a21e818f3129af Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 19:25:32 +0900
Subject: [PATCH 171/336] fix

---
 templates/search.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index 08e4a19..3ee22f6 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -88,7 +88,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             const contestName = [];
             $.ajax({
                 type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
+                url: '/getName',
                 dataType: 'json',
                 success: function(json) {
                     var len = json.length;

From f163e11d799fb66144d3de9446af90aa5f240960 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 19:30:36 +0900
Subject: [PATCH 172/336] fix

---
 templates/search.html | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 3ee22f6..d252843 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -61,9 +61,10 @@
     <div class="container-fluid">
         <div class="jumbotron jumbotron-fluid">
             <div class="container">
-                <h4 class="display-4">コンテスト検索</h4>
+                <h4 class="display-4">問題名検索</h4>
                 <br>
-                <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の候補から選択して下さい。<br> Google Chromeで検索障害が発生していることお詫び申し上げます。</h5>
+                <h5 class="text-muted">解法の見たい問題名を入力し、下の候補から選択して下さい。<br> 検索方法がコンテスト名から問題名に変更されました。
+                </h5>
             </div>
         </div>
 
@@ -71,7 +72,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
 
         <form id="search" method="POST" action="">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-            <input id="autocomplete_search" placeholder="コンテスト名" style="width:600px" name="contestname" type="text" />
+            <input id="autocomplete_search" placeholder="問題名" style="width:600px" name="contestname" type="text" />
         </form>
 
 
@@ -88,7 +89,7 @@ <h5 class="text-muted">解法の見たいコンテスト名を入力し、下の
             const contestName = [];
             $.ajax({
                 type: 'GET',
-                url: '/getName',
+                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
                 dataType: 'json',
                 success: function(json) {
                     var len = json.length;

From ff7fa27c644feca15e181281272d870b665b9075 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 19:33:16 +0900
Subject: [PATCH 173/336] fix

---
 templates/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index c18f3b3..eb33f05 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -67,7 +67,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        ・URLの改良をしました。
+                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。
                     </div>
                 </div>
             </div>

From d6a9da47264ef85b7e0c998430ea7b7215c3416c Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 19:39:25 +0900
Subject: [PATCH 174/336] fix

---
 templates/401.html      | 2 +-
 templates/404.html      | 2 +-
 templates/500.html      | 2 +-
 templates/contest.html  | 2 +-
 templates/error.html    | 2 +-
 templates/index.html    | 2 +-
 templates/ranking.html  | 2 +-
 templates/search.html   | 2 +-
 templates/submited.html | 2 +-
 templates/template.html | 2 +-
 templates/user.html     | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/templates/401.html b/templates/401.html
index e59dc40..ac27986 100644
--- a/templates/401.html
+++ b/templates/401.html
@@ -46,7 +46,7 @@
         <div class="collapse navbar-collapse" id="nav1">
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
                 <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
                 <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
diff --git a/templates/404.html b/templates/404.html
index b90e9cf..a9fd6bc 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -46,7 +46,7 @@
         <div class="collapse navbar-collapse" id="nav1">
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
                 <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
                 <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
diff --git a/templates/500.html b/templates/500.html
index 987847c..1b76aa8 100644
--- a/templates/500.html
+++ b/templates/500.html
@@ -45,7 +45,7 @@
         <div class="collapse navbar-collapse" id="nav1">
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
                 <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
                 <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
diff --git a/templates/contest.html b/templates/contest.html
index 5efba68..07e6916 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -46,7 +46,7 @@
         <div class="collapse navbar-collapse" id="nav1">
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item active"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item active"><a href="/search" class="nav-link">問題</a></li>
                 <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
                 <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
diff --git a/templates/error.html b/templates/error.html
index b876509..c6ff6ad 100644
--- a/templates/error.html
+++ b/templates/error.html
@@ -46,7 +46,7 @@
         <div class="collapse navbar-collapse" id="nav1">
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
                 <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
                 <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
diff --git a/templates/index.html b/templates/index.html
index eb33f05..e6e1953 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -46,7 +46,7 @@
         <div class="collapse navbar-collapse" id="nav1">
             <ul class="navbar-nav">
                 <li class="nav-item active"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
                 <li class="nav-item "><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
                 <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
diff --git a/templates/ranking.html b/templates/ranking.html
index a550bb7..f30d233 100644
--- a/templates/ranking.html
+++ b/templates/ranking.html
@@ -45,7 +45,7 @@
         <div class="collapse navbar-collapse" id="nav1">
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
                 <li class="nav-item active"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
                 <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
diff --git a/templates/search.html b/templates/search.html
index d252843..1f347f9 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -46,7 +46,7 @@
         <div class="collapse navbar-collapse" id="nav1">
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item active"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item active"><a href="/search" class="nav-link">問題</a></li>
                 <li class="nav-item "><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
                 <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
diff --git a/templates/submited.html b/templates/submited.html
index 81e0d40..fc56336 100644
--- a/templates/submited.html
+++ b/templates/submited.html
@@ -45,7 +45,7 @@
         <div class="collapse navbar-collapse" id="nav1">
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item active"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item active"><a href="/search" class="nav-link">問題</a></li>
                 <li class="nav-item "><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
                 <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
diff --git a/templates/template.html b/templates/template.html
index e21d69d..ecd9084 100644
--- a/templates/template.html
+++ b/templates/template.html
@@ -45,7 +45,7 @@
         <div class="collapse navbar-collapse" id="nav1">
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
                 <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
                 <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
diff --git a/templates/user.html b/templates/user.html
index a82f4bb..32c12bc 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -45,7 +45,7 @@
         <div class="collapse navbar-collapse" id="nav1">
             <ul class="navbar-nav">
                 <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item"><a href="/search" class="nav-link">コンテスト</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
                 <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
                 {% if current_user.is_authenticated==True %}
                 <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>

From 2a9a7a0f7725368c72a64dd9d18a797bc26d4dd0 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 19:44:18 +0900
Subject: [PATCH 175/336] fix

---
 templates/search.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index 1f347f9..4823e2c 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -89,7 +89,7 @@ <h5 class="text-muted">解法の見たい問題名を入力し、下の候補か
             const contestName = [];
             $.ajax({
                 type: 'GET',
-                url: 'https://kenkoooo.com/atcoder/resources/contests.json',
+                url: '/getName',
                 dataType: 'json',
                 success: function(json) {
                     var len = json.length;

From a71f6ff899d64c0922303de5decaf40ca94de6dd Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 20:01:23 +0900
Subject: [PATCH 176/336] add problem_name on the title

---
 templates/user.html | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/templates/user.html b/templates/user.html
index 32c12bc..5916f23 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -86,6 +86,8 @@ <h4> 投稿数　 :{{num}}</h4>
         <h3>投稿一覧</h3>
         <div>
             {%for e in edit.items %}
+            <br>
+            <h4>{{e.contestname}}</h4>
             <div id="editorial-card">
                 <div class="card col-6 border-0" style="cursor: pointer;">
                     <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">

From 1a65611adfd9cebe5999a03a9ac6d281b99c03a0 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 20:15:02 +0900
Subject: [PATCH 177/336] add fav_btn in user_page

---
 templates/index.html |  2 +-
 templates/user.html  | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index e6e1953..e239ab7 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -67,7 +67,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。
+                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。<br>・ユーザーページの投稿一覧からいいね出来るようにしました。
                     </div>
                 </div>
             </div>
diff --git a/templates/user.html b/templates/user.html
index 5916f23..19afe62 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -87,7 +87,21 @@ <h3>投稿一覧</h3>
         <div>
             {%for e in edit.items %}
             <br>
-            <h4>{{e.contestname}}</h4>
+            <div class="row">
+                {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
+                <form>
+                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                    <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
+                </form>
+                {%else%}
+                <form>
+                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                    <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
+                </form>
+                {%endif%}{%else%}
+                <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
+                <h4>{{e.contestname}}</h4>
+            </div>
             <div id="editorial-card">
                 <div class="card col-6 border-0" style="cursor: pointer;">
                     <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">

From dd9be4792b9555b2716b678fcbb3566936f04c94 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 20:19:42 +0900
Subject: [PATCH 178/336] fix

---
 templates/index.html |  2 +-
 templates/user.html  | 17 +----------------
 2 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index e239ab7..e6e1953 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -67,7 +67,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。<br>・ユーザーページの投稿一覧からいいね出来るようにしました。
+                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。
                     </div>
                 </div>
             </div>
diff --git a/templates/user.html b/templates/user.html
index 19afe62..51bf2fe 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -86,22 +86,7 @@ <h4> 投稿数　 :{{num}}</h4>
         <h3>投稿一覧</h3>
         <div>
             {%for e in edit.items %}
-            <br>
-            <div class="row">
-                {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
-                <form>
-                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
-                    <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
-                </form>
-                {%else%}
-                <form>
-                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
-                    <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
-                </form>
-                {%endif%}{%else%}
-                <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
-                <h4>{{e.contestname}}</h4>
-            </div>
+            <h4>{{e.contestname}}</h4>
             <div id="editorial-card">
                 <div class="card col-6 border-0" style="cursor: pointer;">
                     <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">

From f6ea737f84ccb64e9638af27b0dfa33a0785ce7d Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 21:53:18 +0900
Subject: [PATCH 179/336] add fav-btn in user_page

---
 app.py                 | 16 +++++++++++++---
 templates/contest.html |  1 -
 templates/user.html    | 17 ++++++++++++++++-
 3 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/app.py b/app.py
index 94ba8b0..ee63c32 100644
--- a/app.py
+++ b/app.py
@@ -1,4 +1,4 @@
-from flask import Flask, render_template, request,url_for, redirect,session,jsonify,abort, make_response, current_app
+from flask import Flask, render_template, request,url_for, redirect,session
 from flask_sqlalchemy import SQLAlchemy
 from sqlalchemy import desc
 from flask_migrate import Migrate
@@ -114,9 +114,19 @@ def user(id,page=1):
     per_page=10
     edit=Editorial.query.filter_by(user_id=id).paginate(page, per_page, error_out=False)
 
+    editorials=Editorial.query.filter_by(user_id=id).all()
     #投稿数
-    edit_num=Editorial.query.filter_by(user_id=id).all()
-    num=len(edit_num)
+    num=len(editorials)
+
+    #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
+    if current_user.is_authenticated==True:
+        flag={}
+        for edit in editorials.items:
+            like=db.session.query(Like).filter(Like.edit_id==edit.id,Like.user_id==current_user.id).first()
+            if like:
+                flag[edit.id]=True
+            else:
+                flag[edit.id]=False
 
     #順位計算（繰り上がり処理付き）
     rank_dict=dict({})
diff --git a/templates/contest.html b/templates/contest.html
index 07e6916..9a6b074 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -128,7 +128,6 @@ <h5 class="col-1"></h5>
                     <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>
                 </form>
                 {%endif%}
-                </a>
             </div>
 
             <div class="card col-6 border-0" style="cursor: pointer;">
diff --git a/templates/user.html b/templates/user.html
index 51bf2fe..ef393b5 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -86,7 +86,22 @@ <h4> 投稿数　 :{{num}}</h4>
         <h3>投稿一覧</h3>
         <div>
             {%for e in edit.items %}
-            <h4>{{e.contestname}}</h4>
+            <div class="row">
+                {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
+                <form>
+                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                    <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
+                </form>
+                {%else%}
+                <form>
+                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                    <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
+                </form>
+                {%endif%} {%else%}
+                <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
+                <h4>{{e.contestname}}</h4>
+            </div>
+
             <div id="editorial-card">
                 <div class="card col-6 border-0" style="cursor: pointer;">
                     <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">

From 8166b86cf2d41766fbffb7c7979e02e327d3605f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 21:56:04 +0900
Subject: [PATCH 180/336] fix

---
 templates/user.html | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/templates/user.html b/templates/user.html
index ef393b5..f542a5b 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -86,22 +86,7 @@ <h4> 投稿数　 :{{num}}</h4>
         <h3>投稿一覧</h3>
         <div>
             {%for e in edit.items %}
-            <div class="row">
-                {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
-                <form>
-                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
-                    <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
-                </form>
-                {%else%}
-                <form>
-                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
-                    <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
-                </form>
-                {%endif%} {%else%}
-                <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
-                <h4>{{e.contestname}}</h4>
-            </div>
-
+            <h4>{{edit.contestname}}</h4>
             <div id="editorial-card">
                 <div class="card col-6 border-0" style="cursor: pointer;">
                     <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">

From 078c2c32fff9cf7993eb81b2e98f946fe6e72fe8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 21:57:28 +0900
Subject: [PATCH 181/336] fix

---
 templates/user.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index f542a5b..51bf2fe 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -86,7 +86,7 @@ <h4> 投稿数　 :{{num}}</h4>
         <h3>投稿一覧</h3>
         <div>
             {%for e in edit.items %}
-            <h4>{{edit.contestname}}</h4>
+            <h4>{{e.contestname}}</h4>
             <div id="editorial-card">
                 <div class="card col-6 border-0" style="cursor: pointer;">
                     <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">

From 1d6a20ff84a55eab6df20fcb42aaf080421565d1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 22:02:06 +0900
Subject: [PATCH 182/336] fix

---
 templates/user.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index 51bf2fe..dfadfea 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -1,4 +1,5 @@
 <!DOCTYPE html>
+
 <html lang="ja">
 
 <head>
@@ -86,7 +87,6 @@ <h4> 投稿数　 :{{num}}</h4>
         <h3>投稿一覧</h3>
         <div>
             {%for e in edit.items %}
-            <h4>{{e.contestname}}</h4>
             <div id="editorial-card">
                 <div class="card col-6 border-0" style="cursor: pointer;">
                     <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">

From ecc5085e99ec51443f8e209e36258aaafd3bc05a Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 22:06:20 +0900
Subject: [PATCH 183/336] fix

---
 app.py | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/app.py b/app.py
index ee63c32..7d6067f 100644
--- a/app.py
+++ b/app.py
@@ -1,4 +1,4 @@
-from flask import Flask, render_template, request,url_for, redirect,session
+from flask import Flask, render_template, request,url_for, redirect,session,jsonify,abort, make_response, current_app
 from flask_sqlalchemy import SQLAlchemy
 from sqlalchemy import desc
 from flask_migrate import Migrate
@@ -114,19 +114,9 @@ def user(id,page=1):
     per_page=10
     edit=Editorial.query.filter_by(user_id=id).paginate(page, per_page, error_out=False)
 
-    editorials=Editorial.query.filter_by(user_id=id).all()
     #投稿数
-    num=len(editorials)
-
-    #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
-    if current_user.is_authenticated==True:
-        flag={}
-        for edit in editorials.items:
-            like=db.session.query(Like).filter(Like.edit_id==edit.id,Like.user_id==current_user.id).first()
-            if like:
-                flag[edit.id]=True
-            else:
-                flag[edit.id]=False
+    edit_num=Editorial.query.filter_by(user_id=id).all()
+    num=len(edit_num)
 
     #順位計算（繰り上がり処理付き）
     rank_dict=dict({})
@@ -303,4 +293,4 @@ def initdb_command():
 
 
 if __name__ == '__main__':
-    app.run(debug=True)
+    app.run(debug=True)
\ No newline at end of file

From c38f26ea3680b9df66837670566b7c9f56a6448f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 22:10:10 +0900
Subject: [PATCH 184/336] add title

---
 templates/user.html | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/templates/user.html b/templates/user.html
index dfadfea..4736dc7 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -88,6 +88,8 @@ <h3>投稿一覧</h3>
         <div>
             {%for e in edit.items %}
             <div id="editorial-card">
+                <br>
+                <h4>{{e.contestname}}</h4>
                 <div class="card col-6 border-0" style="cursor: pointer;">
                     <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
                         {{e.title}}

From 5f9d3bece6d248c80bde20fecf3180f7c90602ac Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 22:52:00 +0900
Subject: [PATCH 185/336] add fav in user_page

---
 app.py              | 16 +++++++--
 templates/user.html | 85 ++++++++++++++++++++++++++-------------------
 2 files changed, 63 insertions(+), 38 deletions(-)

diff --git a/app.py b/app.py
index 7d6067f..24c1184 100644
--- a/app.py
+++ b/app.py
@@ -115,8 +115,18 @@ def user(id,page=1):
     edit=Editorial.query.filter_by(user_id=id).paginate(page, per_page, error_out=False)
 
     #投稿数
-    edit_num=Editorial.query.filter_by(user_id=id).all()
-    num=len(edit_num)
+    editorials=Editorial.query.filter_by(user_id=id).all()
+    num=len(editorials)
+
+    flag={}
+    #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
+    if current_user.is_authenticated==True:
+        for edit in editorials.items:
+            like=db.session.query(Like).filter(Like.edit_id==edit.id,Like.user_id==current_user.id).first()
+            if like:
+                flag[edit.id]=True
+            else:
+                flag[edit.id]=False
 
     #順位計算（繰り上がり処理付き）
     rank_dict=dict({})
@@ -136,7 +146,7 @@ def user(id,page=1):
     date_published=str(user.date_published)
     date_published=date_published.split(' ')[0]
 
-    return render_template('user.html',user=user,edit=edit,num=num,rank=rank,date_published=date_published)
+    return render_template('user.html',user=user,edit=edit,num=num,rank=rank,flag=flag,date_published=date_published)
 
 @app.route('/ranking/<int:page>')
 def ranking(page=1):
diff --git a/templates/user.html b/templates/user.html
index 4736dc7..1f1c5e9 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -89,50 +89,65 @@ <h3>投稿一覧</h3>
             {%for e in edit.items %}
             <div id="editorial-card">
                 <br>
-                <h4>{{e.contestname}}</h4>
-                <div class="card col-6 border-0" style="cursor: pointer;">
-                    <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
-                        {{e.title}}
-                    </h4>
+                <div class="row">
+                    {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}
+                    <form>
+                        <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                        <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{e.like}}いいね</button>
+                    </form>
+                    {%else%}
+                    <form>
+                        <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                        <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{e.like}}いいね</button>
+                    </form>
+                    {%endif%}{%endif%}
+                    <h4>{{e.contestname}}</h4>
+                </div>
 
-                    <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
-                        {% if e.url!=None%}
-                        <a href={{e.url}}>{{e.url}}</a> {%endif%}
-                    </div>
+                <div class=" row container-fluid">
+                    <div class="card col-6 border-0" style="cursor: pointer;">
+                        <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
+                            {{e.title}}
+                        </h4>
+
+                        <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
+                            {% if e.url!=None%}
+                            <a href={{e.url}}>{{e.url}}</a> {%endif%}
+                        </div>
 
-                    <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
-                        {% autoescape false %} {%if e.description!=None%}
-                        <br>
-                        <p>{{e.description}}</p>
-                        {%endif%} {% endautoescape %}
+                        <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
+                            {% autoescape false %} {%if e.description!=None%}
+                            <br>
+                            <p>{{e.description}}</p>
+                            {%endif%} {% endautoescape %}
+                        </div>
                     </div>
+                    <br>
+                    <br>
                 </div>
-                <br>
-                <br> {% endfor %}
             </div>
-
+            {% endfor %}
         </div>
-    </div>
 
-    <div class="container-fluid">
-        <ul class="pagination">
-            {% if edit.has_prev %}
-            <li class="page-item">
-                <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=user.id)}}">前のページ</a>
-            </li>
-            {% endif %} {% if edit.has_next %}
-            <li class="page-item">
-                <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=user.id)}}">次のページ</a>
-            </li>
-            {% endif %}
-        </ul>
-    </div>
+        <div class="container-fluid">
+            <ul class="pagination">
+                {% if edit.has_prev %}
+                <li class="page-item">
+                    <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=user.id)}}">前のページ</a>
+                </li>
+                {% endif %} {% if edit.has_next %}
+                <li class="page-item">
+                    <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=user.id)}}">次のページ</a>
+                </li>
+                {% endif %}
+            </ul>
+        </div>
 
 
-    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
-    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
-    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
-    <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
+        <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
+        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+        <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
 </body>
 
 

From 1a55957390e2f3653ea341e73e55fd44f92821bd Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 22:55:22 +0900
Subject: [PATCH 186/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 24c1184..4d25e29 100644
--- a/app.py
+++ b/app.py
@@ -121,7 +121,7 @@ def user(id,page=1):
     flag={}
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
     if current_user.is_authenticated==True:
-        for edit in editorials.items:
+        for edit in editorials:
             like=db.session.query(Like).filter(Like.edit_id==edit.id,Like.user_id==current_user.id).first()
             if like:
                 flag[edit.id]=True

From 12cbf0e9222966ed817dbc30ebb9c5581f1e0c1c Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 22:57:36 +0900
Subject: [PATCH 187/336] fix

---
 app.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app.py b/app.py
index 4d25e29..fe571e2 100644
--- a/app.py
+++ b/app.py
@@ -121,12 +121,12 @@ def user(id,page=1):
     flag={}
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
     if current_user.is_authenticated==True:
-        for edit in editorials:
-            like=db.session.query(Like).filter(Like.edit_id==edit.id,Like.user_id==current_user.id).first()
+        for edit_ in editorials:
+            like=db.session.query(Like).filter(Like.edit_id==edit_.id,Like.user_id==current_user.id).first()
             if like:
-                flag[edit.id]=True
+                flag[edit_.id]=True
             else:
-                flag[edit.id]=False
+                flag[edit_.id]=False
 
     #順位計算（繰り上がり処理付き）
     rank_dict=dict({})

From 75c82ec1006d1ec8bf6e78af605980698a7a5d1d Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 23:00:30 +0900
Subject: [PATCH 188/336] fix

---
 templates/user.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/templates/user.html b/templates/user.html
index 1f1c5e9..fcfdfe0 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -88,6 +88,7 @@ <h3>投稿一覧</h3>
         <div>
             {%for e in edit.items %}
             <div id="editorial-card">
+                <br>
                 <br>
                 <div class="row">
                     {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}

From b9869d0d15ed48daebcd182d9929840527aa34d7 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 23:06:12 +0900
Subject: [PATCH 189/336] stable-ver

---
 templates/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index e6e1953..6ae5d74 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -67,7 +67,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。
+                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。<br>・ユーザーページからいいね出来るようにしました。
                     </div>
                 </div>
             </div>

From eb5f3c3f315d3c55eb6cacfd5900a84703bacad7 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 23:25:07 +0900
Subject: [PATCH 190/336] fix

---
 templates/user.html | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/templates/user.html b/templates/user.html
index fcfdfe0..60ef3ed 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -149,6 +149,34 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
         <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
         <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
         <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
+        <script type="text/javascript">
+            $('.like_button').on('click', function() {
+                $(this).toggleClass('active');
+
+                if ($(this).hasClass('active')) {
+                    var text = $(this).data('btn btn-info');
+                } else {
+                    var text = $(this).data('btn btnconsole.log($(this).val);-outline-info');
+                }
+
+                $(this).html(text);
+
+                event.preventDefault();
+                $.ajax({
+                        url: '/like',
+                        type: 'post',
+                        dataType: 'text',
+                        data: {
+                            id: $(this).val(),
+                        },
+                    }).done(function(response) {
+                        console.log('success');
+                    })
+                    .fail(function() {
+                        console.log('fail');
+                    });
+            })
+        </script>
 </body>
 
 

From 5a1d4abc4af77c20cad889eb032af16fc07d2913 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 23:30:17 +0900
Subject: [PATCH 191/336] fix

---
 templates/contest.html | 3 ++-
 templates/user.html    | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 9a6b074..98ba170 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -183,12 +183,13 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
             if ($(this).hasClass('active')) {
                 var text = $(this).data('btn btn-info');
             } else {
-                var text = $(this).data('btn btnconsole.log($(this).val);-outline-info');
+                var text = $(this).data('btn btn-outline-info');
             }
 
             $(this).html(text);
 
             event.preventDefault();
+            S
             $.ajax({
                     url: '/like',
                     type: 'post',
diff --git a/templates/user.html b/templates/user.html
index 60ef3ed..192ebcd 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -156,7 +156,7 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
                 if ($(this).hasClass('active')) {
                     var text = $(this).data('btn btn-info');
                 } else {
-                    var text = $(this).data('btn btnconsole.log($(this).val);-outline-info');
+                    var text = $(this).data('btn btn-outline-info');
                 }
 
                 $(this).html(text);

From bb33c18bf81298e8fb8fe71f868bbf7715381878 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 23:42:33 +0900
Subject: [PATCH 192/336] fix

---
 templates/contest.html | 1 -
 1 file changed, 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 98ba170..fdf9ac3 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -189,7 +189,6 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
             $(this).html(text);
 
             event.preventDefault();
-            S
             $.ajax({
                     url: '/like',
                     type: 'post',

From 2e6eac33c6d3029830d1c4bfd9fda29347680c72 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 23:44:42 +0900
Subject: [PATCH 193/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index fe571e2..efc84f7 100644
--- a/app.py
+++ b/app.py
@@ -224,7 +224,7 @@ def oauth_callback():
     return redirect(url_for('index'))
 
 #いいね処理
-@app.route('/like',methods=['POST'])
+@app.route('/like',methods=['GET'])
 def like():
     id=request.form['id']
 

From a874208609cb53b5c2c04ccfc4b125ddf1afc327 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 23:46:28 +0900
Subject: [PATCH 194/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index efc84f7..fe571e2 100644
--- a/app.py
+++ b/app.py
@@ -224,7 +224,7 @@ def oauth_callback():
     return redirect(url_for('index'))
 
 #いいね処理
-@app.route('/like',methods=['GET'])
+@app.route('/like',methods=['POST'])
 def like():
     id=request.form['id']
 

From c7d56769b46aed287c0c3b37dbcc4e33fd31a0e1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 23:49:42 +0900
Subject: [PATCH 195/336] fix

---
 templates/user.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index 192ebcd..0a85bd9 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -164,7 +164,7 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
                 event.preventDefault();
                 $.ajax({
                         url: '/like',
-                        type: 'post',
+                        type: 'get',
                         dataType: 'text',
                         data: {
                             id: $(this).val(),

From cbee7c31f4206cb7c52ce88184b20dc9b3681452 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 23:52:06 +0900
Subject: [PATCH 196/336] fix

---
 templates/user.html | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index 0a85bd9..5a13c47 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -161,10 +161,12 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
 
                 $(this).html(text);
 
+                console.log($(this).val)
+
                 event.preventDefault();
                 $.ajax({
                         url: '/like',
-                        type: 'get',
+                        type: 'post',
                         dataType: 'text',
                         data: {
                             id: $(this).val(),

From 53f24321536ac76e8558b02ccd534544b876771a Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 23:54:01 +0900
Subject: [PATCH 197/336] fix

---
 templates/user.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index 5a13c47..0232811 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -161,7 +161,7 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
 
                 $(this).html(text);
 
-                console.log($(this).val)
+                console.log($(this).val())
 
                 event.preventDefault();
                 $.ajax({

From 876c45d3e6902278ec98c73e50e72e4e1b8c92ee Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Sun, 25 Aug 2019 23:58:25 +0900
Subject: [PATCH 198/336] fix

---
 templates/index.html |  2 +-
 templates/user.html  | 43 +------------------------------------------
 2 files changed, 2 insertions(+), 43 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index 6ae5d74..e6e1953 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -67,7 +67,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。<br>・ユーザーページからいいね出来るようにしました。
+                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。
                     </div>
                 </div>
             </div>
diff --git a/templates/user.html b/templates/user.html
index 0232811..5443638 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -90,18 +90,7 @@ <h3>投稿一覧</h3>
             <div id="editorial-card">
                 <br>
                 <br>
-                <div class="row">
-                    {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}
-                    <form>
-                        <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
-                        <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{e.like}}いいね</button>
-                    </form>
-                    {%else%}
-                    <form>
-                        <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
-                        <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{e.like}}いいね</button>
-                    </form>
-                    {%endif%}{%endif%}
+                <div class="container-fluid">
                     <h4>{{e.contestname}}</h4>
                 </div>
 
@@ -149,36 +138,6 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
         <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
         <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
         <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
-        <script type="text/javascript">
-            $('.like_button').on('click', function() {
-                $(this).toggleClass('active');
-
-                if ($(this).hasClass('active')) {
-                    var text = $(this).data('btn btn-info');
-                } else {
-                    var text = $(this).data('btn btn-outline-info');
-                }
-
-                $(this).html(text);
-
-                console.log($(this).val())
-
-                event.preventDefault();
-                $.ajax({
-                        url: '/like',
-                        type: 'post',
-                        dataType: 'text',
-                        data: {
-                            id: $(this).val(),
-                        },
-                    }).done(function(response) {
-                        console.log('success');
-                    })
-                    .fail(function() {
-                        console.log('fail');
-                    });
-            })
-        </script>
 </body>
 
 

From 0ead0d307590fb5fb7d1a2d91e17402bbc9cf415 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 16:25:28 +0900
Subject: [PATCH 199/336] add new_contest_table

---
 app.py                | 22 ++++++++++++++++++++--
 templates/search.html | 32 ++++++++++++++++++++++++++++----
 2 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/app.py b/app.py
index fe571e2..97e97bc 100644
--- a/app.py
+++ b/app.py
@@ -50,12 +50,30 @@ def index():
 
 @app.route('/search', methods=['GET'])
 def contest_search():
-    return render_template('search.html')
+    #JSON取得　
+    get_problem=requests.get('https://kenkoooo.com/atcoder/resources/problems.json')
+    get_contest=requests.get('https://kenkoooo.com/atcoder/resources/contests.json')
+    #list型に変換
+    get_problem=get_problem.json()
+    get_contest=get_contest.json()
+
+    #コンテストを新しい順に並び替える
+    contest_list=sorted(get_contest,key=lambda x: x['start_epoch_second'],reverse=True)
+    #最新のコンテスト名
+    contestname=contest_list[0]['id']
+
+    #新着問題を取得する
+    problem_list=[]
+    for problem in get_problem:
+        if problem['contest_id']==contestname:
+            problem_list.append(problem['title'])
+
+    return render_template('search.html',problems=problem_list)
 
 
 @app.route('/search/<contestname>/<int:page>', methods=['GET','POST'])
 def contest_get(contestname,page=1):
-    contestname = _normalize_contestname(request.form.get('contestname'))
+    contestname = _normalize_contestname(contestname)
 
     #ページネーション
     per_page = 10
diff --git a/templates/search.html b/templates/search.html
index 4823e2c..35a8e26 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -67,14 +67,38 @@ <h5 class="text-muted">解法の見たい問題名を入力し、下の候補か
                 </h5>
             </div>
         </div>
-
-        <br>
-
+        <h3>新着問題</h3>
+
+        <table class="table table-borderd">
+            <thead class="thead-light">
+                <tr>
+                    <th scope="col">#</th>
+                    <th scope="col">名前</th>
+                </tr>
+            </thead> {% for problem in problems%}
+            <tbody>
+                <tr>
+                    <th scope="row">{{loop.index}}</th>
+                    <td>
+                        <a href="/search/{{problem}}/1" method="POST">{{problem}}</a>
+                    </td>
+                </tr>
+                {%endfor%}
+            </tbody>
+        </table>
+
+        <div class="row container-fluid">
+            <h3>検索</h3>
+            <h3 class="col-1"></h3>
+            <h3 class="text-muted"> 入力後、下にスクロールして下さい</h3>
+        </div>
         <form id="search" method="POST" action="">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
             <input id="autocomplete_search" placeholder="問題名" style="width:600px" name="contestname" type="text" />
         </form>
-
+        <br>
+        <br>
+        <br>
 
     </div>
 

From c386e06824e22ce1e638a251688e2996de8af5a8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 16:31:04 +0900
Subject: [PATCH 200/336] fix

---
 templates/index.html  | 2 +-
 templates/search.html | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index e6e1953..ff753b9 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -67,7 +67,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。
+                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。・<br>新着問題テーブルを追加しました。
                     </div>
                 </div>
             </div>
diff --git a/templates/search.html b/templates/search.html
index 35a8e26..bab6ef6 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -87,6 +87,8 @@ <h3>新着問題</h3>
             </tbody>
         </table>
 
+        <br>
+
         <div class="row container-fluid">
             <h3>検索</h3>
             <h3 class="col-1"></h3>

From 75a1e07e3bfb5e9fb92b673b4c40078c4f93cff7 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 16:35:26 +0900
Subject: [PATCH 201/336] fix

---
 templates/user.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index 5443638..c34277f 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -94,7 +94,7 @@ <h3>投稿一覧</h3>
                     <h4>{{e.contestname}}</h4>
                 </div>
 
-                <div class=" row container-fluid">
+                <div class="row">
                     <div class="card col-6 border-0" style="cursor: pointer;">
                         <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
                             {{e.title}}

From 0b3a8f9b32a0619058e71eb286cdf5c10b51ab93 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 16:44:16 +0900
Subject: [PATCH 202/336] fix

---
 templates/user.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index c34277f..5443638 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -94,7 +94,7 @@ <h3>投稿一覧</h3>
                     <h4>{{e.contestname}}</h4>
                 </div>
 
-                <div class="row">
+                <div class=" row container-fluid">
                     <div class="card col-6 border-0" style="cursor: pointer;">
                         <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
                             {{e.title}}

From a53ba73971a93e4b7a5bfa54153c62292b74de58 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 16:53:08 +0900
Subject: [PATCH 203/336] fix

---
 templates/user.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index 5443638..bcd7cbc 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -94,7 +94,7 @@ <h3>投稿一覧</h3>
                     <h4>{{e.contestname}}</h4>
                 </div>
 
-                <div class=" row container-fluid">
+                <div class="container-fluid">
                     <div class="card col-6 border-0" style="cursor: pointer;">
                         <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
                             {{e.title}}

From 57e6405a4cc3f9525eb356ec37ded0110b02a528 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 17:00:23 +0900
Subject: [PATCH 204/336] fix

---
 templates/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index ff753b9..107bcaa 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -67,7 +67,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。・<br>新着問題テーブルを追加しました。
+                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。<br>・新着問題テーブルを追加しました。
                     </div>
                 </div>
             </div>

From e24b9fd23338579e63c5875545363400e169acd3 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 17:52:23 +0900
Subject: [PATCH 205/336] add tweet-button

---
 templates/contest.html | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index fdf9ac3..eac0437 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -63,8 +63,19 @@
         <h1>{{request.args.get('contestname','')}}</h1>
     </div>
     {%else%}
-    <div class="container-fluid">
-        <h1>{{contestname}}</h1>
+    <div class="row">
+        <div class="container-fluid">
+            <h1>{{contestname}}</h1>
+        </div>
+        <h4 class="col-1"></h4>
+        <div>
+            {%if current_user.is_authenticated==True%}
+            <div class="twitter">
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{rank}}位になりました！" data-url="https://atcoder-editorials.herokuapp.com/user/{{user.id}}/1" data-lang="ja">
+                </a>
+            </div>
+            {%endif%}
+        </div>
     </div>
     {%endif%}
 

From 17e7aeb20a0e7d134fe65fce5c810cf66b9874ed Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 17:55:10 +0900
Subject: [PATCH 206/336] fix:

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index eac0437..57d1d47 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -71,7 +71,7 @@ <h4 class="col-1"></h4>
         <div>
             {%if current_user.is_authenticated==True%}
             <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{rank}}位になりました！" data-url="https://atcoder-editorials.herokuapp.com/user/{{user.id}}/1" data-lang="ja">
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
                 </a>
             </div>
             {%endif%}

From 1362dd46b4c0e8091fe990e064f9863d98cdc7dd Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 18:05:59 +0900
Subject: [PATCH 207/336] add tweet btn

---
 templates/contest.html | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 57d1d47..496f20f 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -63,19 +63,19 @@
         <h1>{{request.args.get('contestname','')}}</h1>
     </div>
     {%else%}
-    <div class="row">
-        <div class="container-fluid">
+    <div class="row container-fluid">
+        <div>
             <h1>{{contestname}}</h1>
         </div>
         <h4 class="col-1"></h4>
+        {% if current_user.is_authenticated== True %}
         <div>
-            {%if current_user.is_authenticated==True%}
             <div class="twitter">
                 <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
                 </a>
             </div>
-            {%endif%}
         </div>
+        {%endif%}
     </div>
     {%endif%}
 
@@ -186,6 +186,7 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
     <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
+    <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
 
     <script type="text/javascript">
         $('.like_button').on('click', function() {

From 695da3333fcf3506cd825e0a00f3326eca5bce43 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 18:12:42 +0900
Subject: [PATCH 208/336] fix

---
 templates/contest.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 496f20f..915a6b3 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -71,8 +71,8 @@ <h4 class="col-1"></h4>
         {% if current_user.is_authenticated== True %}
         <div>
             <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
-                </a>
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
+                </a>"
             </div>
         </div>
         {%endif%}

From 08dea3028f7a2c3bab740d0ce9b9ccb83d03fc06 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 18:14:10 +0900
Subject: [PATCH 209/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 915a6b3..463b16d 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -72,7 +72,7 @@ <h4 class="col-1"></h4>
         <div>
             <div class="twitter">
                 <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
-                </a>"
+                </a>
             </div>
         </div>
         {%endif%}

From 8708b4c9c7051c67973cfe2c4d7a6dc2739f0af3 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 18:15:45 +0900
Subject: [PATCH 210/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 463b16d..496f20f 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -71,7 +71,7 @@ <h4 class="col-1"></h4>
         {% if current_user.is_authenticated== True %}
         <div>
             <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
                 </a>
             </div>
         </div>

From f30683261aa9a12ea90cbaa85bf1f396d6211949 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 18:25:45 +0900
Subject: [PATCH 211/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 496f20f..5eb202f 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -71,7 +71,7 @@ <h4 class="col-1"></h4>
         {% if current_user.is_authenticated== True %}
         <div>
             <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url='https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1' data-lang="ja">
                 </a>
             </div>
         </div>

From 7575637a0428aa4abd93cd39e279bf7f7d015b4f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 18:29:07 +0900
Subject: [PATCH 212/336] fix

---
 templates/contest.html | 48 +++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 5eb202f..bbdc63d 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -71,7 +71,7 @@ <h4 class="col-1"></h4>
         {% if current_user.is_authenticated== True %}
         <div>
             <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url='https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1' data-lang="ja">
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
                 </a>
             </div>
         </div>
@@ -88,14 +88,14 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                 投稿する
             </h4>
             <div class="collapse" id="sub1" data-parent="#submit-card" style="cursor: pointer;">
-                <form action="/submited " method='POST'>
+                <form action="/submited " method=' POST '>
                     <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
                     <input type="text" placeholder="タイトル" name="title" style="width:535px" />
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
                     <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea> {%if contestname==None%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname','')}}">投稿</button> {%else%}
+                    <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname ',' ')}}">投稿</button> {%else%}
                     <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
 
                 </form>
@@ -130,7 +130,7 @@ <h4>投稿をするにはログインが必要です</h4>
                 {%endif%}{%else%}
                 <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
                 <h5 class="col-1"></h5>
-                <img src={{edit.user_image_url}} alt='No Image' style="width:36px;height:36px;vertical-align:middle;">
+                <img src={{edit.user_image_url}} alt='No Image ' style="width:36px;height:36px;vertical-align:middle;">
                 <a href="/user/{{edit.user_id}}/1" class="h4 text-dark" style="vertical-align:middle;">{{edit.username}}</a>
                 <h5 class="col-1"></h5>
                 {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
@@ -162,7 +162,7 @@ <h4 class="card-header text-light bg-light text-dark col-10" data-toggle="collap
             <br> {% endfor %}
         </div>
         {%else%}
-        <h4 class='container-fluid'>まだ投稿がありません</h4>
+        <h4 class='container-fluid '>まだ投稿がありません</h4>
         <br> {%endif%}
     </div>
 
@@ -170,14 +170,14 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
 
         <ul class="pagination">
             {% if editorials.has_prev %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',''))}}">
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get ', page=editorials.prev_num,contestname=request.args.get('contestname ',' '))}}">
         {%else%}
-        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname)}}">
+        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get ', page=editorials.prev_num,contestname=contestname)}}">
         {%endif%}
         << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname','')) }}">
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get ', page=editorials.next_num,contestname=request.args.get('contestname ',' ')) }}">
                 {%else%}
-                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname)}}">
+                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get ', page=editorials.next_num,contestname=contestname)}}">
         {%endif%}
          次のページ >></a></li>{% endif %}
         </ul>
@@ -189,41 +189,41 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
     <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
 
     <script type="text/javascript">
-        $('.like_button').on('click', function() {
-            $(this).toggleClass('active');
+        $('.like_button ').on('click ', function() {
+            $(this).toggleClass('active ');
 
-            if ($(this).hasClass('active')) {
-                var text = $(this).data('btn btn-info');
+            if ($(this).hasClass('active ')) {
+                var text = $(this).data('btn btn-info ');
             } else {
-                var text = $(this).data('btn btn-outline-info');
+                var text = $(this).data('btn btn-outline-info ');
             }
 
             $(this).html(text);
 
             event.preventDefault();
             $.ajax({
-                    url: '/like',
-                    type: 'post',
-                    dataType: 'text',
+                    url: '/like ',
+                    type: 'post ',
+                    dataType: 'text ',
                     data: {
                         id: $(this).val(),
                     },
                 }).done(function(response) {
-                    console.log('success');
+                    console.log('success ');
                 })
                 .fail(function() {
-                    console.log('fail');
+                    console.log('fail ');
                 });
         })
 
-        $('.delete_button').on('click', function() {
+        $('.delete_button ').on('click ', function() {
             flag = window.confirm("本当に削除してもよろしいでしょうか？")
             event.preventDefault();
             if (flag === true) {
                 $.ajax({
-                    url: '/delete',
-                    type: 'post',
-                    dataType: 'text',
+                    url: '/delete ',
+                    type: 'post ',
+                    dataType: 'text ',
                     data: {
                         id: $(this).val(),
                     }
@@ -238,7 +238,7 @@ <h4 class='container-fluid'>まだ投稿がありません</h4>
             });
         });
 
-        var csrftoken = $('meta[name=csrf-token]').attr('content')
+        var csrftoken = $('meta[name=csrf-token] ').attr('content ')
 
         $.ajaxSetup({
             beforeSend: function(xhr, settings) {

From 73077d9664518418fc365a930457ce3db814467f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 18:33:02 +0900
Subject: [PATCH 213/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index bbdc63d..ebd1c29 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -71,7 +71,7 @@ <h4 class="col-1"></h4>
         {% if current_user.is_authenticated== True %}
         <div>
             <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！ https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
                 </a>
             </div>
         </div>

From a024f6b33b4555630171987f17acf5b55f807c31 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 18:34:51 +0900
Subject: [PATCH 214/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index ebd1c29..78f49c3 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -71,7 +71,7 @@ <h4 class="col-1"></h4>
         {% if current_user.is_authenticated== True %}
         <div>
             <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！ https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！ " data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
                 </a>
             </div>
         </div>

From 6c4b97287d2cee9df67314f79fc33637498ec9d7 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 19:21:21 +0900
Subject: [PATCH 215/336] fix url-problem  about '/'

---
 app.py                 | 2 +-
 templates/contest.html | 2 +-
 templates/search.html  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/app.py b/app.py
index 97e97bc..426b7e5 100644
--- a/app.py
+++ b/app.py
@@ -74,7 +74,7 @@ def contest_search():
 @app.route('/search/<contestname>/<int:page>', methods=['GET','POST'])
 def contest_get(contestname,page=1):
     contestname = _normalize_contestname(contestname)
-
+    contestname.replace('/',"")
     #ページネーション
     per_page = 10
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
diff --git a/templates/contest.html b/templates/contest.html
index 78f49c3..bbdc63d 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -71,7 +71,7 @@ <h4 class="col-1"></h4>
         {% if current_user.is_authenticated== True %}
         <div>
             <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！ " data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
                 </a>
             </div>
         </div>
diff --git a/templates/search.html b/templates/search.html
index bab6ef6..3d8fcc3 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -137,7 +137,7 @@ <h3 class="text-muted"> 入力後、下にスクロールして下さい</h3>
                 select: function(event, ui) {
                     $("#autocomplete_search").val(ui.item.label);
 
-                    var url = '/search/' + ui.item.label + '/1'
+                    var url = '/search/' + ui.item.label.replace('/', '') + '/1'
 
                     $('form').attr('action', url)
                     $("#search").submit();

From 530f07508161e7086ca24db4a92430f0225be6a9 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 19:26:16 +0900
Subject: [PATCH 216/336] fix

---
 templates/search.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index 3d8fcc3..fc72a22 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -137,7 +137,7 @@ <h3 class="text-muted"> 入力後、下にスクロールして下さい</h3>
                 select: function(event, ui) {
                     $("#autocomplete_search").val(ui.item.label);
 
-                    var url = '/search/' + ui.item.label.replace('/', '') + '/1'
+                    var url = '/search/' + ui.item.label.replace('/', '%2F') + '/1'
 
                     $('form').attr('action', url)
                     $("#search").submit();

From c973d7af3652a5b6b93083ea4d1751f712d255b6 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 20:02:59 +0900
Subject: [PATCH 217/336] fix

---
 templates/search.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index fc72a22..930ba9f 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -137,9 +137,9 @@ <h3 class="text-muted"> 入力後、下にスクロールして下さい</h3>
                 select: function(event, ui) {
                     $("#autocomplete_search").val(ui.item.label);
 
-                    var url = '/search/' + ui.item.label.replace('/', '%2F') + '/1'
+                    var url = '/search/' + ui.item.label.replace('/', '|') + '/1';
 
-                    $('form').attr('action', url)
+                    $('form').attr('action', url);
                     $("#search").submit();
                 }
             });

From 1a1e9c4755914144e8459303adcba01510994a72 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 20:18:26 +0900
Subject: [PATCH 218/336] fix

---
 templates/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index 107bcaa..912b9e8 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -67,7 +67,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。<br>・新着問題テーブルを追加しました。
+                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。<br>・新着問題テーブルを追加しました。<br>・問題ページにツイートボタンを設置しました。
                     </div>
                 </div>
             </div>

From a07a8a66b0a90a55f03123b1d6dee3f19724a445 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 22:45:44 +0900
Subject: [PATCH 219/336] fix

---
 app.py                | 10 +++++-----
 templates/search.html | 20 ++++++++++++++++----
 2 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/app.py b/app.py
index 426b7e5..5ae337a 100644
--- a/app.py
+++ b/app.py
@@ -66,15 +66,15 @@ def contest_search():
     problem_list=[]
     for problem in get_problem:
         if problem['contest_id']==contestname:
-            problem_list.append(problem['title'])
+            problem_list.append((problem['title'],problem['id']))
 
     return render_template('search.html',problems=problem_list)
 
 
-@app.route('/search/<contestname>/<int:page>', methods=['GET','POST'])
-def contest_get(contestname,page=1):
-    contestname = _normalize_contestname(contestname)
-    contestname.replace('/',"")
+@app.route('/search/<contest_id>/<int:page>', methods=['GET','POST'])
+def contest_get(contest_id,page=1):
+    contestname = _normalize_contestname(request.args.get('contestname'))
+    
     #ページネーション
     per_page = 10
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
diff --git a/templates/search.html b/templates/search.html
index 930ba9f..b0e7faf 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -80,7 +80,7 @@ <h3>新着問題</h3>
                 <tr>
                     <th scope="row">{{loop.index}}</th>
                     <td>
-                        <a href="/search/{{problem}}/1" method="POST">{{problem}}</a>
+                        <a href="/search/{{problem[1]}}/1?contestname={{problem[0]}}" method="POST">{{problem[0]}}</a>
                     </td>
                 </tr>
                 {%endfor%}
@@ -120,7 +120,7 @@ <h3 class="text-muted"> 入力後、下にスクロールして下さい</h3>
                 success: function(json) {
                     var len = json.length;
                     for (var i = 0; i < len; i++) {
-                        contestName.push(json[i].title);
+                        contestName.push(json[i].id + ":" + json[i].title);
                     }
                 }
             });
@@ -135,9 +135,21 @@ <h3 class="text-muted"> 入力後、下にスクロールして下さい</h3>
 
                 //候補をクリックすることでsubmitできるようにする
                 select: function(event, ui) {
-                    $("#autocomplete_search").val(ui.item.label);
+                    var name = ui.item.label;
+                    console.log(typeof(name))
+                    $("#autocomplete_search").val(name);
+
+                    var num = 0;
+                    for (let i = 0; i < name.length; i++) {
+                        if (name[i] == ':') {
+                            num = i + 1;
+                            break;
+                        }
+                    }
+
+                    var url = '/search/' + name.split(':')[0] + '/1?contestname=' + name.slice(num, -1);
 
-                    var url = '/search/' + ui.item.label.replace('/', '|') + '/1';
+                    console.log(name.slice(num, -1));
 
                     $('form').attr('action', url);
                     $("#search").submit();

From f3f7f0ca6a4904cdd56dd26c973083763f9a62cc Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 22:54:19 +0900
Subject: [PATCH 220/336] fix

---
 templates/search.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index b0e7faf..d0c7728 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -147,7 +147,7 @@ <h3 class="text-muted"> 入力後、下にスクロールして下さい</h3>
                         }
                     }
 
-                    var url = '/search/' + name.split(':')[0] + '/1?contestname=' + name.slice(num, -1);
+                    var url = '/search/' + name.split(':')[0] + '/1?contestname=' + name.slice(num);
 
                     console.log(name.slice(num, -1));
 

From c78fc3184f45759fd9d60bb8e6cec957d211bc19 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 23:09:39 +0900
Subject: [PATCH 221/336] fix

---
 app.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index 5ae337a..c003ade 100644
--- a/app.py
+++ b/app.py
@@ -74,9 +74,9 @@ def contest_search():
 @app.route('/search/<contest_id>/<int:page>', methods=['GET','POST'])
 def contest_get(contest_id,page=1):
     contestname = _normalize_contestname(request.args.get('contestname'))
-    
+
     #ページネーション
-    per_page = 10
+    per_page = 1
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
 
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす

From 85e241d81a3fe364ade1079a3b175bc8eb24a6c0 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 23:13:14 +0900
Subject: [PATCH 222/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index c003ade..9b19177 100644
--- a/app.py
+++ b/app.py
@@ -94,7 +94,7 @@ def contest_get(contest_id,page=1):
         return render_template('contest.html',contestname=contestname,editorials=editorials)
 
 
-@app.route('/submited', methods=['POST'])
+@app.route('/submited', methods=['POST','GET'])
 def submit():
     #DBに挿入する解法情報
     params = {

From 8b8c2b886d0262a3ad038230eae9d068079821ab Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 23:16:20 +0900
Subject: [PATCH 223/336] fix

---
 app.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index 9b19177..66e12aa 100644
--- a/app.py
+++ b/app.py
@@ -107,8 +107,9 @@ def submit():
         'username': current_user.username,
         'user_id':current_user.id
     }   
-
-    params['description']=params['description'].replace('\r\n','<br>')
+    
+    if params['description']!=None:
+            params['description']=params['description'].replace('\r\n','<br>')
 
     #必要量記入されているかチェック
     if ((params['description'] is not None and params['description'] is not '') or (params['url'] is not None and params['url'] is not ''))\

From ab3efaebb6433dc603c5516ca6d5b3ca03ec0b8d Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 23:20:38 +0900
Subject: [PATCH 224/336] fix

---
 app.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app.py b/app.py
index 66e12aa..47dd188 100644
--- a/app.py
+++ b/app.py
@@ -111,6 +111,8 @@ def submit():
     if params['description']!=None:
             params['description']=params['description'].replace('\r\n','<br>')
 
+    prin(params['title'],params['url'],params['description'])
+
     #必要量記入されているかチェック
     if ((params['description'] is not None and params['description'] is not '') or (params['url'] is not None and params['url'] is not ''))\
           and params['title'] is not None and params['title'] is not '':

From 13c7f245c4b6acdc31ba2683dfb7f73a59e0eaaf Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 23:20:59 +0900
Subject: [PATCH 225/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 47dd188..88c7027 100644
--- a/app.py
+++ b/app.py
@@ -111,7 +111,7 @@ def submit():
     if params['description']!=None:
             params['description']=params['description'].replace('\r\n','<br>')
 
-    prin(params['title'],params['url'],params['description'])
+    print(params['title'],params['url'],params['description'])
 
     #必要量記入されているかチェック
     if ((params['description'] is not None and params['description'] is not '') or (params['url'] is not None and params['url'] is not ''))\

From 7ef93a774203f359aa2429109c677b865a489e02 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 23:22:43 +0900
Subject: [PATCH 226/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 88c7027..b465c91 100644
--- a/app.py
+++ b/app.py
@@ -76,7 +76,7 @@ def contest_get(contest_id,page=1):
     contestname = _normalize_contestname(request.args.get('contestname'))
 
     #ページネーション
-    per_page = 1
+    per_page = 10
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
 
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす

From c41ecefc9cb805309ed21e5f83971d8c6cefd3a2 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Mon, 26 Aug 2019 23:30:08 +0900
Subject: [PATCH 227/336] fix

---
 app.py                 | 4 ++--
 templates/contest.html | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/app.py b/app.py
index b465c91..fb925d6 100644
--- a/app.py
+++ b/app.py
@@ -114,8 +114,8 @@ def submit():
     print(params['title'],params['url'],params['description'])
 
     #必要量記入されているかチェック
-    if ((params['description'] is not None and params['description'] is not '') or (params['url'] is not None and params['url'] is not ''))\
-          and params['title'] is not None and params['title'] is not '':
+    if (params['description'] is not None and params['description'] is not '') or ((params['url'] is not None and params['url'] is not '')\
+          and (params['title'] is not None and params['title'] is not '')):
         newEditorial = Editorial(**params)
         db.session.add(newEditorial)
         db.session.commit()
diff --git a/templates/contest.html b/templates/contest.html
index bbdc63d..ec889ec 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -88,7 +88,7 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                 投稿する
             </h4>
             <div class="collapse" id="sub1" data-parent="#submit-card" style="cursor: pointer;">
-                <form action="/submited " method=' POST '>
+                <form action="/submited " method='POST'>
                     <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
                     <input type="text" placeholder="タイトル" name="title" style="width:535px" />
                     <br>

From 588d5a19fda0520be9c85d787f6efbcafaaed151 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 13:55:20 +0900
Subject: [PATCH 228/336] fix

---
 app.py                 | 7 +++----
 templates/contest.html | 8 ++++----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/app.py b/app.py
index fb925d6..996cef0 100644
--- a/app.py
+++ b/app.py
@@ -76,7 +76,7 @@ def contest_get(contest_id,page=1):
     contestname = _normalize_contestname(request.args.get('contestname'))
 
     #ページネーション
-    per_page = 10
+    per_page = 1
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
 
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
@@ -89,9 +89,9 @@ def contest_get(contest_id,page=1):
             else:
                 flag[edit.id]=False
 
-        return render_template('contest.html', contestname=contestname, editorials=editorials,flag=flag)
+        return render_template('contest.html', contestname=contestname, editorials=editorials,flag=flag,contest_id=contest_id)
     else:
-        return render_template('contest.html',contestname=contestname,editorials=editorials)
+        return render_template('contest.html',contestname=contestname,editorials=editorials,contest_id=contest_id)
 
 
 @app.route('/submited', methods=['POST','GET'])
@@ -111,7 +111,6 @@ def submit():
     if params['description']!=None:
             params['description']=params['description'].replace('\r\n','<br>')
 
-    print(params['title'],params['url'],params['description'])
 
     #必要量記入されているかチェック
     if (params['description'] is not None and params['description'] is not '') or ((params['url'] is not None and params['url'] is not '')\
diff --git a/templates/contest.html b/templates/contest.html
index ec889ec..f0de077 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -170,14 +170,14 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
 
         <ul class="pagination">
             {% if editorials.has_prev %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get ', page=editorials.prev_num,contestname=request.args.get('contestname ',' '))}}">
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id)}}">
         {%else%}
-        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get ', page=editorials.prev_num,contestname=contestname)}}">
+        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id)}}">
         {%endif%}
         << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get ', page=editorials.next_num,contestname=request.args.get('contestname ',' ')) }}">
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id) }}">
                 {%else%}
-                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get ', page=editorials.next_num,contestname=contestname)}}">
+                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id)}}">
         {%endif%}
          次のページ >></a></li>{% endif %}
         </ul>

From 6a77594d75da8005a7772f7c5977806a8f986b93 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 13:56:54 +0900
Subject: [PATCH 229/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 996cef0..4c85b23 100644
--- a/app.py
+++ b/app.py
@@ -76,7 +76,7 @@ def contest_get(contest_id,page=1):
     contestname = _normalize_contestname(request.args.get('contestname'))
 
     #ページネーション
-    per_page = 1
+    per_page = 10
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
 
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす

From d22cb93e5eab32ed79d4621ab236db4f7bad7dcd Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 13:59:25 +0900
Subject: [PATCH 230/336] fix

---
 templates/contest.html | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/templates/contest.html b/templates/contest.html
index f0de077..353a1fd 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -227,6 +227,10 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
                     data: {
                         id: $(this).val(),
                     }
+                }).done(function() {
+                    console.log('success');
+                }).fail(function() {
+                    console.log('fail');
                 })
             }
         })

From 1e6ad7a93a3acae24183af26eacfa4635ebc1940 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 14:02:00 +0900
Subject: [PATCH 231/336] fix

---
 templates/contest.html | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 353a1fd..e3ff454 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -189,30 +189,30 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
     <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
 
     <script type="text/javascript">
-        $('.like_button ').on('click ', function() {
-            $(this).toggleClass('active ');
+        $('.like_button').on('click', function() {
+            $(this).toggleClass('active');
 
-            if ($(this).hasClass('active ')) {
-                var text = $(this).data('btn btn-info ');
+            if ($(this).hasClass('active')) {
+                var text = $(this).data('btn btn-info');
             } else {
-                var text = $(this).data('btn btn-outline-info ');
+                var text = $(this).data('btn btn-outline-info');
             }
 
             $(this).html(text);
 
             event.preventDefault();
             $.ajax({
-                    url: '/like ',
-                    type: 'post ',
-                    dataType: 'text ',
+                    url: '/like',
+                    type: 'post',
+                    dataType: 'text',
                     data: {
                         id: $(this).val(),
                     },
                 }).done(function(response) {
-                    console.log('success ');
+                    console.log('success');
                 })
                 .fail(function() {
-                    console.log('fail ');
+                    console.log('fail');
                 });
         })
 
@@ -221,9 +221,9 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
             event.preventDefault();
             if (flag === true) {
                 $.ajax({
-                    url: '/delete ',
-                    type: 'post ',
-                    dataType: 'text ',
+                    url: '/delete',
+                    type: 'post',
+                    dataType: 'text',
                     data: {
                         id: $(this).val(),
                     }

From 2a62efcf845786f8db2e5181906ef88aafce01ab Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 14:09:26 +0900
Subject: [PATCH 232/336] fix

---
 app.py                 |  4 ++--
 templates/contest.html | 10 ++++------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/app.py b/app.py
index 4c85b23..ba1a60a 100644
--- a/app.py
+++ b/app.py
@@ -275,9 +275,9 @@ def like():
     return 'hoge'
 
 #解法消去処理
-@app.route('/delete',methods=['POST'])
+@app.route('/delete',methods=['GET'])
 def delete():
-    edit=db.session.query(Editorial).filter(Editorial.id==request.form['id']).first()
+    edit=db.session.query(Editorial).filter(Editorial.id==request.args.get('id')).first()
 
     #投稿者の総いいね数から、消去する解法のいいね数を減らす
     user=db.session.query(User).filter(User.id==edit.user_id).first()
diff --git a/templates/contest.html b/templates/contest.html
index e3ff454..ccdac54 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -221,12 +221,10 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
             event.preventDefault();
             if (flag === true) {
                 $.ajax({
-                    url: '/delete',
-                    type: 'post',
+                    url: '/delete?id=$(this).val()',
+                    type: 'GET',
                     dataType: 'text',
-                    data: {
-                        id: $(this).val(),
-                    }
+
                 }).done(function() {
                     console.log('success');
                 }).fail(function() {
@@ -242,7 +240,7 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
             });
         });
 
-        var csrftoken = $('meta[name=csrf-token] ').attr('content ')
+        var csrftoken = $('meta[name=csrf-token]').attr('content')
 
         $.ajaxSetup({
             beforeSend: function(xhr, settings) {

From 05491001fbfa778252197c72e5e4ee3a11c8f907 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 14:13:18 +0900
Subject: [PATCH 233/336] fix

---
 templates/contest.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index ccdac54..c8d85fa 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -220,8 +220,9 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
             flag = window.confirm("本当に削除してもよろしいでしょうか？")
             event.preventDefault();
             if (flag === true) {
+                url = '/delete?id=' + $(this).val();
                 $.ajax({
-                    url: '/delete?id=$(this).val()',
+                    url: url,
                     type: 'GET',
                     dataType: 'text',
 

From 79e91c6ea20970142c48384c65fbd6010d01c81f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 14:18:04 +0900
Subject: [PATCH 234/336] fix

---
 app.py                 |  4 ++--
 templates/contest.html | 22 ++++++----------------
 2 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/app.py b/app.py
index ba1a60a..73d4184 100644
--- a/app.py
+++ b/app.py
@@ -244,9 +244,9 @@ def oauth_callback():
     return redirect(url_for('index'))
 
 #いいね処理
-@app.route('/like',methods=['POST'])
+@app.route('/like',methods=['GET'])
 def like():
-    id=request.form['id']
+    id=request.args.get('id')
 
     #いいねを既にされているかどうか
     flag=db.session.query(Like).filter(Like.edit_id==id ).filter(Like.user_id==current_user.id).first()
diff --git a/templates/contest.html b/templates/contest.html
index c8d85fa..2c052e0 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -201,19 +201,13 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
             $(this).html(text);
 
             event.preventDefault();
+
+            url = '/like?id=' + $(this).val();
             $.ajax({
-                    url: '/like',
-                    type: 'post',
-                    dataType: 'text',
-                    data: {
-                        id: $(this).val(),
-                    },
-                }).done(function(response) {
-                    console.log('success');
-                })
-                .fail(function() {
-                    console.log('fail');
-                });
+                url: url,
+                type: 'GET',
+                dataType: 'text',
+            })
         })
 
         $('.delete_button ').on('click ', function() {
@@ -226,10 +220,6 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
                     type: 'GET',
                     dataType: 'text',
 
-                }).done(function() {
-                    console.log('success');
-                }).fail(function() {
-                    console.log('fail');
                 })
             }
         })

From e31f4e591f2031b303be1d418d9ecb672adb6e84 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 14:20:49 +0900
Subject: [PATCH 235/336] fix

---
 app.py                 | 2 +-
 templates/contest.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index 73d4184..6c97eed 100644
--- a/app.py
+++ b/app.py
@@ -244,7 +244,7 @@ def oauth_callback():
     return redirect(url_for('index'))
 
 #いいね処理
-@app.route('/like',methods=['GET'])
+@app.route('/like',methods=['POST'])
 def like():
     id=request.args.get('id')
 
diff --git a/templates/contest.html b/templates/contest.html
index 2c052e0..76f3c2b 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -205,7 +205,7 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
             url = '/like?id=' + $(this).val();
             $.ajax({
                 url: url,
-                type: 'GET',
+                type: 'POST',
                 dataType: 'text',
             })
         })

From 429fd4fd6396f5aa58d5938354b8719fde45469f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 14:24:40 +0900
Subject: [PATCH 236/336] fix

---
 static/script.js | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/static/script.js b/static/script.js
index 6a616ee..febe49e 100644
--- a/static/script.js
+++ b/static/script.js
@@ -1,3 +1,38 @@
+$('.like_button').on('click', function() {
+    $(this).toggleClass('active');
+
+    if ($(this).hasClass('active')) {
+        var text = $(this).data('btn btn-info');
+    } else {
+        var text = $(this).data('btn btn-outline-info');
+    }
+
+    $(this).html(text);
+
+    event.preventDefault();
+
+    url = '/like?id=' + $(this).val();
+    $.ajax({
+        url: url,
+        type: 'POST',
+        dataType: 'text',
+    })
+})
+
+$('.delete_button ').on('click ', function() {
+    flag = window.confirm("本当に削除してもよろしいでしょうか？")
+    event.preventDefault();
+    if (flag === true) {
+        url = '/delete?id=' + $(this).val();
+        $.ajax({
+            url: url,
+            type: 'GET',
+            dataType: 'text',
+
+        })
+    }
+})
+
 //input内でのEnter無効化
 $(function() {
     $(document).on("keypress", "input:not(.allow_submit)", function(event) {

From eed70604a9ce026ad696c2239dbfe30e51101cdf Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 14:30:17 +0900
Subject: [PATCH 237/336] stable -ver

---
 templates/contest.html | 55 +-----------------------------------------
 1 file changed, 1 insertion(+), 54 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 76f3c2b..e92541d 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -187,60 +187,7 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
     <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
-
-    <script type="text/javascript">
-        $('.like_button').on('click', function() {
-            $(this).toggleClass('active');
-
-            if ($(this).hasClass('active')) {
-                var text = $(this).data('btn btn-info');
-            } else {
-                var text = $(this).data('btn btn-outline-info');
-            }
-
-            $(this).html(text);
-
-            event.preventDefault();
-
-            url = '/like?id=' + $(this).val();
-            $.ajax({
-                url: url,
-                type: 'POST',
-                dataType: 'text',
-            })
-        })
-
-        $('.delete_button ').on('click ', function() {
-            flag = window.confirm("本当に削除してもよろしいでしょうか？")
-            event.preventDefault();
-            if (flag === true) {
-                url = '/delete?id=' + $(this).val();
-                $.ajax({
-                    url: url,
-                    type: 'GET',
-                    dataType: 'text',
-
-                })
-            }
-        })
-
-        //input内でのEnter無効化
-        $(function() {
-            $(document).on("keypress", "input:not(.allow_submit)", function(event) {
-                return event.which !== 13;
-            });
-        });
-
-        var csrftoken = $('meta[name=csrf-token]').attr('content')
-
-        $.ajaxSetup({
-            beforeSend: function(xhr, settings) {
-                if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type)) {
-                    xhr.setRequestHeader("X-CSRFToken", csrftoken)
-                }
-            }
-        })
-    </script>
+    <script src="/static/script.js"></script>
 </body>
 
 </html>
\ No newline at end of file

From dc4fdcd46d1cb7bbfa9a105902c8f86706eaf964 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 15:03:36 +0900
Subject: [PATCH 238/336] add official problem and editorial

---
 app.py                 | 17 +++++++++++++----
 templates/contest.html | 13 +++++++++----
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/app.py b/app.py
index 6c97eed..98ab618 100644
--- a/app.py
+++ b/app.py
@@ -71,9 +71,18 @@ def contest_search():
     return render_template('search.html',problems=problem_list)
 
 
-@app.route('/search/<contest_id>/<int:page>', methods=['GET','POST'])
-def contest_get(contest_id,page=1):
+@app.route('/search/<problem_id>/<int:page>', methods=['GET','POST'])
+def contest_get(problem_id,page=1):
     contestname = _normalize_contestname(request.args.get('contestname'))
+    
+    get_problem=requests.get('https://kenkoooo.com/atcoder/resources/problems.json')
+    get_problem=get_problem.json()
+
+    contest_id=''
+    for problem in get_problem:
+        if problem_id==problem['id']:
+            contest_id=problem['contest_id']
+            break
 
     #ページネーション
     per_page = 10
@@ -89,9 +98,9 @@ def contest_get(contest_id,page=1):
             else:
                 flag[edit.id]=False
 
-        return render_template('contest.html', contestname=contestname, editorials=editorials,flag=flag,contest_id=contest_id)
+        return render_template('contest.html', contestname=contestname, editorials=editorials,flag=flag,problem_id=problem_id,contest_id=contest_id)
     else:
-        return render_template('contest.html',contestname=contestname,editorials=editorials,contest_id=contest_id)
+        return render_template('contest.html',contestname=contestname,editorials=editorials,problem_id=problem_id,contest_id=contest_id)
 
 
 @app.route('/submited', methods=['POST','GET'])
diff --git a/templates/contest.html b/templates/contest.html
index e92541d..dccd191 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -79,6 +79,11 @@ <h4 class="col-1"></h4>
     </div>
     {%endif%}
 
+    <div class="container-fluid">
+        <a class="h4" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}">問題ページ</a>
+        <a class="h4" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf">公式editorial</a>
+    </div>
+
 
     <br> {% if current_user.is_authenticated== True %}
     <div id="submit-card">
@@ -170,14 +175,14 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
 
         <ul class="pagination">
             {% if editorials.has_prev %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id)}}">
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id)}}">
         {%else%}
-        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id)}}">
+        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id)}}">
         {%endif%}
         << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id) }}">
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id) }}">
                 {%else%}
-                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id)}}">
+                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id)}}">
         {%endif%}
          次のページ >></a></li>{% endif %}
         </ul>

From 2d37cb8acacb0151a59dfb869385689ce5bc2376 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 15:05:49 +0900
Subject: [PATCH 239/336] fix

---
 templates/contest.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index dccd191..fdb515b 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -79,8 +79,9 @@ <h4 class="col-1"></h4>
     </div>
     {%endif%}
 
-    <div class="container-fluid">
+    <div class="row container-fluid">
         <a class="h4" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}">問題ページ</a>
+        <h4 class="col-1"></h4>
         <a class="h4" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf">公式editorial</a>
     </div>
 

From 6b5834d4bdf5da66dec92740cf48502efac4e236 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 15:09:20 +0900
Subject: [PATCH 240/336] add comment

---
 templates/index.html | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index 912b9e8..932c10a 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -67,7 +67,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。<br>・新着問題テーブルを追加しました。<br>・問題ページにツイートボタンを設置しました。
+                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。<br>・新着問題テーブルを追加しました。<br>・問題ページにツイートボタンを設置しました。<br>・公式editorialと問題ページヘのリンクを追加しました。
                     </div>
                 </div>
             </div>
@@ -99,7 +99,6 @@ <h4>良い解法をより見つけやすく</h4>
                 <h4>投稿方法</h4>
                 ・AtCoderEditorialsに直接書き込む。
                 <br>・解法ブログの記事などのURLを貼る。
-                <br>・自分以外が書いた解法の投稿は、許可を貰ってからお願いします。
                 <br>
                 <br>
                 <h4>ログインについて</h4>

From 3c7f3ef6d4eaa55bb1edceb1a2ca5743ab40d118 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 15:22:34 +0900
Subject: [PATCH 241/336] fix

---
 app.py                 | 2 +-
 templates/contest.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index 98ab618..869b1ca 100644
--- a/app.py
+++ b/app.py
@@ -85,7 +85,7 @@ def contest_get(problem_id,page=1):
             break
 
     #ページネーション
-    per_page = 10
+    per_page = 1
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
 
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
diff --git a/templates/contest.html b/templates/contest.html
index fdb515b..03dad95 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -79,7 +79,7 @@ <h4 class="col-1"></h4>
     </div>
     {%endif%}
 
-    <div class="row container-fluid">
+    <div class="container-fluid">
         <a class="h4" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}">問題ページ</a>
         <h4 class="col-1"></h4>
         <a class="h4" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf">公式editorial</a>

From d2769634cd2a7f0abdec52e388e0fc502cb42377 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 15:25:13 +0900
Subject: [PATCH 242/336] add comment

---
 templates/index.html | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index 932c10a..660fd2a 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -67,7 +67,12 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        ・URLの改良をしました。 <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。<br>・新着問題テーブルを追加しました。<br>・問題ページにツイートボタンを設置しました。<br>・公式editorialと問題ページヘのリンクを追加しました。
+                        ・URLの改良をしました。
+                        <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。
+                        <br>・新着問題テーブルを追加しました。
+                        <br>・問題ページにツイートボタンを設置しました。
+                        <br>・公式editorialと問題ページヘのリンクを追加しました。
+                        <br>（公式editorialは旧コンテスト未対応です）
                     </div>
                 </div>
             </div>

From d91443fdee043a352d44131c1957298436cc45d1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 15:28:18 +0900
Subject: [PATCH 243/336] fix

---
 templates/contest.html | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/templates/contest.html b/templates/contest.html
index 03dad95..f1d24cf 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -79,12 +79,16 @@ <h4 class="col-1"></h4>
     </div>
     {%endif%}
 
+    <br>
+
     <div class="container-fluid">
         <a class="h4" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}">問題ページ</a>
         <h4 class="col-1"></h4>
         <a class="h4" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf">公式editorial</a>
     </div>
 
+    <br>
+
 
     <br> {% if current_user.is_authenticated== True %}
     <div id="submit-card">

From 9755720f55a554dd25c65164ca29a4aa466777b8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 15:37:37 +0900
Subject: [PATCH 244/336] fix

---
 templates/search.html | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index d0c7728..20f403a 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -63,7 +63,7 @@
             <div class="container">
                 <h4 class="display-4">問題名検索</h4>
                 <br>
-                <h5 class="text-muted">解法の見たい問題名を入力し、下の候補から選択して下さい。<br> 検索方法がコンテスト名から問題名に変更されました。
+                <h5 class="text-muted">解法の見たい問題名を入力し、下の候補から選択して下さい
                 </h5>
             </div>
         </div>
@@ -91,8 +91,6 @@ <h3>新着問題</h3>
 
         <div class="row container-fluid">
             <h3>検索</h3>
-            <h3 class="col-1"></h3>
-            <h3 class="text-muted"> 入力後、下にスクロールして下さい</h3>
         </div>
         <form id="search" method="POST" action="">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />

From f1a34168e428887b77abb74b884e479fb0b8dd53 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 15:40:20 +0900
Subject: [PATCH 245/336] add target _blank

---
 templates/contest.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index f1d24cf..490542f 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -82,9 +82,9 @@ <h4 class="col-1"></h4>
     <br>
 
     <div class="container-fluid">
-        <a class="h4" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}">問題ページ</a>
+        <a class="h4" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}" target="_blank">問題ページ</a>
         <h4 class="col-1"></h4>
-        <a class="h4" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf">公式editorial</a>
+        <a class="h4" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf" target="_blank">公式editorial</a>
     </div>
 
     <br>

From 53d1b61b71a6bfd7082d24dc29a008b1c91706ce Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 15:43:11 +0900
Subject: [PATCH 246/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 490542f..54a0fec 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -71,7 +71,7 @@ <h4 class="col-1"></h4>
         {% if current_user.is_authenticated== True %}
         <div>
             <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！ https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-url="" data-lang="ja">
                 </a>
             </div>
         </div>

From fea655b90d8b487921fa7b0c52166ab59f6888e8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 15:46:00 +0900
Subject: [PATCH 247/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 54a0fec..490542f 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -71,7 +71,7 @@ <h4 class="col-1"></h4>
         {% if current_user.is_authenticated== True %}
         <div>
             <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！ https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-url="" data-lang="ja">
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
                 </a>
             </div>
         </div>

From c34dc030c4d203793ed0b2fe2726ccb42b4d4227 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 15:49:52 +0900
Subject: [PATCH 248/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 490542f..f9669d5 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -71,7 +71,7 @@ <h4 class="col-1"></h4>
         {% if current_user.is_authenticated== True %}
         <div>
             <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{contestname}}/1" data-lang="ja">
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{problem_id}}/1" data-lang="ja">
                 </a>
             </div>
         </div>

From 7bdbd9aefa91cba30e143cf682834ff06c1b8c02 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 16:12:10 +0900
Subject: [PATCH 249/336] add delete btn at user_page

---
 templates/contest.html | 5 -----
 templates/user.html    | 8 ++++++++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index f9669d5..8a2c421 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -79,17 +79,12 @@ <h4 class="col-1"></h4>
     </div>
     {%endif%}
 
-    <br>
-
     <div class="container-fluid">
         <a class="h4" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}" target="_blank">問題ページ</a>
         <h4 class="col-1"></h4>
         <a class="h4" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf" target="_blank">公式editorial</a>
     </div>
 
-    <br>
-
-
     <br> {% if current_user.is_authenticated== True %}
     <div id="submit-card">
 
diff --git a/templates/user.html b/templates/user.html
index bcd7cbc..71338cc 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -90,6 +90,14 @@ <h3>投稿一覧</h3>
             <div id="editorial-card">
                 <br>
                 <br>
+                <div class="container-fluid">
+                    {% if current_user.is_authenticated==True and e.user_id==current_user.id%}
+                    <form>
+                        <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                        <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{e.id}}>削除</button>
+                    </form>
+                    {%endif%}
+                </div>
                 <div class="container-fluid">
                     <h4>{{e.contestname}}</h4>
                 </div>

From 8341f582a16ed30058ba06788c97679ef02b5cde Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 16:14:05 +0900
Subject: [PATCH 250/336] fix

---
 templates/user.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/templates/user.html b/templates/user.html
index 71338cc..5104902 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -146,6 +146,7 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
         <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
         <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
         <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
+        <script src="/static//script.js"></script>
 </body>
 
 

From cc082ac43b71ffa3ee500f8369aa267737785d37 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 16:15:30 +0900
Subject: [PATCH 251/336] fix

---
 templates/user.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index 5104902..60778cc 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -146,7 +146,7 @@ <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-ta
         <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
         <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
         <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
-        <script src="/static//script.js"></script>
+        <script src="/static/script.js"></script>
 </body>
 
 

From 97deabfdef1eb98d57486a82b723d3042fbd9013 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 16:25:22 +0900
Subject: [PATCH 252/336] fix

---
 templates/user.html | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/templates/user.html b/templates/user.html
index 60778cc..acfbaf4 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -90,7 +90,8 @@ <h3>投稿一覧</h3>
             <div id="editorial-card">
                 <br>
                 <br>
-                <div class="container-fluid">
+                <div class="row container-fluid">
+                    <h4>{{e.contestname}}</h4>
                     {% if current_user.is_authenticated==True and e.user_id==current_user.id%}
                     <form>
                         <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
@@ -98,9 +99,6 @@ <h3>投稿一覧</h3>
                     </form>
                     {%endif%}
                 </div>
-                <div class="container-fluid">
-                    <h4>{{e.contestname}}</h4>
-                </div>
 
                 <div class="container-fluid">
                     <div class="card col-6 border-0" style="cursor: pointer;">

From 66f08bec639d840fc8816497f096462760fbf9f7 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 16:27:02 +0900
Subject: [PATCH 253/336] fix

---
 templates/user.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/templates/user.html b/templates/user.html
index acfbaf4..42ca6c0 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -92,6 +92,7 @@ <h3>投稿一覧</h3>
                 <br>
                 <div class="row container-fluid">
                     <h4>{{e.contestname}}</h4>
+                    <h4 class="col-1"></h4>
                     {% if current_user.is_authenticated==True and e.user_id==current_user.id%}
                     <form>
                         <input type="hidden" name="csrf_token" value="{{csrf_token}}" />

From 47cd7fc8f889732f05db03faddd8f35385b1aed2 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 16:33:26 +0900
Subject: [PATCH 254/336] stable

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 8a2c421..03ac21c 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -109,7 +109,7 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
     </div>
     {% else %}
     <div class="container-fluid">
-        <h4>投稿をするにはログインが必要です</h4>
+        <h4>「投稿」または「いいね」をするにはログインが必要です</h4>
     </div>
     {%endif%}
     <br>

From 1ff5493471b4b49354978578d571e8ab1c2fb998 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 16:37:13 +0900
Subject: [PATCH 255/336] fix

---
 app.py                 | 2 +-
 templates/contest.html | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 869b1ca..98ab618 100644
--- a/app.py
+++ b/app.py
@@ -85,7 +85,7 @@ def contest_get(problem_id,page=1):
             break
 
     #ページネーション
-    per_page = 1
+    per_page = 10
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
 
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
diff --git a/templates/contest.html b/templates/contest.html
index 03ac21c..3b4cce7 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -121,6 +121,7 @@ <h4>「投稿」または「いいね」をするにはログインが必要で
         <div id="editorial-card">
 
             {% for edit in editorials.items %}
+            <br>
             <div class="row container-fluid">
                 {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
                 <form>

From ddbb2e2f44c956b97c2ff2ff7849633c55bf5bf8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 16:46:36 +0900
Subject: [PATCH 256/336] add fav-btn at user_page

---
 templates/user.html | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/templates/user.html b/templates/user.html
index 42ca6c0..81e4c99 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -91,6 +91,18 @@ <h3>投稿一覧</h3>
                 <br>
                 <br>
                 <div class="row container-fluid">
+                    {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}
+                    <form>
+                        <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                        <button class="like_button btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button>
+                    </form>
+                    {%else%}
+                    <form>
+                        <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                        <button class="like_button btn btn-info" name="id" value={{e.id}}>{{e.like}}いいね</button>
+                    </form>
+                    {%endif%}{%else%}
+                    <button class="like_button_no_login btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button> {%endif%}
                     <h4>{{e.contestname}}</h4>
                     <h4 class="col-1"></h4>
                     {% if current_user.is_authenticated==True and e.user_id==current_user.id%}

From 1493a7d417ca1cad59af1d34dd1d4911dedf8465 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 16:51:29 +0900
Subject: [PATCH 257/336] fix

---
 templates/user.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/templates/user.html b/templates/user.html
index 81e4c99..b2d8280 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -103,6 +103,7 @@ <h3>投稿一覧</h3>
                     </form>
                     {%endif%}{%else%}
                     <button class="like_button_no_login btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button> {%endif%}
+                    <h4 class="col-1"></h4>
                     <h4>{{e.contestname}}</h4>
                     <h4 class="col-1"></h4>
                     {% if current_user.is_authenticated==True and e.user_id==current_user.id%}

From a7184bb139e14bbb88b06887cb66209a9a30333f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 16:54:36 +0900
Subject: [PATCH 258/336] fix

---
 templates/user.html | 1 -
 1 file changed, 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index b2d8280..81e4c99 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -103,7 +103,6 @@ <h3>投稿一覧</h3>
                     </form>
                     {%endif%}{%else%}
                     <button class="like_button_no_login btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button> {%endif%}
-                    <h4 class="col-1"></h4>
                     <h4>{{e.contestname}}</h4>
                     <h4 class="col-1"></h4>
                     {% if current_user.is_authenticated==True and e.user_id==current_user.id%}

From 27e052ac3baa6f87a71b41ea98d310c8d641e123 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 17:00:40 +0900
Subject: [PATCH 259/336] fix

---
 static/script.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/static/script.js b/static/script.js
index febe49e..7739c28 100644
--- a/static/script.js
+++ b/static/script.js
@@ -12,10 +12,15 @@ $('.like_button').on('click', function() {
     event.preventDefault();
 
     url = '/like?id=' + $(this).val();
+    console.log(url);
     $.ajax({
         url: url,
         type: 'POST',
         dataType: 'text',
+    }).done(function() {
+        console.log('success');
+    }).fail(function() {
+        console.log('fail');
     })
 })
 

From 5b1ad9255a4a62d6613faf5a7d18b962573fa950 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 17:06:10 +0900
Subject: [PATCH 260/336] fix

---
 app.py           | 2 +-
 static/script.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index 98ab618..d98ba0d 100644
--- a/app.py
+++ b/app.py
@@ -253,7 +253,7 @@ def oauth_callback():
     return redirect(url_for('index'))
 
 #いいね処理
-@app.route('/like',methods=['POST'])
+@app.route('/like',methods=['GET'])
 def like():
     id=request.args.get('id')
 
diff --git a/static/script.js b/static/script.js
index 7739c28..467d04a 100644
--- a/static/script.js
+++ b/static/script.js
@@ -15,7 +15,7 @@ $('.like_button').on('click', function() {
     console.log(url);
     $.ajax({
         url: url,
-        type: 'POST',
+        type: 'GET',
         dataType: 'text',
     }).done(function() {
         console.log('success');

From d58c576aa133629c7dbcc6cc5a087481c01ce74f Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 17:08:35 +0900
Subject: [PATCH 261/336] fix

---
 app.py           | 2 +-
 static/script.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index d98ba0d..98ab618 100644
--- a/app.py
+++ b/app.py
@@ -253,7 +253,7 @@ def oauth_callback():
     return redirect(url_for('index'))
 
 #いいね処理
-@app.route('/like',methods=['GET'])
+@app.route('/like',methods=['POST'])
 def like():
     id=request.args.get('id')
 
diff --git a/static/script.js b/static/script.js
index 467d04a..7739c28 100644
--- a/static/script.js
+++ b/static/script.js
@@ -15,7 +15,7 @@ $('.like_button').on('click', function() {
     console.log(url);
     $.ajax({
         url: url,
-        type: 'GET',
+        type: 'POST',
         dataType: 'text',
     }).done(function() {
         console.log('success');

From 17fe32bf62bf390bf41727a25284e133b8fc2512 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 17:14:16 +0900
Subject: [PATCH 262/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 98ab618..7d48648 100644
--- a/app.py
+++ b/app.py
@@ -253,7 +253,7 @@ def oauth_callback():
     return redirect(url_for('index'))
 
 #いいね処理
-@app.route('/like',methods=['POST'])
+@app.route('/like',methods=['POST','GET'])
 def like():
     id=request.args.get('id')
 

From 0cad395b89bb0f8885e95f6737821af0c7ff66f3 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 17:17:38 +0900
Subject: [PATCH 263/336] fix

---
 app.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 7d48648..470f463 100644
--- a/app.py
+++ b/app.py
@@ -253,7 +253,7 @@ def oauth_callback():
     return redirect(url_for('index'))
 
 #いいね処理
-@app.route('/like',methods=['POST','GET'])
+@app.route('/like',methods=['POST'])
 def like():
     id=request.args.get('id')
 
@@ -264,6 +264,8 @@ def like():
     #ユーザー情報
     user=db.session.query(User).filter(User.id==edit.user_id).first()
 
+    print(flag,edit,user)
+
     #既にいいねされていた場合
     newLike=Like(user_id=current_user.id,edit_id=id)
     if flag!=None:

From f5c9faf24d1388c9d3582df9eb01b28c511a2c56 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 17:20:00 +0900
Subject: [PATCH 264/336] fix

---
 app.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/app.py b/app.py
index 470f463..98ab618 100644
--- a/app.py
+++ b/app.py
@@ -264,8 +264,6 @@ def like():
     #ユーザー情報
     user=db.session.query(User).filter(User.id==edit.user_id).first()
 
-    print(flag,edit,user)
-
     #既にいいねされていた場合
     newLike=Like(user_id=current_user.id,edit_id=id)
     if flag!=None:

From 659a97970f63cc1f99eb6e3f031e6859de6728bd Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 17:39:52 +0900
Subject: [PATCH 265/336] fix

---
 app.py           | 2 +-
 static/script.js | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 98ab618..e6961d0 100644
--- a/app.py
+++ b/app.py
@@ -258,7 +258,7 @@ def like():
     id=request.args.get('id')
 
     #いいねを既にされているかどうか
-    flag=db.session.query(Like).filter(Like.edit_id==id ).filter(Like.user_id==current_user.id).first()
+    flag=db.session.query(Like).filter(Like.edit_id==id).filter(Like.user_id==current_user.id).first()
     #解法情報
     edit=db.session.query(Editorial).filter(Editorial.id==id).first()
     #ユーザー情報
diff --git a/static/script.js b/static/script.js
index 7739c28..61a937a 100644
--- a/static/script.js
+++ b/static/script.js
@@ -17,6 +17,7 @@ $('.like_button').on('click', function() {
         url: url,
         type: 'POST',
         dataType: 'text',
+        data: data,
     }).done(function() {
         console.log('success');
     }).fail(function() {

From ea2ec0b07a2b16692cfcc504dc32c55bcf266415 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 17:42:32 +0900
Subject: [PATCH 266/336] fix

---
 static/script.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/static/script.js b/static/script.js
index 61a937a..64725ca 100644
--- a/static/script.js
+++ b/static/script.js
@@ -17,7 +17,9 @@ $('.like_button').on('click', function() {
         url: url,
         type: 'POST',
         dataType: 'text',
-        data: data,
+        data: {
+            id: $(this).val()
+        },
     }).done(function() {
         console.log('success');
     }).fail(function() {

From a9864c96114d3103176d46221862aacbec02c87c Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 17:45:59 +0900
Subject: [PATCH 267/336] fix

---
 templates/contest.html | 2 +-
 templates/user.html    | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 3b4cce7..6b9ade6 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -141,7 +141,7 @@ <h5 class="col-1"></h5>
                 <h5 class="col-1"></h5>
                 {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
                 <form>
-                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                    <input type="hidden" name="csrf_oken" value="{{csrf_token}}" />
                     <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>
                 </form>
                 {%endif%}
diff --git a/templates/user.html b/templates/user.html
index 81e4c99..3eab000 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -91,6 +91,7 @@ <h3>投稿一覧</h3>
                 <br>
                 <br>
                 <div class="row container-fluid">
+                    <!--
                     {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}
                     <form>
                         <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
@@ -103,6 +104,7 @@ <h3>投稿一覧</h3>
                     </form>
                     {%endif%}{%else%}
                     <button class="like_button_no_login btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button> {%endif%}
+                     -->
                     <h4>{{e.contestname}}</h4>
                     <h4 class="col-1"></h4>
                     {% if current_user.is_authenticated==True and e.user_id==current_user.id%}

From 3f28eb825f811d0256aaa779abcc54c559bf209d Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 17:48:54 +0900
Subject: [PATCH 268/336] fix

---
 templates/index.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/templates/index.html b/templates/index.html
index 660fd2a..f4a01c3 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -73,6 +73,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                         <br>・問題ページにツイートボタンを設置しました。
                         <br>・公式editorialと問題ページヘのリンクを追加しました。
                         <br>（公式editorialは旧コンテスト未対応です）
+                        <br>・ユーザーページの解法に消去ボタンを追加しました。
                     </div>
                 </div>
             </div>

From c1854ba39d4c8b08c907d950ebe1daf478742133 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 19:25:21 +0900
Subject: [PATCH 269/336] fix

---
 app.py              | 2 +-
 static/script.js    | 3 ---
 templates/user.html | 3 +--
 3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/app.py b/app.py
index e6961d0..82da2b5 100644
--- a/app.py
+++ b/app.py
@@ -253,7 +253,7 @@ def oauth_callback():
     return redirect(url_for('index'))
 
 #いいね処理
-@app.route('/like',methods=['POST'])
+@app.route('/like',methods=['GET'])
 def like():
     id=request.args.get('id')
 
diff --git a/static/script.js b/static/script.js
index 64725ca..7739c28 100644
--- a/static/script.js
+++ b/static/script.js
@@ -17,9 +17,6 @@ $('.like_button').on('click', function() {
         url: url,
         type: 'POST',
         dataType: 'text',
-        data: {
-            id: $(this).val()
-        },
     }).done(function() {
         console.log('success');
     }).fail(function() {
diff --git a/templates/user.html b/templates/user.html
index 3eab000..a46472d 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -91,7 +91,6 @@ <h3>投稿一覧</h3>
                 <br>
                 <br>
                 <div class="row container-fluid">
-                    <!--
                     {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}
                     <form>
                         <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
@@ -104,7 +103,7 @@ <h3>投稿一覧</h3>
                     </form>
                     {%endif%}{%else%}
                     <button class="like_button_no_login btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button> {%endif%}
-                     -->
+
                     <h4>{{e.contestname}}</h4>
                     <h4 class="col-1"></h4>
                     {% if current_user.is_authenticated==True and e.user_id==current_user.id%}

From 23ebfa424b16bd1f82cbc327a923540576890af5 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 19:27:06 +0900
Subject: [PATCH 270/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 82da2b5..e6961d0 100644
--- a/app.py
+++ b/app.py
@@ -253,7 +253,7 @@ def oauth_callback():
     return redirect(url_for('index'))
 
 #いいね処理
-@app.route('/like',methods=['GET'])
+@app.route('/like',methods=['POST'])
 def like():
     id=request.args.get('id')
 

From 7703c99d49074b1aba841f4bdf796039e6b5bb42 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 19:29:43 +0900
Subject: [PATCH 271/336] fix

---
 app.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app.py b/app.py
index e6961d0..2e3b1f8 100644
--- a/app.py
+++ b/app.py
@@ -256,6 +256,7 @@ def oauth_callback():
 @app.route('/like',methods=['POST'])
 def like():
     id=request.args.get('id')
+    print(id)
 
     #いいねを既にされているかどうか
     flag=db.session.query(Like).filter(Like.edit_id==id).filter(Like.user_id==current_user.id).first()

From d9a3c1c3c57244062f4d7db350ef7909f158e588 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 19:37:13 +0900
Subject: [PATCH 272/336] fix

---
 app.py           | 3 +--
 static/script.js | 6 ++++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/app.py b/app.py
index 2e3b1f8..a173062 100644
--- a/app.py
+++ b/app.py
@@ -255,8 +255,7 @@ def oauth_callback():
 #いいね処理
 @app.route('/like',methods=['POST'])
 def like():
-    id=request.args.get('id')
-    print(id)
+    id=request.form['id']
 
     #いいねを既にされているかどうか
     flag=db.session.query(Like).filter(Like.edit_id==id).filter(Like.user_id==current_user.id).first()
diff --git a/static/script.js b/static/script.js
index 7739c28..526ce17 100644
--- a/static/script.js
+++ b/static/script.js
@@ -11,12 +11,14 @@ $('.like_button').on('click', function() {
 
     event.preventDefault();
 
-    url = '/like?id=' + $(this).val();
     console.log(url);
     $.ajax({
-        url: url,
+        url: '/like',
         type: 'POST',
         dataType: 'text',
+        data: {
+            id: $(this).val()
+        }
     }).done(function() {
         console.log('success');
     }).fail(function() {

From 994246bd3f734c99e7dad4055b117fa888372790 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 19:38:35 +0900
Subject: [PATCH 273/336] fix

---
 app.py           | 2 +-
 static/script.js | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/app.py b/app.py
index a173062..e6961d0 100644
--- a/app.py
+++ b/app.py
@@ -255,7 +255,7 @@ def oauth_callback():
 #いいね処理
 @app.route('/like',methods=['POST'])
 def like():
-    id=request.form['id']
+    id=request.args.get('id')
 
     #いいねを既にされているかどうか
     flag=db.session.query(Like).filter(Like.edit_id==id).filter(Like.user_id==current_user.id).first()
diff --git a/static/script.js b/static/script.js
index 526ce17..7739c28 100644
--- a/static/script.js
+++ b/static/script.js
@@ -11,14 +11,12 @@ $('.like_button').on('click', function() {
 
     event.preventDefault();
 
+    url = '/like?id=' + $(this).val();
     console.log(url);
     $.ajax({
-        url: '/like',
+        url: url,
         type: 'POST',
         dataType: 'text',
-        data: {
-            id: $(this).val()
-        }
     }).done(function() {
         console.log('success');
     }).fail(function() {

From ae37b3cb64a2eb4f666dc4a658697e65c10282a1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 19:42:12 +0900
Subject: [PATCH 274/336] fix

---
 app.py           | 2 +-
 static/script.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index e6961d0..12b2834 100644
--- a/app.py
+++ b/app.py
@@ -253,7 +253,7 @@ def oauth_callback():
     return redirect(url_for('index'))
 
 #いいね処理
-@app.route('/like',methods=['POST'])
+@app.route('/like',methods=['POST','GET'])
 def like():
     id=request.args.get('id')
 
diff --git a/static/script.js b/static/script.js
index 7739c28..467d04a 100644
--- a/static/script.js
+++ b/static/script.js
@@ -15,7 +15,7 @@ $('.like_button').on('click', function() {
     console.log(url);
     $.ajax({
         url: url,
-        type: 'POST',
+        type: 'GET',
         dataType: 'text',
     }).done(function() {
         console.log('success');

From bd1b12805fb7cea265e0e2cf0ba1ead5ea7a7b18 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 20:07:59 +0900
Subject: [PATCH 275/336] fix

---
 app.py           | 2 +-
 static/script.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index 12b2834..6943205 100644
--- a/app.py
+++ b/app.py
@@ -255,7 +255,7 @@ def oauth_callback():
 #いいね処理
 @app.route('/like',methods=['POST','GET'])
 def like():
-    id=request.args.get('id')
+    id=request.form['id']
 
     #いいねを既にされているかどうか
     flag=db.session.query(Like).filter(Like.edit_id==id).filter(Like.user_id==current_user.id).first()
diff --git a/static/script.js b/static/script.js
index 467d04a..7739c28 100644
--- a/static/script.js
+++ b/static/script.js
@@ -15,7 +15,7 @@ $('.like_button').on('click', function() {
     console.log(url);
     $.ajax({
         url: url,
-        type: 'GET',
+        type: 'POST',
         dataType: 'text',
     }).done(function() {
         console.log('success');

From 5b6e9156aa183ca24e101b2531a039fd88c8e544 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 20:10:01 +0900
Subject: [PATCH 276/336] fix

---
 app.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index 6943205..e6961d0 100644
--- a/app.py
+++ b/app.py
@@ -253,9 +253,9 @@ def oauth_callback():
     return redirect(url_for('index'))
 
 #いいね処理
-@app.route('/like',methods=['POST','GET'])
+@app.route('/like',methods=['POST'])
 def like():
-    id=request.form['id']
+    id=request.args.get('id')
 
     #いいねを既にされているかどうか
     flag=db.session.query(Like).filter(Like.edit_id==id).filter(Like.user_id==current_user.id).first()

From 912791ad21ac9605753dc887f47f79bd2465fe93 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 20:22:21 +0900
Subject: [PATCH 277/336] fix

---
 templates/contest.html |  2 +
 templates/user.html    | 93 +++++++++++++++++++++---------------------
 2 files changed, 49 insertions(+), 46 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 6b9ade6..3babab1 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -123,6 +123,7 @@ <h4>「投稿」または「いいね」をするにはログインが必要で
             {% for edit in editorials.items %}
             <br>
             <div class="row container-fluid">
+                <!--
                 {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
                 <form>
                     <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
@@ -135,6 +136,7 @@ <h4>「投稿」または「いいね」をするにはログインが必要で
                 </form>
                 {%endif%}{%else%}
                 <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
+            -->
                 <h5 class="col-1"></h5>
                 <img src={{edit.user_image_url}} alt='No Image ' style="width:36px;height:36px;vertical-align:middle;">
                 <a href="/user/{{edit.user_id}}/1" class="h4 text-dark" style="vertical-align:middle;">{{edit.username}}</a>
diff --git a/templates/user.html b/templates/user.html
index a46472d..f0cc72c 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -90,6 +90,7 @@ <h3>投稿一覧</h3>
             <div id="editorial-card">
                 <br>
                 <br>
+                <!--
                 <div class="row container-fluid">
                     {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}
                     <form>
@@ -103,62 +104,62 @@ <h3>投稿一覧</h3>
                     </form>
                     {%endif%}{%else%}
                     <button class="like_button_no_login btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button> {%endif%}
+                -->
+                <h4>{{e.contestname}}</h4>
+                <h4 class="col-1"></h4>
+                {% if current_user.is_authenticated==True and e.user_id==current_user.id%}
+                <form>
+                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                    <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{e.id}}>削除</button>
+                </form>
+                {%endif%}
+            </div>
 
-                    <h4>{{e.contestname}}</h4>
-                    <h4 class="col-1"></h4>
-                    {% if current_user.is_authenticated==True and e.user_id==current_user.id%}
-                    <form>
-                        <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
-                        <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{e.id}}>削除</button>
-                    </form>
-                    {%endif%}
-                </div>
-
-                <div class="container-fluid">
-                    <div class="card col-6 border-0" style="cursor: pointer;">
-                        <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
-                            {{e.title}}
-                        </h4>
+            <div class="container-fluid">
+                <div class="card col-6 border-0" style="cursor: pointer;">
+                    <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
+                        {{e.title}}
+                    </h4>
 
-                        <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
-                            {% if e.url!=None%}
-                            <a href={{e.url}}>{{e.url}}</a> {%endif%}
-                        </div>
+                    <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
+                        {% if e.url!=None%}
+                        <a href={{e.url}}>{{e.url}}</a> {%endif%}
+                    </div>
 
-                        <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
-                            {% autoescape false %} {%if e.description!=None%}
-                            <br>
-                            <p>{{e.description}}</p>
-                            {%endif%} {% endautoescape %}
-                        </div>
+                    <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
+                        {% autoescape false %} {%if e.description!=None%}
+                        <br>
+                        <p>{{e.description}}</p>
+                        {%endif%} {% endautoescape %}
                     </div>
-                    <br>
-                    <br>
                 </div>
+                <br>
+                <br>
             </div>
-            {% endfor %}
         </div>
+        {% endfor %}
+    </div>
 
-        <div class="container-fluid">
-            <ul class="pagination">
-                {% if edit.has_prev %}
-                <li class="page-item">
-                    <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=user.id)}}">前のページ</a>
-                </li>
-                {% endif %} {% if edit.has_next %}
-                <li class="page-item">
-                    <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=user.id)}}">次のページ</a>
-                </li>
-                {% endif %}
-            </ul>
-        </div>
+    <div class="container-fluid">
+        <ul class="pagination">
+            {% if edit.has_prev %}
+            <li class="page-item">
+                <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=user.id)}}">前のページ</a>
+            </li>
+            {% endif %} {% if edit.has_next %}
+            <li class="page-item">
+                <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=user.id)}}">次のページ</a>
+            </li>
+            {% endif %}
+        </ul>
+    </div>
 
 
-        <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
-        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
-        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
-        <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
-        <script src="/static/script.js"></script>
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+    <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
+    <script src="/static/script.js"></script>
 </body>
 
 

From ec289e1dea044f3aaca6e14be6f6aecff4172b00 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 20:32:16 +0900
Subject: [PATCH 278/336] fix

---
 templates/user.html | 94 ++++++++++++++++++++++-----------------------
 1 file changed, 47 insertions(+), 47 deletions(-)

diff --git a/templates/user.html b/templates/user.html
index f0cc72c..8330b9c 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -90,7 +90,7 @@ <h3>投稿一覧</h3>
             <div id="editorial-card">
                 <br>
                 <br>
-                <!--
+
                 <div class="row container-fluid">
                     {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}
                     <form>
@@ -104,62 +104,62 @@ <h3>投稿一覧</h3>
                     </form>
                     {%endif%}{%else%}
                     <button class="like_button_no_login btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button> {%endif%}
-                -->
-                <h4>{{e.contestname}}</h4>
-                <h4 class="col-1"></h4>
-                {% if current_user.is_authenticated==True and e.user_id==current_user.id%}
-                <form>
-                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
-                    <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{e.id}}>削除</button>
-                </form>
-                {%endif%}
-            </div>
 
-            <div class="container-fluid">
-                <div class="card col-6 border-0" style="cursor: pointer;">
-                    <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
-                        {{e.title}}
-                    </h4>
+                    <h4>{{e.contestname}}</h4>
+                    <h4 class="col-1"></h4>
+                    {% if current_user.is_authenticated==True and e.user_id==current_user.id%}
+                    <form>
+                        <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                        <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{e.id}}>削除</button>
+                    </form>
+                    {%endif%}
+                </div>
 
-                    <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
-                        {% if e.url!=None%}
-                        <a href={{e.url}}>{{e.url}}</a> {%endif%}
-                    </div>
+                <div class="container-fluid">
+                    <div class="card col-6 border-0" style="cursor: pointer;">
+                        <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
+                            {{e.title}}
+                        </h4>
 
-                    <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
-                        {% autoescape false %} {%if e.description!=None%}
-                        <br>
-                        <p>{{e.description}}</p>
-                        {%endif%} {% endautoescape %}
+                        <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
+                            {% if e.url!=None%}
+                            <a href={{e.url}}>{{e.url}}</a> {%endif%}
+                        </div>
+
+                        <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
+                            {% autoescape false %} {%if e.description!=None%}
+                            <br>
+                            <p>{{e.description}}</p>
+                            {%endif%} {% endautoescape %}
+                        </div>
                     </div>
+                    <br>
+                    <br>
                 </div>
-                <br>
-                <br>
             </div>
+            {% endfor %}
         </div>
-        {% endfor %}
-    </div>
 
-    <div class="container-fluid">
-        <ul class="pagination">
-            {% if edit.has_prev %}
-            <li class="page-item">
-                <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=user.id)}}">前のページ</a>
-            </li>
-            {% endif %} {% if edit.has_next %}
-            <li class="page-item">
-                <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=user.id)}}">次のページ</a>
-            </li>
-            {% endif %}
-        </ul>
-    </div>
+        <div class="container-fluid">
+            <ul class="pagination">
+                {% if edit.has_prev %}
+                <li class="page-item">
+                    <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=user.id)}}">前のページ</a>
+                </li>
+                {% endif %} {% if edit.has_next %}
+                <li class="page-item">
+                    <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=user.id)}}">次のページ</a>
+                </li>
+                {% endif %}
+            </ul>
+        </div>
 
 
-    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
-    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
-    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
-    <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
-    <script src="/static/script.js"></script>
+        <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
+        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+        <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
+        <script src="/static/script.js"></script>
 </body>
 
 

From b1da597ceb71d78dea940f728004e541e62d25c3 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 21:04:14 +0900
Subject: [PATCH 279/336] fix

---
 templates/user.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index 8330b9c..a0bf2a2 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -92,6 +92,7 @@ <h3>投稿一覧</h3>
                 <br>
 
                 <div class="row container-fluid">
+                    <!--
                     {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}
                     <form>
                         <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
@@ -104,7 +105,7 @@ <h3>投稿一覧</h3>
                     </form>
                     {%endif%}{%else%}
                     <button class="like_button_no_login btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button> {%endif%}
-
+                -->
                     <h4>{{e.contestname}}</h4>
                     <h4 class="col-1"></h4>
                     {% if current_user.is_authenticated==True and e.user_id==current_user.id%}

From 5bd2498f7664dbfee3d6a978ad44980fda3cc6af Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 21:22:55 +0900
Subject: [PATCH 280/336] fix

---
 templates/search.html | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/templates/search.html b/templates/search.html
index 20f403a..6271d14 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -145,7 +145,11 @@ <h3>検索</h3>
                         }
                     }
 
-                    var url = '/search/' + name.split(':')[0] + '/1?contestname=' + name.slice(num);
+                    var back = name.slice(num).replace('&', '%26');
+                    back = back.replace('?', '%3F');
+                    back = back.replace('=', '%3D');
+
+                    var url = '/search/' + name.split(':')[0] + '/1?contestname=' + back;
 
                     console.log(name.slice(num, -1));
 

From 7fef723dd10f1c8550e7fc73b3c5b45c7cb49ee9 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 21:25:14 +0900
Subject: [PATCH 281/336] fix

---
 templates/contest.html | 2 --
 templates/user.html    | 3 +--
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 3babab1..6b9ade6 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -123,7 +123,6 @@ <h4>「投稿」または「いいね」をするにはログインが必要で
             {% for edit in editorials.items %}
             <br>
             <div class="row container-fluid">
-                <!--
                 {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
                 <form>
                     <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
@@ -136,7 +135,6 @@ <h4>「投稿」または「いいね」をするにはログインが必要で
                 </form>
                 {%endif%}{%else%}
                 <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
-            -->
                 <h5 class="col-1"></h5>
                 <img src={{edit.user_image_url}} alt='No Image ' style="width:36px;height:36px;vertical-align:middle;">
                 <a href="/user/{{edit.user_id}}/1" class="h4 text-dark" style="vertical-align:middle;">{{edit.username}}</a>
diff --git a/templates/user.html b/templates/user.html
index a0bf2a2..8330b9c 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -92,7 +92,6 @@ <h3>投稿一覧</h3>
                 <br>
 
                 <div class="row container-fluid">
-                    <!--
                     {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}
                     <form>
                         <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
@@ -105,7 +104,7 @@ <h3>投稿一覧</h3>
                     </form>
                     {%endif%}{%else%}
                     <button class="like_button_no_login btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button> {%endif%}
-                -->
+
                     <h4>{{e.contestname}}</h4>
                     <h4 class="col-1"></h4>
                     {% if current_user.is_authenticated==True and e.user_id==current_user.id%}

From a19bb87c310c8000c2aec2c570432b1b899a6927 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 21:32:15 +0900
Subject: [PATCH 282/336] fix

---
 templates/contest.html | 4 ++--
 templates/user.html    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 6b9ade6..3913627 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -125,12 +125,12 @@ <h4>「投稿」または「いいね」をするにはログインが必要で
             <div class="row container-fluid">
                 {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
                 <form>
-                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
                     <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
                 </form>
                 {%else%}
                 <form>
-                    <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
                     <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
                 </form>
                 {%endif%}{%else%}
diff --git a/templates/user.html b/templates/user.html
index 8330b9c..11ed684 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -94,12 +94,12 @@ <h3>投稿一覧</h3>
                 <div class="row container-fluid">
                     {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}
                     <form>
-                        <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                        <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
                         <button class="like_button btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button>
                     </form>
                     {%else%}
                     <form>
-                        <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                        <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
                         <button class="like_button btn btn-info" name="id" value={{e.id}}>{{e.like}}いいね</button>
                     </form>
                     {%endif%}{%else%}

From 984ce9668fa81eebae31026dde77141d8ad6beda Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 21:34:51 +0900
Subject: [PATCH 283/336] fix

---
 templates/contest.html | 2 +-
 templates/user.html    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 3913627..0eb94b6 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -141,7 +141,7 @@ <h5 class="col-1"></h5>
                 <h5 class="col-1"></h5>
                 {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
                 <form>
-                    <input type="hidden" name="csrf_oken" value="{{csrf_token}}" />
+                    <input type="hidden" name="csrf_oken" value="{{csrf_token()}}" />
                     <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>
                 </form>
                 {%endif%}
diff --git a/templates/user.html b/templates/user.html
index 11ed684..ba0d646 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -109,7 +109,7 @@ <h4>{{e.contestname}}</h4>
                     <h4 class="col-1"></h4>
                     {% if current_user.is_authenticated==True and e.user_id==current_user.id%}
                     <form>
-                        <input type="hidden" name="csrf_token" value="{{csrf_token}}" />
+                        <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
                         <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{e.id}}>削除</button>
                     </form>
                     {%endif%}

From 88b54e704b481ea6adc2135e6fdae034555e3959 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 21:42:19 +0900
Subject: [PATCH 284/336] fix

---
 templates/contest.html | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 0eb94b6..2d80ad3 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -125,12 +125,12 @@ <h4>「投稿」または「いいね」をするにはログインが必要で
             <div class="row container-fluid">
                 {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
                 <form>
-                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
                     <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
                 </form>
                 {%else%}
                 <form>
-                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
                     <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
                 </form>
                 {%endif%}{%else%}
@@ -141,7 +141,7 @@ <h5 class="col-1"></h5>
                 <h5 class="col-1"></h5>
                 {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
                 <form>
-                    <input type="hidden" name="csrf_oken" value="{{csrf_token()}}" />
+                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
                     <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>
                 </form>
                 {%endif%}

From 96a877800db3c4f1b20ee0403150541e138f1d28 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Tue, 27 Aug 2019 21:45:33 +0900
Subject: [PATCH 285/336] fix

---
 templates/user.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/templates/user.html b/templates/user.html
index ba0d646..65696cf 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -24,6 +24,7 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="csrf-token" content="{{ csrf_token() }}">
     <link rel="icon" type="image/x-icon" href="/favicon.ico">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <title>AtCoder Editorials</title>

From c97834c09b9341a162c2520aa72e902f05970400 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 13:39:24 +0900
Subject: [PATCH 286/336] stable ver

---
 templates/search.html | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/templates/search.html b/templates/search.html
index 6271d14..68fc20b 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -145,13 +145,7 @@ <h3>検索</h3>
                         }
                     }
 
-                    var back = name.slice(num).replace('&', '%26');
-                    back = back.replace('?', '%3F');
-                    back = back.replace('=', '%3D');
-
-                    var url = '/search/' + name.split(':')[0] + '/1?contestname=' + back;
-
-                    console.log(name.slice(num, -1));
+                    var url = '/search/' + name.split(':')[0] + '/1?contestname=' + encodeURIComponent(name.slice(num));
 
                     $('form').attr('action', url);
                     $("#search").submit();

From 1fef4c2cf1a3e3650d31090d8c26afb0e03c9df9 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 15:06:28 +0900
Subject: [PATCH 287/336] fix

---
 app.py                   |  24 +++++-
 templates/contest.html   |   6 ++
 templates/edit.html      |  89 +++++++++++++++++++++
 templates/edit_fin.html  |  70 ++++++++++++++++
 templates/index.html     |   1 +
 templates/user copy.html | 167 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 356 insertions(+), 1 deletion(-)
 create mode 100644 templates/edit.html
 create mode 100644 templates/edit_fin.html
 create mode 100644 templates/user copy.html

diff --git a/app.py b/app.py
index e6961d0..690653e 100644
--- a/app.py
+++ b/app.py
@@ -118,7 +118,7 @@ def submit():
     }   
     
     if params['description']!=None:
-            params['description']=params['description'].replace('\r\n','<br>')
+            params['description']=params['description'].replace('\r\n','&#13;')
 
 
     #必要量記入されているかチェック
@@ -134,6 +134,28 @@ def submit():
         else:
             return render_template('error.html', message='Error:URLまたは解説文を入力して下さい。')
 
+#編集
+@app.route('/edit',methods=['POST'])
+def edit():
+    id=request.form['edit_id']
+    edit=Editorial.query.filter_by(id=id).first()
+    return render_template('edit.html',edit=edit)
+
+@app.route('/edit_fin',methods=['POST'])
+def edit_fin():
+    id=request.form['id']
+    edit=Editorial.query.filter_by(id=id).first()
+
+    edit.title=request.form['title']
+    edit.url=request.form['url']
+
+    description=request.form['description']
+    if description!=None:
+            description=description.replace('\r\n','&#13;')
+    
+    edit.description=description
+
+    return render_template('edit_fin.html')
 
 @app.route('/user/<int:id>/<int:page>',methods=['GET'])
 def user(id,page=1):
diff --git a/templates/contest.html b/templates/contest.html
index 2d80ad3..a91d10c 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -139,14 +139,20 @@ <h5 class="col-1"></h5>
                 <img src={{edit.user_image_url}} alt='No Image ' style="width:36px;height:36px;vertical-align:middle;">
                 <a href="/user/{{edit.user_id}}/1" class="h4 text-dark" style="vertical-align:middle;">{{edit.username}}</a>
                 <h5 class="col-1"></h5>
+                <form action="/edit" method="POST">
+                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+                    <button class="btn" name="edit_id" value={{edit.id}} type="submit">編集</button>
+                </form>
                 {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
                 <form>
                     <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
                     <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>
                 </form>
+                <h5 class="col-1"></h5>
                 {%endif%}
             </div>
 
+
             <div class="card col-6 border-0" style="cursor: pointer;">
                 <h4 class="card-header text-light bg-light text-dark col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
                     {{edit.title}}
diff --git a/templates/edit.html b/templates/edit.html
new file mode 100644
index 0000000..3dd67b2
--- /dev/null
+++ b/templates/edit.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+<html lang="ja">
+
+<head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="csrf-token" content="{{ csrf_token() }}">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
+    <title>AtCoder Editorials</title>
+</head>
+
+<body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+
+    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
+        <a href="/" class="navbar-brand">AtCoder Editorials</a>
+
+        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse" id="nav1">
+            <ul class="navbar-nav">
+                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
+            </ul>
+            {% if current_user.is_authenticated==False %}
+            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
+        </div>
+    </nav>
+
+    <br>
+    <div id="submit-card">
+
+        <div class="card col-6 border-0" style="cursor: pointer;">
+            <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-target="#sub1">
+                編集する
+            </h4>
+            <div class="collapse　show" id="sub1" data-parent="#submit-card" style="cursor: pointer;">
+                <form action="/edit_fin " method='POST'>
+                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+                    <input type="text" name="title" value={{edit.title}} style="width:545px" />
+                    <br>
+                    <input type="text" name="url" value="{{edit.url}}" style="width:545px" />
+                    <br>
+                    <textarea name="description" 　style="white-space:pre; word-wrap:break-word;" rows=15 cols=56>{%autoescape false%}{{edit.description}}{%endautoescape%}</textarea>
+                    <button type="submit" class="btn btn-info" name="id" value="{{edit.id}}">編集</button>
+
+                </form>
+            </div>
+        </div>
+    </div>
+
+
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/templates/edit_fin.html b/templates/edit_fin.html
new file mode 100644
index 0000000..6991fd7
--- /dev/null
+++ b/templates/edit_fin.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html lang="ja">
+
+<head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
+    <title>AtCoder Editorials</title>
+</head>
+
+<body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+
+    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
+        <a href="/" class="navbar-brand">AtCoder Editorials</a>
+
+        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse" id="nav1">
+            <ul class="navbar-nav">
+                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
+            </ul>
+            {% if current_user.is_authenticated==False %}
+            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
+        </div>
+    </nav>
+
+    <div class="jumbotron jumbotron-fluid">
+        <h2>編集しました。</h2>
+    </div>
+
+
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/templates/index.html b/templates/index.html
index f4a01c3..0f70bd3 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -74,6 +74,7 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                         <br>・公式editorialと問題ページヘのリンクを追加しました。
                         <br>（公式editorialは旧コンテスト未対応です）
                         <br>・ユーザーページの解法に消去ボタンを追加しました。
+                        <br>・ユーザーページにいいねボタンを追加しました。
                     </div>
                 </div>
             </div>
diff --git a/templates/user copy.html b/templates/user copy.html
new file mode 100644
index 0000000..65696cf
--- /dev/null
+++ b/templates/user copy.html	
@@ -0,0 +1,167 @@
+<!DOCTYPE html>
+
+<html lang="ja">
+
+<head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="csrf-token" content="{{ csrf_token() }}">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <title>AtCoder Editorials</title>
+</head>
+
+<body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+
+    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
+        <a href="/" class="navbar-brand">AtCoder Editorials</a>
+
+        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse" id="nav1">
+            <ul class="navbar-nav">
+                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
+            </ul>
+            {% if current_user.is_authenticated==False %}
+            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
+        </div>
+    </nav>
+
+    <div class="container-fluid">
+        <div class="jumbotron jumbotron-fluid text-dark">
+            <h1>{{user.username}}</h1>
+            <div>
+                <h4>登録日時：{{date_published}}</h4>
+            </div>
+            <div>
+                <h4>順位　　：{{rank}}位</h4>
+            </div>
+            <div>
+                <h4> いいね数 :{{user.like_sum}}</h4>
+            </div>
+            <div>
+                <h4> 投稿数　 :{{num}}</h4>
+            </div>
+            <div>
+                {%if current_user.is_authenticated==True%}
+                <div class="twitter">
+                    <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{rank}}位になりました！" data-url="https://atcoder-editorials.herokuapp.com/user/{{user.id}}/1" data-lang="ja">
+                    </a>
+                </div>
+                {%endif%}
+            </div>
+        </div>
+    </div>
+    <div class="container-fluid">
+        <h3>投稿一覧</h3>
+        <div>
+            {%for e in edit.items %}
+            <div id="editorial-card">
+                <br>
+                <br>
+
+                <div class="row container-fluid">
+                    {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}
+                    <form>
+                        <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+                        <button class="like_button btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button>
+                    </form>
+                    {%else%}
+                    <form>
+                        <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+                        <button class="like_button btn btn-info" name="id" value={{e.id}}>{{e.like}}いいね</button>
+                    </form>
+                    {%endif%}{%else%}
+                    <button class="like_button_no_login btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button> {%endif%}
+
+                    <h4>{{e.contestname}}</h4>
+                    <h4 class="col-1"></h4>
+                    {% if current_user.is_authenticated==True and e.user_id==current_user.id%}
+                    <form>
+                        <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+                        <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{e.id}}>削除</button>
+                    </form>
+                    {%endif%}
+                </div>
+
+                <div class="container-fluid">
+                    <div class="card col-6 border-0" style="cursor: pointer;">
+                        <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
+                            {{e.title}}
+                        </h4>
+
+                        <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
+                            {% if e.url!=None%}
+                            <a href={{e.url}}>{{e.url}}</a> {%endif%}
+                        </div>
+
+                        <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
+                            {% autoescape false %} {%if e.description!=None%}
+                            <br>
+                            <p>{{e.description}}</p>
+                            {%endif%} {% endautoescape %}
+                        </div>
+                    </div>
+                    <br>
+                    <br>
+                </div>
+            </div>
+            {% endfor %}
+        </div>
+
+        <div class="container-fluid">
+            <ul class="pagination">
+                {% if edit.has_prev %}
+                <li class="page-item">
+                    <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=user.id)}}">前のページ</a>
+                </li>
+                {% endif %} {% if edit.has_next %}
+                <li class="page-item">
+                    <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=user.id)}}">次のページ</a>
+                </li>
+                {% endif %}
+            </ul>
+        </div>
+
+
+        <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
+        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+        <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
+        <script src="/static/script.js"></script>
+</body>
+
+
+</html>
\ No newline at end of file

From 6a78d428c3d0aba9e81c2073b54ecc64e3977626 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 15:07:58 +0900
Subject: [PATCH 288/336] add edit btn

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index a91d10c..f5b7090 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -139,11 +139,11 @@ <h5 class="col-1"></h5>
                 <img src={{edit.user_image_url}} alt='No Image ' style="width:36px;height:36px;vertical-align:middle;">
                 <a href="/user/{{edit.user_id}}/1" class="h4 text-dark" style="vertical-align:middle;">{{edit.username}}</a>
                 <h5 class="col-1"></h5>
+                {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
                 <form action="/edit" method="POST">
                     <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
                     <button class="btn" name="edit_id" value={{edit.id}} type="submit">編集</button>
                 </form>
-                {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
                 <form>
                     <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
                     <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>

From 46d8473166b47c689f487e1b96c5565e52a77fc7 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 15:11:47 +0900
Subject: [PATCH 289/336] fix

---
 app.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app.py b/app.py
index 690653e..9acc55a 100644
--- a/app.py
+++ b/app.py
@@ -155,6 +155,8 @@ def edit_fin():
     
     edit.description=description
 
+    db.session.commit()
+
     return render_template('edit_fin.html')
 
 @app.route('/user/<int:id>/<int:page>',methods=['GET'])

From 9c18988f09ec3c7565164c02b69d0a0e918953ed Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 15:19:26 +0900
Subject: [PATCH 290/336] fix

---
 app.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/app.py b/app.py
index 9acc55a..1b09e21 100644
--- a/app.py
+++ b/app.py
@@ -118,7 +118,7 @@ def submit():
     }   
     
     if params['description']!=None:
-            params['description']=params['description'].replace('\r\n','&#13;')
+            params['description']=params['description'].replace('\r\n','<br>')
 
 
     #必要量記入されているかチェック
@@ -139,6 +139,10 @@ def submit():
 def edit():
     id=request.form['edit_id']
     edit=Editorial.query.filter_by(id=id).first()
+
+    if edit.description!=None:
+        edit.description.replace('<br>','&#13')
+        
     return render_template('edit.html',edit=edit)
 
 @app.route('/edit_fin',methods=['POST'])
@@ -151,11 +155,11 @@ def edit_fin():
 
     description=request.form['description']
     if description!=None:
-            description=description.replace('\r\n','&#13;')
+            description=description.replace('\r\n','<br>')
     
     edit.description=description
 
-    db.session.commit()
+    db.session.commit
 
     return render_template('edit_fin.html')
 

From 5b06c5ce24121b9782fd3aa5b654e58f04236427 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 15:21:59 +0900
Subject: [PATCH 291/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 1b09e21..23bb6be 100644
--- a/app.py
+++ b/app.py
@@ -142,7 +142,7 @@ def edit():
 
     if edit.description!=None:
         edit.description.replace('<br>','&#13')
-        
+        db.session.commit()
     return render_template('edit.html',edit=edit)
 
 @app.route('/edit_fin',methods=['POST'])

From 3280b01235e8da9a87aa4ad0a32c6e2a6bb3fbce Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 15:28:02 +0900
Subject: [PATCH 292/336] fix

---
 app.py              | 7 ++-----
 templates/edit.html | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/app.py b/app.py
index 23bb6be..9193b5e 100644
--- a/app.py
+++ b/app.py
@@ -139,11 +139,8 @@ def submit():
 def edit():
     id=request.form['edit_id']
     edit=Editorial.query.filter_by(id=id).first()
-
-    if edit.description!=None:
-        edit.description.replace('<br>','&#13')
-        db.session.commit()
-    return render_template('edit.html',edit=edit)
+    description=edit.description.replace('<br>','&#13')
+    return render_template('edit.html',edit=edit,description=description)
 
 @app.route('/edit_fin',methods=['POST'])
 def edit_fin():
diff --git a/templates/edit.html b/templates/edit.html
index 3dd67b2..9d4f3c3 100644
--- a/templates/edit.html
+++ b/templates/edit.html
@@ -72,7 +72,7 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <br>
                     <input type="text" name="url" value="{{edit.url}}" style="width:545px" />
                     <br>
-                    <textarea name="description" 　style="white-space:pre; word-wrap:break-word;" rows=15 cols=56>{%autoescape false%}{{edit.description}}{%endautoescape%}</textarea>
+                    <textarea name="description" 　style="white-space:pre; word-wrap:break-word;" rows=15 cols=56>{%autoescape false%}{{description}}{%endautoescape%}</textarea>
                     <button type="submit" class="btn btn-info" name="id" value="{{edit.id}}">編集</button>
 
                 </form>

From 97d177fcc61147d83596ee87a136122e2a4aefe4 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 15:32:49 +0900
Subject: [PATCH 293/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 9193b5e..2ff0db4 100644
--- a/app.py
+++ b/app.py
@@ -156,7 +156,7 @@ def edit_fin():
     
     edit.description=description
 
-    db.session.commit
+    db.session.commit()
 
     return render_template('edit_fin.html')
 

From 6b4e965d4793c8335f3868fd39a343ed8d03ebb7 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 15:38:12 +0900
Subject: [PATCH 294/336] add edit btn at user_page

---
 templates/user.html | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/templates/user.html b/templates/user.html
index 65696cf..4c67a84 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -109,6 +109,10 @@ <h3>投稿一覧</h3>
                     <h4>{{e.contestname}}</h4>
                     <h4 class="col-1"></h4>
                     {% if current_user.is_authenticated==True and e.user_id==current_user.id%}
+                    <form action="/edit" method="POST">
+                        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+                        <button class="btn" name="edit_id" value={{edit.id}} type="submit">編集</button>
+                    </form>
                     <form>
                         <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
                         <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{e.id}}>削除</button>

From 9d8d9b3c240ddfde847ff97c96c05b8840fa9db4 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 15:39:55 +0900
Subject: [PATCH 295/336] fix

---
 templates/user.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/user.html b/templates/user.html
index 4c67a84..68d62a5 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -111,7 +111,7 @@ <h4 class="col-1"></h4>
                     {% if current_user.is_authenticated==True and e.user_id==current_user.id%}
                     <form action="/edit" method="POST">
                         <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
-                        <button class="btn" name="edit_id" value={{edit.id}} type="submit">編集</button>
+                        <button class="btn" name="edit_id" value={{e.id}} type="submit">編集</button>
                     </form>
                     <form>
                         <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />

From 0da10ed8b828b53bb5c27ea6e81c1a2e74aa7081 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 15:42:24 +0900
Subject: [PATCH 296/336] add comment

---
 templates/index.html | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index 0f70bd3..e9bbb60 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -68,13 +68,11 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
                         ・URLの改良をしました。
-                        <br> ・検索方法をコンテスト名検索から問題名検索に変更しました。
-                        <br>・新着問題テーブルを追加しました。
-                        <br>・問題ページにツイートボタンを設置しました。
                         <br>・公式editorialと問題ページヘのリンクを追加しました。
                         <br>（公式editorialは旧コンテスト未対応です）
                         <br>・ユーザーページの解法に消去ボタンを追加しました。
                         <br>・ユーザーページにいいねボタンを追加しました。
+                        <br>・編集ボタンを追加しました。
                     </div>
                 </div>
             </div>

From b59e80e9480a4130dceb22604ed2d18966e73b53 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 17:53:31 +0900
Subject: [PATCH 297/336] fix

---
 tag.txt                 | 24 ++++++++++++++++++++++++
 templates/edit_fin.html |  2 +-
 2 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 tag.txt

diff --git a/tag.txt b/tag.txt
new file mode 100644
index 0000000..c2cb314
--- /dev/null
+++ b/tag.txt
@@ -0,0 +1,24 @@
+tags=["実装","探索","数学","算数","貪欲法","文字列","数え上げ",
+"門松列","二分探索","場合分け","幾何","セグメント木","累積和","組合せ",
+"幅優先探索","発想","グラフ","ソート","期待値","リアクティブ","素因数分解",
+"BIT","bitDP","ゲーム","文字列処理","構築","確率","桁DP","シミュレーション",
+"剰余","回文","木","union-find","メモ化再帰","平方分割","座標圧縮",
+"しゃくとり法","探索","深さ優先探索","漸化式","約数","ダイクストラ法",
+"フェルマーの小定理","包除原理","埋め込み","最大公約数","素数判定","行列べき乗",
+"誤差","Grundy数","cww","ビット演算","分数","半分全列挙","平衡二分探索木",
+"構文解析","繰り返し二乗法","置換","貪欲","逆元","FFT","Nim","アドホック",
+"マンハッタン距離","三分探索","中華風剰余定理","周期性","多倍長整数",
+"最小公倍数","木DP","正規表現","考察","行列","計算","遅延セグメント木",
+"Heavy-Light_Decomposition","Miller-Rabin素数判定法","RMQ","SPFA",
+"チェビシェフ距離","バケット法","フィボナッチ","優先度付きキュー","分割統治法",
+"基数変換","場合の数","巡回群","整数論","素数","素数列挙","経路復元",
+"行列累乗","転倒数","連立方程式","順列","魔方陣","-SAT","Garner","LCA",
+"Mod","Polyaの定理","dfs","imos法","union-find木","きたまさ法",
+"カタラン数","スライド最小値","チャンパーノウン定数","テトラナッチ","データ構造",
+"ハッシュテーブル","バケットソート","バックトラック","パスカルの三角形",
+"ビット並列","メモリ制限","メモ化","モンテカルロ法","ルジャンドルの定理",
+"ロシアゲー","ローリングハッシュ","ワーシャルフロイド","乱択アルゴリズム",
+"二次関数","余り","偶奇性","入出力","全列挙","凸包","図形","多項式","巡回路",
+"挿入DP","排他的論理和","数値計算","数字根","整数計算","最大流","最小カット",
+"最小全域木","最短経路","期待値の線形性","木構造","条件分岐","枝刈り","格子点",
+"独立性","畳み込み","精度落ち","総当り","配列","閉路検出","inline-DP"]
diff --git a/templates/edit_fin.html b/templates/edit_fin.html
index 6991fd7..1d1332b 100644
--- a/templates/edit_fin.html
+++ b/templates/edit_fin.html
@@ -57,7 +57,7 @@
         </div>
     </nav>
 
-    <div class="jumbotron jumbotron-fluid">
+    <div class="jumbotron jumbotron-fluid container-fluid">
         <h2>編集しました。</h2>
     </div>
 

From e3c96081d71ca3990fd4d369a662c6ceb8cb5852 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 18:15:16 +0900
Subject: [PATCH 298/336] fix

---
 tag.txt | 286 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 286 insertions(+)

diff --git a/tag.txt b/tag.txt
index c2cb314..a758742 100644
--- a/tag.txt
+++ b/tag.txt
@@ -22,3 +22,289 @@ tags=["実装","探索","数学","算数","貪欲法","文字列","数え上げ"
 "挿入DP","排他的論理和","数値計算","数字根","整数計算","最大流","最小カット",
 "最小全域木","最短経路","期待値の線形性","木構造","条件分岐","枝刈り","格子点",
 "独立性","畳み込み","精度落ち","総当り","配列","閉路検出","inline-DP"]
+
+
+<!DOCTYPE html>
+<html lang="ja">
+
+<head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="csrf-token" content="{{ csrf_token() }}">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
+    <title>AtCoder Editorials</title>
+</head>
+
+<body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+
+    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
+        <a href="/" class="navbar-brand">AtCoder Editorials</a>
+
+        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse" id="nav1">
+            <ul class="navbar-nav">
+                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
+                <li class="nav-item active"><a href="/search" class="nav-link">問題</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
+            </ul>
+            {% if current_user.is_authenticated==False %}
+            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
+        </div>
+    </nav>
+
+    {%if contestname == None%}
+    <div class="container-fluid">
+        <h1>{{request.args.get('contestname','')}}</h1>
+    </div>
+    {%else%}
+    <div class="row container-fluid">
+        <div>
+            <h1>{{contestname}}</h1>
+        </div>
+        <h4 class="col-1"></h4>
+        {% if current_user.is_authenticated== True %}
+        <div>
+            <div class="twitter">
+                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{problem_id}}/1" data-lang="ja">
+                </a>
+            </div>
+        </div>
+        {%endif%}
+    </div>
+    {%endif%}
+
+    <div class="container-fluid">
+        <a class="h4" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}" target="_blank">問題ページ</a>
+        <h4 class="col-1"></h4>
+        <a class="h4" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf" target="_blank">公式editorial</a>
+    </div>
+
+    <br> {% if current_user.is_authenticated== True %}
+    <div id="submit-card">
+
+        <div class="card col-6 border-0" style="cursor: pointer;">
+            <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-target="#sub1">
+                投稿する
+            </h4>
+            <div class="collapse" id="sub1" data-parent="#submit-card" style="cursor: pointer;">
+                <form action="/submited " method='POST'>
+                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+                    <input type="text" placeholder="タイトル" name="title" style="width:535px" />
+                    <br>
+                    <input type="text" placeholder="URL" name="url" style="width:535px" />
+                    <br>
+                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea> {%if contestname==None%}
+                    <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname ',' ')}}">投稿</button> {%else%}
+                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
+
+                </form>
+            </div>
+        </div>
+    </div>
+    {% else %}
+    <div class="container-fluid">
+        <h4>「投稿」または「いいね」をするにはログインが必要です</h4>
+    </div>
+    {%endif%}
+    <br>
+
+    <br>
+    <br>
+
+    <div class="row container-fluid">
+        <h3>タグ投票</h3>
+    </div>
+    <form id="search" method="POST" action="">
+        <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+        <input id="tag_search" placeholder="タグ名" style="width:600px" name="tagName" type="text" />
+    </form>
+
+    <br>
+    <br>
+
+
+    <div>
+        {% if editorials.items|length >0 %}
+
+        <div id="editorial-card">
+
+            {% for edit in editorials.items %}
+            <br>
+            <div class="row container-fluid">
+                {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
+                <form>
+                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+                    <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
+                </form>
+                {%else%}
+                <form>
+                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+                    <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
+                </form>
+                {%endif%}{%else%}
+                <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
+                <h5 class="col-1"></h5>
+                <img src={{edit.user_image_url}} alt='No Image ' style="width:36px;height:36px;vertical-align:middle;">
+                <a href="/user/{{edit.user_id}}/1" class="h4 text-dark" style="vertical-align:middle;">{{edit.username}}</a>
+                <h5 class="col-1"></h5>
+                {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
+                <form action="/edit" method="POST">
+                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+                    <button class="btn" name="edit_id" value={{edit.id}} type="submit">編集</button>
+                </form>
+                <form>
+                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+                    <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>
+                </form>
+                <h5 class="col-1"></h5>
+                {%endif%}
+            </div>
+
+            <div class="card col-6 border-0" style="cursor: pointer;">
+                <h4 class="card-header text-light bg-light text-dark col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
+                    {{edit.title}}
+                </h4>
+
+                <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
+                    {% if edit.url!=None%}
+                    <a href={{edit.url}}>{{edit.url}}</a> {%endif%}
+                </div>
+
+                <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
+                    {% autoescape false %} {%if edit.description!=None%}
+                    <br>
+                    <p>{{edit.description}}</p>
+                    {%endif%} {% endautoescape %}
+                </div>
+            </div>
+            <br>
+            <br> {% endfor %}
+        </div>
+        {%else%}
+        <h4 class='container-fluid '>まだ投稿がありません</h4>
+        <br> {%endif%}
+    </div>
+
+    <div class="container-fluid h4">
+
+        <ul class="pagination">
+            {% if editorials.has_prev %} {%if contestname==None%}
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id)}}">
+        {%else%}
+        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id)}}">
+        {%endif%}
+        << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id) }}">
+                {%else%}
+                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id)}}">
+        {%endif%}
+         次のページ >></a></li>{% endif %}
+        </ul>
+    </div>
+
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
+    <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js" integrity="sha256-DI6NdAhhFRnO2k51mumYeDShet3I8AKCQf/tf7ARNhI=" crossorigin="anonymous"></script>
+    <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
+    <script src="/static/script.js"></script>
+
+    <script type="text/javascript">
+        (async function() {
+
+            const tags = ["実装", "探索", "数学", "算数", "貪欲法", "文字列", "数え上げ",
+                "門松列", "二分探索", "場合分け", "幾何", "セグメント木", "累積和", "組合せ",
+                "幅優先探索", "発想", "グラフ", "ソート", "期待値", "リアクティブ", "素因数分解",
+                "BIT", "bitDP", "ゲーム", "文字列処理", "構築", "確率", "桁DP", "シミュレーション",
+                "剰余", "回文", "木", "union-find", "メモ化再帰", "平方分割", "座標圧縮",
+                "しゃくとり法", "探索", "深さ優先探索", "漸化式", "約数", "ダイクストラ法",
+                "フェルマーの小定理", "包除原理", "埋め込み", "最大公約数", "素数判定", "行列べき乗",
+                "誤差", "Grundy数", "cww", "ビット演算", "分数", "半分全列挙", "平衡二分探索木",
+                "構文解析", "繰り返し二乗法", "置換", "貪欲", "逆元", "FFT", "Nim", "アドホック",
+                "マンハッタン距離", "三分探索", "中華風剰余定理", "周期性", "多倍長整数",
+                "最小公倍数", "木DP", "正規表現", "考察", "行列", "計算", "遅延セグメント木",
+                "Heavy-Light_Decomposition", "Miller-Rabin素数判定法", "RMQ", "SPFA",
+                "チェビシェフ距離", "バケット法", "フィボナッチ", "優先度付きキュー", "分割統治法",
+                "基数変換", "場合の数", "巡回群", "整数論", "素数", "素数列挙", "経路復元",
+                "行列累乗", "転倒数", "連立方程式", "順列", "魔方陣", "-SAT", "Garner", "LCA",
+                "Mod", "Polyaの定理", "dfs", "imos法", "union-find木", "きたまさ法",
+                "カタラン数", "スライド最小値", "チャンパーノウン定数", "テトラナッチ", "データ構造",
+                "ハッシュテーブル", "バケットソート", "バックトラック", "パスカルの三角形",
+                "ビット並列", "メモリ制限", "メモ化", "モンテカルロ法", "ルジャンドルの定理",
+                "ロシアゲー", "ローリングハッシュ", "ワーシャルフロイド", "乱択アルゴリズム",
+                "二次関数", "余り", "偶奇性", "入出力", "全列挙", "凸包", "図形", "多項式", "巡回路",
+                "挿入DP", "排他的論理和", "数値計算", "数字根", "整数計算", "最大流", "最小カット",
+                "最小全域木", "最短経路", "期待値の線形性", "木構造", "条件分岐", "枝刈り", "格子点",
+                "独立性", "畳み込み", "精度落ち", "総当り", "配列", "閉路検出", "inline-DP"
+            ];
+
+            //検索候補を表示する。
+            $('#tag_search').autocomplete({
+                source: tags,
+                autoFocus: true,
+                delay: 100,
+                minLength: 2,
+                appendTo: "menu",
+
+                //候補をクリックすることでsubmitできるようにする
+                select: function(event, ui) {
+                    $("#tag_search").val(ui.item.label);
+                    $('form').attr('action', '/tag_search?tagName=' + ui.item.label);
+                    $("#search").submit();
+                }
+            });
+
+            //input内でのEnter無効化
+            $(function() {
+                $(document).on("keypress", "input:not(.allow_submit)", function(event) {
+                    return event.which !== 13;
+                });
+            });
+
+            //日本語入力をスタートしたら無効化
+            $('#autocomplete_search').on('compositionstart', function() {
+                $('#autocomplete_search').autocomplete('disable');
+            });
+
+            //日本語入力が確定したら有効化
+            $('#autocomplete_search').on('compositionend', function() {
+                $('#autocomplete_search').autocomplete('enable').autocomplete('search');
+            });
+
+        })();
+    </script>
+</body>
+
+</html>
\ No newline at end of file

From 3c09c3080d2015e1cf4996bc0c18102846e131f0 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Wed, 28 Aug 2019 19:43:29 +0900
Subject: [PATCH 299/336] add tag

---
 app.py                 |   6 +
 tag.txt                | 289 +----------------------------------------
 templates/contest.html |  81 +++++++++++-
 3 files changed, 89 insertions(+), 287 deletions(-)

diff --git a/app.py b/app.py
index 2ff0db4..865387e 100644
--- a/app.py
+++ b/app.py
@@ -37,6 +37,12 @@ class Like(db.Model):
     user_id=db.Column(db.Integer)
     edit_id=db.Column(db.Integer)
 
+class Tag(db.Model):
+    id=db.Column(db.Integer,primary_key=True)
+    problem_id=db.Column(db.Integer)
+    tag=db.Column(db.String(64))
+    user_id=db.Column(db.Integer)
+
 #コンテスト名に含まれる空白などを取り除く
 def _normalize_contestname(contestname):
     if isinstance(contestname, str):
diff --git a/tag.txt b/tag.txt
index a758742..7b61004 100644
--- a/tag.txt
+++ b/tag.txt
@@ -1,3 +1,6 @@
+
+
+
 tags=["実装","探索","数学","算数","貪欲法","文字列","数え上げ",
 "門松列","二分探索","場合分け","幾何","セグメント木","累積和","組合せ",
 "幅優先探索","発想","グラフ","ソート","期待値","リアクティブ","素因数分解",
@@ -22,289 +25,3 @@ tags=["実装","探索","数学","算数","貪欲法","文字列","数え上げ"
 "挿入DP","排他的論理和","数値計算","数字根","整数計算","最大流","最小カット",
 "最小全域木","最短経路","期待値の線形性","木構造","条件分岐","枝刈り","格子点",
 "独立性","畳み込み","精度落ち","総当り","配列","閉路検出","inline-DP"]
-
-
-<!DOCTYPE html>
-<html lang="ja">
-
-<head>
-    <!-- Google Tag Manager -->
-    <script>
-        (function(w, d, s, l, i) {
-            w[l] = w[l] || [];
-            w[l].push({
-                'gtm.start': new Date().getTime(),
-                event: 'gtm.js'
-            });
-            var f = d.getElementsByTagName(s)[0],
-                j = d.createElement(s),
-                dl = l != 'dataLayer' ? '&l=' + l : '';
-            j.async = true;
-            j.src =
-                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
-            f.parentNode.insertBefore(j, f);
-        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
-    </script>
-    <!-- End Google Tag Manager -->
-    <meta charset="utf-8" />
-    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="csrf-token" content="{{ csrf_token() }}">
-    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <link rel="icon" type="image/x-icon" href="/favicon.ico">
-    <title>AtCoder Editorials</title>
-</head>
-
-<body style="padding-top:5rem">
-    <!-- Google Tag Manager (noscript) -->
-    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
-            style="display:none;visibility:hidden"></iframe></noscript>
-    <!-- End Google Tag Manager (noscript) -->
-    <noscript>You need to enable JavaScript to run this app.</noscript>
-
-    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
-        <a href="/" class="navbar-brand">AtCoder Editorials</a>
-
-        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
-            <span class="navbar-toggler-icon"></span>
-        </button>
-
-        <div class="collapse navbar-collapse" id="nav1">
-            <ul class="navbar-nav">
-                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item active"><a href="/search" class="nav-link">問題</a></li>
-                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
-                {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
-                {%endif%}
-            </ul>
-            {% if current_user.is_authenticated==False %}
-            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
-            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
-        </div>
-    </nav>
-
-    {%if contestname == None%}
-    <div class="container-fluid">
-        <h1>{{request.args.get('contestname','')}}</h1>
-    </div>
-    {%else%}
-    <div class="row container-fluid">
-        <div>
-            <h1>{{contestname}}</h1>
-        </div>
-        <h4 class="col-1"></h4>
-        {% if current_user.is_authenticated== True %}
-        <div>
-            <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{problem_id}}/1" data-lang="ja">
-                </a>
-            </div>
-        </div>
-        {%endif%}
-    </div>
-    {%endif%}
-
-    <div class="container-fluid">
-        <a class="h4" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}" target="_blank">問題ページ</a>
-        <h4 class="col-1"></h4>
-        <a class="h4" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf" target="_blank">公式editorial</a>
-    </div>
-
-    <br> {% if current_user.is_authenticated== True %}
-    <div id="submit-card">
-
-        <div class="card col-6 border-0" style="cursor: pointer;">
-            <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-target="#sub1">
-                投稿する
-            </h4>
-            <div class="collapse" id="sub1" data-parent="#submit-card" style="cursor: pointer;">
-                <form action="/submited " method='POST'>
-                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-                    <input type="text" placeholder="タイトル" name="title" style="width:535px" />
-                    <br>
-                    <input type="text" placeholder="URL" name="url" style="width:535px" />
-                    <br>
-                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea> {%if contestname==None%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname ',' ')}}">投稿</button> {%else%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
-
-                </form>
-            </div>
-        </div>
-    </div>
-    {% else %}
-    <div class="container-fluid">
-        <h4>「投稿」または「いいね」をするにはログインが必要です</h4>
-    </div>
-    {%endif%}
-    <br>
-
-    <br>
-    <br>
-
-    <div class="row container-fluid">
-        <h3>タグ投票</h3>
-    </div>
-    <form id="search" method="POST" action="">
-        <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-        <input id="tag_search" placeholder="タグ名" style="width:600px" name="tagName" type="text" />
-    </form>
-
-    <br>
-    <br>
-
-
-    <div>
-        {% if editorials.items|length >0 %}
-
-        <div id="editorial-card">
-
-            {% for edit in editorials.items %}
-            <br>
-            <div class="row container-fluid">
-                {%if current_user.is_authenticated==True%} {% if flag[edit.id]==False%}
-                <form>
-                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
-                    <button class="like_button btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
-                </form>
-                {%else%}
-                <form>
-                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
-                    <button class="like_button btn btn-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button>
-                </form>
-                {%endif%}{%else%}
-                <button class="like_button_no_login btn btn-outline-info" name="id" value={{edit.id}}>{{edit.like}}いいね</button> {%endif%}
-                <h5 class="col-1"></h5>
-                <img src={{edit.user_image_url}} alt='No Image ' style="width:36px;height:36px;vertical-align:middle;">
-                <a href="/user/{{edit.user_id}}/1" class="h4 text-dark" style="vertical-align:middle;">{{edit.username}}</a>
-                <h5 class="col-1"></h5>
-                {% if current_user.is_authenticated==True and edit.user_id==current_user.id%}
-                <form action="/edit" method="POST">
-                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
-                    <button class="btn" name="edit_id" value={{edit.id}} type="submit">編集</button>
-                </form>
-                <form>
-                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
-                    <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{edit.id}}>削除</button>
-                </form>
-                <h5 class="col-1"></h5>
-                {%endif%}
-            </div>
-
-            <div class="card col-6 border-0" style="cursor: pointer;">
-                <h4 class="card-header text-light bg-light text-dark col-10" data-toggle="collapse" data-target="#edi{{loop.index}}">
-                    {{edit.title}}
-                </h4>
-
-                <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
-                    {% if edit.url!=None%}
-                    <a href={{edit.url}}>{{edit.url}}</a> {%endif%}
-                </div>
-
-                <div class="collapse" id="edi{{loop.index}}" data-parent="#editorial-card">
-                    {% autoescape false %} {%if edit.description!=None%}
-                    <br>
-                    <p>{{edit.description}}</p>
-                    {%endif%} {% endautoescape %}
-                </div>
-            </div>
-            <br>
-            <br> {% endfor %}
-        </div>
-        {%else%}
-        <h4 class='container-fluid '>まだ投稿がありません</h4>
-        <br> {%endif%}
-    </div>
-
-    <div class="container-fluid h4">
-
-        <ul class="pagination">
-            {% if editorials.has_prev %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id)}}">
-        {%else%}
-        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id)}}">
-        {%endif%}
-        << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id) }}">
-                {%else%}
-                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id)}}">
-        {%endif%}
-         次のページ >></a></li>{% endif %}
-        </ul>
-    </div>
-
-    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
-    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
-    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
-    <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js" integrity="sha256-DI6NdAhhFRnO2k51mumYeDShet3I8AKCQf/tf7ARNhI=" crossorigin="anonymous"></script>
-    <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
-    <script src="/static/script.js"></script>
-
-    <script type="text/javascript">
-        (async function() {
-
-            const tags = ["実装", "探索", "数学", "算数", "貪欲法", "文字列", "数え上げ",
-                "門松列", "二分探索", "場合分け", "幾何", "セグメント木", "累積和", "組合せ",
-                "幅優先探索", "発想", "グラフ", "ソート", "期待値", "リアクティブ", "素因数分解",
-                "BIT", "bitDP", "ゲーム", "文字列処理", "構築", "確率", "桁DP", "シミュレーション",
-                "剰余", "回文", "木", "union-find", "メモ化再帰", "平方分割", "座標圧縮",
-                "しゃくとり法", "探索", "深さ優先探索", "漸化式", "約数", "ダイクストラ法",
-                "フェルマーの小定理", "包除原理", "埋め込み", "最大公約数", "素数判定", "行列べき乗",
-                "誤差", "Grundy数", "cww", "ビット演算", "分数", "半分全列挙", "平衡二分探索木",
-                "構文解析", "繰り返し二乗法", "置換", "貪欲", "逆元", "FFT", "Nim", "アドホック",
-                "マンハッタン距離", "三分探索", "中華風剰余定理", "周期性", "多倍長整数",
-                "最小公倍数", "木DP", "正規表現", "考察", "行列", "計算", "遅延セグメント木",
-                "Heavy-Light_Decomposition", "Miller-Rabin素数判定法", "RMQ", "SPFA",
-                "チェビシェフ距離", "バケット法", "フィボナッチ", "優先度付きキュー", "分割統治法",
-                "基数変換", "場合の数", "巡回群", "整数論", "素数", "素数列挙", "経路復元",
-                "行列累乗", "転倒数", "連立方程式", "順列", "魔方陣", "-SAT", "Garner", "LCA",
-                "Mod", "Polyaの定理", "dfs", "imos法", "union-find木", "きたまさ法",
-                "カタラン数", "スライド最小値", "チャンパーノウン定数", "テトラナッチ", "データ構造",
-                "ハッシュテーブル", "バケットソート", "バックトラック", "パスカルの三角形",
-                "ビット並列", "メモリ制限", "メモ化", "モンテカルロ法", "ルジャンドルの定理",
-                "ロシアゲー", "ローリングハッシュ", "ワーシャルフロイド", "乱択アルゴリズム",
-                "二次関数", "余り", "偶奇性", "入出力", "全列挙", "凸包", "図形", "多項式", "巡回路",
-                "挿入DP", "排他的論理和", "数値計算", "数字根", "整数計算", "最大流", "最小カット",
-                "最小全域木", "最短経路", "期待値の線形性", "木構造", "条件分岐", "枝刈り", "格子点",
-                "独立性", "畳み込み", "精度落ち", "総当り", "配列", "閉路検出", "inline-DP"
-            ];
-
-            //検索候補を表示する。
-            $('#tag_search').autocomplete({
-                source: tags,
-                autoFocus: true,
-                delay: 100,
-                minLength: 2,
-                appendTo: "menu",
-
-                //候補をクリックすることでsubmitできるようにする
-                select: function(event, ui) {
-                    $("#tag_search").val(ui.item.label);
-                    $('form').attr('action', '/tag_search?tagName=' + ui.item.label);
-                    $("#search").submit();
-                }
-            });
-
-            //input内でのEnter無効化
-            $(function() {
-                $(document).on("keypress", "input:not(.allow_submit)", function(event) {
-                    return event.which !== 13;
-                });
-            });
-
-            //日本語入力をスタートしたら無効化
-            $('#autocomplete_search').on('compositionstart', function() {
-                $('#autocomplete_search').autocomplete('disable');
-            });
-
-            //日本語入力が確定したら有効化
-            $('#autocomplete_search').on('compositionend', function() {
-                $('#autocomplete_search').autocomplete('enable').autocomplete('search');
-            });
-
-        })();
-    </script>
-</body>
-
-</html>
\ No newline at end of file
diff --git a/templates/contest.html b/templates/contest.html
index f5b7090..dbabd52 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -112,7 +112,6 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
         <h4>「投稿」または「いいね」をするにはログインが必要です</h4>
     </div>
     {%endif%}
-    <br>
 
 
     <div>
@@ -195,11 +194,91 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
         </ul>
     </div>
 
+    <br>
+    <br>
+
+    <div class="container-fluid">
+        <h3>タグ投票</h3>
+        <form id="search" method="POST" action="">
+            <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+            <input id="tag_search" placeholder="タグ名" style="width:600px" name="tagName" type="text" />
+        </form>
+    </div>
+
+    <br>
+    <br>
+
     <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
+    <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js" integrity="sha256-DI6NdAhhFRnO2k51mumYeDShet3I8AKCQf/tf7ARNhI=" crossorigin="anonymous"></script>
     <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
     <script src="/static/script.js"></script>
+
+    <script type="text/javascript">
+        (async function() {
+            const tags = ["実装", "探索", "数学", "算数", "貪欲法", "文字列", "数え上げ",
+                "門松列", "二分探索", "場合分け", "幾何", "セグメント木", "累積和", "組合せ",
+                "幅優先探索", "発想", "グラフ", "ソート", "期待値", "リアクティブ", "素因数分解",
+                "BIT", "bitDP", "ゲーム", "文字列処理", "構築", "確率", "桁DP", "シミュレーション",
+                "剰余", "回文", "木", "union-find", "メモ化再帰", "平方分割", "座標圧縮",
+                "しゃくとり法", "探索", "深さ優先探索", "漸化式", "約数", "ダイクストラ法",
+                "フェルマーの小定理", "包除原理", "埋め込み", "最大公約数", "素数判定", "行列べき乗",
+                "誤差", "Grundy数", "cww", "ビット演算", "分数", "半分全列挙", "平衡二分探索木",
+                "構文解析", "繰り返し二乗法", "置換", "貪欲", "逆元", "FFT", "Nim", "アドホック",
+                "マンハッタン距離", "三分探索", "中華風剰余定理", "周期性", "多倍長整数",
+                "最小公倍数", "木DP", "正規表現", "考察", "行列", "計算", "遅延セグメント木",
+                "Heavy-Light_Decomposition", "Miller-Rabin素数判定法", "RMQ", "SPFA",
+                "チェビシェフ距離", "バケット法", "フィボナッチ", "優先度付きキュー", "分割統治法",
+                "基数変換", "場合の数", "巡回群", "整数論", "素数", "素数列挙", "経路復元",
+                "行列累乗", "転倒数", "連立方程式", "順列", "魔方陣", "-SAT", "Garner", "LCA",
+                "Mod", "Polyaの定理", "dfs", "imos法", "union-find木", "きたまさ法",
+                "カタラン数", "スライド最小値", "チャンパーノウン定数", "テトラナッチ", "データ構造",
+                "ハッシュテーブル", "バケットソート", "バックトラック", "パスカルの三角形",
+                "ビット並列", "メモリ制限", "メモ化", "モンテカルロ法", "ルジャンドルの定理",
+                "ロシアゲー", "ローリングハッシュ", "ワーシャルフロイド", "乱択アルゴリズム",
+                "二次関数", "余り", "偶奇性", "入出力", "全列挙", "凸包", "図形", "多項式", "巡回路",
+                "挿入DP", "排他的論理和", "数値計算", "数字根", "整数計算", "最大流", "最小カット",
+                "最小全域木", "最短経路", "期待値の線形性", "木構造", "条件分岐", "枝刈り", "格子点",
+                "独立性", "畳み込み", "精度落ち", "総当り", "配列", "閉路検出", "inline-DP"
+            ];
+
+            $('#tag_search').autocomplete({
+                source: tags,
+                autoFocus: true,
+                delay: 100,
+                minLength: 2,
+                appendTo: "menu",
+
+                //候補をクリックすることでsubmitできるようにする
+                select: function(event, ui) {
+                    var name = ui.item.label;
+                    $("#tag_search").val(name);
+                    $('form').attr('action', '/tag_search?tagName=' + name + '&problem_id={{problem_id}}');
+                    $("#search").submit();
+                }
+            });
+
+            //input内でのEnter無効化
+            $(function() {
+                $(document).on("keypress", "input:not(.allow_submit)", function(event) {
+                    return event.which !== 13;
+                });
+            });
+
+            //日本語入力をスタートしたら無効化
+            $('#tag_search').on('compositionstart', function() {
+                $('#tag_search').autocomplete('disable');
+            });
+
+            //日本語入力が確定したら有効化
+            $('#tag_search').on('compositionend', function() {
+                $('#tag_search').autocomplete('enable').autocomplete('search');
+            });
+
+        })();
+    </script>
+
 </body>
 
 </html>
\ No newline at end of file

From 7baecf7e59ddc69670ee0704556b736f075c219a Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 17:58:50 +0900
Subject: [PATCH 300/336] change contestname->problem_id

---
 app.py                 |  2 +-
 tag.txt                | 23 +++++++++++++++++++
 templates/contest.html | 52 +++++++++++++++++++-----------------------
 3 files changed, 48 insertions(+), 29 deletions(-)

diff --git a/app.py b/app.py
index 865387e..1db8b05 100644
--- a/app.py
+++ b/app.py
@@ -115,7 +115,7 @@ def submit():
     params = {
         'title': request.form.get('title'),
         'description': request.form.get('description'),
-        'contestname': _normalize_contestname(request.form.get('contestname')),
+        'contestname': _normalize_contestname(request.form.get('problem_id')),
         'url': request.form.get('url'),
         'like':int(0),
         'user_image_url': current_user.user_image_url,
diff --git a/tag.txt b/tag.txt
index 7b61004..35ad58b 100644
--- a/tag.txt
+++ b/tag.txt
@@ -25,3 +25,26 @@ tags=["実装","探索","数学","算数","貪欲法","文字列","数え上げ"
 "挿入DP","排他的論理和","数値計算","数字根","整数計算","最大流","最小カット",
 "最小全域木","最短経路","期待値の線形性","木構造","条件分岐","枝刈り","格子点",
 "独立性","畳み込み","精度落ち","総当り","配列","閉路検出","inline-DP"]
+
+tag=["フロー","最小費用流","最大マッチング","最大流","数学",
+"包除原理","連立方程式","半環","確率","期待値","FFT",
+"アダマール変換","メビウス変換","ゼータ変換","XOR","中国剰余定理",
+"線形計画法","フィボナッチ数列","有理数","木構造",
+"LCA","HL分解","オイラーツアー","木の同型判定",
+"重心分解","LinkCutTree","DynamicTree","グラフ理論",
+"スペクトルグラフ理論","行列木定理","ケイリーの公式",
+"橋"、"関節点","サイクル基底","lowlink","ダイクストラ","ベルマンフォード",
+"ワーシャルフロイド","オイラー路","強連結成分分解","最小パス被覆",
+"Dilworthの定理","トポロジカルソート","最大クリーク","最大独立集合",
+"BFS","後退解析","最小全域木","プリム","クラスカル","ブルーフカ",
+"データ構造","UnionFind","セグメントツリー","BIT","遅延評価セグメントツリー",
+"永続データ構造","平衡二分木","SparseTable","WaveletMatrix","動的計画法",
+"区間DP","桁DP","CHT","MongeDP","AlianDP","インラインDP","きたまさ法",
+"行列累乗","戻すDP","全方位木DP","木DP","bitDP","挿入DP","連結DP","inlineDP",
+"枝刈り","マンハッタン距離","しゃくとり法","二分探索","三分探索",
+"imos法","累積和","最長部分増加列","Mo'sAlgorithm",
+"平方分割","ローリングハッシュ","SuffixArray","LCP","KMP",
+"Aho-Corasick","Z-algorithm","PalindromicTree","Manacher",
+"SuffixTree","Nim","Grundy数","後退解析","ミニマックス法",
+"2-SAT","マージテク","エラトステネスの篩","区間篩","分割統治法","凸包",
+"構築","乱択アルゴリズム","半分全列挙","最近点対","幾何","構文解析","平面走査"]
diff --git a/templates/contest.html b/templates/contest.html
index dbabd52..402a41b 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -99,9 +99,8 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
-                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea> {%if contestname==None%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname ',' ')}}">投稿</button> {%else%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
+                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea>
+                    <button type="submit" class="btn btn-info" name="problem_id" value="{{problem_id}}">投稿</button>
 
                 </form>
             </div>
@@ -217,32 +216,29 @@ <h3>タグ投票</h3>
 
     <script type="text/javascript">
         (async function() {
-            const tags = ["実装", "探索", "数学", "算数", "貪欲法", "文字列", "数え上げ",
-                "門松列", "二分探索", "場合分け", "幾何", "セグメント木", "累積和", "組合せ",
-                "幅優先探索", "発想", "グラフ", "ソート", "期待値", "リアクティブ", "素因数分解",
-                "BIT", "bitDP", "ゲーム", "文字列処理", "構築", "確率", "桁DP", "シミュレーション",
-                "剰余", "回文", "木", "union-find", "メモ化再帰", "平方分割", "座標圧縮",
-                "しゃくとり法", "探索", "深さ優先探索", "漸化式", "約数", "ダイクストラ法",
-                "フェルマーの小定理", "包除原理", "埋め込み", "最大公約数", "素数判定", "行列べき乗",
-                "誤差", "Grundy数", "cww", "ビット演算", "分数", "半分全列挙", "平衡二分探索木",
-                "構文解析", "繰り返し二乗法", "置換", "貪欲", "逆元", "FFT", "Nim", "アドホック",
-                "マンハッタン距離", "三分探索", "中華風剰余定理", "周期性", "多倍長整数",
-                "最小公倍数", "木DP", "正規表現", "考察", "行列", "計算", "遅延セグメント木",
-                "Heavy-Light_Decomposition", "Miller-Rabin素数判定法", "RMQ", "SPFA",
-                "チェビシェフ距離", "バケット法", "フィボナッチ", "優先度付きキュー", "分割統治法",
-                "基数変換", "場合の数", "巡回群", "整数論", "素数", "素数列挙", "経路復元",
-                "行列累乗", "転倒数", "連立方程式", "順列", "魔方陣", "-SAT", "Garner", "LCA",
-                "Mod", "Polyaの定理", "dfs", "imos法", "union-find木", "きたまさ法",
-                "カタラン数", "スライド最小値", "チャンパーノウン定数", "テトラナッチ", "データ構造",
-                "ハッシュテーブル", "バケットソート", "バックトラック", "パスカルの三角形",
-                "ビット並列", "メモリ制限", "メモ化", "モンテカルロ法", "ルジャンドルの定理",
-                "ロシアゲー", "ローリングハッシュ", "ワーシャルフロイド", "乱択アルゴリズム",
-                "二次関数", "余り", "偶奇性", "入出力", "全列挙", "凸包", "図形", "多項式", "巡回路",
-                "挿入DP", "排他的論理和", "数値計算", "数字根", "整数計算", "最大流", "最小カット",
-                "最小全域木", "最短経路", "期待値の線形性", "木構造", "条件分岐", "枝刈り", "格子点",
-                "独立性", "畳み込み", "精度落ち", "総当り", "配列", "閉路検出", "inline-DP"
+            const tag = ["フロー", "最小費用流", "最大マッチング", "最大流", "数学",
+                "包除原理", "連立方程式", "半環", "確率", "期待値", "FFT",
+                "アダマール変換", "メビウス変換", "ゼータ変換", "XOR", "中国剰余定理",
+                "線形計画法", "フィボナッチ数列", "有理数", "木構造",
+                "LCA", "HL分解", "オイラーツアー", "木の同型判定",
+                "重心分解", "LinkCutTree", "DynamicTree", "グラフ理論",
+                "スペクトルグラフ理論", "行列木定理", "ケイリーの公式", "橋",
+                "関節点", "サイクル基底", "lowlink", "ダイクストラ", "ベルマンフォード",
+                "ワーシャルフロイド", "オイラー路", "強連結成分分解", "最小パス被覆",
+                "Dilworthの定理", "トポロジカルソート", "最大クリーク", "最大独立集合",
+                "BFS", "後退解析", "最小全域木", "プリム", "クラスカル", "ブルーフカ",
+                "データ構造", "UnionFind", "セグメントツリー", "BIT", "遅延評価セグメントツリー",
+                "永続データ構造", "平衡二分木", "SparseTable", "WaveletMatrix", "動的計画法",
+                "区間DP", "桁DP", "CHT", "MongeDP", "AlianDP", "インラインDP", "きたまさ法",
+                "行列累乗", "戻すDP", "全方位木DP", "木DP", "bitDP", "挿入DP", "連結DP", "inlineDP",
+                "枝刈り", "マンハッタン距離", "しゃくとり法", "二分探索", "三分探索",
+                "imos法", "累積和", "最長部分増加列", "Mo'sAlgorithm",
+                "平方分割", "ローリングハッシュ", "SuffixArray", "LCP", "KMP",
+                "Aho-Corasick", "Z-algorithm", "PalindromicTree", "Manacher",
+                "SuffixTree", "Nim", "Grundy数", "後退解析", "ミニマックス法",
+                "2-SAT", "マージテク", "エラトステネスの篩", "区間篩", "分割統治法", "凸包",
+                "構築", "乱択アルゴリズム", "半分全列挙", "最近点対", "幾何", "構文解析", "平面走査"
             ];
-
             $('#tag_search').autocomplete({
                 source: tags,
                 autoFocus: true,

From b40cef7e17400a9e1395008f5382b99c3c48e046 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 18:00:20 +0900
Subject: [PATCH 301/336] fix

---
 app.py                 | 2 +-
 templates/contest.html | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/app.py b/app.py
index 2ff0db4..2103dce 100644
--- a/app.py
+++ b/app.py
@@ -109,7 +109,7 @@ def submit():
     params = {
         'title': request.form.get('title'),
         'description': request.form.get('description'),
-        'contestname': _normalize_contestname(request.form.get('contestname')),
+        'contestname': _normalize_contestname(request.form.get('problem_id')),
         'url': request.form.get('url'),
         'like':int(0),
         'user_image_url': current_user.user_image_url,
diff --git a/templates/contest.html b/templates/contest.html
index f5b7090..8ff9b1a 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -99,9 +99,8 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
-                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea> {%if contestname==None%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname ',' ')}}">投稿</button> {%else%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
+                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea>
+                    <button type="submit" class="btn btn-info" name="problem_id" value="{{problem_id}}">投稿</button>{%endif%}
 
                 </form>
             </div>

From 763e933e326d3158c29b4c390246dc027c9f1c54 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 18:03:55 +0900
Subject: [PATCH 302/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 8ff9b1a..6447434 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -100,7 +100,7 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
                     <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea>
-                    <button type="submit" class="btn btn-info" name="problem_id" value="{{problem_id}}">投稿</button>{%endif%}
+                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>
 
                 </form>
             </div>

From b653c235603c483c53c003c335125ab353d65988 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 18:06:01 +0900
Subject: [PATCH 303/336] fix

---
 templates/contest.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index 6447434..8974b73 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -100,7 +100,7 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
                     <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea>
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>
+                    <button type="submit" class="btn btn-info" name="problem_id" value="{{problem_id}}">投稿</button>
 
                 </form>
             </div>

From 44dc2d36b7d85a324c83909a3e922c52c26e541b Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 18:11:30 +0900
Subject: [PATCH 304/336] fix

---
 app.py                 | 8 +++++++-
 templates/contest.html | 9 +++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/app.py b/app.py
index 2103dce..865387e 100644
--- a/app.py
+++ b/app.py
@@ -37,6 +37,12 @@ class Like(db.Model):
     user_id=db.Column(db.Integer)
     edit_id=db.Column(db.Integer)
 
+class Tag(db.Model):
+    id=db.Column(db.Integer,primary_key=True)
+    problem_id=db.Column(db.Integer)
+    tag=db.Column(db.String(64))
+    user_id=db.Column(db.Integer)
+
 #コンテスト名に含まれる空白などを取り除く
 def _normalize_contestname(contestname):
     if isinstance(contestname, str):
@@ -109,7 +115,7 @@ def submit():
     params = {
         'title': request.form.get('title'),
         'description': request.form.get('description'),
-        'contestname': _normalize_contestname(request.form.get('problem_id')),
+        'contestname': _normalize_contestname(request.form.get('contestname')),
         'url': request.form.get('url'),
         'like':int(0),
         'user_image_url': current_user.user_image_url,
diff --git a/templates/contest.html b/templates/contest.html
index 8974b73..a2836a0 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -99,8 +99,9 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
-                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea>
-                    <button type="submit" class="btn btn-info" name="problem_id" value="{{problem_id}}">投稿</button>
+                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea> {%if contestname==None%}
+                    <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname ',' ')}}">投稿</button> {%else%}
+                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
 
                 </form>
             </div>
@@ -111,7 +112,6 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
         <h4>「投稿」または「いいね」をするにはログインが必要です</h4>
     </div>
     {%endif%}
-    <br>
 
 
     <div>
@@ -193,12 +193,13 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
          次のページ >></a></li>{% endif %}
         </ul>
     </div>
-
     <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
+    <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js" integrity="sha256-DI6NdAhhFRnO2k51mumYeDShet3I8AKCQf/tf7ARNhI=" crossorigin="anonymous"></script>
     <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
     <script src="/static/script.js"></script>
+
 </body>
 
 </html>
\ No newline at end of file

From 162aad0539fb79d18f782d7fde68f842069eddd8 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 18:13:27 +0900
Subject: [PATCH 305/336] fix

---
 app.py                 | 8 +-------
 templates/contest.html | 5 ++---
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/app.py b/app.py
index 865387e..2103dce 100644
--- a/app.py
+++ b/app.py
@@ -37,12 +37,6 @@ class Like(db.Model):
     user_id=db.Column(db.Integer)
     edit_id=db.Column(db.Integer)
 
-class Tag(db.Model):
-    id=db.Column(db.Integer,primary_key=True)
-    problem_id=db.Column(db.Integer)
-    tag=db.Column(db.String(64))
-    user_id=db.Column(db.Integer)
-
 #コンテスト名に含まれる空白などを取り除く
 def _normalize_contestname(contestname):
     if isinstance(contestname, str):
@@ -115,7 +109,7 @@ def submit():
     params = {
         'title': request.form.get('title'),
         'description': request.form.get('description'),
-        'contestname': _normalize_contestname(request.form.get('contestname')),
+        'contestname': _normalize_contestname(request.form.get('problem_id')),
         'url': request.form.get('url'),
         'like':int(0),
         'user_image_url': current_user.user_image_url,
diff --git a/templates/contest.html b/templates/contest.html
index a2836a0..ca06908 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -99,9 +99,8 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
-                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea> {%if contestname==None%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname ',' ')}}">投稿</button> {%else%}
-                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
+                    <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea>
+                    <button type="submit" class="btn btn-info" name="problem_id" value="{{problem_id}}">投稿</button>
 
                 </form>
             </div>

From 99bb75d9b4ff62e080ce63cdeb02f4691f69e9c9 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 18:20:21 +0900
Subject: [PATCH 306/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 2103dce..8da179c 100644
--- a/app.py
+++ b/app.py
@@ -86,7 +86,7 @@ def contest_get(problem_id,page=1):
 
     #ページネーション
     per_page = 10
-    editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
+    editorials = db.session.query(Editorial).filter_by(contestname=problem_id).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
 
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
     if current_user.is_authenticated==True:

From 0e2c131e81957e907a19d60f2c4e13a0d128c313 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 19:58:55 +0900
Subject: [PATCH 307/336] add tag

---
 app.py                  | 25 +++++++++++++--
 templates/contest.html  | 29 ++++++++---------
 templates/vote_fin.html | 70 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 107 insertions(+), 17 deletions(-)
 create mode 100644 templates/vote_fin.html

diff --git a/app.py b/app.py
index 1db8b05..e44de6a 100644
--- a/app.py
+++ b/app.py
@@ -39,7 +39,7 @@ class Like(db.Model):
 
 class Tag(db.Model):
     id=db.Column(db.Integer,primary_key=True)
-    problem_id=db.Column(db.Integer)
+    problem_id=db.Column(db.String(64))
     tag=db.Column(db.String(64))
     user_id=db.Column(db.Integer)
 
@@ -90,6 +90,13 @@ def contest_get(problem_id,page=1):
             contest_id=problem['contest_id']
             break
 
+    tag_flag=False
+
+    if current_user.is_authenticated==True:
+         voted=db.session.query(Tag).filter(user_id==current_user.id,problem_id==problem_id).first()
+         if voted==None:
+             tag_flag=True
+
     #ページネーション
     per_page = 10
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
@@ -104,10 +111,22 @@ def contest_get(problem_id,page=1):
             else:
                 flag[edit.id]=False
 
-        return render_template('contest.html', contestname=contestname, editorials=editorials,flag=flag,problem_id=problem_id,contest_id=contest_id)
+        return render_template('contest.html', contestname=contestname, editorials=editorials,flag=flag,problem_id=problem_id,contest_id=contest_id,tag_flag=tag_flag)
     else:
-        return render_template('contest.html',contestname=contestname,editorials=editorials,problem_id=problem_id,contest_id=contest_id)
+        return render_template('contest.html',contestname=contestname,editorials=editorials,problem_id=problem_id,contest_id=contest_id,tag_flag=tag_flag)
+
+@app.route('/tag_vote',methods=['POST'])
+def tag_vote(): 
+    params={
+        'problem_id':request.args.get('problem_id'),
+        'tag':request.args.get('tagName'),
+        'user_id':current_user.id
+    }
+    newTag=Tag(**params)
+    db.session.add(newTag)
+    db.session.commit()
 
+    return render_template('vote_fin.html')
 
 @app.route('/submited', methods=['POST','GET'])
 def submit():
diff --git a/templates/contest.html b/templates/contest.html
index 402a41b..98315d4 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -180,19 +180,20 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
 
         <ul class="pagination">
             {% if editorials.has_prev %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id)}}">
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag)}}">
         {%else%}
-        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id)}}">
+        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag)}}">
         {%endif%}
         << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id) }}">
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag) }}">
                 {%else%}
-                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id)}}">
+                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag)}}">
         {%endif%}
          次のページ >></a></li>{% endif %}
         </ul>
     </div>
 
+    {%if tag_flag==True%}
     <br>
     <br>
 
@@ -200,12 +201,12 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
         <h3>タグ投票</h3>
         <form id="search" method="POST" action="">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-            <input id="tag_search" placeholder="タグ名" style="width:600px" name="tagName" type="text" />
+            <input id="tag_vote" placeholder="タグ名" style="width:600px" name="tagName" type="text" />
         </form>
     </div>
 
     <br>
-    <br>
+    <br> {%endif%}
 
     <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
@@ -239,8 +240,8 @@ <h3>タグ投票</h3>
                 "2-SAT", "マージテク", "エラトステネスの篩", "区間篩", "分割統治法", "凸包",
                 "構築", "乱択アルゴリズム", "半分全列挙", "最近点対", "幾何", "構文解析", "平面走査"
             ];
-            $('#tag_search').autocomplete({
-                source: tags,
+            $('#tag_vote').autocomplete({
+                source: tag,
                 autoFocus: true,
                 delay: 100,
                 minLength: 2,
@@ -249,8 +250,8 @@ <h3>タグ投票</h3>
                 //候補をクリックすることでsubmitできるようにする
                 select: function(event, ui) {
                     var name = ui.item.label;
-                    $("#tag_search").val(name);
-                    $('form').attr('action', '/tag_search?tagName=' + name + '&problem_id={{problem_id}}');
+                    $("#tag_vote").val(name);
+                    $('form').attr('action', '/tag_vote?tagName=' + name + '&problem_id={{problem_id}}');
                     $("#search").submit();
                 }
             });
@@ -263,13 +264,13 @@ <h3>タグ投票</h3>
             });
 
             //日本語入力をスタートしたら無効化
-            $('#tag_search').on('compositionstart', function() {
-                $('#tag_search').autocomplete('disable');
+            $('#tag_vote').on('compositionstart', function() {
+                $('#tag_vote').autocomplete('disable');
             });
 
             //日本語入力が確定したら有効化
-            $('#tag_search').on('compositionend', function() {
-                $('#tag_search').autocomplete('enable').autocomplete('search');
+            $('#tag_vote').on('compositionend', function() {
+                $('#tag_vote').autocomplete('enable').autocomplete('search');
             });
 
         })();
diff --git a/templates/vote_fin.html b/templates/vote_fin.html
new file mode 100644
index 0000000..be269c7
--- /dev/null
+++ b/templates/vote_fin.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html lang="ja">
+
+<head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
+    <title>AtCoder Editorials</title>
+</head>
+
+<body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+
+    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
+        <a href="/" class="navbar-brand">AtCoder Editorials</a>
+
+        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse" id="nav1">
+            <ul class="navbar-nav">
+                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
+            </ul>
+            {% if current_user.is_authenticated==False %}
+            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
+        </div>
+    </nav>
+
+    <div class="jumbotron jumbotron-fluid container-fluid">
+        <h2>投票しました。</h2>
+    </div>
+
+
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+</body>
+
+</html>
\ No newline at end of file

From f3816d363350ce82de6dc2445727b3091dbad02a Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 20:07:33 +0900
Subject: [PATCH 308/336] delete copy

---
 templates/user copy.html | 167 ---------------------------------------
 1 file changed, 167 deletions(-)
 delete mode 100644 templates/user copy.html

diff --git a/templates/user copy.html b/templates/user copy.html
deleted file mode 100644
index 65696cf..0000000
--- a/templates/user copy.html	
+++ /dev/null
@@ -1,167 +0,0 @@
-<!DOCTYPE html>
-
-<html lang="ja">
-
-<head>
-    <!-- Google Tag Manager -->
-    <script>
-        (function(w, d, s, l, i) {
-            w[l] = w[l] || [];
-            w[l].push({
-                'gtm.start': new Date().getTime(),
-                event: 'gtm.js'
-            });
-            var f = d.getElementsByTagName(s)[0],
-                j = d.createElement(s),
-                dl = l != 'dataLayer' ? '&l=' + l : '';
-            j.async = true;
-            j.src =
-                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
-            f.parentNode.insertBefore(j, f);
-        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
-    </script>
-    <!-- End Google Tag Manager -->
-    <meta charset="utf-8" />
-    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="csrf-token" content="{{ csrf_token() }}">
-    <link rel="icon" type="image/x-icon" href="/favicon.ico">
-    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-    <title>AtCoder Editorials</title>
-</head>
-
-<body style="padding-top:5rem">
-    <!-- Google Tag Manager (noscript) -->
-    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
-            style="display:none;visibility:hidden"></iframe></noscript>
-    <!-- End Google Tag Manager (noscript) -->
-    <noscript>You need to enable JavaScript to run this app.</noscript>
-
-    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
-        <a href="/" class="navbar-brand">AtCoder Editorials</a>
-
-        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
-            <span class="navbar-toggler-icon"></span>
-        </button>
-
-        <div class="collapse navbar-collapse" id="nav1">
-            <ul class="navbar-nav">
-                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
-                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
-                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
-                {% if current_user.is_authenticated==True %}
-                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
-                {%endif%}
-            </ul>
-            {% if current_user.is_authenticated==False %}
-            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
-            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
-        </div>
-    </nav>
-
-    <div class="container-fluid">
-        <div class="jumbotron jumbotron-fluid text-dark">
-            <h1>{{user.username}}</h1>
-            <div>
-                <h4>登録日時：{{date_published}}</h4>
-            </div>
-            <div>
-                <h4>順位　　：{{rank}}位</h4>
-            </div>
-            <div>
-                <h4> いいね数 :{{user.like_sum}}</h4>
-            </div>
-            <div>
-                <h4> 投稿数　 :{{num}}</h4>
-            </div>
-            <div>
-                {%if current_user.is_authenticated==True%}
-                <div class="twitter">
-                    <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{rank}}位になりました！" data-url="https://atcoder-editorials.herokuapp.com/user/{{user.id}}/1" data-lang="ja">
-                    </a>
-                </div>
-                {%endif%}
-            </div>
-        </div>
-    </div>
-    <div class="container-fluid">
-        <h3>投稿一覧</h3>
-        <div>
-            {%for e in edit.items %}
-            <div id="editorial-card">
-                <br>
-                <br>
-
-                <div class="row container-fluid">
-                    {%if current_user.is_authenticated==True%} {% if flag[e.id]==False%}
-                    <form>
-                        <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-                        <button class="like_button btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button>
-                    </form>
-                    {%else%}
-                    <form>
-                        <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-                        <button class="like_button btn btn-info" name="id" value={{e.id}}>{{e.like}}いいね</button>
-                    </form>
-                    {%endif%}{%else%}
-                    <button class="like_button_no_login btn btn-outline-info" name="id" value={{e.id}}>{{e.like}}いいね</button> {%endif%}
-
-                    <h4>{{e.contestname}}</h4>
-                    <h4 class="col-1"></h4>
-                    {% if current_user.is_authenticated==True and e.user_id==current_user.id%}
-                    <form>
-                        <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-                        <button class="delete_button btn" style="color:tomato;" name="delete_id" value={{e.id}}>削除</button>
-                    </form>
-                    {%endif%}
-                </div>
-
-                <div class="container-fluid">
-                    <div class="card col-6 border-0" style="cursor: pointer;">
-                        <h4 class="card-header text-dark bg-light col-10" data-toggle="collapse" data-target="#e{{loop.index}}">
-                            {{e.title}}
-                        </h4>
-
-                        <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
-                            {% if e.url!=None%}
-                            <a href={{e.url}}>{{e.url}}</a> {%endif%}
-                        </div>
-
-                        <div class="collapse" id="e{{loop.index}}" data-parent="#editorial-card">
-                            {% autoescape false %} {%if e.description!=None%}
-                            <br>
-                            <p>{{e.description}}</p>
-                            {%endif%} {% endautoescape %}
-                        </div>
-                    </div>
-                    <br>
-                    <br>
-                </div>
-            </div>
-            {% endfor %}
-        </div>
-
-        <div class="container-fluid">
-            <ul class="pagination">
-                {% if edit.has_prev %}
-                <li class="page-item">
-                    <a class="page-link" href="{{ url_for('user', page=edit.prev_num,id=user.id)}}">前のページ</a>
-                </li>
-                {% endif %} {% if edit.has_next %}
-                <li class="page-item">
-                    <a class="page-link" href="{{ url_for('user', page=edit.next_num,id=user.id)}}">次のページ</a>
-                </li>
-                {% endif %}
-            </ul>
-        </div>
-
-
-        <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
-        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
-        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
-        <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
-        <script src="/static/script.js"></script>
-</body>
-
-
-</html>
\ No newline at end of file

From 0a9d39d053fe2cf4579780455efa1cbc7ca096db Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 20:28:26 +0900
Subject: [PATCH 309/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index a9f1c3e..395ef44 100644
--- a/app.py
+++ b/app.py
@@ -93,7 +93,7 @@ def contest_get(problem_id,page=1):
     tag_flag=False
 
     if current_user.is_authenticated==True:
-         voted=db.session.query(Tag).filter(user_id==current_user.id,problem_id==problem_id).first()
+         voted=db.session.query(Tag).filter(Tag.user_id==current_user.id,Tag.problem_id==problem_id).first()
          if voted==None:
              tag_flag=True
 

From 6e553d73998c73917644451a8421602751d8cdbd Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 20:32:54 +0900
Subject: [PATCH 310/336] add tag

---
 templates/contest.html | 99 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 89 insertions(+), 10 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index ca06908..c27dd31 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -180,18 +180,36 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
 
         <ul class="pagination">
             {% if editorials.has_prev %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id)}}">
-        {%else%}
-        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id)}}">
-        {%endif%}
-        << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id) }}">
-                {%else%}
-                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id)}}">
-        {%endif%}
-         次のページ >></a></li>{% endif %}
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag)}}">
+                    {%else%}
+            <li class="page-item"><a class="page-link"
+                    href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag)}}">
+                    {%endif%}
+                    << 前のページ</a> </li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag) }}">
+                            {%else%}
+            <li class="page-item"><a class="page-link"
+                    href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag)}}">
+                    {%endif%}
+                    次のページ >></a></li>{% endif %}
         </ul>
     </div>
+
+    {%if tag_flag==True%}
+    <br>
+    <br>
+
+    <div class="container-fluid">
+        <h3>タグ投票</h3>
+        <form id="search" method="POST" action="">
+            <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+            <input id="tag_vote" placeholder="タグ名" style="width:600px" name="tagName" type="text" />
+        </form>
+    </div>
+
+    <br>
+    <br> {%endif%}
+
     <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin="anonymous "></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin="anonymous "></script>
@@ -199,6 +217,67 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
     <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
     <script src="/static/script.js"></script>
 
+    <script type="text/javascript">
+        (async function() {
+            const tag = ["フロー", "最小費用流", "最大マッチング", "最大流", "数学",
+                "包除原理", "連立方程式", "半環", "確率", "期待値", "FFT",
+                "アダマール変換", "メビウス変換", "ゼータ変換", "XOR", "中国剰余定理",
+                "線形計画法", "フィボナッチ数列", "有理数", "木構造",
+                "LCA", "HL分解", "オイラーツアー", "木の同型判定",
+                "重心分解", "LinkCutTree", "DynamicTree", "グラフ理論",
+                "スペクトルグラフ理論", "行列木定理", "ケイリーの公式", "橋",
+                "関節点", "サイクル基底", "lowlink", "ダイクストラ", "ベルマンフォード",
+                "ワーシャルフロイド", "オイラー路", "強連結成分分解", "最小パス被覆",
+                "Dilworthの定理", "トポロジカルソート", "最大クリーク", "最大独立集合",
+                "BFS", "後退解析", "最小全域木", "プリム", "クラスカル", "ブルーフカ",
+                "データ構造", "UnionFind", "セグメントツリー", "BIT", "遅延評価セグメントツリー",
+                "永続データ構造", "平衡二分木", "SparseTable", "WaveletMatrix", "動的計画法",
+                "区間DP", "桁DP", "CHT", "MongeDP", "AlianDP", "インラインDP", "きたまさ法",
+                "行列累乗", "戻すDP", "全方位木DP", "木DP", "bitDP", "挿入DP", "連結DP", "inlineDP",
+                "枝刈り", "マンハッタン距離", "しゃくとり法", "二分探索", "三分探索",
+                "imos法", "累積和", "最長部分増加列", "Mo'sAlgorithm",
+                "平方分割", "ローリングハッシュ", "SuffixArray", "LCP", "KMP",
+                "Aho-Corasick", "Z-algorithm", "PalindromicTree", "Manacher",
+                "SuffixTree", "Nim", "Grundy数", "後退解析", "ミニマックス法",
+                "2-SAT", "マージテク", "エラトステネスの篩", "区間篩", "分割統治法", "凸包",
+                "構築", "乱択アルゴリズム", "半分全列挙", "最近点対", "幾何", "構文解析", "平面走査"
+            ];
+            $('#tag_vote').autocomplete({
+                source: tag,
+                autoFocus: true,
+                delay: 100,
+                minLength: 2,
+                appendTo: "menu",
+
+                //候補をクリックすることでsubmitできるようにする
+                select: function(event, ui) {
+                    var name = ui.item.label;
+                    $("#tag_vote").val(name);
+                    $('form').attr('action', '/tag_vote?tagName=' + name + '&problem_id={{problem_id}}');
+                    $("#search").submit();
+                }
+            });
+
+            //input内でのEnter無効化
+            $(function() {
+                $(document).on("keypress", "input:not(.allow_submit)", function(event) {
+                    return event.which !== 13;
+                });
+            });
+
+            //日本語入力をスタートしたら無効化
+            $('#tag_vote').on('compositionstart', function() {
+                $('#tag_vote').autocomplete('disable');
+            });
+
+            //日本語入力が確定したら有効化
+            $('#tag_vote').on('compositionend', function() {
+                $('#tag_vote').autocomplete('enable').autocomplete('search');
+            });
+
+        })();
+    </script>
+
 </body>
 
 </html>
\ No newline at end of file

From b0a2ea776b6d43025629d409efc6e9e75515832a Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 21:56:14 +0900
Subject: [PATCH 311/336] fix

---
 templates/contest.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index c27dd31..68c3088 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -240,7 +240,8 @@ <h3>タグ投票</h3>
                 "Aho-Corasick", "Z-algorithm", "PalindromicTree", "Manacher",
                 "SuffixTree", "Nim", "Grundy数", "後退解析", "ミニマックス法",
                 "2-SAT", "マージテク", "エラトステネスの篩", "区間篩", "分割統治法", "凸包",
-                "構築", "乱択アルゴリズム", "半分全列挙", "最近点対", "幾何", "構文解析", "平面走査"
+                "構築", "乱択アルゴリズム", "半分全列挙", "最近点対", "幾何", "構文解析", "平面走査",
+                "再帰"
             ];
             $('#tag_vote').autocomplete({
                 source: tag,

From 683e735f29a560e2694076d833793ac2f2fad4ff Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 22:15:11 +0900
Subject: [PATCH 312/336] commit

---
 templates/contest.html | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 68c3088..c0a638f 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -58,11 +58,6 @@
         </div>
     </nav>
 
-    {%if contestname == None%}
-    <div class="container-fluid">
-        <h1>{{request.args.get('contestname','')}}</h1>
-    </div>
-    {%else%}
     <div class="row container-fluid">
         <div>
             <h1>{{contestname}}</h1>
@@ -77,12 +72,16 @@ <h4 class="col-1"></h4>
         </div>
         {%endif%}
     </div>
-    {%endif%}
+
 
     <div class="container-fluid">
         <a class="h4" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}" target="_blank">問題ページ</a>
         <h4 class="col-1"></h4>
         <a class="h4" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf" target="_blank">公式editorial</a>
+        <h4 class="col-1"></h4>
+        {%if tag == None%}
+        <span class="badge badge-pill badge-secondary py-2">まだ投票されていません</span> {%else%}
+        <span class="badge badge-pill badge-secondary py-2">{{tag}}</span> {%endif%}
     </div>
 
     <br> {% if current_user.is_authenticated== True %}

From 65fb583fae74e9192c5c9547e700b2b9628e7eb9 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 22:26:54 +0900
Subject: [PATCH 313/336] add tag

---
 app.py                 | 21 +++++++++++++++++----
 templates/contest.html |  8 ++++----
 2 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/app.py b/app.py
index e44de6a..5046552 100644
--- a/app.py
+++ b/app.py
@@ -7,6 +7,7 @@
 from rauth import OAuth1Service
 import requests
 import json
+from collections import defaultdict
 from config import app, db, service, login_manager,csrf
 
 #ユーザー情報
@@ -93,14 +94,26 @@ def contest_get(problem_id,page=1):
     tag_flag=False
 
     if current_user.is_authenticated==True:
-         voted=db.session.query(Tag).filter(user_id==current_user.id,problem_id==problem_id).first()
+         voted=db.session.query(Tag).filter(Tag.user_id==current_user.id,Tag.problem_id==problem_id).first()
          if voted==None:
              tag_flag=True
+    
+    tags=db.session.query(Tag).filter(Tag.problem_id==problem_id)
+    vote_num=defaultdict(int)
+    for t in tags:
+        vote_num[t.tag]+=1
+    
+    vote_num= sorted(vote_num.items(), key=lambda x:x[1],reverse=True)
+
+    tag=None
+    if len(vote_num)!=0:
+        tag=vote_num[0][0]
+    
 
     #ページネーション
     per_page = 10
     editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
-
+    
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
     if current_user.is_authenticated==True:
         flag={}
@@ -111,9 +124,9 @@ def contest_get(problem_id,page=1):
             else:
                 flag[edit.id]=False
 
-        return render_template('contest.html', contestname=contestname, editorials=editorials,flag=flag,problem_id=problem_id,contest_id=contest_id,tag_flag=tag_flag)
+        return render_template('contest.html', contestname=contestname, editorials=editorials,flag=flag,problem_id=problem_id,contest_id=contest_id,tag_flag=tag_flag,tag=tag)
     else:
-        return render_template('contest.html',contestname=contestname,editorials=editorials,problem_id=problem_id,contest_id=contest_id,tag_flag=tag_flag)
+        return render_template('contest.html',contestname=contestname,editorials=editorials,problem_id=problem_id,contest_id=contest_id,tag_flag=tag_flag,tag=tag)
 
 @app.route('/tag_vote',methods=['POST'])
 def tag_vote(): 
diff --git a/templates/contest.html b/templates/contest.html
index 98315d4..dd4e527 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -180,14 +180,14 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
 
         <ul class="pagination">
             {% if editorials.has_prev %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag)}}">
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag,tag=tag)}}">
         {%else%}
-        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag)}}">
+        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag,tag=tag)}}">
         {%endif%}
         << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
-            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag) }}">
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag,tag=tag) }}">
                 {%else%}
-                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag)}}">
+                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag,tag=tag)}}">
         {%endif%}
          次のページ >></a></li>{% endif %}
         </ul>

From 9b67d00b327792f088e59725f2c017b797a33658 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 22:34:44 +0900
Subject: [PATCH 314/336] add tag

---
 templates/contest.html | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/templates/contest.html b/templates/contest.html
index dd4e527..edfde8d 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -83,6 +83,10 @@ <h4 class="col-1"></h4>
         <a class="h4" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}" target="_blank">問題ページ</a>
         <h4 class="col-1"></h4>
         <a class="h4" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf" target="_blank">公式editorial</a>
+        <h4 class="col-1"></h4>
+        {%if tag==None%}
+        <span class="badge badge-pill badge-secondary">投票がありません</span> {%else%}
+        <span class="badge badge-pill badge-secondary">{{tag}}</span> {%endif%}
     </div>
 
     <br> {% if current_user.is_authenticated== True %}
@@ -108,7 +112,7 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
     </div>
     {% else %}
     <div class="container-fluid">
-        <h4>「投稿」または「いいね」をするにはログインが必要です</h4>
+        <h4>「投稿」「いいね」「タグ投票」をするにはログインが必要です</h4>
     </div>
     {%endif%}
 

From 49cb5e1f754a28568894727fd45bf2f606d7cc7d Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Thu, 29 Aug 2019 22:48:08 +0900
Subject: [PATCH 315/336] add badge

---
 templates/contest.html | 31 ++++++++++---------------------
 1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 14ce4f7..cb48301 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -81,8 +81,8 @@ <h4 class="col-1"></h4>
         <h4 class="col-1"></h4>
 
         {%if tag==None%}
-        <span class="badge badge-pill badge-secondary">投票がありません</span> {%else%}
-        <span class="badge badge-pill badge-secondary">{{tag}}</span> {%endif%}
+        <span class="badge badge-pill badge-secondary w-auto">投票がありません</span> {%else%}
+        <span class="badge badge-pill badge-secondary w-auto">{{tag}}</span> {%endif%}
     </div>
 
     <br> {% if current_user.is_authenticated== True %}
@@ -180,28 +180,17 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
 
         <ul class="pagination">
             {% if editorials.has_prev %} {%if contestname==None%}
-            <<<<<<< HEAD <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag)}}">
-                    {%else%}
-            <li class="page-item"><a class="page-link"
-                    href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag)}}">
-                    {%endif%}
-                    << 前のページ</a> </li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
-                <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag) }}">
-                            {%else%}
-            <li class="page-item"><a class="page-link"
-                    href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag)}}">
-                    {%endif%}
-                    次のページ >></a></li>{% endif %} =======
-                <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag,tag=tag)}}">
+
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag,tag=tag)}}">
         {%else%}
-        <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag,tag=tag)}}">
+             <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.prev_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag,tag=tag)}}">
         {%endif%}
-        << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
-                <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag,tag=tag) }}">
-                {%else%}
-                <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag,tag=tag)}}">
+             << 前のページ</a></li> {% endif %}{% if editorials.has_next %} {%if contestname==None%}
+            <li class="page-item"><a class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=request.args.get('contestname',' '),contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag,tag=tag) }}">
+         {%else%}
+             <li class="page-item"><a  class="page-link" href="{{ url_for('contest_get', page=editorials.next_num,contestname=contestname,contest_id=contest_id,problem_id=problem_id,tag_flag=tag_flag,tag=tag)}}">
         {%endif%}
-         次のページ >></a></li>{% endif %} >>>>>>> update
+         次のページ >></a></li>{% endif %}
         </ul>
     </div>
 

From 7ed58ff23417149c060eeb788693a714a6ad8cbf Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 15:39:10 +0900
Subject: [PATCH 316/336] fix

---
 app.py                    | 17 +++++++-
 templates/contest.html    |  7 ++--
 templates/search.html     | 81 ++++++++++++++++++++++++++++++++++++---
 templates/tag_result.html | 67 ++++++++++++++++++++++++++++++++
 4 files changed, 162 insertions(+), 10 deletions(-)
 create mode 100644 templates/tag_result.html

diff --git a/app.py b/app.py
index 5046552..4cf384e 100644
--- a/app.py
+++ b/app.py
@@ -31,6 +31,8 @@ class Editorial(db.Model):
     like = db.Column(db.Integer)
     user_image_url = db.Column(db.String(1024), index=True)
     user_id=db.Column(db.Integer)
+    problem_id=db.Column(db.String(64))
+    
 
 #いいね情報
 class Like(db.Model):
@@ -44,6 +46,12 @@ class Tag(db.Model):
     tag=db.Column(db.String(64))
     user_id=db.Column(db.Integer)
 
+class Problem_Tag(db.Model):
+    id=db.Column(db.Integer,primary_key=True)
+    problem_official_name=db.Column(db.String(64))
+    problem_name=db.Column(db.String(64))
+    first_tag=db.Column(db.String(64))
+
 #コンテスト名に含まれる空白などを取り除く
 def _normalize_contestname(contestname):
     if isinstance(contestname, str):
@@ -77,6 +85,10 @@ def contest_search():
 
     return render_template('search.html',problems=problem_list)
 
+@app.route('/tag_search',methods=['POST'])
+def tag_search():
+    tagName=request.args.get('tagName')
+    return render_template('tag_result.html',tagName=tagName)
 
 @app.route('/search/<problem_id>/<int:page>', methods=['GET','POST'])
 def contest_get(problem_id,page=1):
@@ -112,7 +124,7 @@ def contest_get(problem_id,page=1):
 
     #ページネーション
     per_page = 10
-    editorials = db.session.query(Editorial).filter_by(contestname=contestname).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
+    editorials = db.session.query(Editorial).filter_by(problem_id=problem_id).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
     
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
     if current_user.is_authenticated==True:
@@ -147,7 +159,8 @@ def submit():
     params = {
         'title': request.form.get('title'),
         'description': request.form.get('description'),
-        'contestname': _normalize_contestname(request.form.get('problem_id')),
+        'contestname': _normalize_contestname(request.form.get('contest_name')),
+        'problem_id':request.form.get('problem_id'),
         'url': request.form.get('url'),
         'like':int(0),
         'user_image_url': current_user.user_image_url,
diff --git a/templates/contest.html b/templates/contest.html
index edfde8d..8f36c36 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -80,9 +80,9 @@ <h4 class="col-1"></h4>
     {%endif%}
 
     <div class="container-fluid">
-        <a class="h4" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}" target="_blank">問題ページ</a>
+        <a class="h5" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}" target="_blank">問題ページ</a>
         <h4 class="col-1"></h4>
-        <a class="h4" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf" target="_blank">公式editorial</a>
+        <a class="h5" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf" target="_blank">公式editorial</a>
         <h4 class="col-1"></h4>
         {%if tag==None%}
         <span class="badge badge-pill badge-secondary">投票がありません</span> {%else%}
@@ -99,12 +99,13 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
             <div class="collapse" id="sub1" data-parent="#submit-card" style="cursor: pointer;">
                 <form action="/submited " method='POST'>
                     <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+                    <input type="hidden" name="problem_id" value="{{problem_id}}" />
                     <input type="text" placeholder="タイトル" name="title" style="width:535px" />
                     <br>
                     <input type="text" placeholder="URL" name="url" style="width:535px" />
                     <br>
                     <textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea>
-                    <button type="submit" class="btn btn-info" name="problem_id" value="{{problem_id}}">投稿</button>
+                    <button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>
 
                 </form>
             </div>
diff --git a/templates/search.html b/templates/search.html
index 68fc20b..4880bf0 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -90,12 +90,24 @@ <h3>新着問題</h3>
         <br>
 
         <div class="row container-fluid">
-            <h3>検索</h3>
+            <div>
+                <h3>問題検索</h3>
+                <form id="search" method="POST" action="">
+                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+                    <input id="autocomplete_search" placeholder="問題名" style="width:600px" name="contestname" type="text" />
+                </form>
+            </div>
+            <div>
+                <h4 class="col-1"></h4>
+            </div>
+            <div>
+                <h3>タグ検索</h3>
+                <form id="search" method="POST" action="">
+                    <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+                    <input id="tag_search" placeholder="タグ名" style="width:600px" name="tagName" type="text" />
+                </form>
+            </div>
         </div>
-        <form id="search" method="POST" action="">
-            <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
-            <input id="autocomplete_search" placeholder="問題名" style="width:600px" name="contestname" type="text" />
-        </form>
         <br>
         <br>
         <br>
@@ -170,6 +182,65 @@ <h3>検索</h3>
             });
 
         })();
+
+        (async function() {
+            const tag = ["フロー", "最小費用流", "最大マッチング", "最大流", "数学",
+                "包除原理", "連立方程式", "半環", "確率", "期待値", "FFT",
+                "アダマール変換", "メビウス変換", "ゼータ変換", "XOR", "中国剰余定理",
+                "線形計画法", "フィボナッチ数列", "有理数", "木構造",
+                "LCA", "HL分解", "オイラーツアー", "木の同型判定",
+                "重心分解", "LinkCutTree", "DynamicTree", "グラフ理論",
+                "スペクトルグラフ理論", "行列木定理", "ケイリーの公式", "橋",
+                "関節点", "サイクル基底", "lowlink", "ダイクストラ", "ベルマンフォード",
+                "ワーシャルフロイド", "オイラー路", "強連結成分分解", "最小パス被覆",
+                "Dilworthの定理", "トポロジカルソート", "最大クリーク", "最大独立集合",
+                "BFS", "後退解析", "最小全域木", "プリム", "クラスカル", "ブルーフカ",
+                "データ構造", "UnionFind", "セグメントツリー", "BIT", "遅延評価セグメントツリー",
+                "永続データ構造", "平衡二分木", "SparseTable", "WaveletMatrix", "動的計画法",
+                "区間DP", "桁DP", "CHT", "MongeDP", "AlianDP", "インラインDP", "きたまさ法",
+                "行列累乗", "戻すDP", "全方位木DP", "木DP", "bitDP", "挿入DP", "連結DP", "inlineDP",
+                "枝刈り", "マンハッタン距離", "しゃくとり法", "二分探索", "三分探索",
+                "imos法", "累積和", "最長部分増加列", "Mo'sAlgorithm",
+                "平方分割", "ローリングハッシュ", "SuffixArray", "LCP", "KMP",
+                "Aho-Corasick", "Z-algorithm", "PalindromicTree", "Manacher",
+                "SuffixTree", "Nim", "Grundy数", "後退解析", "ミニマックス法",
+                "2-SAT", "マージテク", "エラトステネスの篩", "区間篩", "分割統治法", "凸包",
+                "構築", "乱択アルゴリズム", "半分全列挙", "最近点対", "幾何", "構文解析", "平面走査"
+            ];
+            $('#tag_search').autocomplete({
+                source: tag,
+                autoFocus: true,
+                delay: 100,
+                minLength: 2,
+                appendTo: "menu",
+
+                //候補をクリックすることでsubmitできるようにする
+                select: function(event, ui) {
+                    var name = ui.item.label;
+                    $("#tag_search").val(name);
+                    $('form').attr('action', '/tag_search?tagName=' + name);
+                    $("#search").submit();
+                }
+            });
+
+            //input内でのEnter無効化
+            $(function() {
+                $(document).on("keypress", "input:not(.allow_submit)", function(event) {
+                    return event.which !== 13;
+                });
+            });
+
+            //日本語入力をスタートしたら無効化
+            $('#tag_search').on('compositionstart', function() {
+                $('#tag_search').autocomplete('disable');
+            });
+
+            //日本語入力が確定したら有効化
+            $('#tag_search').on('compositionend', function() {
+                $('#tag_search').autocomplete('enable').autocomplete('search');
+            });
+
+        })();
     </script>
 </body>
 
diff --git a/templates/tag_result.html b/templates/tag_result.html
new file mode 100644
index 0000000..e2e2173
--- /dev/null
+++ b/templates/tag_result.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html lang="ja">
+
+<head>
+    <!-- Google Tag Manager -->
+    <script>
+        (function(w, d, s, l, i) {
+            w[l] = w[l] || [];
+            w[l].push({
+                'gtm.start': new Date().getTime(),
+                event: 'gtm.js'
+            });
+            var f = d.getElementsByTagName(s)[0],
+                j = d.createElement(s),
+                dl = l != 'dataLayer' ? '&l=' + l : '';
+            j.async = true;
+            j.src =
+                'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
+            f.parentNode.insertBefore(j, f);
+        })(window, document, 'script', 'dataLayer', 'GTM-WW39BS6');
+    </script>
+    <!-- End Google Tag Manager -->
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+    <link rel="icon" type="image/x-icon" href="/favicon.ico">
+    <title>AtCoder Editorials</title>
+</head>
+
+<body style="padding-top:5rem">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
+            style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+
+    <nav class="navbar navbar-expand-md  navbar-dark bg-dark fixed-top">
+        <a href="/" class="navbar-brand">AtCoder Editorials</a>
+
+        <button class="navbar-toggler" data-toggle="collapse" data-target="#nav1">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse" id="nav1">
+            <ul class="navbar-nav">
+                <li class="nav-item"><a href="/" class="nav-link">ホーム</a></li>
+                <li class="nav-item"><a href="/search" class="nav-link">問題</a></li>
+                <li class="nav-item"><a href="/ranking/1" class="nav-link">ランキング</a></li>
+                {% if current_user.is_authenticated==True %}
+                <li class="nav-item"><a href="/user/{{current_user.id}}/1" class="nav-link">ユーザーページ</a></li>
+                {%endif%}
+            </ul>
+            {% if current_user.is_authenticated==False %}
+            <span class="navbar-text"><a href="/oauth/twitter" class="btn btn-info">ログイン</a></span> {%else%}
+            <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
+        </div>
+    </nav>
+    <h1>{{tagName}}</h1>
+
+
+    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+</body>
+
+</html>
\ No newline at end of file

From e3f512cdcfaec93df0b52417a0c705d5603f295e Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 15:45:06 +0900
Subject: [PATCH 317/336] fix

---
 app.py | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/app.py b/app.py
index 8ab03d7..4cf384e 100644
--- a/app.py
+++ b/app.py
@@ -124,13 +124,8 @@ def contest_get(problem_id,page=1):
 
     #ページネーション
     per_page = 10
-<<<<<<< HEAD
-    editorials = db.session.query(Editorial).filter_by(contestname=problem_id).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
-
-=======
     editorials = db.session.query(Editorial).filter_by(problem_id=problem_id).order_by(desc(Editorial.like)).paginate(page, per_page, error_out=False)
     
->>>>>>> update
     #ログインしている場合は、既にいいねしている「いいね欄」を塗りつぶす
     if current_user.is_authenticated==True:
         flag={}

From 15b2fd210c4097be04f14aba7b883081ba9ca61e Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 15:50:29 +0900
Subject: [PATCH 318/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 4cf384e..1c04dee 100644
--- a/app.py
+++ b/app.py
@@ -159,7 +159,7 @@ def submit():
     params = {
         'title': request.form.get('title'),
         'description': request.form.get('description'),
-        'contestname': _normalize_contestname(request.form.get('contest_name')),
+        'contestname': _normalize_contestname(request.form.get('contestname')),
         'problem_id':request.form.get('problem_id'),
         'url': request.form.get('url'),
         'like':int(0),

From 84719ae89f276919dd1d7fd1da7b9e2c06d2513a Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 16:06:07 +0900
Subject: [PATCH 319/336] add Problem_Tag

---
 app.py                 | 30 ++++++++++++++++++++++++++++++
 templates/contest.html |  3 ++-
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 1c04dee..fc3938c 100644
--- a/app.py
+++ b/app.py
@@ -151,6 +151,36 @@ def tag_vote():
     db.session.add(newTag)
     db.session.commit()
 
+    tag=db.session.query(Problem_Tag).filter_by(problme_id=params['problem_id']).first()
+
+    if tag==None:
+        tag_params={
+            'problem_id':params['problem_id'],
+            'problem_name':request.args.get('contestname'),
+            'first_tag':params['tag']
+        }
+        newProblemTag=Problem_Tag(**tag_params)
+        db.session.add(newProblemTag)
+        db.session.commit()
+
+    else:
+        tags=db.session.query(Tag).filter(Tag.problem_id==problem_id)
+        vote_num=defaultdict(int)
+
+        for t in tags:
+             vote_num[t.tag]+=1
+    
+         vote_num= sorted(vote_num.items(), key=lambda x:x[1],reverse=True)
+
+         tag=None
+         if len(vote_num)!=0:
+             tag=vote_num[0][0]
+         
+         if tag !=None:
+             tag.first_tag=tag
+             db.session.commit()
+         
+
     return render_template('vote_fin.html')
 
 @app.route('/submited', methods=['POST','GET'])
diff --git a/templates/contest.html b/templates/contest.html
index 95c11e4..9a20a60 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -203,6 +203,7 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
         <h3>タグ投票</h3>
         <form id="search" method="POST" action="">
             <input type="hidden" name="csrf_token" value="{{csrf_token()}}" />
+
             <input id="tag_vote" placeholder="タグ名" style="width:600px" name="tagName" type="text" />
         </form>
     </div>
@@ -254,7 +255,7 @@ <h3>タグ投票</h3>
                 select: function(event, ui) {
                     var name = ui.item.label;
                     $("#tag_vote").val(name);
-                    $('form').attr('action', '/tag_vote?tagName=' + name + '&problem_id={{problem_id}}');
+                    $('form').attr('action', '/tag_vote?tagName=' + name + '&problem_id={{problem_id}}' + '&problem_name={{contestname}}');
                     $("#search").submit();
                 }
             });

From ff5b216cc6083de90d12a549db34f249f189909e Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 16:09:50 +0900
Subject: [PATCH 320/336] fix

---
 app.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/app.py b/app.py
index fc3938c..3b62a74 100644
--- a/app.py
+++ b/app.py
@@ -169,15 +169,14 @@ def tag_vote():
 
         for t in tags:
              vote_num[t.tag]+=1
-    
-         vote_num= sorted(vote_num.items(), key=lambda x:x[1],reverse=True)
+             vote_num= sorted(vote_num.items(), key=lambda x:x[1],reverse=True)
 
-         tag=None
+         tag_=None
          if len(vote_num)!=0:
-             tag=vote_num[0][0]
+             tag_=vote_num[0][0]
          
          if tag !=None:
-             tag.first_tag=tag
+             tag.first_tag=tag_
              db.session.commit()
          
 

From bd397e0e3c7d393dd755d1746eb6563d70f59988 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 16:12:35 +0900
Subject: [PATCH 321/336] fix

---
 app.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/app.py b/app.py
index 3b62a74..d3b9c89 100644
--- a/app.py
+++ b/app.py
@@ -169,13 +169,14 @@ def tag_vote():
 
         for t in tags:
              vote_num[t.tag]+=1
-             vote_num= sorted(vote_num.items(), key=lambda x:x[1],reverse=True)
+        
+        vote_num= sorted(vote_num.items(), key=lambda x:x[1],reverse=True)
 
-         tag_=None
-         if len(vote_num)!=0:
+        tag_=None
+        if len(vote_num)!=0:
              tag_=vote_num[0][0]
          
-         if tag !=None:
+        if tag !=None:
              tag.first_tag=tag_
              db.session.commit()
          

From 6db2d84a93a9ffbd7d78db9df6bbc153b4a21ce4 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 16:31:15 +0900
Subject: [PATCH 322/336] add tag_result page

---
 app.py                    |  3 ++-
 templates/search.html     |  2 +-
 templates/tag_result.html | 23 ++++++++++++++++++++++-
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/app.py b/app.py
index d3b9c89..d1ad6c4 100644
--- a/app.py
+++ b/app.py
@@ -88,7 +88,8 @@ def contest_search():
 @app.route('/tag_search',methods=['POST'])
 def tag_search():
     tagName=request.args.get('tagName')
-    return render_template('tag_result.html',tagName=tagName)
+    problems=db.session.query(Problem_Tag).filter_by(first_tag=tagName)
+    return render_template('tag_result.html',tagName=tagName,problems=problems)
 
 @app.route('/search/<problem_id>/<int:page>', methods=['GET','POST'])
 def contest_get(problem_id,page=1):
diff --git a/templates/search.html b/templates/search.html
index 4880bf0..057ef28 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -78,7 +78,7 @@ <h3>新着問題</h3>
             </thead> {% for problem in problems%}
             <tbody>
                 <tr>
-                    <th scope="row">{{loop.index}}</th>
+                    <td scope="row">{{loop.index}}</td>
                     <td>
                         <a href="/search/{{problem[1]}}/1?contestname={{problem[0]}}" method="POST">{{problem[0]}}</a>
                     </td>
diff --git a/templates/tag_result.html b/templates/tag_result.html
index e2e2173..cba839c 100644
--- a/templates/tag_result.html
+++ b/templates/tag_result.html
@@ -28,7 +28,7 @@
     <title>AtCoder Editorials</title>
 </head>
 
-<body style="padding-top:5rem">
+<body style="padding-top:5rem container-fluid">
     <!-- Google Tag Manager (noscript) -->
     <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
             style="display:none;visibility:hidden"></iframe></noscript>
@@ -57,6 +57,27 @@
         </div>
     </nav>
     <h1>{{tagName}}</h1>
+    <div>
+        <table class="table table-borderd">
+            <thead class="thead-light">
+                <tr>
+                    <th scope="col">#</th>
+                    <th scope="col">名前</th>
+                </tr>
+            </thead> {% for problem in problems%}
+            <tbody>
+                <tr>
+                    <td scope="row">{{loop.index}}</td>
+                    <td>
+                        <a href="/search/{{problem.problem_official_name}}/1?contestname={{problem.problem_name}}" method="POST">{{problem_name}}</a>
+                    </td>
+                </tr>
+                {%endfor%}
+            </tbody>
+
+        </table>
+    </div>
+
 
 
     <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>

From 1d74bf862e0efa92f4103806a042943c0d08cd96 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 16:46:22 +0900
Subject: [PATCH 323/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index d1ad6c4..1fbb377 100644
--- a/app.py
+++ b/app.py
@@ -88,7 +88,7 @@ def contest_search():
 @app.route('/tag_search',methods=['POST'])
 def tag_search():
     tagName=request.args.get('tagName')
-    problems=db.session.query(Problem_Tag).filter_by(first_tag=tagName)
+    problems=Problem_Tag.query.filter_by(first_tag=tagName)
     return render_template('tag_result.html',tagName=tagName,problems=problems)
 
 @app.route('/search/<problem_id>/<int:page>', methods=['GET','POST'])

From 7df77a132ab6746a701486732da88d2922b26470 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 16:55:50 +0900
Subject: [PATCH 324/336] fix

---
 app.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app.py b/app.py
index 1fbb377..854d325 100644
--- a/app.py
+++ b/app.py
@@ -46,7 +46,7 @@ class Tag(db.Model):
     tag=db.Column(db.String(64))
     user_id=db.Column(db.Integer)
 
-class Problem_Tag(db.Model):
+class problem_tag(db.Model):
     id=db.Column(db.Integer,primary_key=True)
     problem_official_name=db.Column(db.String(64))
     problem_name=db.Column(db.String(64))
@@ -88,7 +88,7 @@ def contest_search():
 @app.route('/tag_search',methods=['POST'])
 def tag_search():
     tagName=request.args.get('tagName')
-    problems=Problem_Tag.query.filter_by(first_tag=tagName)
+    problems=db.session.query(problem_tag).filter(problem_tag.first_tag==tagName)
     return render_template('tag_result.html',tagName=tagName,problems=problems)
 
 @app.route('/search/<problem_id>/<int:page>', methods=['GET','POST'])
@@ -152,7 +152,7 @@ def tag_vote():
     db.session.add(newTag)
     db.session.commit()
 
-    tag=db.session.query(Problem_Tag).filter_by(problme_id=params['problem_id']).first()
+    tag=db.session.query(problem_tag).filter_by(problme_id=params['problem_id']).first()
 
     if tag==None:
         tag_params={
@@ -160,7 +160,7 @@ def tag_vote():
             'problem_name':request.args.get('contestname'),
             'first_tag':params['tag']
         }
-        newProblemTag=Problem_Tag(**tag_params)
+        newProblemTag=problem_tag(**tag_params)
         db.session.add(newProblemTag)
         db.session.commit()
 

From 5c31ee976f175c3483811ac720481df90afad7bf Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 17:10:39 +0900
Subject: [PATCH 325/336] fix

---
 app.py                    |  1 +
 templates/tag_result.html | 10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/app.py b/app.py
index 854d325..a1107d1 100644
--- a/app.py
+++ b/app.py
@@ -89,6 +89,7 @@ def contest_search():
 def tag_search():
     tagName=request.args.get('tagName')
     problems=db.session.query(problem_tag).filter(problem_tag.first_tag==tagName)
+    print(problems)
     return render_template('tag_result.html',tagName=tagName,problems=problems)
 
 @app.route('/search/<problem_id>/<int:page>', methods=['GET','POST'])
diff --git a/templates/tag_result.html b/templates/tag_result.html
index cba839c..194ce19 100644
--- a/templates/tag_result.html
+++ b/templates/tag_result.html
@@ -28,7 +28,7 @@
     <title>AtCoder Editorials</title>
 </head>
 
-<body style="padding-top:5rem container-fluid">
+<body style="padding-top:5rem">
     <!-- Google Tag Manager (noscript) -->
     <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WW39BS6" height="0" width="0"
             style="display:none;visibility:hidden"></iframe></noscript>
@@ -56,9 +56,11 @@
             <span class="navbar-text"><a href="/logout" class="btn btn-danger">ログアウト</a></span> {%endif%}
         </div>
     </nav>
-    <h1>{{tagName}}</h1>
     <div>
-        <table class="table table-borderd">
+        <h2 class="container-fluid">{{tagName}}</h2>
+    </div>
+    <div>
+        <table class="table table-borderd container-fluid">
             <thead class="thead-light">
                 <tr>
                     <th scope="col">#</th>
@@ -69,7 +71,7 @@ <h1>{{tagName}}</h1>
                 <tr>
                     <td scope="row">{{loop.index}}</td>
                     <td>
-                        <a href="/search/{{problem.problem_official_name}}/1?contestname={{problem.problem_name}}" method="POST">{{problem_name}}</a>
+                        <a href="/search/{{problem.problem_official_name}}/1?contestname={{problem.problem_name}}" method="POST">{{problem.problem_name}}</a>
                     </td>
                 </tr>
                 {%endfor%}

From 0c6bb9180ceff16c03f0203a6394c952ad8caedc Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 17:21:36 +0900
Subject: [PATCH 326/336] fix

---
 app.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/app.py b/app.py
index a1107d1..0dccb00 100644
--- a/app.py
+++ b/app.py
@@ -89,7 +89,6 @@ def contest_search():
 def tag_search():
     tagName=request.args.get('tagName')
     problems=db.session.query(problem_tag).filter(problem_tag.first_tag==tagName)
-    print(problems)
     return render_template('tag_result.html',tagName=tagName,problems=problems)
 
 @app.route('/search/<problem_id>/<int:page>', methods=['GET','POST'])
@@ -157,7 +156,7 @@ def tag_vote():
 
     if tag==None:
         tag_params={
-            'problem_id':params['problem_id'],
+            'problem_official_name':params['problem_id'],
             'problem_name':request.args.get('contestname'),
             'first_tag':params['tag']
         }

From 0e9a7c29c92f234fb8284a583223ef35a2d149a4 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 17:24:39 +0900
Subject: [PATCH 327/336] Fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index 0dccb00..b35839e 100644
--- a/app.py
+++ b/app.py
@@ -165,7 +165,7 @@ def tag_vote():
         db.session.commit()
 
     else:
-        tags=db.session.query(Tag).filter(Tag.problem_id==problem_id)
+        tags=db.session.query(Tag).filter(Tag.problem_id==params['problem_id'])
         vote_num=defaultdict(int)
 
         for t in tags:

From c6d4e5c769de05cedfd4515e748a202bc12106e2 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 17:30:39 +0900
Subject: [PATCH 328/336] fix

---
 app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app.py b/app.py
index b35839e..f98b62f 100644
--- a/app.py
+++ b/app.py
@@ -152,7 +152,7 @@ def tag_vote():
     db.session.add(newTag)
     db.session.commit()
 
-    tag=db.session.query(problem_tag).filter_by(problme_id=params['problem_id']).first()
+    tag=db.session.query(problem_tag).filter_by(problem_official_name=params['problem_id']).first()
 
     if tag==None:
         tag_params={

From 9107785f35383448d7afa5ca0910b2d9c2afc4d6 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 17:42:17 +0900
Subject: [PATCH 329/336] fix

---
 app.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index f98b62f..02a5138 100644
--- a/app.py
+++ b/app.py
@@ -179,8 +179,8 @@ def tag_vote():
          
         if tag !=None:
              tag.first_tag=tag_
-             db.session.commit()
-         
+        tag.problem_name=request.args.get('contestname')
+        db.session.commit()
 
     return render_template('vote_fin.html')
 

From 1e3a07b48bbeacea619d3e0d52f316fac6b8ed65 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 17:46:31 +0900
Subject: [PATCH 330/336] fix

---
 app.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index 02a5138..ca9ca8b 100644
--- a/app.py
+++ b/app.py
@@ -157,7 +157,7 @@ def tag_vote():
     if tag==None:
         tag_params={
             'problem_official_name':params['problem_id'],
-            'problem_name':request.args.get('contestname'),
+            'problem_name':request.form.get('contestname'),
             'first_tag':params['tag']
         }
         newProblemTag=problem_tag(**tag_params)
@@ -179,7 +179,7 @@ def tag_vote():
          
         if tag !=None:
              tag.first_tag=tag_
-        tag.problem_name=request.args.get('contestname')
+        tag.problem_name=request.form.get('contestname')
         db.session.commit()
 
     return render_template('vote_fin.html')

From 692a2abf5bdc2236a2bc3a8b0fb4dd3e54cbcdd1 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 17:51:30 +0900
Subject: [PATCH 331/336] fix

---
 app.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index ca9ca8b..7b3ea96 100644
--- a/app.py
+++ b/app.py
@@ -157,7 +157,7 @@ def tag_vote():
     if tag==None:
         tag_params={
             'problem_official_name':params['problem_id'],
-            'problem_name':request.form.get('contestname'),
+            'problem_name':request.args.get('problem_name'),
             'first_tag':params['tag']
         }
         newProblemTag=problem_tag(**tag_params)
@@ -179,7 +179,7 @@ def tag_vote():
          
         if tag !=None:
              tag.first_tag=tag_
-        tag.problem_name=request.form.get('contestname')
+        tag.problem_name=request.args.get('problem_name')
         db.session.commit()
 
     return render_template('vote_fin.html')

From 94e9eedc77d41a88fec62d52073378aa2b54ecf4 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 17:55:36 +0900
Subject: [PATCH 332/336] fix

---
 app.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/app.py b/app.py
index 7b3ea96..d0ef95e 100644
--- a/app.py
+++ b/app.py
@@ -179,8 +179,7 @@ def tag_vote():
          
         if tag !=None:
              tag.first_tag=tag_
-        tag.problem_name=request.args.get('problem_name')
-        db.session.commit()
+             db.session.commit()
 
     return render_template('vote_fin.html')
 

From 3a2ddd20694156e16fe366d45bd83181dfaeacdd Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 18:01:45 +0900
Subject: [PATCH 333/336] fix

---
 templates/contest.html | 49 +++++++++++++++++++++---------------------
 1 file changed, 25 insertions(+), 24 deletions(-)

diff --git a/templates/contest.html b/templates/contest.html
index 9a20a60..8d0fdad 100644
--- a/templates/contest.html
+++ b/templates/contest.html
@@ -58,31 +58,33 @@
         </div>
     </nav>
 
-    <div class="row container-fluid">
-        <div>
-            <h1>{{contestname}}</h1>
-        </div>
-        <h4 class="col-1"></h4>
-        {% if current_user.is_authenticated== True %}
-        <div>
-            <div class="twitter">
-                <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{problem_id}}/1" data-lang="ja">
-                </a>
+    <div class="jumbotron jumbotron-fluid container-fluid">
+        <div class="row container-fluid">
+            <div>
+                <h1>{{contestname}}</h1>
+            </div>
+            <h4 class="col-1"></h4>
+            {% if current_user.is_authenticated== True %}
+            <div>
+                <div class="twitter">
+                    <a href="//twitter.com/share" class="twitter-share-button" data-text="AtCoderEditorialsで{{contestname}}の解法を書きました！" data-url="https://atcoder-editorials.herokuapp.com/search/{{problem_id}}/1" data-lang="ja">
+                    </a>
+                </div>
             </div>
+            {%endif%}
         </div>
-        {%endif%}
-    </div>
 
 
-    <div class="container-fluid">
-        <a class="h5" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}" target="_blank">問題ページ</a>
-        <h4 class="col-1"></h4>
-        <a class="h5" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf" target="_blank">公式editorial</a>
-        <h4 class="col-1"></h4>
-
-        {%if tag==None%}
-        <span class="badge badge-pill badge-secondary w-auto">投票がありません</span> {%else%}
-        <span class="badge badge-pill badge-secondary w-auto">{{tag}}</span> {%endif%}
+        <div class="container-fluid">
+            <a class="h5" href="https://atcoder.jp/contests/{{contest_id}}/tasks/{{problem_id}}" target="_blank">問題ページ</a>
+            <h4 class="col-1"></h4>
+            <a class="h5" href="https://img.atcoder.jp/{{contest_id}}/editorial.pdf" target="_blank">公式editorial</a>
+            <h4 class="col-1"></h4>
+
+            {%if tag==None%}
+            <span class="badge badge-pill badge-secondary w-auto">投票がありません</span> {%else%}
+            <span class="badge badge-pill badge-secondary w-auto">{{tag}}</span> {%endif%}
+        </div>
     </div>
 
     <br> {% if current_user.is_authenticated== True %}
@@ -109,11 +111,10 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
     </div>
     {% else %}
     <div class="container-fluid">
-        <h4>「投稿」「いいね」「タグ投票」をするにはログインが必要です</h4>
+        <h4>「投稿」「いいね」「タグ投票」をするにはログインが必要です。</h4>
     </div>
     {%endif%}
 
-
     <div>
         {% if editorials.items|length >0 %}
 
@@ -173,7 +174,7 @@ <h4 class="card-header text-light bg-light text-dark col-10" data-toggle="collap
             <br> {% endfor %}
         </div>
         {%else%}
-        <h4 class='container-fluid '>まだ投稿がありません</h4>
+        <h4 class='container-fluid '>まだ投稿がありません。</h4>
         <br> {%endif%}
     </div>
 

From e94166dcfe535ffd3e5293d88869eec593b55a17 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 18:05:32 +0900
Subject: [PATCH 334/336] fix

---
 templates/index.html | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/templates/index.html b/templates/index.html
index e9bbb60..013c339 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -67,12 +67,11 @@ <h5 class="card-header bg-secondary text-white" data-toggle="collapse" data-targ
                 </h5>
                 <div class="collapse" id="action1" 　data-parent="#events-imfo">
                     <div class="card-body">
-                        ・URLの改良をしました。
-                        <br>・公式editorialと問題ページヘのリンクを追加しました。
-                        <br>（公式editorialは旧コンテスト未対応です）
-                        <br>・ユーザーページの解法に消去ボタンを追加しました。
+                        ・ユーザーページの解法に消去ボタンを追加しました。
                         <br>・ユーザーページにいいねボタンを追加しました。
                         <br>・編集ボタンを追加しました。
+                        <br>・タグ投票機能を追加しました。
+                        <br>・タグ検索機能を追加しました。
                     </div>
                 </div>
             </div>
@@ -85,7 +84,7 @@ <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#
                 </h5>
                 <div class="collapse" id="action2" 　data-parent="#events-imfo" ">
                     <div class="card-body ">
-                        改善案、バグなどございましたら、ぬるぬる(@__Null_Null_)までご連絡お願いします。<br>
+                        改善案・バグ・タグの不足などございましたら、ぬるぬる(@__Null_Null_)までご連絡お願いします。<br>
                         Github: https://github.com/null-null-programming/AtCoder-Editorials
                     </div>
                 </div>

From ddff4ab05cd9d73e1cd3f11cffe1e67e7dd16491 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 18:20:18 +0900
Subject: [PATCH 335/336] fix

---
 templates/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/index.html b/templates/index.html
index 013c339..d5ac9ff 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -94,7 +94,7 @@ <h5 class="card-header bg-info text-white" data-toggle="collapse" data-target="#
 
             <div class="container-fluid ">
                 <h3>AtCoderEditorialsはAtCoderの解法を集めるWebアプリです。</h3>
-                <h5>主な機能は、閲覧・投稿・いいね・ランキングの４つです。</h5>
+                <h5>主な機能は、閲覧・投稿・いいね・タグ機能・ランキングの5つです。</h5>
                 <br>
                 <h4>良い解法をより見つけやすく</h4>
                 ・いいね順に解法を並び替えることで、良い解法を見つけやすくしています。

From f3e9a5f1d65105562c3455d70b09079902e6b981 Mon Sep 17 00:00:00 2001
From: null-null-programming <nullnullprogramming@gmail.com>
Date: Fri, 30 Aug 2019 18:22:51 +0900
Subject: [PATCH 336/336] fix

---
 README.md | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 8e59c13..2ae5925 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
 
 # 説明
 
-　閲覧機能・投稿機能・いいね機能・ランキング機能を持ったWebアプリを目指します。<br>
+　閲覧機能・投稿機能・いいね機能・タグ機能・ランキング機能を持ったWebアプリです。<br>
 
 ・解法の投稿・解法ブログのURLの投稿<br>
 ->バラバラだった多くの解法が、１箇所に集まることを目指します。<br>
@@ -14,3 +14,6 @@
 
 ・ランキング機能<br>
 ->最もわかりやすい解説者は誰なのかをハッキリさせることを目指します。<br>
+
+・タグ機能<br>
+->ジャンルから問題を選択できる、そんな精進の形を提供することを目指します。<br>
