File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ class Like(db.Model):
37
37
user_id = db .Column (db .Integer )
38
38
edit_id = db .Column (db .Integer )
39
39
40
+ class Tag (db .Model ):
41
+ id = db .Column (db .Integer ,primary_key = True )
42
+ problem_id = db .Column (db .Integer )
43
+ tag = db .Column (db .String (64 ))
44
+ user_id = db .Column (db .Integer )
45
+
40
46
#コンテスト名に含まれる空白などを取り除く
41
47
def _normalize_contestname (contestname ):
42
48
if isinstance (contestname , str ):
@@ -109,7 +115,7 @@ def submit():
109
115
params = {
110
116
'title' : request .form .get ('title' ),
111
117
'description' : request .form .get ('description' ),
112
- 'contestname' : _normalize_contestname (request .form .get ('problem_id ' )),
118
+ 'contestname' : _normalize_contestname (request .form .get ('contestname ' )),
113
119
'url' : request .form .get ('url' ),
114
120
'like' :int (0 ),
115
121
'user_image_url' : current_user .user_image_url ,
Original file line number Diff line number Diff line change @@ -99,8 +99,9 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
99
99
< br >
100
100
< input type ="text " placeholder ="URL " name ="url " style ="width:535px " />
101
101
< br >
102
- < textarea placeholder =" 解説文 " name ="description " style ="white-space:pre; word-wrap:break-word; " rows =15 cols =57 > </ textarea >
103
- < button type ="submit " class ="btn btn-info " name ="problem_id " value ="{{problem_id}} "> 投稿</ button >
102
+ < textarea placeholder =" 解説文 " name ="description " style ="white-space:pre; word-wrap:break-word; " rows =15 cols =57 > </ textarea > {%if contestname==None%}
103
+ < button type ="submit " class ="btn btn-info " name ="contestname " value ="{{request.args.get('contestname ',' ')}} "> 投稿</ button > {%else%}
104
+ < button type ="submit " class ="btn btn-info " name ="contestname " value ="{{contestname}} "> 投稿</ button > {%endif%}
104
105
105
106
</ form >
106
107
</ div >
@@ -111,7 +112,6 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
111
112
< h4 > 「投稿」または「いいね」をするにはログインが必要です</ h4 >
112
113
</ div >
113
114
{%endif%}
114
- < br >
115
115
116
116
117
117
< div >
@@ -193,12 +193,13 @@ <h4 class='container-fluid '>まだ投稿がありません</h4>
193
193
次のページ > > </ a > </ li > {% endif %}
194
194
</ ul >
195
195
</ div >
196
-
197
196
< script src ="https://code.jquery.com/jquery-3.4.1.js " integrity ="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU= " crossorigin ="anonymous "> </ script >
198
197
< script src ="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js " integrity ="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1 " crossorigin ="anonymous "> </ script >
199
198
< script src ="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js " integrity ="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM " crossorigin ="anonymous "> </ script >
199
+ < script src ="https://code.jquery.com/ui/1.11.4/jquery-ui.js " integrity ="sha256-DI6NdAhhFRnO2k51mumYeDShet3I8AKCQf/tf7ARNhI= " crossorigin ="anonymous "> </ script >
200
200
< script async src ="https://platform.twitter.com/widgets.js " charset ="utf-8 "> </ script >
201
201
< script src ="/static/script.js "> </ script >
202
+
202
203
</ body >
203
204
204
205
</ html >
You can’t perform that action at this time.
0 commit comments