Skip to content

Commit

Permalink
livescorecard cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
spderosso committed Sep 30, 2019
1 parent 432cbf3 commit 2599467
Show file tree
Hide file tree
Showing 28 changed files with 162 additions and 193 deletions.
7 changes: 2 additions & 5 deletions samples/livescorecard/dvconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@
"climbNumber": {
"type": "number"
},
"score": {
"points": {
"type": "number"
},
"category": {
"type": "string",
"enum": ["beginner", "intermediate", "advanced", "open"]
}
},
"required": ["climbNumber", "score", "category"]
"required": ["climbNumber", "points", "category"]
}
}
},
Expand Down Expand Up @@ -124,9 +124,6 @@
{ "path": "/host/competition-leaderboard", "component": "show-leaderboard" },
{ "path": "/host/competition-hosts", "component": "show-hosts" },
{ "path": "/host/competition-rules", "component": "show-rules" },
{ "path": "/host/edit-competition", "component": "edit-competition" },
{ "path": "/host/edit-participant", "component": "edit-participant" },
{ "path": "/host/edit-climb", "component": "edit-climb" },

{ "path": "/register", "component": "register" },

Expand Down
3 changes: 0 additions & 3 deletions samples/livescorecard/src/banner/banner.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.head {
color: white;
padding-bottom: 0.3em;
}

Expand All @@ -18,13 +17,11 @@
@media screen and (min-width: 495px) {
.head {
margin-top: -1.5em;
color: white;
}
}

@media screen and (max-width: 495px) {
.head {
margin-top: -2.5em;
color: white;
}
}
11 changes: 8 additions & 3 deletions samples/livescorecard/src/banner/banner.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ <h3>I am a ...</h3>

<div class="row">
<div class="offset-lg-4 col-lg-4 offset-lg-4 text-center">
<dv.link href="/login/host" class=$hostLogin ? "btn btn-outline-secondary choice active" : "btn btn-outline-secondary choice">
<dv.link href="/login/host" class=$hostLogin ?
"btn btn-outline-secondary choice active" :
"btn btn-outline-secondary choice">
Host
</dv.link>
<dv.link href="/login/climber" class=$climberLogin ? "btn btn-outline-secondary choice active" : "btn btn-outline-secondary choice">
<dv.link href="/login/climber" class=$climberLogin ?
"btn btn-outline-secondary choice active" :
"btn btn-outline-secondary choice">
Climber
</dv.link>
<dv.link href="/login/spectator" class=$spectatorLogin ? "btn btn-outline-secondary choice active" :
<dv.link href="/login/spectator" class=$spectatorLogin ?
"btn btn-outline-secondary choice active" :
"btn btn-outline-secondary choice">
Spectator
</dv.link>
Expand Down
6 changes: 3 additions & 3 deletions samples/livescorecard/src/climber-login/climber-login.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<dv.tx>
<competitionCode.sign-in class="full"
showOptionToSubmit=false
inputLabel="competition code"/>
inputLabel="Competition Code"/>
<climberCode.sign-in class="full"
showOptionToSubmit=false
inputLabel="climber code"/>
inputLabel="Climber Code"/>
<dv.button class="btn btn-success full">CLIMB!</dv.button>
<dv.callback defaultHref="/climber" onExecSuccess=true hidden=true />
<dv.link href="/climber" hidden=true />
</dv.tx>
</div>
</div>
Expand Down
22 changes: 18 additions & 4 deletions samples/livescorecard/src/create-climb/create-climb.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,27 @@
<div class="card">
<div class="card-body">
<dv.tx>
<dv.status savedText="New climb created" />
<dv.status showSavedText=false />
<dv.gen-id />
<div class="row">
<div class="col-5 col-3-input-fields">
<climb.create-object id=dv.gen-id.id
showOptionToSubmit=false />
<div class="col-3">
<climb.create-property as climbNumber name="climbNumber" />
</div>
<div class="col-3">
<climb.create-property as points name="points" />
</div>
<div class="col-3">
<climb.create-property as category name="category" />
</div>
<climb.create-object id=dv.gen-id.id
initialValue={
climbNumber: climbNumber.value,
points: points.value,
category: category.value
}
hidden=true />
<authorization.verify-can-view
resourceId=$competitionId principalId=$loggedInUserId hidden=true />
<hostAuthentication.authenticate id=$loggedInUserId hidden=true />

