-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: George J Padayatti <[email protected]>
- Loading branch information
1 parent
4c944d4
commit e6c74ed
Showing
4 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
internal/handler/v2/service/datasharing/service_show_data_sharing_ui.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package datasharing | ||
|
||
import ( | ||
"html/template" | ||
"net/http" | ||
) | ||
|
||
func ServiceShowDataSharingUiHandler(w http.ResponseWriter, r *http.Request) { | ||
// HTML template | ||
templateContent := ` | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Consent BB Data Sharing UI</title> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/gh/decentralised-dataexchange/bb-consent-data-sharing-ui/dist/consentBbDataSharingUi.css" | ||
/> | ||
</head> | ||
<body style="margin: 0px"> | ||
<div id="consentBbDataSharingUi"></div> | ||
<script | ||
data-element-id="consentBbDataSharingUi" | ||
id="consentBbDataSharingUi-script" | ||
src="https://cdn.jsdelivr.net/gh/decentralised-dataexchange/bb-consent-data-sharing-ui/dist/consentBbDataSharingUi.js" | ||
></script> | ||
<script> | ||
window.ConsentBbDataSharingUi(); | ||
</script> | ||
</body> | ||
</html> | ||
` | ||
|
||
// Parse the HTML template | ||
tmpl := template.New("my-template") | ||
tmpl, err := tmpl.Parse(templateContent) | ||
if err != nil { | ||
http.Error(w, err.Error(), http.StatusInternalServerError) | ||
return | ||
} | ||
|
||
// Execute the template with the data | ||
err = tmpl.Execute(w, nil) | ||
if err != nil { | ||
http.Error(w, err.Error(), http.StatusInternalServerError) | ||
return | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule config
updated
from 7c4ac2 to c3d8b2