Skip to content

Commit

Permalink
Merge pull request #16 from half-blue/826-midnight-fix
Browse files Browse the repository at this point in the history
8/26 深夜の修正
  • Loading branch information
nitoca authored Aug 26, 2022
2 parents eef382b + f7156bf commit 3c43519
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 33 deletions.
Binary file removed board/static/board/about_image3.jpeg
Binary file not shown.
Binary file removed board/static/board/about_top.jpeg
Binary file not shown.
Binary file modified board/static/board/ad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions board/static/board/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,9 @@
.twitter-svg{
position: relative;
bottom: 1.1px;
}

.user-text {
white-space: pre-wrap;
overflow-wrap: anywhere;
}
Binary file removed board/static/board/enpit.png
Binary file not shown.
Binary file removed board/static/board/enpitA+.png
Binary file not shown.
Binary file removed board/static/board/enpitA+about.png
Binary file not shown.
Binary file removed board/static/board/ieben-tokei.png
Binary file not shown.
Binary file modified board/static/board/new_logo_header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 16 additions & 28 deletions board/templates/col5.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,35 @@
<div class="col-md-5" id="col5_app">
<h5>科目情報</h5>
<div class="row">
<div class="col">
<table class="table table-sm table-borderless w-75" style="margin-left: 16px; padding-right: 16px;">
<div class="col d-flex justify-content-center">
<table class="table table-sm table-borderless" style="width: 90%;">
<tbody>
<tr>
<th scope="row">科目名</th>
<th scope="row" style="white-space: nowrap;">科目名</th>
<td>{{ sub_title }}</td>
</tr>
<tr>
<th scope="row">科目番号</th>
<th scope="row" style="white-space: nowrap;">科目番号</th>
<td>{{ sub_codes }}</td>
</tr>
<tr>
<th scope="row">担当教員</th>
<th scope="row" style="white-space: nowrap;">担当教員</th>
<td>{{ sub_teachers }}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<template v-if="api_check !== false">
<div class="col text-center ad-box">
<template v-if="api_check">
<button type="button" class="btn btn-danger" id="link-btn" v-on:click="share_thread()">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-share" viewBox="0 0 16 16">
<path d="M13.5 1a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM11 2.5a2.5 2.5 0 1 1 .603 1.628l-6.718 3.12a2.499 2.499 0 0 1 0 1.504l6.718 3.12a2.5 2.5 0 1 1-.488.876l-6.718-3.12a2.5 2.5 0 1 1 0-3.256l6.718-3.12A2.5 2.5 0 0 1 11 2.5zm-8.5 4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm11 5.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/>
</svg>
シェア
</button>
</template>
<button type="button" class="btn twitter-bg" v-on:click="tweet()" rel="nofollow noopener noreferrer">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-twitter twitter-svg" viewBox="0 0 16 16">
<path d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334 0-.14 0-.282-.006-.422A6.685 6.685 0 0 0 16 3.542a6.658 6.658 0 0 1-1.889.518 3.301 3.301 0 0 0 1.447-1.817 6.533 6.533 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.325 9.325 0 0 1-6.767-3.429 3.289 3.289 0 0 0 1.018 4.382A3.323 3.323 0 0 1 .64 6.575v.045a3.288 3.288 0 0 0 2.632 3.218 3.203 3.203 0 0 1-.865.115 3.23 3.23 0 0 1-.614-.057 3.283 3.283 0 0 0 3.067 2.277A6.588 6.588 0 0 1 .78 13.58a6.32 6.32 0 0 1-.78-.045A9.344 9.344 0 0 0 5.026 15z"/>
Expand All @@ -41,35 +42,22 @@ <h5>科目情報</h5>
</svg><span class="ms-1">LINE</span>
</button>
</div>
</template>

</div>
<div class="row">
<div class="col text-center ad-box">
広告<br>
<img src="{% static 'board/ad.png' %}" alt="img"
width="50%">
</div>
</div>
<div class="row">
<div class="col text-center ad-box">
<div class="col text-center ad-box col-lg-8 mx-auto">
広告<br>
<img src="{% static 'board/ad.png' %}" alt="img"
width="50%">
<a href="#">
<img src="{% static 'board/ad.png' %}" alt="ad" class="w-100">
</a>
</div>
</div>
<div class="row">
<div class="col text-center ad-box">
<div class="col text-center ad-box col-lg-8 mx-auto">
広告<br>
<img src="{% static 'board/ad.png' %}" alt="img"
width="50%">
</div>
</div>
<div class="row">
<div class="col text-center ad-box">
広告<br>
<img src="{% static 'board/ad.png' %}" alt="img"
width="50%">
<a href="#">
<img src="{% static 'board/ad.png' %}" alt="ad" class="w-100">
</a>
</div>
</div>

</div>
4 changes: 2 additions & 2 deletions board/templates/col7.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h6 >[[ msg.sender_name ]] <span :class="getCSS(msg.emotion)">[[ getText(msg.emo
</span>
</h6>
<p class="lead">
<span style="white-space: pre-wrap; overflow-wrap: anywhere;" v-html="autolink(msg.text)"></span>
<span class="user-text" v-html="autolink(msg.text)"></span>
</p>
<div class="row">
<div class="d-inline-flex col justify-content-start">
Expand Down Expand Up @@ -71,7 +71,7 @@ <h6 >[[ msg.sender_name ]] <span :class="getCSS(msg.emotion)">[[ getText(msg.emo
</span>
</p>
<p class="lead">
<span style="white-space: pre-wrap;" v-html="autolink(reply.text)"></span>
<span class="user-text" v-html="autolink(reply.text)"></span>
</p>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions board/templates/send.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="rows">
<div class="cols" style="margin-left: 3%; margin-right:3%;">
名前 :
<input type="text" v-model="inputName" id="input_name" class="form-control" autocomplete="off" value="名無し" name="username"
<input type="text" v-model.trim="inputName" id="input_name" class="form-control" autocomplete="off" value="名無し" name="username"
minlength="1" maxlength="40" />
<template v-if="inputName.length === 0">
<span style="color:red">
Expand All @@ -27,7 +27,7 @@
<option value="4">ウンウン(´ー`*)</option>
</select>
本文 :
<textarea id="main_textarea" v-model="inputText" class="form-control" rows="15" type="text" id="input_message" autocomplete="off"
<textarea id="main_textarea" v-model.trim="inputText" class="form-control" rows="15" type="text" id="input_message" autocomplete="off"
name="message" minlength="1" maxlength="500"
placeholder="投稿内容"></textarea>
<div class="text-end">
Expand Down
5 changes: 4 additions & 1 deletion board/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ def get_context_data(self, *args, **kwargs):
groupby_data = target_data.values("post_id").annotate(total=Count("post_id"))
for col in groupby_data:
thread_id = Post.objects.filter(post_id=col["post_id"]).values("thread")[0]["thread"]
thread_dict[thread_id] += col["total"]
if thread_id in thread_dict.keys():
thread_dict[thread_id] += col["total"]
else:
thread_dict[thread_id] = col["total"]

ranking = []
ranking_nums = sorted(thread_dict.items(), key=lambda x:x[1], reverse=True)[:5]
Expand Down

0 comments on commit 3c43519

Please sign in to comment.