Merge pull request #263 from Modulos/beta_modal
Show modal after beta access signup
This commit is contained in:
		
				commit
				
					
						21d37ffca4
					
				
			
		
					 8 changed files with 140 additions and 46 deletions
				
			
		
							
								
								
									
										27
									
								
								datacenterlight/templates/datacenterlight/beta_access.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								datacenterlight/templates/datacenterlight/beta_access.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,27 @@
 | 
			
		|||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
<form novalidate id ="beta_access" class="form-beta" method="POST" action="{% url 'datacenterlight:beta_access'%}">
 | 
			
		||||
  {% csrf_token %}
 | 
			
		||||
  {{ form.non_field_errors }}
 | 
			
		||||
  <div>
 | 
			
		||||
	{% for message in messages %}
 | 
			
		||||
		<strong>{{ message }}</strong>
 | 
			
		||||
	{% endfor %}
 | 
			
		||||
  </div>
 | 
			
		||||
 <div class="inputs">
 | 
			
		||||
	 <div class="form-group">
 | 
			
		||||
		<input type="text" name="name" class="form-control" id="name" placeholder="Enter name">
 | 
			
		||||
		<span style="color: white">{{ form.name.errors|striptags}}</span>
 | 
			
		||||
	  </div>
 | 
			
		||||
	  <div class="form-group">
 | 
			
		||||
		<input type="email" name="email" class="form-control" id="email" placeholder="Enter email">
 | 
			
		||||
		<span style="color: white">{{ form.email.errors|striptags}}</span>
 | 
			
		||||
	  </div>
 | 
			
		||||
 </div>
 | 
			
		||||
  <button type="submit" class="btn btn-default btn-transparent btn-lg">{% trans "Request Beta Access" %}</button>
 | 
			
		||||
</form>
 | 
			
		||||
<script>
 | 
			
		||||
	$('#beta_access').ajaxForm({
 | 
			
		||||
		target: '#beta_access_form', success: function(response) { }
 | 
			
		||||
	});
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										47
									
								
								datacenterlight/templates/datacenterlight/beta_success.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								datacenterlight/templates/datacenterlight/beta_success.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,47 @@
 | 
			
		|||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
<div class="modal fade bs-example-modal-sm" style="color:black;"  id="successModal" tabindex="-1" role="dialog">
 | 
			
		||||
    <div class="vertical-alignment-helper">
 | 
			
		||||
        <div class="modal-dialog vertical-align-center">
 | 
			
		||||
			<div class="modal-content">
 | 
			
		||||
			  <div class="modal-header">
 | 
			
		||||
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
 | 
			
		||||
				<h4 class="modal-title">{% trans "Request Sent" %}</h4>
 | 
			
		||||
			  </div>
 | 
			
		||||
			  <div class="modal-body">
 | 
			
		||||
				<p>{% trans "Thank you, we will contact you as soon as possible" %}</p>
 | 
			
		||||
			  </div>
 | 
			
		||||
			</div><!-- /.modal-content -->
 | 
			
		||||
		</div>
 | 
			
		||||
	</div>
 | 
			
		||||
</div><!-- /.modal -->
 | 
			
		||||
<script>
 | 
			
		||||
	// Show modal
 | 
			
		||||
	$('#successModal').modal('show');
 | 
			
		||||
	// close the modal after 3 seconds
 | 
			
		||||
	setTimeout(function() {
 | 
			
		||||
	    $('#successModal').modal('hide');
 | 
			
		||||
	}, 5000);	
 | 
			
		||||
</script>
 | 
			
		||||
<style>
 | 
			
		||||
.vertical-alignment-helper {
 | 
			
		||||
    display:table;
 | 
			
		||||
    height: 100%;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    pointer-events:none; /* This makes sure that we can still click outside of the modal to close it */
 | 
			
		||||
}
 | 
			
		||||
.vertical-align-center {
 | 
			
		||||
    /* To center vertically */
 | 
			
		||||
    display: table-cell;
 | 
			
		||||
    vertical-align: middle;
 | 
			
		||||
    pointer-events:none;
 | 
			
		||||
}
 | 
			
		||||
