From bf8ff67bdf372c78a35a86836b10d914f5a86362 Mon Sep 17 00:00:00 2001 From: Pavel Tatarskiy Date: Tue, 17 Sep 2024 22:00:23 +0300 Subject: [PATCH] add footer and dmca notice --- assets/src/js/app/layout.js | 2 +- serve.go | 4 ++++ services/web/helper.go | 5 ++++ services/web/legal/handler.go | 27 ++++++++++++++++++++++ templates/layouts/main.html | 41 ++++++++++++++++++++++++++++----- templates/partials/list.html | 2 +- templates/views/legal/dmca.html | 16 +++++++++++++ 7 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 services/web/legal/handler.go create mode 100644 templates/views/legal/dmca.html diff --git a/assets/src/js/app/layout.js b/assets/src/js/app/layout.js index 7f2046d..8e38223 100644 --- a/assets/src/js/app/layout.js +++ b/assets/src/js/app/layout.js @@ -17,7 +17,7 @@ import themeSelector from "../lib/themeSelector"; function onLoad() { themeSelector(document.querySelector('[data-toggle-theme]')); - document.body.style.display = 'block'; + document.body.style.display = 'flex'; hideProgress(); bindAsync({ async fetch(f, url, fetchParams) { diff --git a/serve.go b/serve.go index c21fd27..1e4ebe9 100644 --- a/serve.go +++ b/serve.go @@ -3,6 +3,7 @@ package main import ( "github.com/webtor-io/web-ui-v2/services/web/donate" "github.com/webtor-io/web-ui-v2/services/web/ext" + "github.com/webtor-io/web-ui-v2/services/web/legal" "github.com/webtor-io/web-ui-v2/services/web/tests" "net/http" @@ -161,6 +162,9 @@ func serve(c *cli.Context) error { // Setting ApiClaimsHandler sapi.RegisterHandler(r) + // Setting Legal + legal.RegisterHandler(r, tm) + // Setting ResourceHandler wr.RegisterHandler(r, tm, sapi, jobs) diff --git a/services/web/helper.go b/services/web/helper.go index 94f3789..d2e0ba9 100644 --- a/services/web/helper.go +++ b/services/web/helper.go @@ -10,6 +10,7 @@ import ( "os" "reflect" "strings" + "time" "github.com/gin-gonic/gin" "github.com/urfave/cli" @@ -168,3 +169,7 @@ func NewAssetHashes(path string) *AssetHashes { path: path, } } + +func (s *Helper) Now() time.Time { + return time.Now() +} diff --git a/services/web/legal/handler.go b/services/web/legal/handler.go new file mode 100644 index 0000000..3c6e96b --- /dev/null +++ b/services/web/legal/handler.go @@ -0,0 +1,27 @@ +package legal + +import ( + "net/http" + + "github.com/gin-gonic/gin" + "github.com/webtor-io/web-ui-v2/services/template" +) + +type Handler struct { + tb template.Builder +} + +func RegisterHandler(r *gin.Engine, tm *template.Manager) { + h := &Handler{ + tb: tm.MustRegisterViews("legal/**/*").WithLayout("main"), + } + + r.GET("/legal/*template", h.get) +} + +type Data struct { +} + +func (s *Handler) get(c *gin.Context) { + s.tb.Build("legal"+c.Param("template")).HTML(http.StatusOK, c, &Data{}) +} diff --git a/templates/layouts/main.html b/templates/layouts/main.html index 6a02b48..f6aaf77 100644 --- a/templates/layouts/main.html +++ b/templates/layouts/main.html @@ -19,21 +19,50 @@ {{- end }} {{- template "head_extra" . }} - +
-
+
{{ template "main" . }}
-
- - -
+
+
+
+
+
+ +
+ +
+
diff --git a/templates/partials/list.html b/templates/partials/list.html index ef19bc7..08cbbc6 100644 --- a/templates/partials/list.html +++ b/templates/partials/list.html @@ -22,7 +22,7 @@ {{ else if and (not $Args.File) (eq .Type "directory") }}
  • {{ .Name }}
  • {{ else if and ($Item) (eq .PathStr $Item.PathStr) }} -
  • # {{ .Name }}
  • +
  • > {{ .Name }}
  • {{ else }}
  • {{ .Name }}
  • {{ end }} diff --git a/templates/views/legal/dmca.html b/templates/views/legal/dmca.html new file mode 100644 index 0000000..8523115 --- /dev/null +++ b/templates/views/legal/dmca.html @@ -0,0 +1,16 @@ +{{ define "main" }} +

    DMCA

    +

    Webtor.io respects the intellectual property of others. Webtor.io takes matters of Intellectual Property very seriously and is committed to meeting the needs of content owners while helping them manage publication of their content online.

    +

    It should be noted that Webtor.io is a simple search engine of videos available at a wide variety websites. + If you believe that your copyrighted work has been copied in a way that constitutes copyright infringement and is accessible on this site, you may notify our copyright agent, as set forth in the Digital Millennium Copyright Act of 1998 (DMCA). For your complaint to be valid under the DMCA, you must provide the following information when providing notice of the claimed copyright infringement:

    +

    A physical or electronic signature of a person authorized to act on behalf of the copyright owner Identification of the copyrighted work claimed to have been infringed + Identification of the material that is claimed to be infringing or to be the subject of the infringing activity and that is to be removed + Information reasonably sufficient to permit the service provider to contact the complaining party, such as an address, telephone number, and, if available, an electronic mail address + A statement that the complaining party "in good faith believes that use of the material in the manner complained of is not authorized by the copyright owner, its agent, or law" + A statement that the "information in the notification is accurate", and "under penalty of perjury, the complaining party is authorized to act on behalf of the owner of an exclusive right that is allegedly infringed" + The above information must be submitted as a written, faxed or emailed notification to the following Designated Agent:

    +

    Attn: DMCA Office

    +

    Contact Us : {{ domain }}/support

    +

    WE CAUTION YOU THAT UNDER FEDERAL LAW, IF YOU KNOWINGLY MISREPRESENT THAT ONLINE MATERIAL IS INFRINGING, YOU MAY BE SUBJECT TO HEAVY CIVIL PENALTIES. THESE INCLUDE MONETARY DAMAGES, COURT COSTS, AND ATTORNEYS FEES INCURRED BY US, BY ANY COPYRIGHT OWNER, OR BY ANY COPYRIGHT OWNER'S LICENSEE THAT IS INJURED AS A RESULT OF OUR RELYING UPON YOUR MISREPRESENTATION. YOU MAY ALSO BE SUBJECT TO CRIMINAL PROSECUTION FOR PERJURY.

    +

    This information should not be construed as legal advice, for further details on the information required for valid DMCA notifications, see 17 U.S.C. 512(c)(3).

    +{{ end }}