Fixed register page
Cette révision appartient à :
Parent
3c42b2bda0
révision
5bafc6c0b5
5 fichiers modifiés avec 81 ajouts et 2 suppressions
|
@ -146,3 +146,15 @@ div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:last-of-typ
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Credit to bootsnipp.com for the css for the color graph */
|
||||||
|
.colorgraph {
|
||||||
|
height: 5px;
|
||||||
|
border-top: 0;
|
||||||
|
background: #c4e17f;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-image: -webkit-linear-gradient(left, #c4e17f, #c4e17f 12.5%, #f7fdca 12.5%, #f7fdca 25%, #fecf71 25%, #fecf71 37.5%, #f0776c 37.5%, #f0776c 50%, #db9dbe 50%, #db9dbe 62.5%, #c49cde 62.5%, #c49cde 75%, #669ae1 75%, #669ae1 87.5%, #62c2e4 87.5%, #62c2e4);
|
||||||
|
background-image: -moz-linear-gradient(left, #c4e17f, #c4e17f 12.5%, #f7fdca 12.5%, #f7fdca 25%, #fecf71 25%, #fecf71 37.5%, #f0776c 37.5%, #f0776c 50%, #db9dbe 50%, #db9dbe 62.5%, #c49cde 62.5%, #c49cde 75%, #669ae1 75%, #669ae1 87.5%, #62c2e4 87.5%, #62c2e4);
|
||||||
|
background-image: -o-linear-gradient(left, #c4e17f, #c4e17f 12.5%, #f7fdca 12.5%, #f7fdca 25%, #fecf71 25%, #fecf71 37.5%, #f0776c 37.5%, #f0776c 50%, #db9dbe 50%, #db9dbe 62.5%, #c49cde 62.5%, #c49cde 75%, #669ae1 75%, #669ae1 87.5%, #62c2e4 87.5%, #62c2e4);
|
||||||
|
background-image: linear-gradient(to right, #c4e17f, #c4e17f 12.5%, #f7fdca 12.5%, #f7fdca 25%, #fecf71 25%, #fecf71 37.5%, #f0776c 37.5%, #f0776c 50%, #db9dbe 50%, #db9dbe 62.5%, #c49cde 62.5%, #c49cde 75%, #669ae1 75%, #669ae1 87.5%, #62c2e4 87.5%, #62c2e4);
|
||||||
|
}
|
65
public/js/registerPage.js
Fichier normal
65
public/js/registerPage.js
Fichier normal
|
@ -0,0 +1,65 @@
|
||||||
|
$(function () {
|
||||||
|
$('.button-checkbox').each(function () {
|
||||||
|
|
||||||
|
// Settings
|
||||||
|
var $widget = $(this),
|
||||||
|
$button = $widget.find('button'),
|
||||||
|
$checkbox = $widget.find('input:checkbox'),
|
||||||
|
color = $button.data('color'),
|
||||||
|
settings = {
|
||||||
|
on: {
|
||||||
|
icon: 'glyphicon glyphicon-check'
|
||||||
|
},
|
||||||
|
off: {
|
||||||
|
icon: 'glyphicon glyphicon-unchecked'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Event Handlers
|
||||||
|
$button.on('click', function () {
|
||||||
|
$checkbox.prop('checked', !$checkbox.is(':checked'));
|
||||||
|
$checkbox.triggerHandler('change');
|
||||||
|
updateDisplay();
|
||||||
|
});
|
||||||
|
$checkbox.on('change', function () {
|
||||||
|
updateDisplay();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Actions
|
||||||
|
function updateDisplay() {
|
||||||
|
var isChecked = $checkbox.is(':checked');
|
||||||
|
|
||||||
|
// Set the button's state
|
||||||
|
$button.data('state', (isChecked) ? "on" : "off");
|
||||||
|
|
||||||
|
// Set the button's icon
|
||||||
|
$button.find('.state-icon')
|
||||||
|
.removeClass()
|
||||||
|
.addClass('state-icon ' + settings[$button.data('state')].icon);
|
||||||
|
|
||||||
|
// Update the button's color
|
||||||
|
if (isChecked) {
|
||||||
|
$button
|
||||||
|
.removeClass('btn-default')
|
||||||
|
.addClass('btn-' + color + ' active');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$button
|
||||||
|
.removeClass('btn-' + color + ' active')
|
||||||
|
.addClass('btn-default');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialization
|
||||||
|
function init() {
|
||||||
|
|
||||||
|
updateDisplay();
|
||||||
|
|
||||||
|
// Inject the icon if applicable
|
||||||
|
if ($button.find('.state-icon').length == 0) {
|
||||||
|
$button.prepend('<i class="state-icon ' + settings[$button.data('state')].icon + '"></i>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
init();
|
||||||
|
});
|
||||||
|
});
|
|
@ -25,7 +25,7 @@ func UserRegisterFormHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
modelHelper.BindValueForm(&b, r)
|
modelHelper.BindValueForm(&b, r)
|
||||||
languages.SetTranslation("en-us", viewRegisterTemplate)
|
languages.SetTranslation("en-us", viewRegisterTemplate)
|
||||||
htv := UserRegisterTemplateVariables{b, NewSearchForm(), Navigation{}, r.URL, mux.CurrentRoute(r)}
|
htv := UserRegisterTemplateVariables{b, NewSearchForm(), Navigation{}, r.URL, mux.CurrentRoute(r)}
|
||||||
err := viewTemplate.ExecuteTemplate(w, "index.html", htv)
|
err := viewRegisterTemplate.ExecuteTemplate(w, "index.html", htv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,5 +91,6 @@
|
||||||
|
|
||||||
<!-- Main Javascript File -->
|
<!-- Main Javascript File -->
|
||||||
<script type="text/javascript" charset="utf-8" src="{{.URL.Parse "/js/main.js"}}"></script>
|
<script type="text/javascript" charset="utf-8" src="{{.URL.Parse "/js/main.js"}}"></script>
|
||||||
|
{{block "js_footer" .}}{{end}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -63,4 +63,5 @@
|
||||||
</div><!-- /.modal-dialog -->
|
</div><!-- /.modal-dialog -->
|
||||||
</div><!-- /.modal -->
|
</div><!-- /.modal -->
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{define "js_footer"}}<script type="text/javascript" charset="utf-8" src="{{.URL.Parse "/js/registerPage.js"}}"></script>{{end}}
|
Référencer dans un nouveau ticket