.modal-content {
 | 
			
		||||
    /* Bootstrap sets the size of the modal in the modal-dialog class, we need to inherit it */
 | 
			
		||||
    width:inherit;
 | 
			
		||||
    height:inherit;
 | 
			
		||||
    /* To center horizontally */
 | 
			
		||||
    margin: 0 auto;
 | 
			
		||||
    pointer-events: all;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
| 
						 | 
				
			
			@ -261,43 +261,9 @@
 | 
			
		|||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="col-sm-6 col-md-6">
 | 
			
		||||
                    <div class="form">
 | 
			
		||||
                        <form class="form-beta" method="POST" action="">
 | 
			
		||||
                          {% csrf_token %}
 | 
			
		||||
                          {{ form.non_field_errors }}
 | 
			
		||||
                          {{ form.email.errors|striptags}}
 | 
			
		||||
                          <div>
 | 
			
		||||
                            {% for message in messages %}
 | 
			
		||||
                                <strong>{{ message }}</strong>
 | 
			
		||||
                            {% endfor %}                  
 | 
			
		||||
                          </div>
 | 
			
		||||
                         <div class="inputs">
 | 
			
		||||
                             <div class="form-group">
 | 
			
		||||
                                <input type="text" name="name" class="form-control" id="name" placeholder="Enter name">
 | 
			
		||||
                              </div>
 | 
			
		||||
                              <div class="form-group">
 | 
			
		||||
                                <input type="email" name="email" class="form-control" id="email" placeholder="Enter email">
 | 
			
		||||
                              </div>
 | 
			
		||||
                         </div>
 | 
			
		||||
                          <button type="submit" class="btn btn-default btn-transparent btn-lg">{% trans "Request Beta Access" %}</button>
 | 
			
		||||
                        </form>
 | 
			
		||||
                    </div>
 | 
			
		||||
                     <div class="modal fade bs-example-modal-sm" style="color:black;"  id="sucessModal" tabindex="-1" role="dialog">
 | 
			
		||||
                          <div class="modal-dialog" role="document">
 | 
			
		||||
                            <div class="modal-content">
 | 
			
		||||
                              <div class="modal-header">
 | 
			
		||||
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
 | 
			
		||||
                                <h4 class="modal-title">{% trans "Request Sent" %}</h4>
 | 
			
		||||
                              </div>
 | 
			
		||||
                              <div class="modal-body">
 | 
			
		||||
                                <p>{% trans "Thank you, we will contact you as soon as possible" %}</p>
 | 
			
		||||
                              </div>
 | 
			
		||||
                              <div class="modal-footer text-center">
 | 
			
		||||
                                <button type="submit" class="btn btn-primary" data-dismiss="modal">Ok</button>
 | 
			
		||||
                              </div>
 | 
			
		||||
                            </div><!-- /.modal-content -->
 | 
			
		||||
                          </div><!-- /.modal-dialog -->
 | 
			
		||||
                        </div><!-- /.modal -->
 | 
			
		||||
					<!-- Beta access form, will be loaded via ajax -->
 | 
			
		||||
                    <div class="form" id="beta_access_form">
 | 
			
		||||
					</div>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -389,12 +355,12 @@
 | 
			
		|||
             windowPadding: 10,
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        var hash = window.location.hash.substr(1);
 | 
			
		||||
        console.log(hash);
 | 
			
		||||
        if (hash == 'requestform'){
 | 
			
		||||
            $('#reques-success-message').modal('show');
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
  		$.ajax({
 | 
			
		||||
	        url: "{% url 'datacenterlight:beta_access' %}",
 | 
			
		||||
				context: document.body
 | 
			
		||||
			}).done(function(response) {
 | 
			
		||||
				$('#beta_access_form').html(response);
 | 
			
		||||
			});
 | 
			
		||||
       };
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -403,6 +369,8 @@
 | 
			
		|||
    <!-- Bootstrap Core JavaScript -->
 | 
			
		||||
    <script src="{% static 'datacenterlight/js/bootstrap.min.js' %}"></script>
 | 
			
		||||
    <script src="{% static 'datacenterlight/js/main.js' %}"></script>
 | 
			
		||||
    <!-- Load form js -->
 | 
			
		||||
    <script src="{% static 'datacenterlight/js/form.js' %}"></script>
 | 
			
		||||
 | 
			
		||||
</body>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue