minor fixes + update version number

This commit is contained in:
Yusur 2023-03-16 14:52:55 +01:00
parent 722ceb4724
commit 695a469092
2 changed files with 3 additions and 9 deletions

View file

@ -46,11 +46,6 @@ directory = /path/to/database/
+ You can now access Salvi in your browser at port 5000. + You can now access Salvi in your browser at port 5000.
## Caveats
+ All pages created are, as of now, viewable and editable by anyone, with no
trace of users and/or passwords.
## License ## License
[MIT License](./LICENSE). [MIT License](./LICENSE).

7
app.py
View file

@ -29,7 +29,7 @@ from configparser import ConfigParser
import i18n import i18n
import gzip import gzip
__version__ = '0.7-dev' __version__ = '0.7.0'
#### CONSTANTS #### #### CONSTANTS ####
@ -381,7 +381,7 @@ class PageLink(BaseModel):
def init_db(): def init_db():
database.create_tables([ database.create_tables([
Page, PageText, PageRevision, PageTag, PageProperty, PageLink User, Page, PageText, PageRevision, PageTag, PageProperty, PageLink
]) ])
#### WIKI SYNTAX #### #### WIKI SYNTAX ####
@ -454,7 +454,6 @@ login_manager = LoginManager(app)
login_manager.login_view = 'accounts_login' login_manager.login_view = 'accounts_login'
#### ROUTES #### #### ROUTES ####
@app.before_request @app.before_request
@ -487,13 +486,13 @@ def _inject_variables():
def _inject_user(userid): def _inject_user(userid):
return User[userid] return User[userid]
@app.template_filter() @app.template_filter()
def linebreaks(text): def linebreaks(text):
text = html.escape(text) text = html.escape(text)
text = text.replace("\n\n", '</p><p>').replace('\n', '<br />') text = text.replace("\n\n", '</p><p>').replace('\n', '<br />')
return Markup(text) return Markup(text)
@app.route('/') @app.route('/')
def homepage(): def homepage():
page_limit = _getconf("appearance","items_per_page",20,cast=int) page_limit = _getconf("appearance","items_per_page",20,cast=int)