mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2025-01-01 15:39:20 +00:00
Add docs links
This commit is contained in:
parent
8a4d83a73f
commit
82e7bc9d23
3 changed files with 21 additions and 1 deletions
|
@ -952,6 +952,12 @@ class ImportView(SecureAdminBaseView):
|
||||||
return self.render("import.html", form=form)
|
return self.render("import.html", form=form)
|
||||||
|
|
||||||
|
|
||||||
|
class DocsView(SecureAdminBaseView):
|
||||||
|
@expose("/", methods=["GET"])
|
||||||
|
def index(self):
|
||||||
|
return self.render("docs/admin.html")
|
||||||
|
|
||||||
|
|
||||||
adminSpace.add_view(StudentView(Student, db.session))
|
adminSpace.add_view(StudentView(Student, db.session))
|
||||||
adminSpace.add_view(PartStudentView(PartStudent, db.session))
|
adminSpace.add_view(PartStudentView(PartStudent, db.session))
|
||||||
adminSpace.add_view(GroupView(Group, db.session))
|
adminSpace.add_view(GroupView(Group, db.session))
|
||||||
|
@ -967,5 +973,6 @@ adminSpace.add_view(UserView(User, db.session))
|
||||||
adminSpace.add_view(RoleView(Role, db.session))
|
adminSpace.add_view(RoleView(Role, db.session))
|
||||||
adminSpace.add_view(ProgramView(Program, db.session))
|
adminSpace.add_view(ProgramView(Program, db.session))
|
||||||
adminSpace.add_view(ImportView(name="Import"))
|
adminSpace.add_view(ImportView(name="Import"))
|
||||||
|
adminSpace.add_view(DocsView(name="Docs"))
|
||||||
|
|
||||||
initActiveSemesterMenuLinks(adminSpace)
|
initActiveSemesterMenuLinks(adminSpace)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from flask import flash
|
from flask import flash
|
||||||
|
from flask_admin import expose
|
||||||
from flask_admin.contrib.sqla.fields import QuerySelectField, QuerySelectMultipleField
|
from flask_admin.contrib.sqla.fields import QuerySelectField, QuerySelectMultipleField
|
||||||
from flask_security import current_user
|
from flask_security import current_user
|
||||||
from sqlalchemy import and_
|
from sqlalchemy import and_
|
||||||
|
@ -7,7 +8,7 @@ from wtforms.fields import DateField
|
||||||
from wtforms.validators import NumberRange
|
from wtforms.validators import NumberRange
|
||||||
|
|
||||||
from advlabdb import assistantSpace, db
|
from advlabdb import assistantSpace, db
|
||||||
from advlabdb.customClasses import SecureAssistantModelView
|
from advlabdb.customClasses import SecureAssistantBaseView, SecureAssistantModelView
|
||||||
from advlabdb.exceptions import DataBaseException, ModelViewException
|
from advlabdb.exceptions import DataBaseException, ModelViewException
|
||||||
from advlabdb.models import (
|
from advlabdb.models import (
|
||||||
Appointment,
|
Appointment,
|
||||||
|
@ -151,6 +152,12 @@ class AssistantUserView(SecureAssistantModelView):
|
||||||
return User.id == current_user.id
|
return User.id == current_user.id
|
||||||
|
|
||||||
|
|
||||||
|
class AssistantDocsView(SecureAssistantBaseView):
|
||||||
|
@expose("/", methods=["GET"])
|
||||||
|
def index(self):
|
||||||
|
return self.render("docs/assistant.html")
|
||||||
|
|
||||||
|
|
||||||
assistantSpace.add_view(
|
assistantSpace.add_view(
|
||||||
AssistantAppointmentView(Appointment, db.session, endpoint="assistant_appointment", url="appointment")
|
AssistantAppointmentView(Appointment, db.session, endpoint="assistant_appointment", url="appointment")
|
||||||
)
|
)
|
||||||
|
@ -158,5 +165,6 @@ assistantSpace.add_view(
|
||||||
AssistantExperimentMarkView(ExperimentMark, db.session, endpoint="assistant_experimentmark", url="experimentmark")
|
AssistantExperimentMarkView(ExperimentMark, db.session, endpoint="assistant_experimentmark", url="experimentmark")
|
||||||
)
|
)
|
||||||
assistantSpace.add_view(AssistantUserView(User, db.session, endpoint="assistant_user", url="user"))
|
assistantSpace.add_view(AssistantUserView(User, db.session, endpoint="assistant_user", url="user"))
|
||||||
|
assistantSpace.add_view(AssistantDocsView(name="Docs", endpoint="assistant_docs", url="docs"))
|
||||||
|
|
||||||
initActiveSemesterMenuLinks(assistantSpace)
|
initActiveSemesterMenuLinks(assistantSpace)
|
||||||
|
|
|
@ -147,3 +147,8 @@ class SecureAssistantModelView(CustomModelView):
|
||||||
class SecureAdminBaseView(BaseView):
|
class SecureAdminBaseView(BaseView):
|
||||||
def is_accessible(self):
|
def is_accessible(self):
|
||||||
return adminViewIsAccessible()
|
return adminViewIsAccessible()
|
||||||
|
|
||||||
|
|
||||||
|
class SecureAssistantBaseView(BaseView):
|
||||||
|
def is_accessible(self):
|
||||||
|
return assistantViewIsAccessible()
|
||||||
|
|
Loading…
Reference in a new issue