Skip to content

Commit

Permalink
fix(login): remove autocomplete and translate
Browse files Browse the repository at this point in the history
This commit removes the autocomplete options from the login form (it
seems to take specialized attributes).  It also converts all translate
filters to directives.
  • Loading branch information
Jonathan Niles authored and jniles committed Jan 6, 2017
1 parent 39bb976 commit eea39e7
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions client/src/partials/login/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<!--@fixme - style hacks for content centering-->
<div class="panel panel-default" style="margin-top : calc(50vh - 190px); max-width: 400px; margin-right: auto; margin-left: auto">
<div class="panel-heading clearfix">
<strong>{{ "AUTH.LOGIN" | translate }}</strong>
<strong translate>AUTH.LOGIN</strong>
<div class="pull-right" uib-dropdown>
<button class="btn btn-default btn-xs" uib-dropdown-toggle>
<a class="btn btn-default btn-xs" uib-dropdown-toggle>
<span class="caret"></span>
</button>
</a>
<ul role="menu" uib-dropdown-menu>
<li role="menuitem" ng-repeat="(key, lang) in LoginCtrl.languages">
<a ng-click="LoginCtrl.languageService.set(key)" href>
Expand All @@ -26,7 +26,7 @@
<div
class="form-group"
ng-class="{ 'has-error' : LoginForm.$submitted && LoginForm.username.$invalid }">
<label class="control-label"> {{ "FORM.LABELS.USERNAME" | translate }} </label>
<label class="control-label" translate>FORM.LABELS.USERNAME</label>
<div class="input-group">
<span class="input-group-addon" style="background-color: #fff;">
<span class="fa fa-user"></span>
Expand All @@ -38,14 +38,15 @@
ng-model="LoginCtrl.credentials.username"
placeholder="{{ 'FORM.PLACEHOLDERS.USERNAME' | translate }}"
autofocus
autocomplete="nope"
required />
</div>
</div>

<div
class="form-group"
ng-class="{ 'has-error' : LoginForm.$submitted && LoginForm.password.$invalid }">
<label class="control-label"> {{ "FORM.LABELS.PASSWORD" | translate }} </label>
<label class="control-label" translate>FORM.LABELS.PASSWORD</label>
<div class="input-group">
<span class="input-group-addon" style="background-color: #fff;">
<span class="fa fa-lock"></span>
Expand All @@ -56,39 +57,40 @@
ng-model="LoginCtrl.credentials.password"
class="form-control"
placeholder="{{ 'FORM.PLACEHOLDERS.PASSWORD' | translate }}"
autocomplete="nope"
required />
</div>
</div>

<div
class="form-group"
ng-class="{ 'has-error' : LoginForm.$submitted && LoginForm.project.$invalid }">
<label class="control-label">
{{ "FORM.LABELS.PROJECT" | translate }}
<label class="control-label" translate>
FORM.LABELS.PROJECT
</label>
<div class="input-group">
<span class="input-group-addon" style="background-color: #fff;">
<span class="fa fa-home"></span>
<i class="fa fa-home"></i>
</span>
<select
name="project"
class="form-control"
ng-model="LoginCtrl.credentials.project"
ng-options="proj.id as proj.name for proj in LoginCtrl.projects"
required >
<option value="" disabled>{{ "FORM.SELECT.PROJECT" | translate }}</option>
<option value="" disabled translate>FORM.SELECT.PROJECT</option>
</select>
</div>
</div>

<div class="form-group" ng-class="{ 'has-error' : LoginForm.$submitted && LoginForm.$invalid }">
<bh-loading-button loading-state="LoginForm.$loading" button-class="btn-default">
{{ "FORM.BUTTONS.CONNECTION" | translate }}
<span translate>FORM.BUTTONS.CONNECTION</span>
</bh-loading-button>

<!-- client-side validation error: requires username, password, and project -->
<p class="help-block" ng-if="LoginForm.$submitted && LoginForm.$invalid" style="margin-top:10px;">
<i class="fa fa-exclamation-circle"></i> {{ "FORM.ERRORS.MISSING" | translate }}
<i class="fa fa-exclamation-circle"></i> <span translate>FORM.ERRORS.MISSING</span>
</p>
</div>
</form>
Expand Down

0 comments on commit eea39e7

Please sign in to comment.