<commit_before>var color     = require("color");
var Radium    = require("radium");
var React     = require("react");
var bootstrap = require("react-bootstrap");

var components = require("components");
var colors     = require("lib/colors_restyling");
var icons      = require("lib/icons_restyling");

var styles = {
    inputs: {
        borderRadius: "15px",
        overflow: "hidden",
        borderWidth: "1px",
        borderColor: color(colors.white).alpha(0.3).rgbString(),
        borderStyle: "solid",
        color: colors.white
    },
    loginButton: {
        background: colors.buttonPrimary,
        color: colors.white,
        height: "68px",
        width: "80%",
        margin: "auto",
        borderRadius: "30px",
        border: "0px none",
        fontSize: "22px"
    },
    errorAlert: {
        marginTop: "16px",
        textAlign: "center"
    }
};

var LoginView = React.createClass({
    propTypes: {
        asteroid: React.PropTypes.object.isRequired
    },
    getInitialState: function () {
        return {
            loginError: null
        };
    },
    setLoginError: function (error) {
        this.setState({
            loginError: error
        });
    },
    login: function () {
        var credentials = {
            email: this.refs.email.getValue(),
            password: this.refs.password.getValue()
        };
        this.setLoginError(null);
        this.props.asteroid.loginWithPassword(credentials).catch(this.setLoginError);
    },
    renderError: function () {
        return this.state.loginError ? (
            <bootstrap.Alert
                bsStyle="danger"
                style={styles.errorAlert}
            >
                {"Login non riuscito: email o password errate"}
            </bootstrap.Alert>
        ) : null;
    },
    render: function () {
        return (
            <div>
                <div className="ac-login-modal-inputs" style={styles.inputs}>
                    <Radium.Style
                        rules={{
                            ".form-group": {
                                marginBottom: "0px",
                                border: "solid 1px " + color(colors.white).alpha(0.3).rgbString()
                            },
                            ".form-group div, .form-group span, .form-group input": {
                                border: "0px",
                                borderRadius: "0px !important",
                                boxShadow: "none",
                                background: color(colors.darkBlack).alpha(0.1).rgbString(),
                                color: colors.white
                            },
                            ".form-control:focus": {
                                boxShadow: "none"
                            },
                            "::-webkit-input-placeholder": {
                                color: color(colors.white).alpha(0.7).rgbString()
                            },
                            ":-moz-placeholder": { /* Firefox 18- */
                                color: color(colors.white).alpha(0.7).rgbString()
                            },
                            "::-moz-placeholder": {  /* Firefox 19+ */
                                color: color(colors.white).alpha(0.7).rgbString()
                            },
                            ":-ms-input-placeholder": {
                                color: color(colors.white).alpha(0.7).rgbString()
                            }<commit_msg>Fixed height of the input in the login-view<commit_after>var color     = require("color");
var Radium    = require("radium");
var React     = require("react");
var bootstrap = require("react-bootstrap");

var components = require("components");
var colors     = require("lib/colors_restyling");
var icons      = require("lib/icons_restyling");

var styles = {
    inputs: {
        borderRadius: "15px",
        overflow: "hidden",
        borderWidth: "1px",
        borderColor: color(colors.white).alpha(0.3).rgbString(),
        borderStyle: "solid",
        color: colors.white
    },
    loginButton: {
        background: colors.buttonPrimary,
        color: colors.white,
        height: "68px",
        width: "80%",
        margin: "auto",
        borderRadius: "30px",
        border: "0px none",
        fontSize: "22px"
    },
    errorAlert: {
        marginTop: "16px",
        textAlign: "center"
    }
};

var LoginView = React.createClass({
    propTypes: {
        asteroid: React.PropTypes.object.isRequired
    },
    getInitialState: function () {
        return {
            loginError: null
        };
    },
    setLoginError: function (error) {
        this.setState({
            loginError: error
        });
    },
    login: function () {
        var credentials = {
            email: this.refs.email.getValue(),
            password: this.refs.password.getValue()
        };
        this.setLoginError(null);
        this.props.asteroid.loginWithPassword(credentials).catch(this.setLoginError);
    },
    renderError: function () {
        return this.state.loginError ? (
            <bootstrap.Alert
                bsStyle="danger"
                style={styles.errorAlert}
            >
                {"Login non riuscito: email o password errate"}
            </bootstrap.Alert>
        ) : null;
    },
    render: function () {
        return (
            <div>
                <div className="ac-login-modal-inputs" style={styles.inputs}>
                    <Radium.Style
                        rules={{
                            ".form-group": {
                                marginBottom: "0px",
                                border: "solid 1px " + color(colors.white).alpha(0.3).rgbString()
                            },
                            ".form-group div, .form-group span, .form-group input": {
                                border: "0px",
                                borderRadius: "0px !important",
                                boxShadow: "none",
                                background: color(colors.darkBlack).alpha(0.1).rgbString(),
                                color: colors.white
                            },
                            ".form-control": {
                                height: "60px"
                            },
                            ".form-control:focus": {
                                boxShadow: "none"
                            },
                            "::-webkit-input-placeholder": {
                                color: color(colors.white).alpha(0.7).rgbString()
                            },
                            ":-moz-placeholder": { /* Firefox 18- */
                                color: color(colors.white).alpha(0.7).rgbString()
                            },
                            "::-moz-placeholder": {  /* Firefox 19+ */
                                color: color(colors.white).alpha(0.7).rgbString()
                            },
                            ":-ms-input-placeholder": {
                                color: color(colors.white).alpha(0.7).rgbString()
                            }
{'fraction_non_alphanumeric': 0.12146538515113525, 'fraction_numerical': 0.01030784231787157, 'mean_word_length': 1.1718088324258924, 'pattern_counts': {'":': 23, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1446420', 'n_tokens_mistral': 1832, 'n_tokens_neox': 1752, 'n_words': 318}