Commit graph

109 commits

Author SHA1 Message Date
Kevin Morris
29989b7fdb
change(aurblup): converted to use aurweb.db ORM
Introduces:
- aurweb.testing.alpm.AlpmDatabase
    - Used to mock up and manage a remote repository.
- templates/testing/alpm_package.j2
    - Used to generate a single ALPM package desc.
- Removed aurblup sharness test

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-28 19:55:08 -08:00
Kevin Morris
a348cdaac3
housekeep(fastapi): cleanup unneeded jinja set statement
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-18 16:44:13 -08:00
Kevin Morris
7739b2178e
fix(fastapi): fix comment edit image sources
These were using the old comment image sources. Slipped in
due to cache and not checking without cache.

Fixed them to use src="/static/images/...".

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-18 16:43:10 -08:00
Kevin Morris
dbe5cb4a33
fix(fastapi): only include comment-edit.js where needed
Closes: #178

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-18 16:42:26 -08:00
Kevin Morris
bd59adc886
fix(fastapi): use NumVotes for votes field in package details
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-12 17:39:26 -08:00
Kevin Morris
686c032290
feat(fastapi): add id="licenses" to package details licenses
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-11 19:55:04 -08:00
Kevin Morris
7aa959150e
feat(fastapi): add id="conflicts" to package details conflicts
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-11 19:54:30 -08:00
Kevin Morris
e8e9edbb21
change(fastapi): simplify package details database queries
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-11 19:30:21 -08:00
Kevin Morris
a33e9bd571
feat(fastapi): add Replaces field to package details
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-11 19:15:29 -08:00
Kevin Morris
50a9690c2d
feat(fastapi): add Provides field in package details
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-11 19:15:03 -08:00
Kevin Morris
2016b80ea9
fix(fastapi): hide conflicts when there are none
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-11 18:14:50 -08:00
Kevin Morris
2dc6cfec23
fix(fastapi): reorganize licenses display
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-11 18:14:15 -08:00
Kevin Morris
20f5519b99
fix(fastapi): hide keywords when there are none or they can't be edited
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-11 18:13:21 -08:00
Kevin Morris
363afff332
feat(fastapi): add /pkgbase/{name}/keywords (post)
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-11 17:36:08 -08:00
Kevin Morris
5f5fa44d0d
fix(fastapi): fix licenses check
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-11 17:12:13 -08:00
Kevin Morris
85ebc72e8a
fix(fastapi): only elevated users are allowed to suspend accounts
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-08 18:51:39 -08:00
Kevin Morris
9464de108f
feat(fastapi): add /pkgbase/{name}/comments/{id}/edit (get)
This is needed so that users can edit comments when they don't have
Javascript being used in their browser.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-29 21:37:52 -07:00
Kevin Morris
8dcdc7ff38
change(fastapi): decouple account comment templates
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-29 18:28:14 -07:00
Kevin Morris
46c39399ff
fix(fastapi): fix /account/{username} links
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-29 17:18:54 -07:00
Kevin Morris
691b7b9091
feat(fastapi): add comment actions to /account/{username}/comments
With this change, we've decoupled some partials shared between
`/pkgbase/{name}` and `/account/{username}/comments`. The comment
actions template now resolves its package base via the `comment`
instance instead of requiring `pkgbase`.

We've also modified the existing package comment routes to
support execution from any location using the `next` parameter.
This allows us to reuse code from package comments for
account comments actions.

Moved the majority of comment editing javascript to its own
.js file.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-29 17:18:49 -07:00
Kevin Morris
adb6252f85
feat(fastapi): add /account/{username}/comments
This commit contains a base template of account comments
in sorted order (based on ColumnTS.desc).

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-28 13:21:16 -07:00
Kevin Morris
0d734eb07d
feat(fastapi): add configurable commit hash display
Two new options have been added:

- [devel] commit_url
    - URL including an %s format specifier that can be used to link
      to a webpage for the commit.
- [devel] commit_hash
    - HEAD's commit hash (produced via `git rev-parse HEAD`)

If a `[devel] commit_hash` is configured, a link to the commit based on
`[devel] commit_url` will be displayed in the aurweb footer in
the form: `HEAD@<commit_hash>`. If no `[devel] commit_url` is
configured, a non-linked hash will be displayed.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-24 18:12:19 -07:00
Kevin Morris
da55aa6491
fix(fastapi): use more credentials in archdev-navbar.html
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-23 20:57:43 -07:00
Kevin Morris
5fb75b9614
feat(fastapi): add /pkgbase/{name}/merge (post)
Changes:

- `via` is not required in FastAPI. We deduce the involved
  requests via their PackageBaseName / MergeBaseName columns
  and set them to Accepted when merged.
- When erroneous input is given, the error is now presented
  on the merge page instead of sending the user to the pkgbase
  page.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-23 19:03:32 -07:00
