Skip to content

Commit

Permalink
Add closing notice to homepage UI
Browse files Browse the repository at this point in the history
  • Loading branch information
ukane-philemon committed Jan 2, 2022
1 parent 4c8a2c3 commit 6b4a5c2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ type config struct {
PoolEmail string `long:"poolemail" description:"Email address to for support inquiries"`
PoolFees float64 `long:"poolfees" description:"The per-ticket fees the user must send to the pool with their tickets"`
PoolLink string `long:"poollink" description:"URL for support inquiries such as forum, IRC, etc"`
NewVspLink string `long:"newvsplink" description:"URL to new vspd"`
RealIPHeader string `long:"realipheader" description:"The name of an HTTP request header containing the actual remote client IP address, typically set by a reverse proxy. An empty string (default) indicates to use net/Request.RemodeAddr."`
SMTPFrom string `long:"smtpfrom" description:"From address to use on outbound mail"`
SMTPHost string `long:"smtphost" description:"SMTP hostname/ip and port, e.g. mail.example.com:25"`
Expand Down
3 changes: 3 additions & 0 deletions controllers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ type Config struct {
PoolEmail string
PoolFees float64
PoolLink string
NewVspLink string
RealIPHeader string
MaxVotedTickets int
Description string
Expand Down Expand Up @@ -1195,6 +1196,8 @@ func (controller *MainController) Index(c web.C, r *http.Request) (string, int)
if controller.Cfg.ClosePool {
c.Env["IsClosed"] = true
c.Env["ClosePoolMsg"] = controller.Cfg.ClosePoolMsg
c.Env["NewVspLink"] = controller.Cfg.NewVspLink
c.Env["Designation"] = controller.Cfg.Designation
}
c.Env["Network"] = controller.Cfg.NetParams.Name
c.Env["PoolEmail"] = controller.Cfg.PoolEmail
Expand Down
8 changes: 6 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ func runMain(ctx context.Context) error {
cfg = loadedCfg
log.Infof("Network: %s", activeNetParams.Params.Name)

if cfg.ClosePool && cfg.NewVspLink == "" {
log.Warn("Config Warning: New vsp link is not set")
}

defer func() {
if logRotator != nil {
logRotator.Close()
Expand Down Expand Up @@ -107,6 +111,7 @@ func runMain(ctx context.Context) error {
PoolEmail: cfg.PoolEmail,
PoolFees: cfg.PoolFees,
PoolLink: cfg.PoolLink,
NewVspLink: cfg.NewVspLink,
RealIPHeader: cfg.RealIPHeader,
MaxVotedTickets: cfg.MaxVotedTickets,
Description: cfg.Description,
Expand Down Expand Up @@ -161,8 +166,7 @@ func runMain(ctx context.Context) error {

err = controller.RPCSync(ctx, application.DbMap)
if err != nil {
return fmt.Errorf("failed to sync the wallets: %v",
err)
return fmt.Errorf("failed to sync the wallets: %v", err)
}

// Set up web server routes
Expand Down
19 changes: 19 additions & 0 deletions views/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@
<div class="row mx-3">
<div class="col-md-6 col-12">
<div class="row">
{{ if .IsClosed}}
<div class="alert alert-danger">
<h4 class="alert-heading mb-3">
This Voting Service Provider is closed
</h4>
<p>
{{ .ClosePoolMsg }}
</p>
<p>
{{if not .NewVspLink}}
Visit <a href="https://decred.org/vsp/" class="alert-link" target="_blank" rel="noopener noreferrer">decred.org</a> to find a new VSP.
{{else}}
Visit the new <a href={{.NewVspLink}} class="alert-link" target="_blank" rel="noopener noreferrer">{{.Designation}}</a> to vote.
{{end}}
<br>
Visit <a href="https://blog.decred.org/2020/06/02/A-More-Private-Way-to-Stake/" class="alert-link" target="_blank" rel="noopener noreferrer">Decred’s Blog</a> to find out more about the migration to a new VSP implementation.
</p>
</div>
{{ end }}
<section class="block">
<div class="col-12 block__title">
<h1><span>Voting Service Provider Overview</span></h1>
Expand Down

0 comments on commit 6b4a5c2

Please sign in to comment.