remove variable attribute section for traits.
[sgn.git] / mason / brapiclient / locations.mas
blob417450e19a9bc373593a9527f295da80c094d4e4
1 <%args>
2 </%args>
4 <div id="brapi_home_locations_div">
6     <h4>Locations</h4>
7     <button class="btn btn-primary" name="brapi_home_locations_submit" id="brapi_home_locations_submit">Get Locations</button>
8     <br/><br/>
9     <div id="brapi_locations_data_result_div">
10     </div>
12 </div>
14 <script>
16 jQuery(document).ready(function() {
17     jQuery("#brapi_home_locations_submit").click(function() {
18         jQuery.ajax( {
19           'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/locations',
20           'method': 'GET',
21           'beforeSend': function() {
22             jQuery('#working_modal').modal('show');
23           },
24           'success': function(response) {
25             jQuery('#working_modal').modal('hide');
26             console.log(response);
27             brapi_create_paginated_table(response.result.data, response.metadata.pagination, 'brapi_locations_data_result_div', jQuery('#brapi_home_url_select').val()+'/brapi/v1/locations', undefined);
29           },
30           error: function(response) {
31             jQuery('#working_modal').modal('hide');
32             alert('An error occurred');
33           }
34         });
35     });
36 });
38 </script>