Skip to content

Commit

Permalink
remove hardcoded cms url
Browse files Browse the repository at this point in the history
  • Loading branch information
Grace-Amondi committed Jul 5, 2023
1 parent becdc71 commit 2e408fc
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion nmhs_cms/templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h3 class="py-2">
Page not found
</h3>
<h5 class="py-4" style="color: grey">Sorry, this page could not be found.</h5>
<a href="{{HTTP_HOST}}"
<a href="{{request.get_full_path}}"
class="button is-rounded center sec-btn cta-btn" style="text-align:center">
<span>Back to Home Page</span>
<span class="icon">
Expand Down
2 changes: 1 addition & 1 deletion nmhs_cms/templates/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h3 class="py-2">
</h3>
<h5 class="py-4" style="color: grey">Sorry, there seems to be an error. Please try again
soon.</h5>
<a href="{{HTTP_HOST}}"
<a href="{{request.get_full_path}}"
class="button is-rounded center sec-btn cta-btn" style="text-align:center">
<span>Back to Home Page</span>
<span class="icon">
Expand Down
2 changes: 1 addition & 1 deletion nmhs_cms/templates/navigation/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="columns is-mobile is-multiline" style="margin: 0">
<div class="column is-half-mobile is-one-quarter-desktop" style="margin-bottom: 20px">
<div>
<a class="footer-logo" href="{{HTTP_HOST}}">
<a class="footer-logo" href="{{request.get_full_path}}">
<figure class="image">
{% if settings.base.OrganisationSetting.footer_logo %}
{% image settings.base.OrganisationSetting.footer_logo original as footer_logo %}
Expand Down
4 changes: 2 additions & 2 deletions nmhs_cms/templates/navigation/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="top-nav-wrapper is-hidden-touch">
<div class="level top-nav">
<div class="level-left">
<a class="level-item main-logo" href="{{HTTP_HOST}}" style="font-weight: 600; font-size: 30px; letter-spacing: 0.2em;color: black;">
<a class="level-item main-logo" href="{{request.get_full_path}}" style="font-weight: 600; font-size: 30px; letter-spacing: 0.2em;color: black;">
{% if settings.base.OrganisationSetting.logo %}
{% image settings.base.OrganisationSetting.logo original as logo %}
<img src="{{ logo.url }}" alt="Logo">
Expand Down Expand Up @@ -101,7 +101,7 @@
<nav class="navbar is-justify-content-center is-align-content-center bottom-nav" role="navigation"
aria-label="main navigation">
<div class="navbar-brand is-hidden-desktop">
<a class="mobile-logo" href="{{HTTP_HOST}}">
<a class="mobile-logo" href="{{request.get_full_path}}">
{% if settings.base.OrganisationSetting.logo %}
{% image settings.base.OrganisationSetting.logo original as logo %}
<img src="{{ logo.url }}" alt="Logo">
Expand Down
4 changes: 2 additions & 2 deletions pages/home/static/js/forecast_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ $(document).ready(function () {
function setForecastData(forecast_date) {

// Make an HTTP GET request to the API endpoint
fetch(`/cms/api/forecasts?forecast_date=${forecast_date}`)
fetch(`${BASE_PATH}api/forecasts?forecast_date=${forecast_date}`)
.then(response => response.json()) // Parse the response as JSON
.then(data => {
// Process the retrieved data
Expand All @@ -103,7 +103,7 @@ $(document).ready(function () {
}

}
img.src = `/cms${icon.properties.condition_icon}`
img.src = `${BASE_PATH}${icon.properties.condition_icon}`
return img.src

})
Expand Down
3 changes: 2 additions & 1 deletion pages/home/templates/home_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@

const temp_units = "{{settings.forecastmanager.ForecastSetting.get_temp_units_display}}"


const BASE_PATH = "{{request.get_full_path}}"
console.log(BASE_PATH)
</script>

<script type="text/javascript" src="{% static 'js/basemap.js' %}"></script>
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ filelock==3.12.0
filetype==1.2.0
Fiona==1.9.4.post1
fonttools==4.39.4
forecastmanager @ https://github.com/wmo-raf/forecastmanager/archive/eb0ae46b6a5e8554ecd69e1d9ddf0b36b7ffda94.zip
forecastmanager==0.0.5
frozenlist==1.3.3
future==0.18.3
geomanager==0.0.1
Expand Down

0 comments on commit 2e408fc

Please sign in to comment.