File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
sde_indexing_helper/templates/sde_collections Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change
1
+ import json
2
+ import urllib .parse
3
+
1
4
from django .contrib .auth import get_user_model
2
5
from django .db import models
3
6
from slugify import slugify
@@ -91,6 +94,20 @@ class Meta:
91
94
verbose_name = "Collection"
92
95
verbose_name_plural = "Collections"
93
96
97
+ @property
98
+ def server_url_test (self ) -> str :
99
+ base_url = "https://sciencediscoveryengine.test.nasa.gov"
100
+ payload = {
101
+ "name" : "query-smd-primary" ,
102
+ "scope" : "All" ,
103
+ "text" : "" ,
104
+ "advanced" : {
105
+ "collection" : f"/SMD/{ self .config_folder } /" ,
106
+ },
107
+ }
108
+ encoded_payload = urllib .parse .quote (json .dumps (payload ))
109
+ return f"{ base_url } /app/nasa-sba-smd/#/search?query={ encoded_payload } "
110
+
94
111
@property
95
112
def curation_status_button_color (self ) -> str :
96
113
color_choices = {
Original file line number Diff line number Diff line change 9
9
{% endblock stylesheets %}
10
10
{% block content %}
11
11
< br >
12
- < h1 > {{ collection.name }}</ h1 >
12
+ < div class ="row ">
13
+ < div class ="col-md-6 ">
14
+
15
+ < h1 > {{ collection.name }}</ h1 >
16
+ </ div >
17
+ < div class ="col-md-6 ">
18
+
19
+ < 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 >
20
+ </ div >
21
+ </ div >
13
22
< table class ="table table-striped ">
14
23
< tbody >
15
24
< tr >
You can’t perform that action at this time.
0 commit comments