Rewrite user follow + fix some css

This commit is contained in:
cuom1999 2024-04-11 23:56:58 -05:00
parent 04877b47c1
commit 361d3fc33a
7 changed files with 52 additions and 31 deletions

View file

@ -28,8 +28,11 @@
}
.user-name {
position: relative;
padding-left: 2em !important;
padding-left: 1em !important;
padding-right: 1em !important;
display: flex;
min-width: max-content;
align-items: center;
}
.organization-column {

View file

@ -79,6 +79,19 @@
{% endblock %}
{% block js_media %}
<script type="text/javascript">
$(function() {
$("#message-button").on("click", function() {
$.get("{{ url('get_or_create_room') }}", {
"other": "{{ chat_param(request.profile, user) }}"
}, function(response) {
window.location.href = response.url;
}).fail(function(error) {
console.log("Error: ", error);
});
});
});
</script>
{% block user_js_media %}{% endblock %}
{% endblock %}
@ -90,7 +103,7 @@
</div>
<br>
{% if request.user != user.user %}
<form method="post">
<form method="post" action="{{ url('user_toggle_follow', user.username) }}">
{% csrf_token %}
<button class="small {{ 'unfollow' if followed else 'follow' }}" style="width:145px">
{% if followed %}
@ -105,19 +118,15 @@
{% endif %}
<br>
<div>
<form action="{{ url('all_user_submissions', user.user.username) }}">
<input type="submit" value="{{ _('View submissions') }}" class="small" style="width:145px; padding-left: 1px; padding-right: 1px">
</form>
<a href="{{ url('all_user_submissions', user.username) }}" class="button small" style="width:145px">
{{ _('View submissions') }}
</a>
</div>
{% if request.user.is_authenticated %}
<br>
<div>
<form action="{{ url('get_or_create_room') }}" method="POST">
{% csrf_token %}
<input type="hidden" value="{{ chat_param(request.profile, user) }}" name="other">
<input type="submit" value="{{ _('Send message') }}" style="width:145px" class="small btn-midnightblue">
</form>
</div>
<button class="small btn-midnightblue" style="width:145px" id="message-button">
{{ _('Send message') }}
</button>
{% endif %}
{% if ratings %}