Skip to content

Commit b35f73a

Browse files
committed
last change before converting to semantic ui
1 parent b4ce080 commit b35f73a

28 files changed

+3059
-87
lines changed

build/webpack.base.conf.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,24 @@ module.exports = {
3333
fallback: [path.join(__dirname, '../node_modules')]
3434
},
3535
module: {
36-
preLoaders: [
37-
{
38-
test: /\.vue$/,
39-
loader: 'eslint',
40-
include: [
41-
path.join(projectRoot, 'src')
42-
],
43-
exclude: /node_modules/
44-
},
45-
{
46-
test: /\.js$/,
47-
loader: 'eslint',
48-
include: [
49-
path.join(projectRoot, 'src')
50-
],
51-
exclude: /node_modules/
52-
}
53-
],
36+
// preLoaders: [
37+
// {
38+
// test: /\.vue$/,
39+
// // loader: 'eslint',
40+
// include: [
41+
// path.join(projectRoot, 'src')
42+
// ],
43+
// exclude: /node_modules/
44+
// },
45+
// {
46+
// test: /\.js$/,
47+
// loader: 'eslint',
48+
// include: [
49+
// path.join(projectRoot, 'src')
50+
// ],
51+
// exclude: /node_modules/
52+
// }
53+
// ],
5454
loaders: [
5555
{
5656
test: /\.vue$/,

index.html

+35
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,44 @@
33
<head>
44
<meta charset="utf-8">
55
<title>app</title>
6+
7+
<!-- Latest compiled and minified CSS -->
8+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
9+
10+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/themes/blue/pace-theme-minimal.min.css">
11+
12+
<!-- <link rel="stylesheet" href="https://bootswatch.com/spacelab/bootstrap.min.css"> -->
13+
14+
<link href="https://fonts.googleapis.com/css?family=Exo:300" rel="stylesheet">
15+
16+
17+
<link rel="stylesheet"
18+
href="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.css" />
19+
20+
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
21+
22+
<script type="text/javascript" src="//d3js.org/d3.v3.min.js"></script>
23+
<script type="text/javascript" src="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js"></script>
24+
<link rel="stylesheet" href="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.css" />
25+
26+
27+
28+
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"> -->
29+
30+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
631
</head>
732
<body>
833
<div id="app"></div>
934
<!-- built files will be auto injected -->
35+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
36+
37+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
38+
<script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/pace.min.js"></script>
39+
40+
41+
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
42+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script> -->
43+
44+
1045
</body>
1146
</html>

package.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@
77
"scripts": {
88
"dev": "node build/dev-server.js",
99
"build": "node build/build.js",
10+
"deploy": "aws s3 rm s3://omni-dev-spa --recursive && aws s3 sync ~/Desktop/app/dist/ s3://omni-dev-spa ",
1011
"lint": "eslint --ext .js,.vue src"
1112
},
1213
"dependencies": {
13-
"vue": "^2.1.0"
14+
"bootstrap": "^3.3.7",
15+
"cal-heatmap": "^3.6.2",
16+
"stripe": "^4.15.0",
17+
"vue": "^2.1.0",
18+
"vue-moment": "^2.0.2",
19+
"vue-resource": "^1.2.0",
20+
"vue-router": "^2.2.0",
21+
"vuex": "^2.1.2"
1422
},
1523
"devDependencies": {
1624
"autoprefixer": "^6.4.0",

src/App.vue

+11-14
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
<template>
2-
<div id="app">
3-
<img src="./assets/logo.png">
4-
<hello></hello>
2+
<div>
3+
<app-navbar></app-navbar>
4+
<router-view></router-view>
5+
<app-footer></app-footer>
56
</div>
67
</template>
7-
88
<script>
9-
import Hello from './components/Hello'
109
10+
import navbar from './components/navbar.vue'
11+
import footer from './components/footer.vue'
1112
export default {
1213
name: 'app',
1314
components: {
14-
Hello
15+
appNavbar: navbar,
16+
appFooter: footer
1517
}
1618
}
1719
</script>
1820

19-
<style>
20-
#app {
21-
font-family: 'Avenir', Helvetica, Arial, sans-serif;
22-
-webkit-font-smoothing: antialiased;
23-
-moz-osx-font-smoothing: grayscale;
24-
text-align: center;
25-
color: #2c3e50;
26-
margin-top: 60px;
21+
<style >
22+
a {
23+
color: #337ab7;
2724
}
2825
</style>

src/components/Hello.vue

-53
This file was deleted.

src/components/accounts/Login.vue

+148
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
<template lang="html">
2+
<div class="container">
3+
<div class="row">
4+
<div class="col-xs-6 col-xs-offset-3">
5+
<div class='login'>
6+
<h1 class='text-center'>Login to OmniBuilds</h1>
7+
<form>
8+
<div
9+
class="form-group has-feedback"
10+
:class="{
11+
'has-error': password.hasError || username.hasError
12+
}">
13+
<label for="username" class="control-label">Username</label>
14+
<input
15+
type="text"
16+
class="form-control"
17+
id="username"
18+
placeholder="Enter your username"
19+
v-model='username.data'
20+
>
21+
<span v-if='password.hasError || username.hasError' class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>
22+
<span
23+
<span
24+
v-if='username.hasError'
25+
class="help-block"
26+
>{{username.error}}
27+
</span>
28+
</div>
29+
<div
30+
class="form-group has-feedback"
31+
:class="{
32+
'has-error': password.hasError
33+
}"
34+
>
35+
<label for="password" class="control-label">Password</label>
36+
<input
37+
type="password"
38+
class="form-control"
39+
id="password"
40+
placeholder="Enter your password"
41+
v-model='password.data'
42+
>
43+
<span v-if='username.hasError || password.hasError' class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>
44+
<span
45+
<span
46+
v-if='password.hasError'
47+
class="help-block"
48+
>{{password.error}}
49+
</span>
50+
</div>
51+
<button
52+
type="submit"
53+
class="btn btn-primary"
54+
@click.prevent='submit'
55+
>Login
56+
</button>
57+
</form>
58+
<br>
59+
<router-link to='/accounts/reset'>Forgot Password</router-link>
60+
</div>
61+
</div>
62+
</div>
63+
</div>
64+
65+
</template>
66+
67+
<script>
68+
export default {
69+
name: 'Login',
70+
data () {
71+
return {
72+
username: {
73+
data: '',
74+
hasError: null,
75+
error: ''
76+
},
77+
password: {
78+
data: '',
79+
hasError: null,
80+
error: ''
81+
},
82+
user: {
83+
id: null,
84+
token: null,
85+
username: null
86+
}
87+
}
88+
},
89+
methods: {
90+
submit: function () {
91+
this.username.hasError = null
92+
this.password.hasError = null
93+
94+
if (this.username.data === '') {
95+
this.username.hasError = true
96+
this.username.error = 'You must enter a username'
97+
}
98+
99+
if (this.password.data === '') {
100+
this.password.hasError = true
101+
this.password.error = 'You must enter a password'
102+
}
103+
104+
if (this.username.hasError === null && this.password.hasError === null) {
105+
console.log('submitting login form')
106+
// create the payload object
107+
let login = {
108+
username: this.username.data,
109+
password: this.password.data
110+
}
111+
this.$http.post('rest-auth/login/', login).then(response => {
112+
console.log('Login successful')
113+
console.log(response)
114+
// get the token and user
115+
let payload = {
116+
user_id: response.body.user.pk,
117+
username: response.body.user.username,
118+
token: response.body.token,
119+
active: true
120+
}
121+
// store user in vuex store
122+
this.$store.commit('startSession', payload)
123+
// redirect to dashboard
124+
this.$router.push({ path: '/home' })
125+
}, response => {
126+
console.log('Error logging in user')
127+
console.log(response)
128+
if (typeof response.body.non_field_errors !== 'undefined') {
129+
this.password.hasError = true
130+
this.password.error = response.body.non_field_errors[0]
131+
}
132+
})
133+
}
134+
}
135+
}
136+
}
137+
</script>
138+
139+
<style lang="css">
140+
.login {
141+
padding: 1.5rem;
142+
margin-right: 0;
143+
margin-bottom: 0;
144+
margin-left: 0;
145+
border-width: .2rem;
146+
border: solid #f7f7f9;
147+
}
148+
</style>

0 commit comments

Comments
 (0)