-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #1742; make start page configurable
- Loading branch information
Showing
7 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 4.1.1 on 2022-11-21 19:53 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("evaluation", "0138_votetimestamp"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="userprofile", | ||
name="startpage", | ||
field=models.CharField( | ||
choices=[("UN", "undefined"), ("ST", "student"), ("CO", "contributor")], | ||
default="UN", | ||
max_length=2, | ||
verbose_name="start page of the user", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% if user.startpage == page %} | ||
<div data-bs-toggle="tooltip" data-bs-placement="left" title="{% trans 'This is your startpage' %}"> | ||
<button type="button" class="btn btn-sm btn-light" disabled><span class="fas fa-house"></span></button> | ||
</div> | ||
{% else %} | ||
<button id="makeStartPageButton" type="button" class="btn btn-sm btn-light" onclick="makeStartPage();" data-bs-toggle="tooltip" data-bs-placement="left" title="{% trans 'Make this my startpage' %}"><span id="span-set-startpage" class="fas fa-house"></span></button> | ||
{% endif %} | ||
|
||
|
||
{% block additional_javascript %} | ||
<script type="text/javascript"> | ||
function makeStartPage() { | ||
var makeStartPageButton = $('#makeStartPageButton'); | ||
makeStartPageButton.prop('disabled', true); | ||
setSpinnerIcon('span-set-startpage'); | ||
$.ajax({ | ||
type: "POST", | ||
url: "{% url 'evaluation:set_startpage' %}", | ||
data: {"page": "{{ page }}"}, | ||
success: function() { location.reload(); }, | ||
error: function() { window.alert("{% trans 'The server is not responding.' %}") }, | ||
}); | ||
} | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters