github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/pkg/template/pages/user_password.html (about)

     1  {{ define "title" }}{{.User.Name}} ยท Password{{ end }}
     2  
     3  {{ define "content" }}
     4  
     5  	<div class="subhead">
     6  		<div class="container">
     7  			<ul class="nav nav-tabs pull-right">
     8  				<li>
     9  					<a href="/dashboard">Dashboard</a>
    10  				</li>
    11  				<li class="active">
    12  					<a href="/account/user/profile">Settings</a>
    13  				</li>
    14  			</ul> <!-- ./nav -->
    15  			<h1 class="user">
    16  				<img src="{{.User.Image}}">
    17  				<span>{{.User.Name}}</span>
    18  			</h1>
    19  		</div><!-- ./container -->
    20  	</div><!-- ./subhead -->
    21  
    22  
    23  	<div class="container">
    24  		<div class="row">
    25  
    26  			<div class="col-xs-3">
    27  				<ul class="nav nav-pills nav-stacked">
    28  					<li><a href="/account/user/profile">Profile</a></li>
    29  					<li class="active"><a href="/account/user/password">Password</a></li>
    30  					<li><a href="/account/user/teams">Teams</a></li>
    31  					<li><a href="/account/user/delete">Delete</a></li>
    32  				</ul>
    33  			</div><!-- ./col-xs-3 -->
    34  
    35  			<div class="col-xs-9" role="main">
    36  				<div class="alert">Change your account Password.</div>
    37  				<div class="col-xs-5">
    38  					<form action="/account/user/password" method="POST" role="form">
    39  						<label>New Password:</label>
    40  						<div>
    41  							<input class="form-control" type="password" name="password" value="">
    42  						</div>
    43  						<div class="alert alert-success hide" id="successAlert"></div>
    44  						<div class="alert alert-error hide" id="failureAlert"></div>
    45  						<div class="form-actions">
    46  							<input class="btn btn-primary" id="submitButton" type="submit" value="Save" data-loading-text="Saving ..">
    47  							<a class="btn btn-default" href="/account/user/password">Cancel</a>
    48  						</div>
    49  					</form>
    50  				</div><!-- ./col-xs-6 -->
    51  
    52  			</div><!-- ./col-xs-9 -->
    53  		</div><!-- ./row -->
    54  
    55  	</div><!-- ./container -->
    56  {{ end }}
    57  
    58  {{ define "script" }}
    59  	<script>
    60  		document.forms[0].onsubmit = function(event) {
    61  						$("#successAlert").hide();
    62  						$("#failureAlert").hide();
    63  						$('#submitButton').button('loading');
    64  
    65  						var form = event.target;
    66  						var formData = new FormData(form);
    67  						xhr = new XMLHttpRequest();
    68  						xhr.open('POST', form.action);
    69  						xhr.onload = function() {
    70  								if (this.status == 200) {
    71  										$("#successAlert").text("Your password was successfully changed");
    72  										$("#successAlert").show().removeClass("hide");
    73  										$('#submitButton').button('reset');
    74  								} else {
    75  										$("#failureAlert").text("Failed to update your password. Must be at least 6 chacters long.");
    76  										$("#failureAlert").show().removeClass("hide");
    77  										$('#submitButton').button('reset');
    78  								};
    79  						};
    80  						xhr.send(formData);
    81  						return false;
    82  				}
    83  	</script>
    84  {{ end }}