Skip to content

Commit

Permalink
Merge pull request #248 from compute-tooling/v1-fixups
Browse files Browse the repository at this point in the history
1.0 Fixups
  • Loading branch information
hdoupe authored Jan 17, 2020
2 parents 8574fa0 + 628bf6a commit 1910a22
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Simulation/Description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export default class DescriptionComponent extends React.PureComponent<
: null}
{this.writable() ?
<Col className="col-sm-2 ml-sm-auto" style={{ paddingRight: 0 }}>
<Tip tip={`Make this simulation ${is_public ? "private" : "public"}.`}>
<Tip tip={`Make this simulation ${values.is_public ? "private" : "public"}.`}>
<Button variant="dark" style={{ backgroundColor: "rgba(60, 62, 62, 1)" }} className="mb-4 w-100" onClick={e => {
e.target.value = !values.is_public;
setFieldValue("is_public", !values.is_public);
Expand Down
12 changes: 11 additions & 1 deletion src/Simulation/Outputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,19 @@ export default class OutputsComponent extends React.Component<
);
})}
</Row>
<Row className="text-center">
<Col>
<a
href={`/${project.owner}/${project.title}/${remoteSim.model_pk}/download/`}
className="btn btn-lg btn-match-nav">
Download Results</a>

</Col>
</Row>

</Card.Body>
</Card>
</Card>
</Card >
);
}
}
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export interface AccessStatus {

export interface Project {
title: string;
owner: string;
oneliner: string;
description: string;
repo_url: string;
Expand Down
2 changes: 1 addition & 1 deletion static/js/sim.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions templates/comp/model.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ <h1 class="display-5">
aria-controls="project-desc-collapse">
README
</button>
{% if project_status == "live" or project_status == "updating" %}
<button class="btn btn-outline-success">live</button>
{% else %}
{% if project_status == "pending" %}
<button class="btn btn-outline-warning">pending</button>
{% endif %}
</div>
Expand Down
4 changes: 1 addition & 3 deletions webapp/apps/comp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
from webapp.settings import INPUTS_SALT


# TODO: Update to deploy date.
# (set to nye for testing)
# 11:59 tonight
# 11:59 on night of deployment
ANON_BEFORE = datetime.datetime(
2020, 1, 16, 23, 59, 59, tzinfo=pytz.timezone("US/Eastern")
)
Expand Down
3 changes: 2 additions & 1 deletion webapp/apps/comp/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class ModelPageView(InputsMixin, View):

def get(self, request, *args, **kwargs):
print("method=GET", request.GET, kwargs)
project = self.projects.get(
project = get_object_or_404(
self.projects,
owner__user__username__iexact=kwargs["username"],
title__iexact=kwargs["title"],
)
Expand Down

0 comments on commit 1910a22

Please sign in to comment.