aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-06-16 19:51:55 -0400
committerB. Stack <bgstack15@gmail.com>2023-08-31 11:03:56 -0400
commit66b9f932b978df28ff6e6feb89eb1e0f046bcfe6 (patch)
treea682f6a5861336efdf78d5ac6240e538ef4fa78e
parentchg: [dependencies] Updated Python dependencies. (diff)
downloadnewspipe-66b9f932b978df28ff6e6feb89eb1e0f046bcfe6.tar.gz
newspipe-66b9f932b978df28ff6e6feb89eb1e0f046bcfe6.tar.bz2
newspipe-66b9f932b978df28ff6e6feb89eb1e0f046bcfe6.zip
WIP: initial ldap supportstackrpms-branding
Still need schema support for attribute user.external_auth, probably of type bool. disallow ext-auth user to change nickname add better branding, and do not use git for version customize css
-rw-r--r--newspipe/controllers/user.py6
-rw-r--r--newspipe/static/css/custom.css72
-rw-r--r--newspipe/templates/about.html1
-rw-r--r--newspipe/templates/about_more.html2
-rw-r--r--newspipe/web/__init__.py11
-rw-r--r--newspipe/web/views/user.py1
-rw-r--r--newspipe/web/views/views.py4
7 files changed, 77 insertions, 20 deletions
diff --git a/newspipe/controllers/user.py b/newspipe/controllers/user.py
index 00ffb96a..c2501649 100644
--- a/newspipe/controllers/user.py
+++ b/newspipe/controllers/user.py
@@ -5,6 +5,7 @@ import ldap3
from ldap3.core.exceptions import LDAPBindError
from werkzeug.security import check_password_hash
from werkzeug.security import generate_password_hash
+from urllib.parse import urlparse
from .abstract import AbstractController
from newspipe.bootstrap import application
@@ -17,6 +18,11 @@ from newspipe.models import User
logger = logging.getLogger(__name__)
+# FOR LDAP
+# Reference: session_app
+import ldap3
+from ldap3.core.exceptions import LDAPBindError, LDAPPasswordIsMandatoryError
+
class UserController(AbstractController):
_db_cls = User
diff --git a/newspipe/static/css/custom.css b/newspipe/static/css/custom.css
index 70a24bf8..65625f0e 100644
--- a/newspipe/static/css/custom.css
+++ b/newspipe/static/css/custom.css
@@ -1,3 +1,13 @@
+:root {
+ /* primary color, for header bar, links, etc. */
+ --main-color: #bc0900;
+ /* right side of header bar, border around some buttons, button hover color */
+ --main-shade: #7f0600;
+ /* color of active button */
+ --main-tint: #ed0b00;
+ /* very light color, not used at present, but designed for the background of (2n+1) table rows */
+ --main-accent: #fcf5f4;
+}
html {
position: relative;
min-height: 100%;
@@ -11,8 +21,9 @@ body {
img {
padding: 2px;
}
-a {
- color: #3572B0;
+a, a.nav-link {
+ /*color: #3572B0;*/
+ color: var(--main-color);
}
#sidebar {
@@ -33,28 +44,55 @@ a {
rgb(255, 255, 255, 1);
}
+a:hover,a.nav-link:hover {
+ color: var(--main-shade);
+}
+
.bg-newspipe-blue {
/* background-color: #0082c9; */
- background-image: linear-gradient(40deg, #0082c9 0%, #30b6ff 100%);
+ /* background-image: linear-gradient(40deg, #0082c9 0%, #30b6ff 100%); */
+ background-image: linear-gradient(40deg, var(--main-color) 0%, var(--main-shade) 100%);
}
.btn-primary {
- background-color: #0082c9;
+ /* background-color: #0082c9; */
+ background-color: var(--main-color);
+ border-color: var(--main-shade);
opacity: 1;
color: white;
}
.btn-secondary {
- background-color: #0082c9;
+ /* background-color: #0082c9; */
+ background-color: var(--main-color);
opacity: 0.6;
color: white;
}
+.btn-primary:hover, .btn-secondary {
+ background-color: var(--main-shade);
+}
.btn-outline-primary {
- border-color: #0082c9;
- color: #0082c9;
+ /* border-color: #0082c9;
+ color: #0082c9; */
+ border-color: var(--main-color);
+ color: var(--main-color);
+}
+
+.btn-primary:hover {
+ border-color: var(--main-shade);
+}
+
+.btn-primary:active, .btn.btn-primary:active, .btn-secondary:active, a.btn.btn-primary:active {
+ background-color: var(--main-tint);
+ border: var(--main-tint);
+}
+
+.dropdown-item:active, a.dropdown-item:active {
+ background-color: var(--main-tint);
}
.bg-primary {
- background-color: #0082c9 !important;
+ /* background-color: #0082c9 !important; */
+ background-color: var(--main-color) !important;
opacity: 1;
color: white;
text-align: center;
@@ -63,7 +101,12 @@ a {
.badge-light {
background-color: rgb(246, 248, 250);
opacity: 1;
- color: #0082c9 !important;
+ /* color: #0082c9 !important; */
+ color: var(--main-color) !important;
+}
+
+.badge:hover {
+ color: var(--main-shade);
}
/* Main table for the list of news */
@@ -113,3 +156,14 @@ a {
.pagination-page-info {
display: inline;
}
+
+.fa-square-o::before, .fa-checked-square-o::before, .fa-star-o::before {
+ color: var(--main-color);
+}
+
+/*
+ * Unnecessary
+.table-striped tbody tr:nth-of-type(2n+1) {
+ background-color: var(--main-accent);
+}
+ */
diff --git a/newspipe/templates/about.html b/newspipe/templates/about.html
index 45703ea0..973c086e 100644
--- a/newspipe/templates/about.html
+++ b/newspipe/templates/about.html
@@ -12,6 +12,7 @@
<p>{{ _('Found a bug? Report it <a href="https://todo.sr.ht/~cedric/newspipe">here</a>.') }}
{{ _('A documentation is available <a href="https://man.sr.ht/~cedric/newspipe">here</a>.') }}</p>
<p><a href="{{ url_for('about_more') }}">{{ _('More information') }}</a> {{ _('about this instance.') }}</p>
+ <p><a href="{{ git_url }}">This fork's source</a></p>
</div>
</div>
<br />
diff --git a/newspipe/templates/about_more.html b/newspipe/templates/about_more.html
index 0df05852..6f01681f 100644
--- a/newspipe/templates/about_more.html
+++ b/newspipe/templates/about_more.html
@@ -5,7 +5,7 @@
<div class="col">
<h2>{{ _('Information about this instance') }}</h2>
<ul class="list-group">
- <li class="list-group-item">{{ _('Newspipe version') }}: <em><a href="{{ version_url }}">{{newspipe_version}}</a></em></li>
+ <li class="list-group-item">{{ _('Newspipe version') }}: <em>{{newspipe_version}}</em></li>
<li class="list-group-item">{{ _('Python version') }}: <em>{{python_version}}</em></li>
<li class="list-group-item">{{ _('Registration') }}: <em>{{registration}}</em></li>
<li class="list-group-item">{{ _('Number of users') }}: <em>{{nb_users}}</em></li>
diff --git a/newspipe/web/__init__.py b/newspipe/web/__init__.py
index 9cd78b88..cbda2235 100644
--- a/newspipe/web/__init__.py
+++ b/newspipe/web/__init__.py
@@ -10,11 +10,6 @@ import subprocess
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
-__version__ = (
- os.environ.get("PKGVER")
- or subprocess.run(
- ["git", "-C", BASE_DIR, "describe", "--tags"], stdout=subprocess.PIPE
- )
- .stdout.decode()
- .strip()
-)
+# bgstack15
+__version__ = "v9.5.1"
+__git_url__ = "https://bgstack15.ddns.net/cgit/newspipe"
diff --git a/newspipe/web/views/user.py b/newspipe/web/views/user.py
index 5f2240bc..6550403c 100644
--- a/newspipe/web/views/user.py
+++ b/newspipe/web/views/user.py
@@ -9,6 +9,7 @@ from flask_login import current_user
from flask_login import login_required
from flask_paginate import get_page_args
from flask_paginate import Pagination
+from werkzeug.exceptions import BadRequest
from newspipe.bootstrap import application
from newspipe.controllers import ArticleController
diff --git a/newspipe/web/views/views.py b/newspipe/web/views/views.py
index 3fc446e0..92724bb6 100644
--- a/newspipe/web/views/views.py
+++ b/newspipe/web/views/views.py
@@ -17,7 +17,7 @@ from newspipe.bootstrap import application
from newspipe.bootstrap import talisman
from newspipe.controllers import FeedController
from newspipe.controllers import UserController
-from newspipe.web import __version__
+from newspipe.web import __version__, __git_url__
from newspipe.web.lib.view_utils import etag_match
logger = logging.getLogger(__name__)
@@ -88,7 +88,7 @@ def popular():
@current_app.route("/about", methods=["GET"])
@etag_match
def about():
- return render_template("about.html", contact=application.config["ADMIN_EMAIL"])
+ return render_template("about.html", contact=application.config["ADMIN_EMAIL"], git_url=__git_url__)
@current_app.route("/about/more", methods=["GET"])
bgstack15