Kevin Morris
5ae9d09e98
fix: remove unused "Merge into" input from /packages
When using this input on `live` as a TU, the field is not
taken into account. Tried with no action and with the
Delete Packages action, which ended up deleting the packages
but not merging into the given target.

So, this commit removes that input from the page.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-20 23:27:07 -07:00
Kevin Morris
2b9840149e
feat(fastapi): add /pkgbase/{name}/merge (get)
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-20 20:31:44 -07:00
Kevin Morris
ddc51dd5eb
Merge branch 'fix-trailing-slashes' into pu 2021-10-20 17:46:12 -07:00
Kevin Morris
beed64e001
fix(fastapi): persist package request form inputs
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-19 15:16:26 -07:00
Kevin Morris
37f0c352f6
feat(FastAPI): add /pkgbase/{name}/flag-comment (get)
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-19 13:39:00 -07:00
Kevin Morris
210d92e382
Merge branch 'pu_packages_action_post' into pu 2021-10-19 13:38:02 -07:00
Kevin Morris
267f2cb2c4
fix(fastapi): remove trailing slashes from fastapi-driven links
With our FastAPI server, trailing slashes causes a 307 redirect
which ends up redirecting users to routes which do not contain
trailing slashes. This removes trailing slashes from our templates
where FastAPI is concerned to avoid unnecessary redirects.

There may still be links or usages around which have unnecessary
usages of a trailing slash; please keep a look out for these and
remove them where possible.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-18 22:42:40 -07:00
Kevin Morris
e05cfc3375
Merge branch 'fix-missing-tags' into pu 2021-10-18 22:17:29 -07:00
Kevin Morris
c588a4e82e
feat(FastAPI): add /packages (post)
The POST /packages route takes an `action`, `merge_into` and `confirm`
form data arguments. It then routes over to `action`'s callback provided
by `PACKAGE_ACTIONS`. This commit does not implement actions, but
mocks out the flow we would expect from the POST route.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-18 17:43:27 -07:00
Steven Guikal
db67e83bb8 fix(FastAPI): use elif statements where appropriate
Signed-off-by: Steven Guikal <void@fluix.one>
2021-10-18 15:07:25 -04:00
Steven Guikal
7f72d78dcc fix(FastAPI): correct HTML tags and indentation
Signed-off-by: Steven Guikal <void@fluix.one>
2021-10-18 14:51:01 -04:00
Kevin Morris
50634d30b3
Merge branch 'pu_package_keywords_fix' into pu 2021-10-15 20:08:31 -07:00
Kevin Morris
27a6563302
fix(FastAPI): use CRED_PKGBASE_SET_KEYWORDS credential properly
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-15 19:11:15 -07:00
Kevin Morris
8040ef5a9c
fix(FastAPI): use pkgbase in package actions
Previously, `result` was being used which was directly set to
`pkgbase` before rendering the actions.html partial. It didn't
make much sense. This commit cleans things up a bit.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-15 19:02:53 -07:00
Kevin Morris
2d46811c45
fix(FastAPI): display VCS note when flagging a VCS package
Closes: #131

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-15 16:16:11 -07:00
Kevin Morris
b631dcb756
Merge branch 'pu_pkgbase_flag_fix' into pu 2021-10-15 13:50:56 -07:00
Kevin Morris
748faca87d
fix(FastAPI): translate some untranslated strings
Affects: templates/partials/packages/search_actions.html

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-12 18:04:07 -07:00
Kevin Morris
5bbc94f2ef
fix(FastAPI): add /pkgbase/{name}/flag (get)
This was missed in the [un]flag (post) commit.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-09 18:41:32 -07:00
Kevin Morris
305d077973
feat(FastAPI): add /pkgbase/{name}/adopt (post)
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-08 15:58:00 -07:00
Kevin Morris
4b95ec41ed
Merge branch 'fix-merge-type' into pu 2021-10-07 23:21:28 -07:00
Kevin Morris
d38abd7832
feat(FastAPI): add /pkgbase/{name}/delete (get, post)
In addition, we've had to add cascade arguments to backref so
sqlalchemy treats the relationships as proper cascades.

Furthermore, our pkgbase actions template was not rendering
actions properly based on TU credentials.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-07 20:36:24 -07:00
Kevin Morris
16d516c221
feat(FastAPI): add /pkgbase/{name}/disown (get, post)
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-07 20:13:40 -07:00
Kevin Morris
dc11a88ed3
change(FastAPI): depend on auth_required redirect for pkgbase actions
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-07 00:40:22 -07:00
Kevin Morris
8bc1fab74d
change(FastAPI): automate request login requirement
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-07 00:27:51 -07:00
Kevin Morris
889c5b1e21
fix(FastAPI): pkgbase actions template
Display Delete, Merge and Disown actions based on user credentials.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-06 22:09:58 -07:00
Steven Guikal
1bce53bbb7 fix(FastAPI): mark user and passwd as required fields 2021-10-05 14:36:46 -04:00