);
}
diff --git a/js/components/header.js b/js/components/header.js
index 66984c62..15983e46 100644
--- a/js/components/header.js
+++ b/js/components/header.js
@@ -6,9 +6,7 @@ import Router from 'react-router';
import UserActions from '../actions/user_actions';
import UserStore from '../stores/user_store';
-import apiUrls from '../constants/api_urls.js';
-//import PieceListActions from '../actions/piece_list_actions';
-import requests from '../utils/requests';
+import Alt from '../alt';
import Nav from 'react-bootstrap/lib/Nav';
import Navbar from 'react-bootstrap/lib/Navbar';
@@ -16,8 +14,8 @@ import NavItem from 'react-bootstrap/lib/NavItem';
import DropdownButton from 'react-bootstrap/lib/DropdownButton';
import MenuItem from 'react-bootstrap/lib/MenuItem';
import MenuItemLink from 'react-router-bootstrap/lib/MenuItemLink';
+import NavItemLink from 'react-router-bootstrap/lib/NavItemLink';
-import LoginModal from '../components/ascribe_modal/modal_login';
import SignupModal from '../components/ascribe_modal/modal_signup';
@@ -26,7 +24,7 @@ import { getLangText } from '../utils/lang_utils';
let Link = Router.Link;
let Header = React.createClass({
- //mixins: [Router.Navigation],
+ mixins: [Router.Navigation],
getInitialState() {
return UserStore.getState();
@@ -41,17 +39,13 @@ let Header = React.createClass({
UserStore.unlisten(this.onChange);
},
handleLogout(){
- requests
- .get(apiUrls.users_logout)
- .then(this.refreshData);
+ UserActions.logoutCurrentUser();
+ Alt.flush();
},
onChange(state) {
this.setState(state);
},
- refreshData(){
- location.reload();
- },
render() {
let account = null;
let signup = null;
@@ -63,15 +57,12 @@ let Header = React.createClass({
-
+
);
}
else {
- account = (
- LOGIN}
- handleSuccess={this.refreshData}/>);
+ account = LOGIN;
signup = (
SIGNUP} />);
diff --git a/js/components/login_container.js b/js/components/login_container.js
new file mode 100644
index 00000000..97e8befb
--- /dev/null
+++ b/js/components/login_container.js
@@ -0,0 +1,83 @@
+'use strict';
+
+import React from 'react';
+import Router from 'react-router';
+
+import UserActions from '../actions/user_actions';
+import UserStore from '../stores/user_store';
+
+import GlobalNotificationModel from '../models/global_notification_model';
+import GlobalNotificationActions from '../actions/global_notification_actions';
+
+import Form from './ascribe_forms/form';
+import Property from './ascribe_forms/property';
+
+import apiUrls from '../constants/api_urls';
+
+
+let LoginContainer = React.createClass({
+ mixins: [Router.Navigation],
+
+ render() {
+ return (
+
+
+
+ Log in to ascribe...
+
+
+
+
+ );
+ }
+});
+
+
+let LoginForm = React.createClass({
+ mixins: [Router.Navigation],
+
+
+ handleSuccess(){
+ let notification = new GlobalNotificationModel('Login successsful', 'success', 10000);
+ GlobalNotificationActions.appendGlobalNotification(notification);
+ this.transitionTo('pieces');
+
+ },
+ render() {
+ return (
+
+ );
+ }
+});
+
+
+export default LoginContainer;
\ No newline at end of file
diff --git a/js/components/register_piece.js b/js/components/register_piece.js
index e1e1824f..d420d32b 100644
--- a/js/components/register_piece.js
+++ b/js/components/register_piece.js
@@ -9,7 +9,7 @@ import ReactS3FineUploader from 'ReactS3FineUploader';
let RegisterPiece = React.createClass( {
render() {
- console.log(AppConstants.serverUrl)
+
return (
diff --git a/js/components/signup_container.js b/js/components/signup_container.js
new file mode 100644
index 00000000..82ca0714
--- /dev/null
+++ b/js/components/signup_container.js
@@ -0,0 +1,114 @@
+'use strict';
+
+import React from 'react';
+import Router from 'react-router';
+
+
+import GlobalNotificationModel from '../models/global_notification_model';
+import GlobalNotificationActions from '../actions/global_notification_actions';
+
+import Form from './ascribe_forms/form';
+import Property from './ascribe_forms/property';
+import InputCheckbox from './ascribe_forms/input_checkbox';
+
+import apiUrls from '../constants/api_urls';
+
+
+let LoginContainer = React.createClass({
+ mixins: [Router.Navigation],
+
+ render() {
+ return (
+
+
+
+ Welcome to ascribe...
+
+
+
+ );
+ }
+});
+
+
+let LoginForm = React.createClass({
+ mixins: [Router.Navigation],
+
+
+ handleSuccess(){
+ let notification = new GlobalNotificationModel('Login successsful', 'success', 10000);
+ GlobalNotificationActions.appendGlobalNotification(notification);
+ this.transitionTo('pieces');
+
+ },
+ render() {
+ let tooltipPassword = 'Your password must be at least 10 characters.\n ' +
+ 'This password is securing your digital property like a bank account.\n ' +
+ 'Store it in a safe place!';
+ return (
+