Commit graph

472 commits

Author SHA1 Message Date
Lukas Fleischer
4be9aa6350 Fix the comment collapse feature
In commit 4abde89 (Use JavaScript to collapse long comments,
2017-04-19), support for collapsing/expanding long comments was added.
This was broken by the recent Markdown support since comments no longer
live inside a single HTML paragraph. Fix this by wrapping each comment
in another div container.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-24 21:10:02 +02:00
Lukas Fleischer
016b40f99d Render comments when storing them in the database
Instead of converting package comments from plain text to HTML code when
they are displayed, do the conversion when the comment is posted and
store the rendered result in the database. The conversion itself is done
by a Python script which uses Bleach for sanitizing the text.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-23 18:43:26 +02:00
Lukas Fleischer
4abde895a5 Use JavaScript to collapse long comments
Instead of using CSS to limit the height of package comments as
implemented in 7b13203 (Limit comment height to 15 lines, 2016-03-12),
use JavaScript to collapse long comments and add a link to expand them.
Clicking the same link twice results in the corresponding comment being
collapsed again.

If JavaScript is disabled, the full comments are shown (without any
possibility to collapse or expand).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-20 07:03:54 +02:00
Lukas Fleischer
44858e0618 Store dependency descriptions in a separate column
Split optional dependency descriptions from dependency names before
storing them in the database and use a separate column to store the
descriptions.

This allows us to simplify and optimize the SQL queries in
pkg_dependencies() as well as pkg_required().

Suggested-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-19 09:13:09 +02:00
Lukas Fleischer
7ee97933de account_delete.php: Fix variable name
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-03-02 21:44:29 +01:00
Lukas Fleischer
92f140c5ca flag_comment.php: Hide comment for unflagged packages
Only show the comment paragraph if the package base is actually flagged
out-of-date.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-27 20:01:50 +01: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
Lukas Fleischer
b205275196 pkgreq_results.php: Hide empty table
Display a message that no requests matched the filter criteria instead
of showing an empty package requests table.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-25 13:09:01 +01:00
Morten Linderud
65b75568cb Add security tracker into navbar
Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-23 07:36:57 +01:00
Lukas Fleischer
5059056567 Fix several PHP short open tags
Use "<?=" instead of "<?" for printing.

