From 843dda0bd0356210c56f8f4de19265730648dfd8 Mon Sep 17 00:00:00 2001 From: Alisha Mohanty Date: Apr 22 2019 18:57:26 +0000 Subject: Add a search button to find FAS-Username --- diff --git a/assets/css/custom.css b/assets/css/custom.css index 8ff3ced..cb9413e 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -385,3 +385,16 @@ blockquote { text-align: center; font-size:1.4rem; } +#search_fasid { + background-color: white; + padding: 0 1em; + color: var(--secondary-color); + font-weight: 500; + cursor: pointer; + font-size: 18px; + border-radius: 2rem; + border: 2px solid var(--secondary-color); + } +#div_id_fasid .controls { + display: inline-flex; +} \ No newline at end of file diff --git a/assets/js/fas_details.js b/assets/js/fas_details.js index 46d7145..a3231b7 100644 --- a/assets/js/fas_details.js +++ b/assets/js/fas_details.js @@ -1,9 +1,17 @@ $(document).ready(function () { + /* + Place the button inside input field + */ + $("#id_fasid").after($("#search_fasid")) + + /* + Making the input fields clear when the page reloads + */ $("#id_fasid").val('') $("#id_recipient_name").val('') $("#id_recipient_email").val('') - $("#id_fasid").change(function () { + $("#search_fasid").click(function () { let fasid = $('#id_fasid').val() $("#server-error").remove() @@ -16,7 +24,7 @@ $(document).ready(function () { $("#id_fasid").prop('disabled', true); $("#no-fas-id-error").remove() $("#server-error").remove() - $("#id_fasid").after('

Searching for FAS Username.........

') + $("#div_id_fasid").after('

Searching for FAS Username.........

') email = $.get('/send/search', { fasid: fasid }, function (data) { @@ -25,7 +33,7 @@ $(document).ready(function () { $('#server-error').remove() $('.searching-text').remove() $("#id_fasid").prop('disabled', false); - $("#id_fasid").after('

Internal Server Error Occured! Enter Name and Email manually!

') + $("#div_id_fasid").after('

Internal Server Error Occured! Enter Name and Email manually!

') $('#server-error').fadeIn('slow', function () { $('#server-error').delay(3000).fadeOut() }) @@ -49,7 +57,7 @@ $(document).ready(function () { } else { $("#no-fas-id-error").remove() - $("#id_fasid").after('

Sorry! No such FAS Username exsist

') + $("#div_id_fasid").after('

Sorry! No such FAS Username exist

') console.log('No such FAS username exsists') $('#no-fas-id-error').fadeIn('slow', function () { $('#no-fas-id-error').delay(2700).fadeOut() diff --git a/templates/messaging/message_send_form.html b/templates/messaging/message_send_form.html index 31bb47f..c678e11 100644 --- a/templates/messaging/message_send_form.html +++ b/templates/messaging/message_send_form.html @@ -6,10 +6,11 @@ {% block content %} - + +{% crispy form %} - {% crispy form %} -{% endblock content %} + +{% endblock content %} \ No newline at end of file