Skip to content

Commit f0f8dc1

Browse files
authored
Merge pull request #28 from csesoc/dev
Version 0.9.0
2 parents 3f80da8 + 924e719 commit f0f8dc1

32 files changed

+2215
-77
lines changed

.eslintrc.js

+20-16
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
module.exports = {
2-
root: true,
3-
env: {
4-
node: true,
5-
},
6-
extends: [
7-
'plugin:vue/essential',
8-
'@vue/airbnb',
9-
],
10-
rules: {
11-
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12-
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
13-
'import/extensions': 'off'
14-
},
15-
parserOptions: {
16-
parser: 'babel-eslint',
17-
},
2+
root: true,
3+
env: {
4+
node: true,
5+
},
6+
extends: [
7+
'plugin:vue/essential',
8+
'@vue/airbnb',
9+
],
10+
rules: {
11+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
13+
'import/extensions': 'off',
14+
'max-len': ['error',
15+
{ code: 120, ignoreUrls: true
16+
}
17+
],
18+
},
19+
parserOptions: {
20+
parser: 'babel-eslint',
21+
},
1822
};

package.json

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
2-
"name": "27-1hoursite",
3-
"version": "0.1.0",
4-
"private": true,
5-
"scripts": {
6-
"serve": "vue-cli-service serve",
7-
"build": "vue-cli-service build",
8-
"lint": "vue-cli-service lint"
9-
},
10-
"dependencies": {
11-
"core-js": "^2.6.5",
12-
"vue": "^2.6.10",
13-
"vue-router": "^3.0.3",
14-
"vuetify": "^2.0.0"
15-
},
16-
"devDependencies": {
17-
"@vue/cli-plugin-babel": "^3.11.0",
18-
"@vue/cli-plugin-eslint": "^3.11.0",
19-
"@vue/cli-service": "^3.11.0",
20-
"@vue/eslint-config-airbnb": "^4.0.0",
21-
"babel-eslint": "^10.0.1",
22-
"eslint": "^5.16.0",
23-
"eslint-plugin-vue": "^5.0.0",
24-
"sass": "^1.17.4",
25-
"sass-loader": "^7.1.0",
26-
"vue-cli-plugin-vuetify": "^0.6.3",
27-
"vue-template-compiler": "^2.6.10",
28-
"vuetify-loader": "^1.2.2"
29-
}
2+
"name": "csesoc-website",
3+
"version": "0.9.0",
4+
"private": true,
5+
"scripts": {
6+
"serve": "vue-cli-service serve",
7+
"build": "vue-cli-service build",
8+
"lint": "vue-cli-service lint"
9+
},
10+
"dependencies": {
11+
"core-js": "^2.6.5",
12+
"vue": "^2.6.10",
13+
"vue-router": "^3.0.3",
14+
"vuetify": "^2.0.0"
15+
},
16+
"devDependencies": {
17+
"@vue/cli-plugin-babel": "^3.11.0",
18+
"@vue/cli-plugin-eslint": "^3.11.0",
19+
"@vue/cli-service": "^3.11.0",
20+
"@vue/eslint-config-airbnb": "^4.0.0",
21+
"babel-eslint": "^10.0.1",
22+
"eslint": "^5.16.0",
23+
"eslint-plugin-vue": "^5.0.0",
24+
"sass": "^1.17.4",
25+
"sass-loader": "^7.1.0",
26+
"vue-cli-plugin-vuetify": "^0.6.3",
27+
"vue-template-compiler": "^2.6.10",
28+
"vuetify-loader": "^1.2.2"
29+
}
3030
}

public/favicon.ico

157 KB
Binary file not shown.

public/index.html

+21-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7-
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8-
<title>Almanac</title>
9-
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
10-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
11-
</head>
12-
<body>
13-
<noscript>
14-
<strong>Sorry, this site needs JavaScript to be enabled to be shown.</strong>
15-
</noscript>
16-
<div id="app"></div>
17-
<!-- built files will be auto injected -->
18-
</body>
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
8+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
9+
<title>CSESoc</title>
10+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
11+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
12+
</head>
13+
14+
<body>
15+
<div id="fb-root"></div>
16+
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v5.0"></script>
17+
<noscript>
18+
<strong>Sorry, this site needs JavaScript to be enabled to be shown.</strong>
19+
</noscript>
20+
<div id="app"></div>
21+
<!-- built files will be auto injected -->
22+
</body>
23+
1924
</html>

server/category.go

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
package main
2+
3+
import (
4+
"context"
5+
"log"
6+
7+
"go.mongodb.org/mongo-driver/bson"
8+
"go.mongodb.org/mongo-driver/mongo"
9+
)
10+
11+
// GetCats - Retrieve a category from the database
12+
func GetCats(collection *mongo.Collection, id int, token string) Category {
13+
// if !validToken(token) {
14+
// return nil
15+
// }
16+
17+
var result Category
18+
filter := bson.D{{"categoryID", id}}
19+
20+
// Find a category
21+
err := collection.FindOne(context.TODO(), filter).Decode(&result)
22+
if err != nil {
23+
log.Fatal(err)
24+
}
25+
26+
return result
27+
}
28+
29+
// NewCats - Add a new category
30+
func NewCats(collection *mongo.Collection, catID int, index int, name string, token string) {
31+
// if !validToken(token) {
32+
// return
33+
// }
34+
35+
category := Category{
36+
categoryID: catID,
37+
categoryName: name,
38+
index: index,
39+
}
40+
41+
_, err := collection.InsertOne(context.TODO(), category)
42+
if err != nil {
43+
log.Fatal(err)
44+
}
45+
}
46+
47+
// PatchCats - Update a category with new information
48+
func PatchCats(collection *mongo.Collection, catID int, name string, index int, token string) {
49+
// if !validToken(token) {
50+
// return
51+
// }
52+
53+
filter := bson.D{{"categoryID", catID}}
54+
update := bson.D{
55+
{"$set", bson.D{
56+
{"categoryName", name},
57+
{"index", index},
58+
}},
59+
}
60+
61+
// Find a category by id and update it
62+
_, err := collection.UpdateOne(context.TODO(), filter, update)
63+
if err != nil {
64+
log.Fatal(err)
65+
}
66+
}
67+
68+
// DeleteCats - Delete a category from the database
69+
func DeleteCats(collection *mongo.Collection, id int, token string) {
70+
// if !validToken(token) {
71+
// return
72+
// }
73+
74+
filter := bson.D{{"categoryID", id}}
75+
76+
// Find a category by id and delete it
77+
_, err := collection.DeleteOne(context.TODO(), filter)
78+
if err != nil {
79+
log.Fatal(err)
80+
}
81+
}

server/go.mod

+15-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,18 @@ module csesoc.unsw.edu.au/m/v2
22

33
go 1.13
44

5-
require github.com/labstack/echo/v4 v4.1.10 // indirect
5+
require (
6+
github.com/dgrijalva/jwt-go v3.2.0+incompatible
7+
github.com/go-stack/stack v1.8.0 // indirect
8+
github.com/golang/snappy v0.0.1 // indirect
9+
github.com/google/go-cmp v0.3.1 // indirect
10+
github.com/google/uuid v1.1.1
11+
github.com/labstack/echo/v4 v4.1.10
12+
github.com/tidwall/pretty v1.0.0 // indirect
13+
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect
14+
github.com/xdg/stringprep v1.0.0 // indirect
15+
go.mongodb.org/mongo-driver v1.1.2
16+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
17+
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
18+
gopkg.in/ldap.v2 v2.5.1
19+
)

server/go.sum

+27
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
12
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3+
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
24
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
5+
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
6+
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
7+
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
8+
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
9+
github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
10+
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
11+
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
12+
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
313
github.com/labstack/echo/v4 v4.1.10 h1:/yhIpO50CBInUbE/nHJtGIyhBv0dJe2cDAYxc3V3uMo=
414
github.com/labstack/echo/v4 v4.1.10/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g=
515
github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=
@@ -9,23 +19,40 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc
919
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
1020
github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg=
1121
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
22+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1223
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1324
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
25+
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
1426
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
27+
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
28+
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
1529
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
1630
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
1731
github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8=
1832
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
33+
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk=
34+
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
35+
github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0=
36+
github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
37+
go.mongodb.org/mongo-driver v1.1.2 h1:jxcFYjlkl8xaERsgLo+RNquI0epW6zuy/ZRQs6jnrFA=
38+
go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
1939
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
2040
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc=
2141
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
2242
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
2343
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
44+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
45+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
2446
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
2547
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
2648
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
2749
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
2850
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
2951
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
52+
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM=
53+
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
3054
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
55+
gopkg.in/ldap.v2 v2.5.1 h1:wiu0okdNfjlBzg6UWvd1Hn8Y+Ux17/u/4nlk4CQr6tU=
56+
gopkg.in/ldap.v2 v2.5.1/go.mod h1:oI0cpe/D7HRtBQl8aTg+ZmzFUAvu4lsv3eLXMLGFxWk=
57+
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
3158
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

0 commit comments

Comments
 (0)