diff --git a/src/mainapp/templates/venues.html b/src/mainapp/templates/venues.html index 8d02516..e357063 100644 --- a/src/mainapp/templates/venues.html +++ b/src/mainapp/templates/venues.html @@ -9,10 +9,6 @@ {% endblock style %} {% block header_buttons %} - {% endblock header_buttons %} {% block content %} @@ -31,7 +27,7 @@
- +
+
{% endfor %} @@ -93,8 +99,11 @@
-

New Venue

-
- +
@@ -171,21 +180,30 @@
- - + +
- - + +
- - + +
-
+
@@ -201,8 +219,73 @@

Specimen Carp

- 1 · 36 - +
+ +
  • +
    +
    Section A · Coal Wharf, Market Drayton
    +

    Commercial Water

    +

    Specimen Carp

    +
    +
    + 1 · 36 + +
    +
  • +
  • +
    +
    Section A · Coal Wharf, Market Drayton
    +

    Commercial Water

    +

    Specimen Carp

    +
    +
    + 1 · 36 + +
    +
  • +
  • +
    +
    Section A · Coal Wharf, Market Drayton
    +

    Commercial Water

    +

    Specimen Carp

    +
    +
    + 1 · 36 + +
    +
  • +
  • +
    +
    Section A · Coal Wharf, Market Drayton
    +

    Commercial Water

    +

    Specimen Carp

    +
    +
    + 1 · 36 + +
    +
  • +
  • +
    +
    Section A · Coal Wharf, Market Drayton
    +

    Commercial Water

    +

    Specimen Carp

    +
    +
    + 1 · 36 +
    @@ -214,7 +297,10 @@
  • @@ -223,4 +309,5 @@ {% endblock content %} {% block scripts %} + {% endblock scripts %} diff --git a/src/static/js/mainapp/venues.js b/src/static/js/mainapp/venues.js index 883c45d..d0e11b2 100644 --- a/src/static/js/mainapp/venues.js +++ b/src/static/js/mainapp/venues.js @@ -1,13 +1,72 @@ -function getWaters(venueID) { - $.ajax({ - url: `/venues/get-waters/${venueID}`, - type: "GET", - "dataType": "json", - success: function (data) { - alert(JSON.stringify(data)); - }, - error: function (error) { - alert("error: " + error); - } - }); +// function getWaters(venueID) { +// $.ajax({ +// url: `/venues/get-waters/${venueID}`, +// type: "GET", +// "dataType": "json", +// success: function (data) { +// alert(JSON.stringify(data)); +// }, +// error: function (error) { +// alert("error: " + error); +// } +// }); +// } + +function openVenueModal(venue_id) { + if (venue_id == -1) { + $("#venueModal .edit").hide(); + $("#venueModal .create").show(); + + $("#venueName").val(""); + $("#venueDescription").val(""); + $("#venueType").val("FISHERY").change(); + + $("#venueStreetAddress").val(""); + $("#venueCity").val(""); + $("#venueProvence").val(""); + $("#venuePostCode").val("") + + $("#venuePhone").val(""); + $("#venueEmail").val(""); + $("#venueWebsite").val(""); + + $("#venueTwitter").val(""); + $("#venueFacebook").val(""); + $("#venueInstagram").val(""); + } + else { + $("#venueModal .edit").show(); + $("#venueModal .create").hide(); + + $.ajax({ + url: `/venues/api/${venue_id}`, + method: 'get', + dataType: 'json', + success: function(response) { + const venue = response.data; + + $("#venueName").val(venue.name); + $("#venueDescription").val(venue.description); + $("#venueType").val(venue.venue_type).change(); + + $("#venueStreetAddress").val(venue.street_address); + $("#venueCity").val(venue.city); + $("#venueProvence").val(venue.provence); + $("#venuePostCode").val(venue.postal_code) + + $("#venuePhone").val(venue.phone_number); + $("#venueEmail").val(venue.email_address); + $("#venueWebsite").val(venue.website_url); + + $("#venueTwitter").val(venue.twitter_url); + $("#venueFacebook").val(venue.facebook_url); + $("#venueInstagram").val(venue.instagram); + }, + error: function(error) { + alert("error: " + JSON.stringify(error)); + } + }); + } + + new bootstrap.Modal("#venueModal").show(); } \ No newline at end of file diff --git a/src/static/scss/base.scss b/src/static/scss/base.scss index 8ec0ec8..98300b3 100644 --- a/src/static/scss/base.scss +++ b/src/static/scss/base.scss @@ -155,4 +155,8 @@ border-bottom-left-radius: 0.8rem !important; border-top-right-radius: 1.2rem !important; border-bottom-right-radius: 1.2rem !important; +} + +#venueModal .modal-content { + min-height: 550px; } \ No newline at end of file