[Bps-public-commit] App-Changeloggr branch, master, updated. 488a7d71d02d7ed193c315ac1fa26f23b31fae19
Alex M Vandiver
alexmv at bestpractical.com
Wed Apr 29 14:38:54 EDT 2009
The branch, master has been updated
via 488a7d71d02d7ed193c315ac1fa26f23b31fae19 (commit)
via 992d4824c30865014882335d3f42eec6aa572f87 (commit)
via 9515550ac252a87c0bd3274a0c679b211b774394 (commit)
from 16a3869d831d77fc847553bc7f4179f33fc6a3e1 (commit)
Summary of changes:
lib/App/Changeloggr/Action/AddChanges.pm | 18 ++++++++++++------
lib/App/Changeloggr/Dispatcher.pm | 2 +-
lib/App/Changeloggr/InputFormat.pm | 6 ++++++
share/web/static/css/nav.css | 2 +-
4 files changed, 20 insertions(+), 8 deletions(-)
- Log -----------------------------------------------------------------
commit 9515550ac252a87c0bd3274a0c679b211b774394
Author: Alex Vandiver <alexmv at mit.edu>
Date: Wed Apr 29 14:36:43 2009 -0400
Background uploading for large (>4k) changelogs
diff --git a/lib/App/Changeloggr/Action/AddChanges.pm b/lib/App/Changeloggr/Action/AddChanges.pm
index c44a754..82034fd 100644
--- a/lib/App/Changeloggr/Action/AddChanges.pm
+++ b/lib/App/Changeloggr/Action/AddChanges.pm
@@ -24,13 +24,19 @@ sub take_action {
}
my $changelog = $self->get_changelog;
- my $changes = $changelog->add_changes( $parser );
- if ($changes->count) {
- $self->result->message(_("Added your %quant(%1,change)!", $changes->count));
- }
- else {
- $self->result->message("No changes to add.");
+ if ($parser->take_offline) {
+ Jifty->background( sub { $changelog->add_changes( $parser ) } );
+ $self->result->message(_("Importing your changes in the background."));
+ } else {
+ my $changes = $changelog->add_changes( $parser );
+
+ if ($changes->count) {
+ $self->result->message(_("Added your %quant(%1,change)!", $changes->count));
+ }
+ else {
+ $self->result->message("No changes to add.");
+ }
}
}
diff --git a/lib/App/Changeloggr/InputFormat.pm b/lib/App/Changeloggr/InputFormat.pm
index 3a97077..7115443 100644
--- a/lib/App/Changeloggr/InputFormat.pm
+++ b/lib/App/Changeloggr/InputFormat.pm
@@ -35,4 +35,10 @@ sub next_match {
return undef;
}
+sub take_offline {
+ my $self = shift;
+
+ return length($self->{text}) > 4 * 1024; # 4k of text or more
+}
+
1;
commit 992d4824c30865014882335d3f42eec6aa572f87
Author: Alex Vandiver <alexmv at mit.edu>
Date: Wed Apr 29 14:37:37 2009 -0400
Redirect to change upload form after creation
diff --git a/lib/App/Changeloggr/Dispatcher.pm b/lib/App/Changeloggr/Dispatcher.pm
index d85fcf7..23d4470 100644
--- a/lib/App/Changeloggr/Dispatcher.pm
+++ b/lib/App/Changeloggr/Dispatcher.pm
@@ -12,7 +12,7 @@ before '*' => run {
on '/admin/created-changelog' => run {
my $id = Jifty->web->response->result('create-changelog')->content('id');
my $admin_token = Changelog($id)->as_superuser->admin_token;
- redirect "/admin/changelog/$admin_token";
+ redirect "/admin/changelog/changes/$admin_token";
};
on '/changelog/*' => run {
commit 488a7d71d02d7ed193c315ac1fa26f23b31fae19
Author: Alex Vandiver <alexmv at mit.edu>
Date: Wed Apr 29 14:38:45 2009 -0400
Adjust width on submenu, for added "votes"
diff --git a/share/web/static/css/nav.css b/share/web/static/css/nav.css
index b33d601..f3d836e 100644
--- a/share/web/static/css/nav.css
+++ b/share/web/static/css/nav.css
@@ -59,7 +59,7 @@
margin-top: 4px;
padding-top: 5px;
padding-bottom: 5px;
- width: 16em;
+ width: 20em;
border-left: 1px solid #445;
border-right: 1px solid #445;
border-bottom: 1px solid #445;
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list