[aur-dev] [PATCH] Rename 'Un-Vote' and 'Unflag' buttons.
This is to be consistent with 'UnNotify'. Signed-off-by: Nathan Jones <nathanj@insightbb.com> --- web/lib/pkgfuncs.inc | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 1517cfc..d383536 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -485,7 +485,7 @@ function package_details($id=0, $SID="") { echo " value='".__("Vote")."'>"; } else { echo "<input type='submit' class='button' name='do_UnVote'"; - echo " value='".__("Un-Vote")."'>"; + echo " value='".__("UnVote")."'>"; } # Comment Nofify Button # @@ -504,7 +504,7 @@ function package_details($id=0, $SID="") { echo " value='".__("Flag Out-of-date")."'>\n"; } else { echo "<input type='submit' class='button' name='do_UnFlag'"; - echo " value='".__("Unflag Out-of-date")."'>\n"; + echo " value='".__("UnFlag Out-of-date")."'>\n"; } if ($row["MaintainerUID"] == 0) { -- 1.6.0.4
Signed-off-by: Nathan Jones <nathanj@insightbb.com> --- web/html/packages.php | 24 ++++++++++++++++++++++++ web/html/pkgedit.php | 9 +++++++++ web/lib/pkgfuncs.inc | 29 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 0 deletions(-) diff --git a/web/html/packages.php b/web/html/packages.php index ca2b26a..07220a2 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -37,26 +37,44 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) { print "<p>"; print pkg_flag($atype, $ids, True); print "</p>"; + print "<p>"; + print pkg_backlink($ids); + print "</p>"; } elseif ($_POST['action'] == "do_UnFlag" || isset($_POST['do_UnFlag'])) { print "<p>"; print pkg_flag($atype, $ids, False); print "</p>"; + print "<p>"; + print pkg_backlink($ids); + print "</p>"; } elseif ($_POST['action'] == "do_Adopt" || isset($_POST['do_Adopt'])) { print "<p>"; print pkg_adopt($atype, $ids, True); print "</p>"; + print "<p>"; + print pkg_backlink($ids); + print "</p>"; } elseif ($_POST['action'] == "do_Disown" || isset($_POST['do_Disown'])) { print "<p>"; print pkg_adopt($atype, $ids, False); print "</p>"; + print "<p>"; + print pkg_backlink($ids); + print "</p>"; } elseif ($_POST['action'] == "do_Vote" || isset($_POST['do_Vote'])) { print "<p>"; print pkg_vote($atype, $ids, True); print "</p>"; + print "<p>"; + print pkg_backlink($ids); + print "</p>"; } elseif ($_POST['action'] == "do_UnVote" || isset($_POST['do_UnVote'])) { print "<p>"; print pkg_vote($atype, $ids, False); print "</p>"; + print "<p>"; + print pkg_backlink($ids); + print "</p>"; } elseif ($_POST['action'] == "do_Delete" || isset($_POST['do_Delete'])) { print "<p>"; print pkg_delete($atype, $ids); @@ -65,10 +83,16 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) { print "<p>"; print pkg_notify($atype, $ids); print "</p>"; + print "<p>"; + print pkg_backlink($ids); + print "</p>"; } elseif ($_POST['action'] == "do_UnNotify" || isset($_POST['do_UnNotify'])) { print "<p>"; print pkg_notify($atype, $ids, False); print "</p>"; + print "<p>"; + print pkg_backlink($ids); + print "</p>"; } elseif (isset($_GET["ID"])) { if (!intval($_GET["ID"])) { diff --git a/web/html/pkgedit.php b/web/html/pkgedit.php index 974f14b..d2e36d3 100644 --- a/web/html/pkgedit.php +++ b/web/html/pkgedit.php @@ -51,6 +51,9 @@ if ($_REQUEST["del_Comment"]) { } else { print __("Missing comment ID.")."<br />\n"; } + print "<p>"; + print pkg_backlink($_REQUEST["ID"]); + print "</p>"; html_footer(AUR_VERSION); exit(); } @@ -69,6 +72,9 @@ if ($_REQUEST["add_Comment"]) { $q.= "UNIX_TIMESTAMP())"; db_query($q, $dbh); print __("Comment has been added."); + print "<p>"; + print pkg_backlink($_REQUEST["ID"]); + print "</p>"; # Send email notifications # @@ -135,6 +141,9 @@ if ($_REQUEST["change_Category"]) { } else { print __("Invalid category ID.")."<br />\n"; } + print "<p>"; + print pkg_backlink($_REQUEST["ID"]); + print "</p>"; } else { # Prompt visitor for new category_id # diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index d383536..1e88009 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -1374,3 +1374,32 @@ function pkg_notify ($atype, $ids, $action = True) { return $output; } +/** + * Creates a return to package link + * + * @param array $ids Array of package IDs to flag/unflag, formatted as + * $package_id => $useless_crap. The array must only have one entry in it. + * If $ids is a string, it will be used as the id. + * + * @return string Translated return to package link or blank string + */ +function pkg_backlink ($ids) { + $output = ""; + + if (is_array($ids)) { + if (count($ids) == 1) { + $keys = array_keys($ids); + $id = $keys[0]; + $output .= "<a href='/packages.php?ID=$id'>"; + $output .= __("Return to the package details."); + $output .= "</a>"; + } + } else if (is_string($ids)) { + $output .= "<a href='/packages.php?ID=$ids'>"; + $output .= __("Return to the package details."); + $output .= "</a>"; + } + + return $output; +} + -- 1.6.0.4
This is to be consistent with other pages. Signed-off-by: Nathan Jones <nathanj@insightbb.com> --- web/html/pkgedit.php | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/web/html/pkgedit.php b/web/html/pkgedit.php index d2e36d3..e341470 100644 --- a/web/html/pkgedit.php +++ b/web/html/pkgedit.php @@ -44,12 +44,18 @@ if ($_REQUEST["del_Comment"]) { $q.= "SET DelUsersID = ".$uid." "; $q.= "WHERE ID = ".intval($_REQUEST["comment_id"]); db_query($q, $dbh); - print __("Comment has been deleted.")."<br />\n"; + print "<p>"; + print __("Comment has been deleted."); + print "</p>"; } else { - print __("You are not allowed to delete this comment.")."<br />\n"; + print "<p>"; + print __("You are not allowed to delete this comment."); + print "</p>"; } } else { - print __("Missing comment ID.")."<br />\n"; + print "<p>"; + print __("Missing comment ID."); + print "</p>"; } print "<p>"; print pkg_backlink($_REQUEST["ID"]); @@ -71,7 +77,9 @@ if ($_REQUEST["add_Comment"]) { $q.= "'".mysql_real_escape_string($_REQUEST["comment"])."', "; $q.= "UNIX_TIMESTAMP())"; db_query($q, $dbh); + print "<p>"; print __("Comment has been added."); + print "</p>"; print "<p>"; print pkg_backlink($_REQUEST["ID"]); print "</p>"; @@ -136,10 +144,14 @@ if ($_REQUEST["change_Category"]) { $q = "UPDATE Packages SET CategoryID = ".intval($_REQUEST["category_id"]); $q.= " WHERE ID = ".intval($_REQUEST["ID"]); db_query($q, $dbh); - print __("Package category updated.")."<br />\n"; + print "<p>"; + print __("Package category updated."); + print "</p>"; } else { - print __("Invalid category ID.")."<br />\n"; + print "<p>"; + print __("Invalid category ID."); + print "</p>"; } print "<p>"; print pkg_backlink($_REQUEST["ID"]); -- 1.6.0.4
Signed-off-by: Nathan Jones <nathanj@insightbb.com> --- .gitignore | 1 + web/README | 6 +++++- 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/.gitignore b/.gitignore index c1c6d56..4085fb7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ web/lib/config.inc *.DS_Store web/html/xml/*.xml +support/schema/dummy-data.sql.bz2 diff --git a/web/README b/web/README index b0e6c39..e15f88a 100644 --- a/web/README +++ b/web/README @@ -73,7 +73,11 @@ Setup on Arch Linux: (give password 'aur' at the prompt) - Optionally load some test data for development purposes. - # bzcat ~/aur/support/schema/dummy-data.sql.bz2 | mysql -uaur -p AUR + # pacman -S words mysql-python + # cd ~/aur/support/schema/ + # python gendummydata.py dummy-data.sql + # bzip2 dummy-data.sql + # bzcat dummy-data.sql.bz2 | mysql -uaur -p AUR (give password 'aur' at the prompt) 7) Copy the config.inc.proto file to config.inc. Modify as needed. -- 1.6.0.4
On Wed, Dec 03, 2008 at 09:36:58AM -0500, Nathan Jones wrote:
Signed-off-by: Nathan Jones <nathanj@insightbb.com> --- .gitignore | 1 + web/README | 6 +++++- 2 files changed, 6 insertions(+), 1 deletions(-)
Pushed.
Hi there, Your other patches look good to apply but (unfortunately since this is the biggest patch) the plan when I made all these functions was to get rid of these useless success pages completely. If you take a look at '[PATCH] Remove "success" pages after package actions' from Oct 5 you can see the intended behavior when all my patches went live. At the moment the patches are all a bit of a mess and some are not even applied but eventually it should get done. Also with your patch, keep in mind we want to keep all HTML out of functions and if possible out of the logic entirely since that's why the AUR is in such a mess in the first place. You're also allowed to document the functions with proper names, I was very bored by the end of the doc patch and probably shouldn't have used retarded variable names. :P -- Callan Barrett
On Thu, Dec 04, 2008 at 12:27:48AM +0900, Callan Barrett wrote:
Hi there,
Your other patches look good to apply but (unfortunately since this is the biggest patch) the plan when I made all these functions was to get rid of these useless success pages completely. If you take a look at '[PATCH] Remove "success" pages after package actions' from Oct 5 you can see the intended behavior when all my patches went live. At the moment the patches are all a bit of a mess and some are not even applied but eventually it should get done.
Yes, feel free to disregard any patches don't make sense with all the changes you have made. I just subscribed to this list a few days ago, so I have not read through all the patches in past months. Anyway, it was the biggest patch only because it was a copy and paste mess, so no harm done :)
On Wed, Dec 03, 2008 at 09:36:55AM -0500, Nathan Jones wrote:
This is to be consistent with 'UnNotify'.
Signed-off-by: Nathan Jones <nathanj@insightbb.com> --- web/lib/pkgfuncs.inc | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
I'll add these in sometime later. We should be declaring a new release soon, so I'd want to keep translation changes to a minimum.
On Wed, Dec 03, 2008 at 09:36:55AM -0500, Nathan Jones wrote:
This is to be consistent with 'UnNotify'.
Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Pushed now.
participants (3)
-
Callan Barrett
-
Loui Chang
-
Nathan Jones