<task.create-tasks-for-assignees showOptionToInputDueDate=false
Expand Down
19 changes: 14 additions & 5 deletions samples/livescorecard/src/create-climber/create-climber.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
<div class="card">
<div class="card-body">
<dv.tx>
<dv.status savedText="Participant added to competition!" />
<dv.status showSavedText=false />
<dv.gen-id />
<div class="row">
<div class="offset-1 col-3">
<!-- Participant Name -->
<userProfile.create-object id=dv.gen-id.id
showOptionToSubmit=false />
</div>
<div class="col-4">
<climberProfile.create-object id=dv.gen-id.id
showOptionToSubmit=false />
<div class="col-2">
<climberProfile.create-property as sex class="prop" name="sex" />
</div>
<div class="col-2">
<climberProfile.create-property as category class="prop"
name="category" />
</div>
<div class="col-2 center">
<div class="offset-2 col-2">
<climberProfile.create-object id=dv.gen-id.id
initialValue={ sex: sex.value, category: category.value }
hidden=true />
<climberScore.create-score targetId=dv.gen-id.id
sourceId=$competitionId
value=0
Expand All @@ -26,6 +32,9 @@
<competitionClimbers.add-to-group id=$competitionId
memberId=dv.gen-id.id
hidden=true />
<authorization.verify-can-view
resourceId=$competitionId principalId=$loggedInUserId
hidden=true />
<hostAuthentication.authenticate id=$loggedInUserId hidden=true />

<dv.button class="add">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="card">
<div class="card-body">
<dv.tx>
<dv.status savedText="New competition created!" />
<dv.status showSavedText=false />
<dv.gen-id />
<div class="row">
<div class="col-3">
Expand All @@ -20,7 +20,7 @@
<!-- Competition Code -->
<competitionCode.create-passkey
id=dv.gen-id.id
inputLabel="comp code"
inputLabel="Competition Code"
signIn=false
showOptionToSubmit=false />
</div>
Expand Down
8 changes: 5 additions & 3 deletions samples/livescorecard/src/create-host/create-host.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@
<hostAuthentication.choose-user showChooseButton=false
chooseSelectPlaceholder="Choose Host" />
<dv.tx>
<dv.status savedText="New host added to the competition" />
<dv.status showSavedText=false />
<div class="row inline-block">
<competitionHosts.add-to-group id=$competitionId
memberId=hostAuthentication.choose-user.selectedUser?.id
hidden=true />
<authorization.add-viewer id=$competitionId
viewerId=hostAuthentication.choose-user.selectedUser?.id
hidden=true />
<authorization.verify-can-view
resourceId=$competitionId principalId=$loggedInUserId hidden=true />
<hostAuthentication.authenticate id=$loggedInUserId hidden=true />

<dv.button class="add right-shift">
<img src="assets/add.png" />
</dv.button>
<dv.callback defaultHref="/host/competition-hosts"
onExecSuccess=true hidden=true />
<dv.link href="/host/competition-hosts"
params={ competitionId: $competitionId } hidden=true />
</div>
</dv.tx>
</div>
Expand Down
Empty file.
9 changes: 0 additions & 9 deletions samples/livescorecard/src/edit-climb/edit-climb.html

This file was deleted.

Empty file.
15 changes: 0 additions & 15 deletions samples/livescorecard/src/edit-competition/edit-competition.html

This file was deleted.

Empty file.
15 changes: 0 additions & 15 deletions samples/livescorecard/src/edit-participant/edit-participant.html

This file was deleted.

8 changes: 2 additions & 6 deletions samples/livescorecard/src/host-login/host-login.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@
<div class="offset-lg-4 col-lg-4 offset-lg-4">
<hr class="user-form" />
<dv.tx>
<hostAuthentication.sign-in
class="full"
inputLabel="username"
passwordLabel="password"
buttonLabel="LOGIN" />
<dv.callback defaultHref="/host" onExecSuccess=true hidden=true />
<hostAuthentication.sign-in class="full" buttonLabel="LOGIN" />
<dv.link href="/host" hidden=true />
</dv.tx>
<p>Don't have an account? Sign up
<dv.link href="/register" class="link inline-block">here</dv.link>
Expand Down
7 changes: 2 additions & 5 deletions samples/livescorecard/src/register/register.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dv.component name="register">
<div class="host-register white-back">
<livescorecard.banner />
<livescorecard.banner hostLogin=true />
<div class="container text-center">
<div class="row">
<div class="offset-lg-4 col-lg-4 offset-lg-4">
Expand All @@ -11,12 +11,9 @@
showOptionToSubmit=false />

