Fix accept cookie button and reestyle the reply button
parent
13b0821eef
commit
6e6eba2ca1
|
|
@ -1,11 +1,11 @@
|
||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/gorilla/sessions"
|
||||||
|
"html/template"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"github.com/gorilla/sessions"
|
|
||||||
"html/template"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func AboutHandler(app *App) http.HandlerFunc {
|
func AboutHandler(app *App) http.HandlerFunc {
|
||||||
|
|
@ -32,7 +32,7 @@ func AboutHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
AboutContent: template.HTML(aboutContent),
|
AboutContent: template.HTML(aboutContent),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/gorilla/sessions"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"threadr/models"
|
"threadr/models"
|
||||||
"github.com/gorilla/sessions"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func BoardHandler(app *App) http.HandlerFunc {
|
func BoardHandler(app *App) http.HandlerFunc {
|
||||||
|
|
@ -117,7 +117,7 @@ func BoardHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
Board: *board,
|
Board: *board,
|
||||||
Threads: threads,
|
Threads: threads,
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/gorilla/sessions"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"threadr/models"
|
"threadr/models"
|
||||||
"github.com/gorilla/sessions"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func BoardsHandler(app *App) http.HandlerFunc {
|
func BoardsHandler(app *App) http.HandlerFunc {
|
||||||
|
|
@ -105,7 +105,7 @@ func BoardsHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
PublicBoards: publicBoards,
|
PublicBoards: publicBoards,
|
||||||
PrivateBoards: privateBoards,
|
PrivateBoards: privateBoards,
|
||||||
|
|
|
||||||
|
|
@ -237,7 +237,7 @@ func ChatHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
ContentTemplate: "chat-content",
|
ContentTemplate: "chat-content",
|
||||||
BodyClass: "chat-page",
|
BodyClass: "chat-page",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/gorilla/sessions"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"github.com/gorilla/sessions"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func HomeHandler(app *App) http.HandlerFunc {
|
func HomeHandler(app *App) http.HandlerFunc {
|
||||||
|
|
@ -22,7 +22,7 @@ func HomeHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: filepath.Join(app.Config.ThreadrDir, "static"),
|
StaticPath: filepath.Join(app.Config.ThreadrDir, "static"),
|
||||||
CurrentURL: r.URL.String(),
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if err := app.Tmpl.ExecuteTemplate(w, "home", data); err != nil {
|
if err := app.Tmpl.ExecuteTemplate(w, "home", data); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ func LoginHandler(app *App) http.HandlerFunc {
|
||||||
LoggedIn: false,
|
LoggedIn: false,
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
Error: "",
|
Error: "",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/gorilla/sessions"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"threadr/models"
|
"threadr/models"
|
||||||
"github.com/gorilla/sessions"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewsHandler(app *App) http.HandlerFunc {
|
func NewsHandler(app *App) http.HandlerFunc {
|
||||||
|
|
@ -84,7 +84,7 @@ func NewsHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
News: newsItems,
|
News: newsItems,
|
||||||
IsAdmin: isAdmin,
|
IsAdmin: isAdmin,
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ func PreferencesHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: false,
|
ShowCookieBanner: false,
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
ContentTemplate: "preferences-content",
|
ContentTemplate: "preferences-content",
|
||||||
},
|
},
|
||||||
Preferences: prefs,
|
Preferences: prefs,
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/gorilla/sessions"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"threadr/models"
|
"threadr/models"
|
||||||
"github.com/gorilla/sessions"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func ProfileHandler(app *App) http.HandlerFunc {
|
func ProfileHandler(app *App) http.HandlerFunc {
|
||||||
|
|
@ -41,7 +41,7 @@ func ProfileHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: false,
|
ShowCookieBanner: false,
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
User: *user,
|
User: *user,
|
||||||
DisplayName: displayName,
|
DisplayName: displayName,
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ func ProfileEditHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: false,
|
ShowCookieBanner: false,
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
User: *user,
|
User: *user,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ func SignupHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
Error: "Passwords do not match. Please try again.",
|
Error: "Passwords do not match. Please try again.",
|
||||||
}
|
}
|
||||||
|
|
@ -56,7 +56,7 @@ func SignupHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
Error: "An error occurred during sign up. Please try again.",
|
Error: "An error occurred during sign up. Please try again.",
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +81,7 @@ func SignupHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
Error: "",
|
Error: "",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ func ThreadHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
ShowCookieBanner: cookie == nil || cookie.Value != "accepted",
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
Thread: *thread,
|
Thread: *thread,
|
||||||
Board: *board,
|
Board: *board,
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/gorilla/sessions"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"threadr/models"
|
"threadr/models"
|
||||||
"github.com/gorilla/sessions"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func UserHomeHandler(app *App) http.HandlerFunc {
|
func UserHomeHandler(app *App) http.HandlerFunc {
|
||||||
|
|
@ -36,7 +36,7 @@ func UserHomeHandler(app *App) http.HandlerFunc {
|
||||||
ShowCookieBanner: false,
|
ShowCookieBanner: false,
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.RequestURI(),
|
||||||
},
|
},
|
||||||
Username: user.Username,
|
Username: user.Username,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -551,6 +551,26 @@ p.thread-info {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chat-message .post-actions {
|
||||||
|
position: absolute;
|
||||||
|
top: -12px;
|
||||||
|
right: 0;
|
||||||
|
margin: 0;
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
background-color: #fef6e4;
|
||||||
|
border: 1px solid #001858;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 2px 4px;
|
||||||
|
z-index: 10;
|
||||||
|
transition: opacity 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-message:hover .post-actions {
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.chat-message-header {
|
.chat-message-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -622,20 +642,16 @@ p.thread-info {
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-message:hover .post-actions {
|
.chat-message .post-actions a {
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-actions a {
|
|
||||||
color: #001858;
|
color: #001858;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
padding: 2px 5px;
|
padding: 2px 5px;
|
||||||
border: 1px solid #001858;
|
border: none;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-actions a:hover {
|
.chat-message .post-actions a:hover {
|
||||||
background-color: #8bd3dd;
|
background-color: #8bd3dd;
|
||||||
color: #fef6e4;
|
color: #fef6e4;
|
||||||
}
|
}
|
||||||
|
|
@ -851,12 +867,16 @@ p.thread-info {
|
||||||
background-color: #555;
|
background-color: #555;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-actions a {
|
.chat-message .post-actions {
|
||||||
color: #fef6e4;
|
background-color: #444;
|
||||||
border-color: #fef6e4;
|
border-color: #fef6e4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-actions a:hover {
|
.chat-message .post-actions a {
|
||||||
|
color: #fef6e4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-message .post-actions a:hover {
|
||||||
background-color: #8bd3dd;
|
background-color: #8bd3dd;
|
||||||
color: #001858;
|
color: #001858;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue