Commit graph

38 commits

Author SHA1 Message Date
Jelle van der Waa
8b6f92f9e9
Use the clipboard API for copy paste
The Document.execCommand API is deprecated and no longer recommended to
be used. It's replacement is the much simpler navigator.clipboard API
which is supported in all browsers except internet explorer.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
2021-06-21 15:17:42 -04:00
Lukas Fleischer
58aa0a9e45 Copy Git repository URL on click
The Git repository URLs are not meant to be visited using a web browser.
Copy the link to the clipboard instead.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2019-12-11 15:40:59 -05:00
Lukas Fleischer
99a3ced73b Display popularity with less decimal points
Limit the display to two decimal points for packages with a popularity
of at least 0.2.

Suggested-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2019-10-26 21:09:35 -04:00
Lukas Fleischer
4b8b2e3eb1 Stop using each()
The each() function has been deprecated as of PHP 7.2.0. Use foreach
loops instead.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-05-12 13:35:11 +02:00
Lukas Fleischer
22e8ff0bb6 Always use source_file_uri instead of pkgbuild_uri
The pkgbuild_uri option was replaced by source_file_uri in 9df1bd5 (Add
direct links to each source file, 2017-02-12). Change one remaining
reference to pkgbuild_uri accordingly.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-27 18:19:08 +01:00
Mark Weiman
1ed8471182 Show co-maintainers SSH clone URL on package base page
On package base pages, if a co-maintainer visits, only the read-only URL
is displayed which is inconsistent with how the individual packages of a
package base's pages displays them. This adds the SSH clone URL to the
package base's page for co-maintainers to see.

Implements FS#52675.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-23 09:29:50 +01:00
Mark Weiman
608c483090 Add user set timezones
Currently, aurweb displays all dates and times in UTC time. This patch
adds a capability for each logged in user to set their preferred
timezone.

Implements FS#48729.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-20 23:20:40 +01:00
Lukas Fleischer
57db4814a4 Allow users to unflag packages they flagged themselves
Sometimes, a user accidentally flags a package out-of-date. Allow users
to unflag packages that they flagged themselves, thereby providing a way
to undo these actions.

Implements FS#46145.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-30 16:51:14 +02:00
Lukas Fleischer
e610360c95 Show popularity in package base details
Fixes FS#45600.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:24 +02:00
Lukas Fleischer
dbe56342a1 Split out package actions into a separate template
This package base details and package details pages now use exactly the
same code for the package actions box, so it makes sense to use a
separate template file instead.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27 13:04:03 +02:00
Lukas Fleischer
4bc990f9c0 Split out code to generate action links
Add (and use) two new helper functions html_account_link() and
html_account_form() to generate the links in the package actions box.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27 13:04:03 +02:00
Marcel Korpel
d852da79e4 pkgbase_details.php/pkg_details.php: Show keywords
Keywords are hyperlinked so a user can search for other packages with
the same name and/or keyword.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-19 14:40:08 +02:00
Lukas Fleischer
1e3a7179bd Clarify that HTTPs clone URIs are for read-only access
Fixes FS#45335.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-17 17:06:41 +02:00
Lukas Fleischer
fb42ec696c Show co-maintainers next to maintainers in details
Implements FS#45313.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14 17:58:56 +02:00
Lukas Fleischer
a2f79eb2e1 Refactor code for printing account links
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14 17:58:56 +02:00
Lukas Fleischer
5fb7a74e23 Replace categories with keywords
Remove package base categories. Instead, users can now specify up to
twenty custom keywords that are taken into consideration when searching.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14 17:58:55 +02:00
Lukas Fleischer
d1fd6f4897 Make URIs to the individual cgit pages configurable
Make the locations of the PKGBUILD preview, the log and the snapshot
tarball configurable. This increases flexibility and simplifies the code
a bit.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 13:36:27 +02:00
Lukas Fleischer
631d7bdff9 Encode cgit URIs properly
Fixes FS#45276 and FS#45277.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 13:50:39 +02:00
Lukas Fleischer
dc86f6cc82 pkgbase_details.php: Fix cgit links
We forgot to amend those when switching to gitnamespaces-based storage
in b44411f (Use gitnamespaces for efficient storage, 2015-06-01).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 10:53:28 +02:00
Lukas Fleischer
85b48ceb12 Link to the cgit log from package details
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2015-01-09 17:50:39 +01:00
Lukas Fleischer
fc23a9bd50 Add support for package base co-maintainers
This allows for having multiple co-maintainers for AUR packages.
Co-maintainers have push access to the package base Git repository but
are not allowed to change the package base category, disown the package
or modify the list of co-maintainers. The primary maintainer of an AUR
package can edit the list of co-maintainers from the Package Actions
box.

Implements FS#17911.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2015-01-07 12:21:21 +01:00
Lukas Fleischer
176014a5d7 Add links to public and private clone URLs
Show a public clone URL (using Git over HTTP) by default and only show
the private clone URL to the package maintainer.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-12-29 13:22:05 +01:00
Lukas Fleischer
1dcdd3b3ea Add public clone URLs to package details
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-12-27 12:42:12 +01:00
Lukas Fleischer
74edb6fea9 Use Git repositories to store packages
* Remove package submission page from the web interface.
* Replace PKGBUILD and tarball links with links to cgit.
* Remove the "URLPath" field from RPC replies.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-12-27 12:42:12 +01:00
Lukas Fleischer
571b74b901 Always use virtual URLs
Support for non-virtual URLs has been broken for a long time and is no
longer used on the official AUR setup.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-11-21 11:43:31 +01:00
Lukas Fleischer
76343fb915 Use an INI-style configuration file
Replace web/lib/config.inc.php with an INI-style configuration file.
This allows us to get rid of several globals and makes it easier to use
the same configuration file in external scripts.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-10-24 10:03:54 +02:00
Lukas Fleischer
03c6304e19 Rework permission handling
Add a new function has_credential() that checks whether the currently
logged in user is allowed to perform a given action. Moving all
permission handling to this central place makes adding new user groups
and adjusting permissions much more convenient.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-15 22:56:57 +02:00
Lukas Fleischer
111d836912 Display number of pending requests in actions box
For packages with pending package requests, display the number of
requests above the "File Request" link.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-04 12:28:12 +02:00
Lukas Fleischer
6a319a3be7 Fix "File Request" link in package base details
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-01 20:24:53 +02:00
Lukas Fleischer
48cc8207bf Add support for filing package requests
Add a new entry to the package actions box that allows for filing
deletion and orphan requests. When choosing that action, the user is
redirected to a new page that allows for selecting a request type and
entering a comment. When submitting the request, a new entry in the
request database is created and an email is sent to a configurable
mailing list (defaults to aur-general).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-25 11:31:11 +02:00
Lukas Fleischer
0a66f48aa1 Do not return "None" in user functions
Return null instead of the string "None" in username_from_id(),
uid_from_email() and uid_from_username().

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-05 15:12:10 +02:00
Lukas Fleischer
019014a3ac Add a "Search wiki" link to package details
Implements FS#33153.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-02 18:15:12 +02:00
Lukas Fleischer
a93363ac08 Add a packager field to packages
Store the last packager in addition to storing the submitter and the
maintainer of a package. This allows for checking who last updated a
package, even if the package has been disowned.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-06 20:52:32 +02:00
Lukas Fleischer
e161c4f94b Fix vote/notify link on the package details page
Call pkgbase_user_voted() and pkgbase_user_notify() using the package
base ID instead of using the package ID.

Fixes FS#40165.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-01 09:29:55 +02:00
Lukas Fleischer
676595f9bf Prefix package functions with pkg_/pkgbase_
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 15:55:31 +02:00
Lukas Fleischer
d16f7cf712 Use snake case for all package functions
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 15:54:21 +02:00
Lukas Fleischer
f461344211 Move package actions to package bases
Package actions now operate on package bases instead of packages. Move
all actions to the correct locations.

This also fixes some issues with comment notifications.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 13:54:06 +02:00
Lukas Fleischer
f7d13b5b36 Add package base detail pages
This adds package base details pages, similar to the package details
pages. Each package base details page contains general information
(package base name, category, submitter, maintainer, ...) and links to
all the corresponding packages. As on the package details pages,
comments and links to several package actions are also provided.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00