move 'view tag history' to image controls

This commit is contained in:
Shish 2012-03-12 03:39:37 +00:00
parent 98310df9ee
commit 11ab2a1e14
3 changed files with 7 additions and 10 deletions

View File

@ -77,10 +77,12 @@ class Tag_History extends Extension {
} }
} }
public function onDisplayingImage(DisplayingImageEvent $event) { public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event) {
global $page; $event->add_part("
// handle displaying a link on the view page <form action='".make_link("tag_history/{$event->image->id}")."' method='GET'>
$this->theme->display_history_link($page, $event->image->id); <input type='submit' value='View Tag History'>
</form>
", 20);
} }
public function onSetupBuilding(SetupBuildingEvent $event) { public function onSetupBuilding(SetupBuildingEvent $event) {

View File

@ -8,7 +8,7 @@ class TagHistoryTest extends ShimmieWebTestCase {
$this->set_field("tag_edit__tags", "new"); $this->set_field("tag_edit__tags", "new");
$this->click("Set"); $this->click("Set");
$this->assert_title("Image $image_id: new"); $this->assert_title("Image $image_id: new");
$this->click("Tag History"); $this->click("View Tag History");
$this->assert_text("new (Set by demo"); $this->assert_text("new (Set by demo");
$this->click("Revert To"); $this->click("Revert To");
$this->assert_title("Image $image_id: pbx"); $this->assert_title("Image $image_id: pbx");

View File

@ -97,11 +97,6 @@ class Tag_HistoryTheme extends Themelet {
$page->add_block(new Block("Navigation", $nav, "left")); $page->add_block(new Block("Navigation", $nav, "left"));
} }
public function display_history_link(Page $page, /*int*/ $image_id) {
$link = '<a href="'.make_link("tag_history/$image_id").'">Tag History</a>';
$page->add_block(new Block(null, $link, "main", 5));
}
/* /*
* Add a section to the admin page. * Add a section to the admin page.
*/ */