Skip to content

Commit

Permalink
Add code to view on prod
Browse files Browse the repository at this point in the history
  • Loading branch information
code-geek committed Mar 7, 2024
1 parent d7f64c8 commit f56fb94
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions sde_collections/models/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ def server_url_test(self) -> str:
encoded_payload = urllib.parse.quote(json.dumps(payload))
return f"{base_url}/app/nasa-sba-smd/#/search?query={encoded_payload}"

@property
def server_url_prod(self) -> str:
base_url = "https://sciencediscoveryengine.nasa.gov"
payload = {
"name": "query-smd-primary",
"scope": "All",
"text": "",
"advanced": {
"collection": f"/SDE/{self.config_folder}/",
},
}
encoded_payload = urllib.parse.quote(json.dumps(payload))
return f"{base_url}/app/nasa-sba-smd/#/search?query={encoded_payload}"

@property
def curation_status_button_color(self) -> str:
color_choices = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<h1>{{ collection.name }}</h1>
</div>
<div class="col-md-6">

<a href="{{ collection.server_url_test }}" target="_blank" style="color:white"><button class="btn btn-primary btn-sm pull-right">View on test server</button></a>
<a href="{{ collection.server_url_test }}" target="_blank" style="color:white"><button class="btn btn-primary btn-sm pull-right">View on test</button></a>
<a href="{{ collection.server_url_prod }}" target="_blank" style="color:white"><button class="btn btn-primary btn-sm pull-right">View on prod</button></a>
</div>
</div>
<table class="table table-striped">
Expand Down

0 comments on commit f56fb94

Please sign in to comment.