everywhere: use common html to generate footer
This commit is contained in:
		@@ -22,6 +22,7 @@ type staticAssetPlugs struct {
 | 
			
		||||
 | 
			
		||||
type staticHtmlPlugs struct {
 | 
			
		||||
	CdnPrefix string
 | 
			
		||||
	Footer    template.HTML
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func initStaticRouter(router *mux.Router) error {
 | 
			
		||||
@@ -80,6 +81,12 @@ func initStaticRouter(router *mux.Router) error {
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	footer, err := ioutil.ReadFile(os.Getenv("STATIC") + string(os.PathSeparator) + "footer.html")
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		logger.Errorf("cannot read file footer.html: %v", err)
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	pages := []string{
 | 
			
		||||
		"login",
 | 
			
		||||
		"forgot",
 | 
			
		||||
@@ -108,7 +115,7 @@ func initStaticRouter(router *mux.Router) error {
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		var buf bytes.Buffer
 | 
			
		||||
		t.Execute(&buf, &staticHtmlPlugs{CdnPrefix: os.Getenv("CDN_PREFIX")})
 | 
			
		||||
		t.Execute(&buf, &staticHtmlPlugs{CdnPrefix: os.Getenv("CDN_PREFIX"), Footer: template.HTML(string(footer))})
 | 
			
		||||
 | 
			
		||||
		html[page] = buf.String()
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										22
									
								
								frontend/footer.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								frontend/footer.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
<div class="footer">
 | 
			
		||||
  <div class="footer-inner">
 | 
			
		||||
    <div class="links">
 | 
			
		||||
      <div class="link-group">
 | 
			
		||||
        <div class="header">Your Installation</div>
 | 
			
		||||
        <a class="link" href="/login">Login</a>
 | 
			
		||||
        <a class="link" href="/signup">Signup</a>
 | 
			
		||||
        <a class="link" href="/dashboard">Dashboard</a>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="link-group">
 | 
			
		||||
        <div class="header">Documentation</div>
 | 
			
		||||
        <a class="link" href="https://docs.commento.io/">Documentation</a>
 | 
			
		||||
        <a class="link" href="https://gitlab.com/commento">Open Source</a>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="link-group">
 | 
			
		||||
        <div class="header">About</div>
 | 
			
		||||
        <a class="link" href="https://commento.io">About Commento</a>
 | 
			
		||||
        <a class="link" href="https://commento.io/help">Help</a>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -29,26 +29,5 @@
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="footer">
 | 
			
		||||
    <div class="footer-inner">
 | 
			
		||||
      <div class="links">
 | 
			
		||||
        <div class="link-group">
 | 
			
		||||
          <div class="header">Your Installation</div>
 | 
			
		||||
          <a class="link" href="/login">Login</a>
 | 
			
		||||
          <a class="link" href="/signup">Signup</a>
 | 
			
		||||
          <a class="link" href="/dashboard">Dashboard</a>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="link-group">
 | 
			
		||||
          <div class="header">Documentation</div>
 | 
			
		||||
          <a class="link" href="https://docs.commento.io/">Documentation</a>
 | 
			
		||||
          <a class="link" href="https://gitlab.com/commento">Open Source</a>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="link-group">
 | 
			
		||||
          <div class="header">About</div>
 | 
			
		||||
          <a class="link" href="https://commento.io">About Commento</a>
 | 
			
		||||
          <a class="link" href="https://commento.io/help">Help</a>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  <<<.Footer>>>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -47,26 +47,5 @@
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="footer">
 | 
			
		||||
    <div class="footer-inner">
 | 
			
		||||
      <div class="links">
 | 
			
		||||
        <div class="link-group">
 | 
			
		||||
          <div class="header">Your Installation</div>
 | 
			
		||||
          <a class="link" href="/login">Login</a>
 | 
			
		||||
          <a class="link" href="/signup">Signup</a>
 | 
			
		||||
          <a class="link" href="/dashboard">Dashboard</a>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="link-group">
 | 
			
		||||
          <div class="header">Documentation</div>
 | 
			
		||||
          <a class="link" href="https://docs.commento.io/">Documentation</a>
 | 
			
		||||
          <a class="link" href="https://gitlab.com/commento">Open Source</a>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="link-group">
 | 
			
		||||
          <div class="header">About</div>
 | 
			
		||||
          <a class="link" href="https://commento.io">About Commento</a>
 | 
			
		||||
          <a class="link" href="https://commento.io/help">Help</a>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  <<<.Footer>>>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -37,26 +37,5 @@
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="footer">
 | 
			
		||||
    <div class="footer-inner">
 | 
			
		||||
      <div class="links">
 | 
			
		||||
        <div class="link-group">
 | 
			
		||||
          <div class="header">Your Installation</div>
 | 
			
		||||
          <a class="link" href="/login">Login</a>
 | 
			
		||||
          <a class="link" href="/signup">Signup</a>
 | 
			
		||||
          <a class="link" href="/dashboard">Dashboard</a>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="link-group">
 | 
			
		||||
          <div class="header">Documentation</div>
 | 
			
		||||
          <a class="link" href="https://docs.commento.io/">Documentation</a>
 | 
			
		||||
          <a class="link" href="https://gitlab.com/commento">Open Source</a>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="link-group">
 | 
			
		||||
          <div class="header">About</div>
 | 
			
		||||
          <a class="link" href="https://commento.io">About Commento</a>
 | 
			
		||||
          <a class="link" href="https://commento.io/help">Help</a>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  <<<.Footer>>>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -59,26 +59,5 @@
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="footer">
 | 
			
		||||
    <div class="footer-inner">
 | 
			
		||||
      <div class="links">
 | 
			
		||||
        <div class="link-group">
 | 
			
		||||
          <div class="header">Your Installation</div>
 | 
			
		||||
          <a class="link" href="/login">Login</a>
 | 
			
		||||
          <a class="link" href="/signup">Signup</a>
 | 
			
		||||
          <a class="link" href="/dashboard">Dashboard</a>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="link-group">
 | 
			
		||||
          <div class="header">Documentation</div>
 | 
			
		||||
          <a class="link" href="https://docs.commento.io/">Documentation</a>
 | 
			
		||||
          <a class="link" href="https://gitlab.com/commento">Open Source</a>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="link-group">
 | 
			
		||||
          <div class="header">About</div>
 | 
			
		||||
          <a class="link" href="https://commento.io">About Commento</a>
 | 
			
		||||
          <a class="link" href="https://commento.io/help">Help</a>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  <<<.Footer>>>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user