Self hosted FLOSS fitness/workout, nutrition and weight tracker
Replace jqueryUI's modal dialog with bootstrap's
Roland Geideredf5c86696b9
diff --git a/wger/config/templates/language/view.html b/wger/config/templates/language/view.htmlindex 66d70d33f..38d5655f4 100644--- a/wger/config/templates/language/view.html+++ b/wger/config/templates/language/view.html@@ -45,7 +45,7 @@ in A).{% endblocktrans %}</p>{% endifchanged %}<tr><td>- <a href="{% url 'config:languageconfig-edit' config.id %}" class="modal-dialog">+ <a href="{% url 'config:languageconfig-edit' config.id %}" class="wger-modal-dialog">{{config.language_target.full_name}}</a></td>@@ -73,7 +73,7 @@ in A).{% endblocktrans %}</p><p><a href="{% url 'config:language-edit' view_language.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="32"height="32"@@ -85,7 +85,7 @@ in A).{% endblocktrans %}</p><p><a href="{% url 'config:language-delete' view_language.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/trash.svg' %}"width="32"height="32"diff --git a/wger/core/static/js/workout-manager.js b/wger/core/static/js/workout-manager.jsindex 921126613..3a74547e4 100644--- a/wger/core/static/js/workout-manager.js+++ b/wger/core/static/js/workout-manager.js@@ -141,58 +141,51 @@ function init_tinymce() {* Open a modal dialog for form editing*/function form_modal_dialog() {- // Initialise a modal dialog- $("#ajax-info").dialog({- autoOpen: false,- width: 600,- modal: true,- position: 'top'- });-// Unbind all other click events so we don't do this more than once- $(".modal-dialog").off();+ $(".wger-modal-dialog").off();// Load the edit dialog when the user clicks on an edit link- $(".modal-dialog").click(function (e) {+ $(".wger-modal-dialog").click(function (e) {e.preventDefault();var targetUrl = $(this).attr("href");// Show a loader while we fetch the real page- $("#ajax-info").html('<div style="text-align:center;">' ++ $("#ajax-info-content").html('<div style="text-align:center;">' +'<img src="/static/images/loader.svg" ' +'width="48" ' +'height="48"> ' +'</div>');- $("#ajax-info").dialog({title: 'Loading...'});- $("#ajax-info").dialog("open");-- $("#ajax-info").load(targetUrl + " .ym-form", function (responseText, textStatus) {- // Call other custom initialisation functions- // (e.g. if the form as an autocompleter, it has to be initialised again)- if (typeof custom_modal_init !== "undefined") {- custom_modal_init();- }-- // Set the new title- $("#ajax-info").dialog({title: $(responseText).find("#page-title").html()});-- // If there is a form in the modal dialog (there usually is) prevent the submit- // button from submitting it and do it here with an AJAX request. If there- // are errors (there is an element with the class 'ym-error' in the result)- // reload the content back into the dialog so the user can correct the entries.- // If there isn't assume all was saved correctly and load that result into the- // page's main DIV (#main-content). All this must be done like this because there- // doesn't seem to be any reliable and easy way to detect redirects with AJAX.- if ($(responseText).find(".ym-form").length > 0) {- modal_dialog_form_edit();- }- });+ //$("#wger-ajax-info").modal({title: 'Loading...'});+ $("#wger-ajax-info").modal("show");++ $("#ajax-info-content").load(targetUrl + " .form-horizontal",+ function(responseText, textStatus, XMLHttpRequest){+ // Call other custom initialisation functions+ // (e.g. if the form as an autocompleter, it has to be initialised again)+ if (typeof custom_modal_init !== "undefined") {+ custom_modal_init();+ }++ // Set the new title+ $("#ajax-info-title").html($(responseText).find("#page-title").html());++ // If there is a form in the modal dialog (there usually is) prevent the submit+ // button from submitting it and do it here with an AJAX request. If there+ // are errors (there is an element with the class 'ym-error' in the result)+ // reload the content back into the dialog so the user can correct the entries.+ // If there isn't assume all was saved correctly and load that result into the+ // page's main DIV (#main-content). All this must be done like this because there+ // doesn't seem to be any reliable and easy way to detect redirects with AJAX.+ if ($(responseText).find(".form-horizontal").length > 0) {+ modal_dialog_form_edit();+ }+ });});}function modal_dialog_form_edit() {- var form = $("#ajax-info").find(".ym-form");+ var form = $("#ajax-info-content").find("form");var submit = $(form).find("#form-save");submit.click(function (e) {@@ -206,12 +199,12 @@ function modal_dialog_form_edit() {submit.off();// Show a loader while we fetch the real page- $("#ajax-info .ym-form").html('<div style="text-align:center;">' ++ $("#ajax-info-content form").html('<div style="text-align:center;">' +'<img src="/static/images/loader.svg" ' +'width="48" ' +'height="48"> ' +'</div>');- $("#ajax-info").dialog({title: 'Processing...'}); // TODO: translate this+ $("#ajax-info-title").html('Processing'); // TODO: translate this// OK, we did the POST, what do we do with the result?@@ -226,16 +219,14 @@ function modal_dialog_form_edit() {jqXHR.setRequestHeader("X-wger-no-messages", "1");},success: function (data, textStatus, jqXHR) {- if ($(data).find('.ym-form .ym-error').length > 0) {+ if ($(data).find('form .has-error').length > 0) {// we must do the same with the new form as before, binding the click-event,// checking for errors etc, so it calls itself here again.-- $("#ajax-info .ym-form").html($(data).find('.ym-form').html());- $("#ajax-info").dialog({title: $(data).find("#main-content h2").html()});-+ $("#ajax-info-content form").html($(data).find('form').html());+ $("#ajax-info-title").html($(data).find("#page-title").html());modal_dialog_form_edit();} else {- $("#ajax-info").dialog("close");+ $("#wger-ajax-info").modal("hide");// If there was a redirect we must change the URL of the browser. Otherwise// a reload would not change the adress bar, but the content would.@@ -272,7 +263,7 @@ function modal_dialog_form_edit() {},error: function (jqXHR, textStatus, errorThrown) {//console.log(errorThrown); // INTERNAL SERVER ERROR- $("#ajax-info").html(jqXHR.responseText);+ $("#ajax-info-content").html(jqXHR.responseText);}});});diff --git a/wger/core/templates/index.html b/wger/core/templates/index.htmlindex 800c07d7c..96bccbb4b 100644--- a/wger/core/templates/index.html+++ b/wger/core/templates/index.html@@ -5,40 +5,49 @@{% block title %} {% trans "Dashboard" %}{% endblock %}{% block header %}-<script>-$(document).ready(function() {- // Popup for adding logs- $('#logging-popup-link').click(function(e){- e.preventDefault();- $('#calendar-day-select-popup').dialog({- modal: true- });- });- });-</script>{% endblock %}{% block content %}-<div class="row">- <div class="col-md-6">- <h3>{% trans "Workout"%}</h3>- {% if current_workout %}- <div id="calendar-day-select-popup"- style="display:none;"- title="{% trans 'Add log to day' %}">- <div>+{% if current_workout %}+<div class="modal fade" id="calendar-day-select-popup">+ <div class="modal-dialog">+ <div class="modal-content">+ <div class="modal-header">+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>+ <h4 class="modal-title">{% trans 'Add log to day' %}</h4>+ </div>+ <div class="modal-body">{% if current_workout %}<p>{% blocktrans %}Click to add weight logs to a training-day in your current workout:{% endblocktrans %} {{current_workout}}</p>+day in your current workout:{% endblocktrans %} <strong>{{current_workout}}</strong></p>{% for day in current_workout.day_set.all %}- <a href="{% url 'day-log' day.pk %}" class="btn btn-block">{{day.description}}</a>+ <a href="{% url 'day-log' day.pk %}" class="btn btn-block btn-default">{{day.description}}</a>{% endfor %}- {% endif %}++ {% else %}+ <p><em>{% trans "No workouts found." %}</em></p>+ <p>+ <a href="{% url 'workout-add' %}" class="btn btn-block btn-default">+ <img src="{% static 'images/icons/add.svg' %}"+ width="22"+ height="22"+ alt="">+ {% trans "Add one now." %}+ </a>+ </p>+ {% endif %}</div></div>+ </div>+</div>+++<div class="row">+ <div class="col-md-6">+ <h3>{% trans "Workout"%}</h3>@@ -67,7 +76,7 @@ day in your current workout:{% endblocktrans %} {{current_workout}}</p></ul>{% if current_workout.day_set.all %}- <p><a href="" id="logging-popup-link">{% trans "Add new log" %}</a></p>+ <p><a href="#" id="logging-popup-link" data-toggle="modal" data-target="#calendar-day-select-popup">{% trans "Add new log" %}</a></p>{% endif %}{% if schedule %}diff --git a/wger/core/templates/license/list.html b/wger/core/templates/license/list.htmlindex d21333b32..fea90989b 100644--- a/wger/core/templates/license/list.html+++ b/wger/core/templates/license/list.html@@ -20,7 +20,7 @@<tr><td class="no-hover"><a href="{% url 'core:license-delete' license.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/trash.svg' %}"width="22"height="22"@@ -28,7 +28,7 @@title="{% trans 'Delete' %}"></a><a href="{% url 'core:license-edit' license.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="22"height="22"@@ -57,7 +57,7 @@<h3>{% trans "Options" %}</h3><p><a href="{% url 'core:license-add' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/new.svg' %}"width="32"height="32"diff --git a/wger/core/templates/template.html b/wger/core/templates/template.htmlindex 5ab616958..42d7978e9 100644--- a/wger/core/templates/template.html+++ b/wger/core/templates/template.html@@ -118,7 +118,21 @@{% include 'navigation.html' %}<div id="main"><div class="container">- <div class="ym-gbox-left box invisible" id="ajax-info"></div>+ <div class="modal fade" id="wger-ajax-info" tabindex="-1" role="dialog">+ <div class="modal-dialog">+ <div class="modal-content">+ <div class="modal-header">+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>+ <h4 class="modal-title" id="ajax-info-title">Modal title</h4>+ </div>+ <div class="modal-body" id="ajax-info-content">+ </div>+ <div class="modal-footer">+ <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>+ </div>+ </div>+ </div>+ </div><div id="current-url" data-current-url="{{request_full_path}}"></div><div id="current-language" data-current-language="{{language.short_name}}"></div>@@ -126,12 +140,11 @@<div class="abox ainfo" style="padding:0.6em; margin: 0em 0em 1em 0em;text-align:center;font-size:95%;">{% trans "You are using a guest account, data entered will be deleted after a week."%}{% if not has_demo_data %}- <a href="{% url 'core:demo-entries' %}" rel="nofollow" class="btn btn-success btn-small">{% trans "Create some demo entries" %} »</a>+ <a href="{% url 'core:demo-entries' %}" rel="nofollow" class="btn btn-success btn-xs">{% trans "Create some demo entries" %} »</a>{% endif %}</div>{% endif %}{% block template %}{% endblock %}-</div></div>@@ -151,7 +164,6 @@| <a href="{% url 'software:contribute' %}">{% trans "Contribute!" %}</a>| <a href="{% url 'core:contact' %}">{% trans "Get in touch" %}</a>| <a href="?flavour=mobile" rel="nofollow">{% trans "Mobile version" %}</a>- </div><em class="dimmed" style="font-size: 80%;">{{version}}</em></div>diff --git a/wger/exercises/templates/equipment/list.html b/wger/exercises/templates/equipment/list.htmlindex 77f31a6bf..94d07f0d7 100644--- a/wger/exercises/templates/equipment/list.html+++ b/wger/exercises/templates/equipment/list.html@@ -20,7 +20,7 @@<tr><td class="no-hover"><a href="{% url 'equipment-delete' equipment.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/trash.svg' %}"width="22"height="22"@@ -28,7 +28,7 @@title="{% trans 'Delete' %}"></a><a href="{% url 'equipment-edit' equipment.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="22"height="22"@@ -58,7 +58,7 @@<h3>{% trans "Options" %}</h3><p><a href="{% url 'equipment-add' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/new.svg' %}"width="32"height="32"diff --git a/wger/exercises/templates/exercise/overview.html b/wger/exercises/templates/exercise/overview.htmlindex 7c803d9a6..b9a7ec0f6 100644--- a/wger/exercises/templates/exercise/overview.html+++ b/wger/exercises/templates/exercise/overview.html@@ -137,7 +137,7 @@ $(document).ready(function() {{% with exercise=exercises|first %}<p><a href="{% url 'exercisecategory-edit' exercise.category.id %}"- class="modal-dialog"+ class="wger-modal-dialog"id="current-category-edit"><img src="{% static 'images/icons/edit.svg' %}"width="32"@@ -151,7 +151,7 @@ $(document).ready(function() {<p><a href="{% url 'exercisecategory-delete' exercise.category.id %}"- class="modal-dialog"+ class="wger-modal-dialog"id="current-category-delete"><img src="{% static 'images/icons/trash.svg' %}"width="32"@@ -167,7 +167,7 @@ $(document).ready(function() {<p><a href="{% url 'exercisecategory-add' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/folder-new.svg' %}"width="32"height="32"diff --git a/wger/exercises/templates/exercise/view.html b/wger/exercises/templates/exercise/view.htmlindex dc41d0d4d..b0f0b09be 100644--- a/wger/exercises/templates/exercise/view.html+++ b/wger/exercises/templates/exercise/view.html@@ -109,7 +109,7 @@ included in the database.{% endblocktrans %}</a><a href="{% url 'exercisecomment-edit' comment.id %}"title="{% trans 'Edit' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="16"height="16"@@ -127,7 +127,7 @@ included in the database.{% endblocktrans %}<p><a href="{% url 'exercisecomment-add' exercise.id %}"title="{% trans 'Add' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/add.svg' %}"width="16"height="16"@@ -161,7 +161,7 @@ included in the database.{% endblocktrans %}{% if perms.exercises.change_exerciseimage %}|<a href="{% url 'exerciseimage-delete' exercise.pk image.pk %}"- class="modal-dialog no-hover">+ class="wger-modal-dialog no-hover">{% trans 'Delete' %}</a> |<a href="{% url 'exerciseimage-edit' image.pk %}"class="no-hover">@@ -312,7 +312,7 @@ weight_log_chart({{json|safe}}, "{{svg_uuid}}", "{{reps}}")</p><p><a href="{% url 'exercise-delete' exercise.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/trash.svg' %}"width="32"height="32"diff --git a/wger/exercises/templates/muscles/overview.html b/wger/exercises/templates/muscles/overview.htmlindex ca8385b67..57db741fe 100644--- a/wger/exercises/templates/muscles/overview.html+++ b/wger/exercises/templates/muscles/overview.html@@ -101,7 +101,7 @@ $(document).ready(function() {<p><a href="{% url 'muscle-add' %}"title="{% trans 'Add muscle' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/new.svg' %}"width="32"height="32"@@ -119,7 +119,7 @@ folder <em>images/muscles</em>.{% endblocktrans %}</p><div id="muscle-edit-box" style="display:none;"><p><a href="{% url 'muscle-edit' 1 %}"- class="modal-dialog"+ class="wger-modal-dialog"id="muscle-edit-edit-link"><img src="{% static 'images/icons/edit.svg' %}"width="32"@@ -129,7 +129,7 @@ folder <em>images/muscles</em>.{% endblocktrans %}</p></p><p><a href="{% url 'muscle-delete' 1 %}"- class="modal-dialog"+ class="wger-modal-dialog"id="muscle-edit-delete-link"><img src="{% static 'images/icons/trash.svg' %}"width="32"diff --git a/wger/manager/templates/schedule/overview.html b/wger/manager/templates/schedule/overview.htmlindex 823996bee..3e03e43c8 100644--- a/wger/manager/templates/schedule/overview.html+++ b/wger/manager/templates/schedule/overview.html@@ -42,7 +42,7 @@ function custom_modal_init(){% empty %}<tr><td colspan="3">- <a href="{% url 'schedule-add' %}" class="modal-dialog btn btn-block">+ <a href="{% url 'schedule-add' %}" class="wger-modal-dialog btn btn-block">{% trans "No schedules found." %} {% trans "Add one now." %}</a></td>@@ -70,7 +70,7 @@ deactivate it, if it is a loop.{% endblocktrans %}</p><h3>{% trans "Add schedule" %}</h3><p><a href="{% url 'schedule-add' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/new.svg' %}"width="32"height="32"diff --git a/wger/manager/templates/schedule/view.html b/wger/manager/templates/schedule/view.htmlindex 60f6d90b5..011c7f081 100644--- a/wger/manager/templates/schedule/view.html+++ b/wger/manager/templates/schedule/view.html@@ -43,16 +43,6 @@ $(function() {init_sortable();init_schedule_datepicker();});--$(document).ready(function() {- // Popup for exporting ical file- $('#export-ical-link').click(function(e){- e.preventDefault();- $('#export-ical-popup').dialog({- modal: true- });- });- });</script>{% endblock %}@@ -83,7 +73,7 @@ $(document).ready(function() {class="dragndrop-handle"><a href="{% url 'step-edit' step.id %}"title="{% trans 'Edit' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="22"height="22"@@ -91,7 +81,7 @@ $(document).ready(function() {</a><a href="{% url 'step-delete' step.id %}"title="{% trans 'Delete' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/trash.svg' %}"width="22"height="22"@@ -112,7 +102,7 @@ $(document).ready(function() {{% empty %}<tr><td colspan="4">- <a href="{% url 'step-add' schedule.id %}" class="modal-dialog btn btn-block">+ <a href="{% url 'step-add' schedule.id %}" class="wger-modal-dialog btn btn-block">{% trans "No workouts found." %} {% trans "Add one now." %}</a></td>@@ -133,7 +123,7 @@ $(document).ready(function() {<p><a href="{% url 'step-add' schedule.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/new.svg' %}"width="32"height="32"@@ -153,7 +143,8 @@ than once.{% endblocktrans %}</p><h3>{% trans "Options" %}</h3><p>-<a href="#" id="export-ical-link">++<a href="#" data-toggle="modal" data-target="#export-ical-popup"><img src="{% static 'images/icons/calendar.svg' %}"width="32"height="32"@@ -164,7 +155,7 @@ than once.{% endblocktrans %}</p><p><a href="{% url 'schedule-edit' schedule.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="32"height="32"@@ -175,7 +166,7 @@ than once.{% endblocktrans %}</p><p><a href="{% url 'schedule-delete' schedule.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/trash.svg' %}"width="32"height="32"@@ -184,24 +175,30 @@ than once.{% endblocktrans %}</p>{% trans "Delete schedule" %}</a></p>--<div id="export-ical-popup" style="display:none;">- <div>- <h3>{% trans "Export calendar file" %}</h3>- <p>{% trans "Export this schedule as a calendar file." %}</p>- <p>{% blocktrans %}You can then import the file it into your calendar+<div class="modal fade" id="export-ical-popup">+ <div class="modal-dialog">+ <div class="modal-content">+ <div class="modal-header">+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>+ <h4 class="modal-title">{% trans "Export calendar file" %}</h4>+ </div>+ <div class="modal-body">+ <p>{% trans "Export this schedule as a calendar file." %}</p>+ <p>{% blocktrans %}You can then import the file it into your calendarapplication for example google calendar, outlook or iCal. This will createan appointment for each training day with the appropriate exercises.{% endblocktrans %}</p>- <p>- <a href="{% url 'schedule-ical' schedule.id %}" class="btn btn-block">- <img src="{% static 'images/icons/calendar.svg' %}"- width="32"- height="32"- alt="{% trans 'Export calendar file' %}"- title="{% trans 'Export calendar file' %}">- {% trans "Export calendar file" %}- </a>- </p>+ <p>+ <a href="{% url 'schedule-ical' schedule.id %}" class="btn btn-block btn-default">+ <img src="{% static 'images/icons/calendar.svg' %}"+ width="32"+ height="32"+ alt="{% trans 'Export calendar file' %}"+ title="{% trans 'Export calendar file' %}">+ {% trans "Export calendar file" %}+ </a>+ </p>+ </div>+ </div></div></div>{% endblock %}diff --git a/wger/manager/templates/tags/render_day.html b/wger/manager/templates/tags/render_day.htmlindex eef7f7841..90b347bd4 100644--- a/wger/manager/templates/tags/render_day.html+++ b/wger/manager/templates/tags/render_day.html@@ -32,7 +32,7 @@ $(document).ready(function() {</a><a href="{% url 'day-edit' day.obj.id %}"title="{% trans 'Edit' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="22"height="22"@@ -65,7 +65,7 @@ $(document).ready(function() {{% endif %}<a href="{% url 'set-edit' set.obj.id %}"title="{% trans 'Edit' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="22"height="22"@@ -90,7 +90,7 @@ $(document).ready(function() {{{exercise.setting_text}}{% if not exercise.setting_text %}<a href="{% url 'set-edit' set.obj.id %}"- class="modal-dialog btn btn-block">+ class="wger-modal-dialog btn btn-default btn-block">{% trans "This exercise has no repetitions." %}{% trans "Edit them now."%}</a>@@ -113,7 +113,7 @@ $(document).ready(function() {<tr><td colspan="2"><a href="{% url 'set-add' day.obj.id %}"- class="modal-dialog btn btn-block">+ class="wger-modal-dialog btn btn-default btn-block">{% trans "No exercises selected for this day." %}{% trans "Add one now." %}</a>@@ -123,7 +123,7 @@ $(document).ready(function() {<tr><td colspan="2"><a href="{% url 'set-add' day.obj.id %}"- class="modal-dialog">{% trans "Add exercises to this workout day" %}</a>+ class="wger-modal-dialog">{% trans "Add exercises to this workout day" %}</a></td></tr></tbody>diff --git a/wger/manager/templates/workout/calendar.html b/wger/manager/templates/workout/calendar.htmlindex 58282ba2d..459a4fa86 100644--- a/wger/manager/templates/workout/calendar.html+++ b/wger/manager/templates/workout/calendar.html@@ -13,14 +13,6 @@ $(document).ready(function() {$('.calendar-log-data').hide();$('#' + $(this).data('log')).toggle();});-- // Popup for adding logs- $('#calendar-day-select-link').click(function(e){- e.preventDefault();- $('#calendar-day-select-popup').dialog({- modal: true- });- });});</script>{% endblock %}@@ -50,9 +42,9 @@ $(document).ready(function() {<div class="col-md-4">{% if session %}- <a href="{% url 'workout-session-edit' session.pk %}" class="btn btn-default btn-block modal-dialog">{% trans "Edit workout session" %}</a>+ <a href="{% url 'workout-session-edit' session.pk %}" class="btn btn-default btn-block wger-modal-dialog">{% trans "Edit workout session" %}</a>{% else %}- <a href="{% url 'workout-session-add' first_log.workout_id date|date:'Y' date|date:'m' date|date:'d' %}" class="btn btn-default btn-block modal-dialog">{% trans "Add workout impression" %}</a>+ <a href="{% url 'workout-session-add' first_log.workout_id date|date:'Y' date|date:'m' date|date:'d' %}" class="btn btn-default btn-block wger-modal-dialog">{% trans "Add workout impression" %}</a>{% endif %}</div></div>@@ -82,7 +74,7 @@ $(document).ready(function() {<span class="editoptions"><a href="{% url 'workout-log-delete' log.pk %}"title="{% trans 'Delete' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/trash.svg' %}"width="16"height="16"@@ -90,7 +82,7 @@ $(document).ready(function() {</a><a href="{% url 'workout-log-edit' log.pk %}"title="{% trans 'Edit' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="16"height="16"@@ -110,30 +102,36 @@ $(document).ready(function() {{% block sidebar %}-<div id="calendar-day-select-popup"- style="display:none;"- title="{% trans 'Add log to day' %}">- <div>- {% if current_workout %}- <p>{% blocktrans %}Click to add weight logs to a training-day in your current workout:{% endblocktrans %} {{current_workout}}</p>-- {% for day in current_workout.day_set.all %}- <a href="{% url 'day-log' day.pk %}" class="btn btn-block">{{day.description}}</a>- {% endfor %}+<div class="modal fade" id="ecalendar-day-select-popup">+ <div class="modal-dialog">+ <div class="modal-content">+ <div class="modal-header">+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>+ <h4 class="modal-title">{% trans 'Add log to day' %}</h4>+ </div>+ <div class="modal-body">+ {% if current_workout %}+ <p>{% blocktrans %}Click to add weight logs to a training+day in your current workout:{% endblocktrans %} <strong>{{current_workout}}</strong></p>++ {% for day in current_workout.day_set.all %}+ <a href="{% url 'day-log' day.pk %}" class="btn btn-block btn-default">{{day.description}}</a>+ {% endfor %}- {% else %}- <p><em>{% trans "No workouts found." %}</em></p>- <p>- <a href="{% url 'workout-add' %}" class="btn btn-block">- <img src="{% static 'images/icons/add.svg' %}"- width="22"- height="22"- alt="">- {% trans "Add one now." %}- </a>- </p>- {% endif %}+ {% else %}+ <p><em>{% trans "No workouts found." %}</em></p>+ <p>+ <a href="{% url 'workout-add' %}" class="btn btn-block btn-default">+ <img src="{% static 'images/icons/add.svg' %}"+ width="22"+ height="22"+ alt="">+ {% trans "Add one now." %}+ </a>+ </p>+ {% endif %}+ </div>+ </div></div></div>@@ -151,7 +149,7 @@ you can click on them to see the details.{% endblocktrans %}</p>{% trans "Go to current month" %}</a></p><p>- <a href="" id="calendar-day-select-link">+ <a href="#" id="calendar-day-select-link" data-toggle="modal" data-target="#ecalendar-day-select-popup"><img src="{% static 'images/icons/add.svg' %}"width="32"height="32"diff --git a/wger/manager/templates/workout/view.html b/wger/manager/templates/workout/view.htmlindex eb65ad601..1dac195d4 100644--- a/wger/manager/templates/workout/view.html+++ b/wger/manager/templates/workout/view.html@@ -26,14 +26,6 @@ $(document).ready(function() {$(".exercise-comments").hide();{% endif %}toggle_comments();-- // Popup for exporting ical file- $('#export-ical-link').click(function(e){- e.preventDefault();- $('#export-ical-popup').dialog({- modal: true- });- });});</script>{% endblock %}@@ -55,7 +47,7 @@ $(document).ready(function() {</div>{% empty %}<p>- <a href="{% url 'day-add' workout.id %}" class="modal-dialog btn btn-block">+ <a href="{% url 'day-add' workout.id %}" class="wger-modal-dialog btn btn-block">{% trans "No days for this workout." %}{% trans "Add training day" %}</a>@@ -64,7 +56,7 @@ $(document).ready(function() {<p>- <a href="{% url 'day-add' workout.id %}" class="modal-dialog">{% trans "Add training day" %}</a>+ <a href="{% url 'day-add' workout.id %}" class="wger-modal-dialog">{% trans "Add training day" %}</a>|<a id="exercise-comments-toggle" href="{% url 'core:preferences' %}">{% trans "Show/Hide exercise comments" %}</a></p>@@ -136,7 +128,7 @@ $(document).ready(function() {<p><a href="{% url 'workout-edit' workout.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="32"height="32"@@ -147,7 +139,7 @@ $(document).ready(function() {</p><p>-<a href="#export-ical-popup" id="export-ical-link">+<a data-toggle="modal" data-target="#export-ical-popup"><img src="{% static 'images/icons/calendar.svg' %}"width="32"height="32"@@ -159,7 +151,7 @@ $(document).ready(function() {<p><a href="{% url 'workout-copy' workout.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/copy.svg' %}"width="32"height="32"@@ -171,7 +163,7 @@ $(document).ready(function() {<p><a href="{% url 'workout-delete' workout.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/trash.svg' %}"width="32"height="32"@@ -180,24 +172,31 @@ $(document).ready(function() {</a></p>-<div id="export-ical-popup"- style="display:none;"- title="{% trans 'Export calendar file' %}">- <div>- <p>{% trans "Export this workout as a calendar file." %}</p>- <p>{% blocktrans %}You can then import the file it into your calendar++<div class="modal fade" id="export-ical-popup">+ <div class="modal-dialog">+ <div class="modal-content">+ <div class="modal-header">+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>+ <h4 class="modal-title">{% trans "Export calendar file" %}</h4>+ </div>+ <div class="modal-body">+ <p>{% trans "Export this workout as a calendar file." %}</p>+ <p>{% blocktrans %}You can then import the file it into your calendarapplication for example google calendar, outlook or iCal. This will createan appointment for each training day with the appropriate exercises.{% endblocktrans %}</p>- <p>- <a href="{% url 'workout-ical' workout.id %}" class="btn btn-block">- <img src="{% static 'images/icons/calendar.svg' %}"- width="32"- height="32"- alt="{% trans 'Export calendar file' %}"- title="{% trans 'Export calendar file' %}">- {% trans "Export calendar file" %}- </a>- </p>+ <p>+ <a href="{% url 'workout-ical' workout.id %}" class="btn btn-block btn-default">+ <img src="{% static 'images/icons/calendar.svg' %}"+ width="32"+ height="32"+ alt="{% trans 'Export calendar file' %}"+ title="{% trans 'Export calendar file' %}">+ {% trans "Export calendar file" %}+ </a>+ </p>+ </div>+ </div></div></div>{% endblock %}diff --git a/wger/nutrition/templates/ingredient/view.html b/wger/nutrition/templates/ingredient/view.htmlindex f9ef8d907..fce5a26d0 100644--- a/wger/nutrition/templates/ingredient/view.html+++ b/wger/nutrition/templates/ingredient/view.html@@ -197,7 +197,7 @@ the search.{% endblocktrans %}<p><a href="{% url 'ingredient-delete' ingredient.id %}"title="{% trans 'Delete ingredient' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/trash.svg' %}"width="32"height="32"@@ -222,7 +222,7 @@ the search.{% endblocktrans %}<h3>{% trans "Weight units" %}</h3><p><a href="{% url 'weight-unit-ingredient-add' ingredient.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/new.svg' %}"width="32"height="32"@@ -246,7 +246,7 @@ the search.{% endblocktrans %}<span class="editoptions float-right"><a href="{% url 'weight-unit-ingredient-edit' unit.id %}"title="{% trans 'Edit' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="16"height="16"@@ -255,7 +255,7 @@ the search.{% endblocktrans %}</a><a href="{% url 'weight-unit-ingredient-delete' unit.id %}"title="{% trans 'Delete' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/trash.svg' %}"width="16"height="16"diff --git a/wger/nutrition/templates/plan/view.html b/wger/nutrition/templates/plan/view.htmlindex 14daa9e0f..e6e69edfe 100644--- a/wger/nutrition/templates/plan/view.html+++ b/wger/nutrition/templates/plan/view.html@@ -64,7 +64,7 @@ $(document).ready(function() {</a><a href="{% url 'meal-edit' meal.id %}"title="{% trans 'Edit' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="16"height="16"@@ -73,7 +73,7 @@ $(document).ready(function() {</a><a href="{% url 'mealitem-add' meal.id %}"title="{% trans 'Add' %}"- class="modal-dialog edit-meal">+ class="wger-modal-dialog edit-meal"><img src="{% static 'images/icons/add.svg' %}"width="16"height="16"@@ -101,7 +101,7 @@ $(document).ready(function() {</a><a href="{% url 'mealitem-edit' item.id %}"title="{% trans 'Edit' %}"- class="modal-dialog edit-meal edit-mealitem">+ class="wger-modal-dialog edit-meal edit-mealitem"><img src="{% static 'images/icons/edit.svg' %}"width="16"height="16"@@ -119,7 +119,7 @@ $(document).ready(function() {<td colspan="7"><a href="{% url 'mealitem-add' meal.id %}"title="{% trans 'Add one now.' %}"- class="modal-dialog edit-meal btn btn-block">+ class="wger-modal-dialog edit-meal btn btn-block">{% trans "No items for this meal." %}{% trans "Add one now."%}</a>@@ -130,7 +130,7 @@ $(document).ready(function() {{% empty %}<p><a href="{% url 'meal-add' plan.id %}"- class="modal-dialog btn btn-block">+ class="wger-modal-dialog btn btn-block">{% trans "No meals for this plan." %}{% trans "Add one now." %}</a>@@ -139,7 +139,7 @@ $(document).ready(function() {<tr><td colspan="6"><a href="{% url 'meal-add' plan.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="16"height="16"@@ -293,7 +293,7 @@ $(document).ready(function() {<p><a href="{% url 'nutrition-edit' plan.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="32"height="32"@@ -315,7 +315,7 @@ $(document).ready(function() {<p><a href="{% url 'nutrition-delete' plan.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/trash.svg' %}"width="32"height="32"diff --git a/wger/nutrition/templates/units/list.html b/wger/nutrition/templates/units/list.htmlindex 3af30e16d..8eb4c0976 100644--- a/wger/nutrition/templates/units/list.html+++ b/wger/nutrition/templates/units/list.html@@ -20,7 +20,7 @@<tr><td class="no-hover"><a href="{% url 'weight-unit-delete' unit.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/trash.svg' %}"width="22"height="22"@@ -28,7 +28,7 @@title="{% trans 'Delete' %}"></a><a href="{% url 'weight-unit-edit' unit.id %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/edit.svg' %}"width="22"height="22"@@ -58,7 +58,7 @@<h3>{% trans "Options" %}</h3><p><a href="{% url 'weight-unit-add' %}"- class="modal-dialog">+ class="wger-modal-dialog"><img src="{% static 'images/icons/new.svg' %}"width="32"height="32"diff --git a/wger/weight/templates/weight_overview.html b/wger/weight/templates/weight_overview.htmlindex a220d4cf6..e079e1545 100644--- a/wger/weight/templates/weight_overview.html+++ b/wger/weight/templates/weight_overview.html@@ -48,7 +48,7 @@ $(document).ready(function () {<p><a href="{% url 'weight-add' %}"- class="modal-dialog"+ class="wger-modal-dialog"id="add-weight-entry">{% trans "Add weight entry" %}</a></p>