Commit graph

5342 commits

Author SHA1 Message Date
Neo
c91d5733b1 Fix immutable cursor issue
Address the issue of using an immutable cursor in the file
flaskr/blog.py. The previous implementation attempted to modify
the 'posts' object, which is immutable, leading to runtime
errors. This commit refactors the code to ensure that the
cursor is handled correctly, preventing any attempts to modify
immutable objects. This change resolves the problem by
introducing a mutable data structure to store the necessary
information, thereby maintaining the integrity of the cursor
and avoiding potential errors.
2024-09-09 21:45:36 +00:00
Neo
1d2f1348a4 Add markdown support to post body
Implemented markdown support in the post body to enhance the
editor's functionality. The main blog view now renders markdown
content as HTML. This change allows users to format their posts
using markdown syntax, providing a richer text editing experience.

- Imported the markdown module in blog.py.
- Converted post bodies from markdown to HTML in the index view.
- Updated templates to indicate markdown support in the post body
  field.
- Ensured safe rendering of HTML content in the blog index view.

Fixes #FLAS-29
2024-09-09 21:36:16 +00:00
Jose Palazon
56009a2934 html toggle dark mode 2024-09-09 18:16:56 +01:00
Jose Palazon
2cfef90647 remove workflows 2024-09-09 18:01:28 +01:00
Jose Palazon
467f80faee html dark mode 2024-09-09 17:58:15 +01:00
Jose Palazon
9fa696d5a9 a human touch 2024-09-06 12:36:42 +01:00
Neo
ab02397494 Update font family to FontAwesome
This commit updates the font family in the file
flaskr/static/style.css to FontAwesome as per the
review comment. The previous font family was not
rendering the icons correctly, leading to visual
inconsistencies. By switching to FontAwesome, we
ensure that the icons are displayed as intended.

Additionally, the icon previously set in the
background has been removed to avoid duplication
and potential rendering issues. This change
simplifies the styling and aligns with the
reviewer's feedback.
2024-09-06 12:36:42 +01:00
Neo
8b0b9d259c Fix icon placement in toggle
This commit addresses the issue where the icon was incorrectly
placed in the center of the toggle's background. The icon should
be positioned inside the circle part that moves with the toggle.
This change ensures that the icon moves along with the toggle,
providing a more intuitive and visually consistent user
experience.
2024-09-06 12:36:42 +01:00
Neo
3c2dae6bd6 Fix dark mode icon placement
This commit addresses the issue of incorrect dark mode icon
placement in the toggle button. Previously, the moon and sun
icons were displayed in the background, which was not the
desired behavior. The icons are now correctly placed inside
the circle of the toggle button.

Changes include:
- Updated CSS to center icons within the toggle button.
- Adjusted HTML to ensure the correct icon is displayed based
  on the current theme.
- Modified JavaScript to toggle icons appropriately when
the theme changes.

These changes improve the visual consistency and user
experience of the dark mode toggle.

Fixes #FLAS-5
2024-09-06 12:36:42 +01:00
Neo
e0b8f34770 Improve dark mode styling
This commit addresses the issue of improper dark mode implementation.
The background of all pages and form elements in dark mode were
previously displayed in white, which has now been corrected. The
background for input and textarea elements is set to a darker shade
in dark mode, ensuring consistency with the overall theme.

Additionally, the toggle button for switching themes has been
redesigned to resemble iPhone-style toggles, replacing the previous
square button. This enhances the user interface and provides a more
intuitive experience when toggling between light and dark modes.

Fixes #FLAS-3
2024-09-06 12:36:25 +01:00
Neo
8c57553ada Add dark mode support
Implemented dark mode across all pages, allowing users to toggle
between light and dark themes. The default theme is determined by
the operating system or browser settings. A toggle button in the
navigation bar enables users to switch themes, using sun and moon
icons from Font Awesome. User preferences are stored in cookies
and local storage to ensure consistency across sessions and pages.

The changes include:
- Added a before_request function to load theme preference from
  cookies or set a default based on user agent.
- Updated CSS to support dark mode styling.
- Modified base.html to include a theme toggle button and
  corresponding JavaScript for theme switching.

