Skip to content

Commit

Permalink
Merge branch 'master' into feature/adapt-2024-rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrobo committed May 4, 2024
2 parents 205aac8 + f0933c5 commit fde8a20
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rcj-scoring",
"version": "24.0.0-beta.18",
"version": "24.0.0-beta.19",
"copyright": "2016-2024 RCJ-CMS Development Team",
"private": true,
"scripts": {
Expand Down
3 changes: 1 addition & 2 deletions routes/api/lineRuns.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,12 @@ publicRouter.get('/:runid', async function (req, res, next) {
});
}

dbRun = dbRun.toObject();
if (authResult == 2) {
delete dbRun.comment;
delete dbRun.sign;
}

dbRun = dbRun.toObject();

// return normalized value
let rankingSettings = dbRun.competition.leagues.find(r => r.league == dbRun.team.league);
if (!rankingSettings) {
Expand Down
5 changes: 3 additions & 2 deletions routes/api/mazeRuns.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ publicRouter.get('/competition/:competitionId', function (req, res, next) {
err: err.message,
});
} else if (dbRuns) {
console.log("ABCD")
// Hide map and field from public
dbRuns.map(run => {
switch(auth.authViewRun(req.user, run, ACCESSLEVELS.NONE + 1, run.competition.preparation)) {
Expand Down Expand Up @@ -316,13 +317,13 @@ publicRouter.get('/:runid', function (req, res, next) {
msg: 'You have no authority to access this api!!',
});
}

dbRun = dbRun.toObject();
if (authResult == 2) {
delete dbRun.comment;
delete dbRun.sign;
}

dbRun = dbRun.toObject();

// return normalized value
let rankingSettings = dbRun.competition.leagues.find(r => r.league == dbRun.team.league);
if (normalized && competitiondb.NORMALIZED_RANKING_MODE.includes(rankingSettings.mode)) {
Expand Down
4 changes: 2 additions & 2 deletions routes/api/simRuns.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ publicRouter.get('/:runid', async function (req, res, next) {
ACCESSLEVELS.NONE + 1,
dbRun.competition.preparation
);

dbRun = dbRun.toObject();
if (authResult == 0) return res.status(401).send();
if (authResult == 2) {
delete dbRun.comment;
delete dbRun.sign;
}

dbRun = dbRun.toObject();

// return normalized value
let rankingSettings = dbRun.competition.leagues.find(r => r.league == dbRun.team.league);
if (normalized && competitiondb.NORMALIZED_RANKING_MODE.includes(rankingSettings.mode)) {
Expand Down
55 changes: 28 additions & 27 deletions views/view/line_2024E.pug
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,32 @@ html(ng-app="ddApp")
.d-sm-none
i.fas.fa-stopwatch.fa-2x(aria-hidden='true')
| : {{minutes}} {{'common.min' | translate}} {{seconds}} {{'common.sec' | translate}}
.row(style='margin:0 0 30 0;')
.col-md-12
#sign.card
h3.card-header
i.fas.fa-comment(aria-hidden='true')
| {{'line.view.comment' | translate}}
.card-body
p.card-text.text-info
| {{'line.view.comment_e' | translate}}
.form-group
textarea.form-control(ng-model='comment', rows='3', disabled='')
h3.card-header
i.fas.fa-pencil-alt(aria-hidden='true')
| {{'line.view.sign' | translate}}
.card-body
p.card-text.text-warning(translate='line.view.sign_e')
.sign-box.sign-box-cap
p.sign-box-title.sign-box-title-cap(translate='line.view.cap_sign')
img(ng-src='{{cap_sig}}', style='max-width: 100%;height: auto;')
hr
.sign-box.sign-box-ref
p.sign-box-title.sign-box-title-ref(translate='line.view.ref_sign')
img(ng-src='{{ref_sig}}', style='max-width: 100%;height: auto;')
hr
.sign-box.sign-box-ref
p.sign-box-title.sign-box-title-ref(translate='line.view.cref_sign')
img(ng-src='{{refas_sig}}', style='max-width: 100%;height: auto;')
if user
.row(style='margin:0 0 30 0;')
.col-md-12
#sign.card
h3.card-header
i.fas.fa-comment(aria-hidden='true')
| {{'line.view.comment' | translate}}
.card-body
p.card-text.text-info
| {{'line.view.comment_e' | translate}}
.form-group
textarea.form-control(ng-model='comment', rows='3', disabled='')
h3.card-header
i.fas.fa-pencil-alt(aria-hidden='true')
| {{'line.view.sign' | translate}}
.card-body
p.card-text.text-warning(translate='line.view.sign_e')
.sign-box.sign-box-cap
p.sign-box-title.sign-box-title-cap(translate='line.view.cap_sign')
img(ng-src='{{cap_sig}}', style='max-width: 100%;height: auto;')
hr
.sign-box.sign-box-ref
p.sign-box-title.sign-box-title-ref(translate='line.view.ref_sign')
img(ng-src='{{ref_sig}}', style='max-width: 100%;height: auto;')
hr
.sign-box.sign-box-ref
p.sign-box-title.sign-box-title-ref(translate='line.view.cref_sign')
img(ng-src='{{refas_sig}}', style='max-width: 100%;height: auto;')
include ../includes/footer

0 comments on commit fde8a20

Please sign in to comment.