Browse Source

feat: better UI for disable upload

master
欧醚 3 years ago
parent
commit
62388dbe7d
2 changed files with 20 additions and 0 deletions
  1. +1
    -0
      app.py
  2. +19
    -0
      templates/list.html

+ 1
- 0
app.py View File

@ -104,6 +104,7 @@ def list(username):
all_teachers = [i for i, in db.session.query(Paper.teacher.distinct()).all()]
all_years = [i for i, in db.session.query(Paper.year.distinct()).all()]
ipfs_version = hashlib.sha256(C.ipfs_base_url.encode('utf-8')).hexdigest()
disable_upload = not C.allow_guest_upload and username.startswith('guest~')
return render_template('list.html', **locals())
def check_length(x, limit=30, allow_null=False):

+ 19
- 0
templates/list.html View File

@ -169,6 +169,22 @@
.user-info:not(:hover) div:not(.show) .username{
display: none;
}
.mask {
background: linear-gradient(25deg,
#5558 calc(50% - 1px),
#333 calc(50%),
#5558 calc(50% + 1px)
);
background-size: 10px 5px;
position: absolute;
z-index: 999;
width: 100%;
height: 100%;
top: -5px;
left: -5px;
border-radius: 0;
}
</style>
</head>
@ -242,6 +258,9 @@
</span>
</div>
</form>
{% if disable_upload %}
<button class="mask" onclick="alert('目前guest无权限上传')"></button>
{% endif %}
</div>
<div class="part2" id="part2">

Loading…
Cancel
Save