@@ -32,24 +32,24 @@ <h5 class="card-title">Year</h5>
3232 < div class ="info-section ">
3333 < h5 class ="card-title "> Installation Method</ h5 >
3434 {% if installation_info["sg_installation_method"] == "git" %}
35- < p class ="card-text mb-0 "> Git Repository</ p >
36- < h5 class ="card-title mt-3 "> Git Branch</ h5 >
37- < p class ="card-text mb-0 "> {{ installation_info["git_branch"] }}</ p >
38- <!-- update_available -->
39- {% if installation_info["update_available"] %}
40- < h5 class ="card-title mt-3 "> Update Available</ h5 >
41- < p class ="card-text mb-0 "> A new version is available. Please update to the latest version.</ p >
42- < a href ="# " class ="btn btn-primary btn-lg hover-raise " id ="updateButton ">
43- < i class ="fas fa-download "> </ i > Update Now
44- </ a >
45- {% else %}
46- < h5 class ="card-title mt-3 "> Update Status</ h5 >
47- < p class ="card-text mb-0 "> You are up-to-date with the latest version.</ p >
48- {% endif %}
35+ < p class ="card-text mb-0 "> Git Repository</ p >
36+ < h5 class ="card-title mt-3 "> Git Branch</ h5 >
37+ < p class ="card-text mb-0 "> {{ installation_info["git_branch"] }}</ p >
38+ <!-- update_available -->
39+ {% if installation_info["update_available"] %}
40+ < h5 class ="card-title mt-3 "> Update Available</ h5 >
41+ < p class ="card-text mb-0 "> A new version is available. Please update to the latest version.</ p >
42+ < a href ="# " class ="btn btn-primary btn-lg hover-raise " id ="updateButton ">
43+ < i class ="fas fa-download "> </ i > Update Now
44+ </ a >
45+ {% else %}
46+ < h5 class ="card-title mt-3 "> Update Status</ h5 >
47+ < p class ="card-text mb-0 "> You are up-to-date with the latest version.</ p >
48+ {% endif %}
4949 {% elif installation_info["sg_installation_method"] == "release" %}
50- < p class ="card-text "> Installed via Release</ p >
50+ < p class ="card-text "> Installed via Release</ p >
5151 {% elif installation_info["sg_installation_method"] == "source" %}
52- < p class ="card-text "> Installed via Source Code</ p >
52+ < p class ="card-text "> Installed via Source Code</ p >
5353 {% endif %}
5454 </ div >
5555 < hr >
@@ -69,31 +69,7 @@ <h5 class="card-title">Contact</h5>
6969 </ div >
7070 </ div >
7171</ div >
72-
73- < script >
74- document . getElementById ( 'updateButton' ) . addEventListener ( 'click' , function ( event ) {
75- event . preventDefault ( ) ; // Prevent the default link behavior
76-
77- fetch ( '{{ url_for("update_git_version") }}' , {
78- method : 'POST' ,
79- headers : {
80- 'Content-Type' : 'application/json' ,
81- // Add any additional headers if needed
82- } ,
83- } )
84- . then ( response => response . json ( ) )
85- . then ( data => {
86- if ( data . status === 'success' ) {
87- alert ( 'Update successful: ' + data . message ) ;
88- } else {
89- alert ( 'Update failed: ' + data . message ) ;
90- }
91- } )
92- . catch ( error => {
93- console . error ( 'Error:' , error ) ;
94- alert ( 'An error occurred while updating.' ) ;
95- } ) ;
96- } ) ;
97- </ script >
98-
72+ {% endblock %}
73+ {% block extra_scripts %}
74+ < script src ="{{ url_for('static', filename='js/update.js') }} "> </ script >
9975{% endblock %}
0 commit comments