<hostAuthentication.register-user id=dv.gen-id.id
inputLabel="username"
passwordLabel="password"
retypePasswordLabel="confirm password"
showOptionToSubmit=false />
<dv.button class="btn btn-success full">REGISTER</dv.button>
<dv.callback defaultHref="/host" onExecSuccess=true hidden=true />
<dv.link href="/host" hidden=true />
</dv.tx>

<p class="register-sign-in">Already have an account? Sign in
Expand Down
6 changes: 3 additions & 3 deletions samples/livescorecard/src/show-climb/show-climb.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-2 center">
<div class="col-3">
<climb.show-object object=climb.show-object.loadedObject
showOnly=['climbNumber'] />
</div>
<div class="col-3 center">
<div class="col-3">
<climb.show-object object=climb.show-object.loadedObject
showOnly=['score'] />
showOnly=['points'] />
</div>
<div class="col-3">
<climb.show-object object=climb.show-object.loadedObject
Expand Down
25 changes: 16 additions & 9 deletions samples/livescorecard/src/show-climbers/show-climbers.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
<dv.component name="show-climbers">
<livescorecard.host-navbar />

<div class="container below-navbar">
<br />
<div class="row">
<div class="offset-1 col-3 center white">name</div>
<div class="col-2 center white">sex</div>
<div class="offset-1 col-3 white">name</div>
<div class="col-2 white">sex</div>
<div class="col-2 white">category</div>
<div class="col-2 white">code</div>
</div>

<livescorecard.create-climber
loggedInUserId=livescorecard.host-navbar.loggedInUserId
competitionId=$competitionId />

<competitionClimbers.show-members
inGroupId=$competitionId
noMembersText=""
showMember=<livescorecard.show-climber id=$id /> />
<dv.tx>
<hostAuthentication.authenticate
id=livescorecard.host-navbar.loggedInUserId waitOn=['id'] hidden=true />
<authorization.verify-can-view
resourceId=$competitionId
principalId=livescorecard.host-navbar.loggedInUserId
waitOn=['resourceId', 'principalId']
hidden=true />
<competitionClimbers.show-members
inGroupId=$competitionId
waitOn=['inGroupId']
noMembersText=""
showMember=<livescorecard.show-climber id=$id /> />
</dv.tx>
</div>
</dv.component>
25 changes: 16 additions & 9 deletions samples/livescorecard/src/show-climbs/show-climbs.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
<dv.component name="show-climbs">
<livescorecard.host-navbar />

<div class="container below-navbar">
<div class="row">
<div class="col-2 center white">name</div>
<div class="col-3 center white">points</div>
<div class="col-5 center white">category</div>
<div class="col-3 white">climb #</div>
<div class="col-3 white">points</div>
<div class="col-3 white">category</div>
</div>

<livescorecard.create-climb
competitionId=$competitionId
loggedInUserId=livescorecard.host-navbar.loggedInUserId />

<competitionClimbs.show-members inGroupId=$competitionId
noMembersText=""
showMember=<livescorecard.show-climb climbId=$id /> />
<dv.tx>
<hostAuthentication.authenticate
id=livescorecard.host-navbar.loggedInUserId waitOn=['id'] hidden=true />
<authorization.verify-can-view
resourceId=$competitionId
principalId=livescorecard.host-navbar.loggedInUserId
waitOn=['resourceId', 'principalId']
hidden=true />
<competitionClimbs.show-members inGroupId=$competitionId
waitOn=['inGroupId']
noMembersText=""
showMember=<livescorecard.show-climb climbId=$id /> />
</dv.tx>
</div>
</dv.component>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</span>
</div>
<div class="col-1">
<!-- Comeptition Leaderboard -->
<!-- Competition Leaderboard -->
<dv.link href="/host/competition-leaderboard"
params={ competitionId: $id, isHost: true }>
<img src="assets/leaderboardgray.png" class="trophy" />
Expand All @@ -46,7 +46,7 @@
<div class="col-1">
<!-- Competition Rules -->
<dv.link href="/host/competition-rules"
params={ competitionId: $id, isHost: true, canEdit: true }>
params={ competitionId: $id, isHost: true }>
<img src="assets/rules.png" class="hostcompentry" />
</dv.link>
</div>
Expand Down
Loading

0 comments on commit 2599467

Please sign in to comment.