Fixes a regression introduced in a9048bb (Dedupe translatable strings,
2015-11-25).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-15 22:05:03 +01:00
Janne Heß
9df1bd5fe2 Add direct links to each source file
Currently, each source file which is an external link (http://,
https://, ...) is a clickable link.

This commit extends the behaviour by making files from the repository
clickable as well. The link brings the user to the corresponding cgit
page.

Also, the link to the PKGBUILD is altered to make the configuration more
consistent.

Signed-off-by: Janne Heß <jannehess@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-12 17:53:13 +01:00
Lukas Fleischer
403241baa3 pkgreq_results.php: Add a flag to hide headers
Introduce a new boolean flag that can be used to disable extended
headers, pagination and forms.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-08 19:18:27 +01:00
Lukas Fleischer
05007d8b1a pkgreq_results.php: Split out package results box
Do not include the wrapper div container in the template.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-08 19:18:27 +01:00
Lukas Fleischer
880d25e98c Allow to search for both maintainer and co-maintainer
As a follow-up to commit 6cb8c04 (Implement co-maintainer search,
2017-01-26), add an option to search for both maintainers and
co-maintainers at the same time.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-08 19:18:27 +01:00
Lukas Fleischer
7d7e079326 Hide the table sorting links on the dashboard
The tables on the dashboard always show the 50 most recent packages,
ordered by last update. Do not make the table headers of these tables
clickable.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-08 19:18:26 +01:00
Lukas Fleischer
1049f93191 Add dashboard
For logged in users, the home page is replaced with an overview of the
packages the user maintains or co-maintains.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-04 11:20:59 +01:00
Lukas Fleischer
b6aced9692 pkg_search_results.php: Split out package results box
Do not print the wrapper div container when calling pkg_search_page().

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-04 00:36:55 +01:00
Lukas Fleischer
3b4c6e72a9 Refactor pkg_search_page()
* Pass search parameters using an associative array instead of $_GET.
* Add a boolean parameter to enable and disable headers/footers.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-04 00:36:17 +01:00
Lukas Fleischer
6cb8c041bc Implement co-maintainer search
Add an option to filter package search results by co-maintainer.

Partly fixes FS#45591.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-28 11:23:40 +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
1e9735972a Do not show current day if registration date is unknown
The registration date field on the account details page currently
defaults to the current day if the user's registration date is unknown.
To avoid confusion, show "unknown" in these cases instead.

Fixes FS#51405.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-17 14:58:37 +02:00
Johannes Löthberg
4a355c71cb Add details link from account edit form
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-14 08:00:13 +02:00
Johannes Löthberg
573e0c662b Display registration date on account details page
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-14 08:00:13 +02:00
Safa AlFulaij
b089747774 Fix plural string
Even though the singular form never occurs, we need to use _n() here to
obtain the correct behavior for languages with multiple plural forms.

Signed-off-by: Safa AlFulaij <safa1996alfulaij@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-07-24 18:51:12 +02:00
Lukas Fleischer
2160678f9b Remove wearout factor from translatable string
Even though that number is hardcoded in the source code, it is better to
make it not appear in the message catalog such that it can be made
configurable easily later.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-07-23 15:02:37 +02:00
Lukas Fleischer
fbf3e54057 Add hard limit for the length of dependency lists
Introduce a configuration option max_depends which can be used to
specify a maximum number of (reverse) dependencies to display on the
package details pages.

Fixes FS#49059.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-26 08:53:55 +02:00
Lukas Fleischer
7d42d3fc1c Make request type hints translatable
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-25 16:09:22 +02:00
Johannes Löthberg
16674e4c9d Linkify user homepage URLs
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-25 13:56:23 +02:00
Lukas Fleischer
e3670ef188 Add a homepage field to accounts
Allow users to add a link to their homepage to their profile.

Implements FS#22774.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-08 22:23:57 +02:00
Lukas Fleischer
333596ab4a Update Arch Linux projects subdomain
The projects.archlinux.org subdomain was moved to git.archlinux.org.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-08 22:23:57 +02:00
Lukas Fleischer
e17e88a2e2 Add request type hints
Add a text that explains when the currently selected request type should
be used.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-05-23 22:56:01 +02:00
Mark Weiman
2ef5f8a5ff Change text of enable notifications link
Since notifications are sent for more than just comments, change the notify
link to more generic text.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-03-18 23:30:48 +01:00
Lukas Fleischer
3ec3dfb6aa Merge branch 'maint' 2016-03-13 13:17:15 +01:00
Lukas Fleischer
761952d424 Fix l10n of "more"
Use __() instead of _() to make the string translatable.

Fixes FS#48529.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-03-13 09:14:57 +01:00
Lukas Fleischer
6ec4a3589e Send notifications when changing ownership
Add a new option that makes it possible to subscribe to package
ownership changes (adoption/disownment).

Fixes FS#15412.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-02-21 20:01:13 +01:00
Lukas Fleischer
fb56ec9d1e Hide orphan request option for disowned package bases
If a package base is unmaintained, there is no need to file an orphan
request. Hide the option from the front-end in this case.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-02-19 18:18:48 +01:00
Lukas Fleischer
64072461df Add support for package update notifications
Introduce a new notification option to receive notifications when a new
commit is pushed to a package repository.

Implements FS#30109.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-02-07 10:54:20 +01:00
Lukas Fleischer
aa5e58db81 Add global comment notification setting
Add a configuration option to the account edit page that allows for
globally enabling/disabling package base comment notifications.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-02-07 10:52:05 +01:00
Marcel Korpel
1664a24198 Remove 'new' tag from updates table
It was hard to make it consistent with the other new icons from Open
Iconic and it hadn't much use after all.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-01-31 20:12:56 +01:00
Marcel Korpel
73364ad724 Correctly encode ampersand in query string within HTML attribute
Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-01-31 20:03:49 +01:00
Marcel Korpel
6b766b8e77 Shorten maxlength of email input fields to 254 characters
After 24734d0 (Shorten Email column to 254 characters, 2015-11-12) the
maximum length of the input fields should be shortened, too.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-01-30 11:15:17 +01:00
Lukas Fleischer
700df4f32f Include parentheses in translatable string
This string is easier to understand with the extra parentheses.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-01-28 23:00:08 +01:00
Mark Weiman
b3a6809bad Fix duplicate ids from pinned comments
Fixed duplicate ids caused from pinned comments introduced in 7d4c0c9
(Implement capability to pin comments above others, 2015-12-12).

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-01-24 21:34:54 +01:00
Marcel Korpel
bd85441cf6 Add comment undeletion functionality
Only Developers and Trusted Users can undelete comments.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-01-23 11:50:03 +01:00
Mark Weiman
e9fe1a9eb1 Add link to flag OOD comment
Implements: FS#46546

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-12-15 17:46:18 +01:00
Lukas Fleischer
4653945226 Hide names of deleted accounts in comment headings
When the account of a user who edited/deleted a comment is removed, drop
occurrences of his user name in comment headings instead of replacing
the user name with "None".

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-12-13 21:20:39 +01:00
Lukas Fleischer
51407d4a29 Store current date and time when deleting comments
Instead of modifying EditedTS when a comment is deleted, use a separate
field DelTS. Use this field to determine whether a comment has been
deleted, instead of checking DelUsersID which might be unset when the
corresponding user is deleted.

Fixes FS#47362.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-12-13 21:19:31 +01:00
Lukas Fleischer
9abd44671d Add a "more" link to the recent updates box
Implements FS#46924.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-12-13 18:28:06 +01:00
Lukas Fleischer
9c98523494 Replace new package icon
Use a flat icon from the Open Iconic collection to mark new packages.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-12-13 10:22:59 +01:00