Fixes #FLAS-2
2024-09-06 12:35:40 +01:00
Neo
206f4f4d72 Update font to sans-serif
This commit updates the font style in the file flaskr/static/style.css
to include sans-serif. This change was made in response to a pull
request review comment suggesting that the font should also be
sans-serif. The update ensures consistency in the font style across
the application, enhancing the overall visual appearance and
readability.
2024-09-06 12:35:40 +01:00
Neo
fe88d941ee Update font to Roboto
Replace the previously used font in the style.css file with
Roboto. The original font was not widely supported across
different platforms and browsers, which could lead to
inconsistent user experiences. By switching to Roboto, we
ensure better compatibility and a more uniform appearance
for users accessing the application.
2024-09-06 12:35:40 +01:00
Neo
a5b289e120 Update site to Material design
This commit updates the entire site to follow Material design
guidelines, providing a more modern look and feel. The font has
been changed to 'Roboto' and 'Roboto Slab' for a cleaner
typography. The color scheme has been adjusted to match the
provided palette, enhancing the visual appeal and consistency
across the site.

Additional changes include:
- Updated background and text colors for better contrast.
- Added box shadows and border-radius for a softer appearance.
- Improved button styling with hover effects for better
  interactivity.

These changes aim to improve user experience by aligning with
current design standards and making the interface more
intuitive and visually appealing.

Fixes #FLAS-4
2024-09-06 12:35:40 +01:00
Jose Palazon
28d50f431a instance to /tmp 2024-09-06 10:23:15 +01:00
Jose Palazon
127440c727 I just want the tutorial 2024-09-06 00:18:20 +01:00
David Lord
2fec0b206c
set up pre-commit lite workflow
Committed via https://github.com/asottile/all-repos
2024-09-01 09:04:14 -07:00
David Lord
111e5bd312
set up pre-commit lite workflow
Committed via https://github.com/asottile/all-repos
2024-09-01 08:48:02 -07:00
David Lord
db49548d71
set up pre-commit lite workflow
Committed via https://github.com/asottile/all-repos
2024-09-01 08:32:27 -07:00
David Lord
f93dd6e826
remove pre-commit.ci update 2024-08-23 18:05:21 -07:00
David Lord
7e53070307
Merge branch '3.0.x' 2024-08-23 17:20:31 -07:00
David Lord
c77b099cbb
remove min python for pip-compile 2024-08-23 17:18:38 -07:00
David Lord
eeb5f95a0f
Merge branch '3.0.x' 2024-08-23 16:41:53 -07:00
David Lord
40b78fa2ea
fix min python for pip-compile 2024-08-23 16:41:39 -07:00
David Lord
4e6384da32
Merge branch '3.0.x' 2024-08-23 16:34:57 -07:00
David Lord
2c5d652493
remove unused config 2024-08-23 16:33:59 -07:00
David Lord
176fdfa000
fix mypy findings 2024-08-23 16:33:52 -07:00
David Lord
2d31dce826
remove dependabot 2024-08-23 16:33:40 -07:00
David Lord
29a94bd102
update dev dependencies 2024-08-23 16:33:27 -07:00
David Lord
0f2ae2b933
add gha-update 2024-08-23 16:33:00 -07:00
David Lord
8a6cdf1e2a
[pre-commit.ci] pre-commit autoupdate (#5541) 2024-08-06 08:31:00 -07:00
pre-commit-ci[bot]
326ad3f43c
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.5.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.0...v0.5.6)
2024-08-05 23:09:19 +00:00
David Lord
a791997041
Bump the github-actions group with 3 updates (#5539) 2024-08-03 07:28:45 -07:00
dependabot[bot]
4fe0aebab7
Bump the github-actions group with 3 updates
Bumps the github-actions group with 3 updates: [actions/setup-python](https://github.com/actions/setup-python), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact).


Updates `actions/setup-python` from 5.1.0 to 5.1.1
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](82c7e631bb...39cd14951b)

Updates `actions/upload-artifact` from 4.3.3 to 4.3.4
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](65462800fd...0b2256b8c0)

