Browse Source

feat: contribute link

master
欧醚 3 years ago
parent
commit
ca10ca24e2
2 changed files with 6 additions and 1 deletions
  1. +1
    -0
      app.py
  2. +5
    -1
      templates/list.html

+ 1
- 0
app.py View File

@ -203,6 +203,7 @@ def list(username):
ipfs_version = hashlib.sha256(C.ipfs_base_url.encode('utf-8')).hexdigest()
ipfs_id = ipfs_info.get('ID')
disable_upload = not C.allow_guest_upload and username.startswith('guest<')
contributor_link = C.contributor_link
return render_template('list.html', **locals())
def check_length(x, limit=30, allow_null=False):

+ 5
- 1
templates/list.html View File

@ -446,7 +446,11 @@
</p>
<pre class="ml-3">{{p.notes}}</pre>
<div class="text-right">
<small>@{{'匿名用户' if p.anon else p.author}} | {{p.create_date}}</small>
{% if p.author in contributor_link %}
<small><a href="{{contributor_link[p.author]}}">@{{p.author}}</a></small>
{% else %}
<small>@{{'匿名用户' if p.anon else p.author}} | {{p.create_date}}</small>
{% endif %}
<div class="num-infos">
<button class="btn btn-link" id="like-{{p.id}}" onclick="like('{{p.id}}')">
<span class="num-info {{'active' if p.is_liked() else ''}}">好评(<span>{{p.like_num}}</span>)</span>

Loading…
Cancel
Save