aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCypher <cypher@server.ky>2023-09-29 14:18:30 -0500
committerCypher <cypher@server.ky>2023-09-29 14:28:34 -0500
commit9ae9a0451188b2e8c7c20e2461132a31a01f34bc (patch)
tree452632c100a9187a6543e3dff7de9ac764ecd94d
parentbd9b0b0b273a7ef759d193f7cedfd74ed76f19d0 (diff)
downloadlibrefund-9ae9a0451188b2e8c7c20e2461132a31a01f34bc.tar.xz
HTTP: fix static file location
Fix serving static files over http. Also remove redundant files from the asset/static directory.
-rw-r--r--asset/static/documentation.html47
-rw-r--r--asset/static/index.html5
-rw-r--r--asset/template/header.html.tmpl2
-rw-r--r--http/http.go10
4 files changed, 6 insertions, 58 deletions
diff --git a/asset/static/documentation.html b/asset/static/documentation.html
deleted file mode 100644
index 75e6fdb..0000000
--- a/asset/static/documentation.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<h2 id="about">About</h2>
-<p>Here you find a website collecting funds for a project. It allow
-users to collectively fund and influence the direction of this project
-using a form of <a href="https://snowdrift.coop">crowd matching</a> for
-iterative development.</p>
-<p>The items you see listed are project objectives its maintainer wants
-to work on. They may be concepts such as ‘Be more user friendly’ or
-‘Make better documentation’. A description, expire date, maximum funding
-amount, will be included. These are what you can contribute to. For
-example if you want better documentation, you can fund ‘Make better
-documentation’.</p>
-<p>When contributing, you are acting collectively with others to
-influence the project.</p>
-<p>As an example, imagine a popular free and open source software
-project you use. You like everything, but you wish it had better
-documentation.</p>
-<p>Going to its funding page, you find documentation listed as an
-objective. There are details about its funding status. It has $100
-contributed with a match factor of 80%. The $10 you want to give will
-unlock $8 total of contributions from others. A small portion of the $10
-will also be held to match future contributions by others.</p>
-<p>The project’s maintainer a few days later claims the objective and
-starts improving the documentation. Some of your money is refunded to
-you. This is the amount withheld for matching upcoming contributions.
-Its a small amount since we got close to the funding goal.</p>
-<p>Your contribution is worth more to you if others chip in. The less
-the goal is reached, the more you will be refunded.</p>
-<p>If for some reason the objective expires, or the maintainer cancels
-it, you should be refunded the full amount subject to transaction
-costs.</p>
-<p>There is a level of trust expected from the maintainer to follow
-through on his promises. Be sure to check his reputation and past
-performance if this is a concern.</p>
-<h2 id="faq">FAQ</h2>
-<ul>
-<li><p>How is a contribution split?</p>
-<p>The amount kept is in direct proportion to how close to the funding
-limit is reached. If the total amount raised is 25% of the objectives
-limit, then 25% is kept, and 75% is reserved for matching upcoming
-contributions.</p></li>
-<li><p>What should I do if I want an objective added to the project’s
-funding page?</p>
-<p>Most projects will have a point where its users congregate. Or an
-issue tracker on their project’s page. Try bringing up or discussing the
-concept there. Be careful to check beforehand to see if its been
-considered.</p></li>
-</ul>
diff --git a/asset/static/index.html b/asset/static/index.html
deleted file mode 100644
index 9e18ffa..0000000
--- a/asset/static/index.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<http>
-<body>
- Not Found
-</body>
-<http>
diff --git a/asset/template/header.html.tmpl b/asset/template/header.html.tmpl
index 6224346..dd03b6f 100644
--- a/asset/template/header.html.tmpl
+++ b/asset/template/header.html.tmpl
@@ -4,5 +4,5 @@
{{if .Title}}
<title>{{.Title}}</title>
{{end}}
- <link rel="stylesheet" type="text/css" href="{{.RootURL}}/style.css">
+ <link rel="stylesheet" type="text/css" href="{{.RootURL}}/static/style.css">
</head>
diff --git a/http/http.go b/http/http.go
index 31dd37d..789270a 100644
--- a/http/http.go
+++ b/http/http.go
@@ -119,6 +119,11 @@ func (h *HTTPServer) initRoutes() error {
return err
}
+ staticFiles, err := fs.Sub(librefund.AssetDir, "asset")
+ if err != nil {
+ return errors.New("setting embedded static assets: " + err.Error())
+ }
+
// Keep it consistent
h.router.StrictSlash(true)
@@ -134,11 +139,6 @@ func (h *HTTPServer) initRoutes() error {
h.router.HandleFunc("/project/{project}/transaction/{transactionID}", h.GetTransaction).Name("GetTransaction")
h.router.HandleFunc("/contribute/bitcoin", h.ContributeBitcoin).Name("ContributeBitcoin")
h.router.HandleFunc("/contribute/qrcode/{address}.png", h.WriteQRCode).Name("WriteQRCode")
-
- staticFiles, err := fs.Sub(librefund.AssetDir, "assets/static")
- if err != nil {
- return errors.New("setting embedded static assets: " + err.Error())
- }
h.router.PathPrefix("/static").Handler(http.FileServer(http.FS(staticFiles)))
return nil