Updates `actions/download-artifact` from 4.1.7 to 4.1.8
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](65a9edc588...fa0a91b85d)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 15:48:34 +00:00
David Lord
a8956feba1
Add encoding parameter to open resource (#5526) 2024-07-10 19:16:46 -07:00
David Lord
28d5a4d718
add encoding parameter to open_resource
co-authored-by: mark <lopkophacked@protonmail.com>
2024-07-10 19:14:06 -07:00
David Lord
5353f306fe
Update waitress.rst (#5522) 2024-07-10 18:08:49 -07:00
Amirreza A
321bd74b95
Update waitress.rst
fixed a small typo
2024-07-10 18:06:15 -07:00
David Lord
66af0e55ef
[pre-commit.ci] pre-commit autoupdate (#5517) 2024-07-02 04:17:59 -07:00
pre-commit-ci[bot]
3d357273b5
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.7 → v0.5.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.7...v0.5.0)
2024-07-02 00:15:33 +00:00
David Lord
926ab92118
Bump the python-requirements group in /requirements with 5 updates (#5514) 2024-07-01 16:14:08 -07:00
David Lord
088b58dbce
Bump the github-actions group with 2 updates (#5516) 2024-07-01 12:47:02 -07:00
dependabot[bot]
7621b3d96a
Bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `actions/checkout` from 4.1.6 to 4.1.7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](a5ac7e51b4...692973e3d9)

Updates `pypa/gh-action-pypi-publish` from 1.8.14 to 1.9.0
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](81e9d935c8...ec4db0b4dd)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 15:56:20 +00:00
dependabot[bot]
e165f3aef4
Bump the python-requirements group in /requirements with 5 updates
Bumps the python-requirements group in /requirements with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [cryptography](https://github.com/pyca/cryptography) | `42.0.7` | `42.0.8` |
| [mypy](https://github.com/python/mypy) | `1.10.0` | `1.10.1` |
| [pyright](https://github.com/RobertCraigie/pyright-python) | `1.1.365` | `1.1.369` |
| [pytest](https://github.com/pytest-dev/pytest) | `8.2.1` | `8.2.2` |
| [tox](https://github.com/tox-dev/tox) | `4.15.0` | `4.15.1` |


Updates `cryptography` from 42.0.7 to 42.0.8
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/42.0.7...42.0.8)

Updates `mypy` from 1.10.0 to 1.10.1
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.10.0...v1.10.1)

Updates `pyright` from 1.1.365 to 1.1.369
- [Release notes](https://github.com/RobertCraigie/pyright-python/releases)
- [Commits](https://github.com/RobertCraigie/pyright-python/compare/v1.1.365...v1.1.369)

Updates `pytest` from 8.2.1 to 8.2.2
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.2.1...8.2.2)

Updates `tox` from 4.15.0 to 4.15.1
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.15.0...4.15.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-requirements
- dependency-name: mypy
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-requirements
- dependency-name: pyright
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-requirements
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-requirements
- dependency-name: tox
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: python-requirements
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 15:28:16 +00:00
pgjones
d718ecf6d3 Provide a configuration option to control automatic option responses
By default Flask will provide responses to OPTIONS requests that are
automatically generated. These responses list the valid methods in the
response headers. Whilst this is useful, it can be frowned on by
auditors hence an ability to disable it wholesale is useful.
2024-06-07 19:04:18 +00:00
David Lord
0ce27278d2
[pre-commit.ci] pre-commit autoupdate (#5495) 2024-06-03 15:25:32 -07:00
pre-commit-ci[bot]
07c8f19bfd
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.3 → v0.4.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.3...v0.4.7)
2024-06-03 22:10:27 +00:00
David Lord
0d2100ed17
Bump actions/checkout from 4.1.4 to 4.1.6 in the github-actions group (#5493) 2024-06-01 09:01:46 -07:00
dependabot[bot]
e3535f9971
Bump actions/checkout from 4.1.4 to 4.1.6 in the github-actions group
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 4.1.4 to 4.1.6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](0ad4b8fada...a5ac7e51b4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 15:55:45 +00:00
David Lord
422e05e28d
Bump the python-requirements group in /requirements with 3 updates (#5492) 2024-06-01 08:16:45 -07:00