fixing tag reversion

This commit is contained in:
Shish 2012-03-09 21:43:02 +00:00
parent b1a8a82bf2
commit f6bd6dc057
2 changed files with 10 additions and 11 deletions

View file

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

View file

@ -23,22 +23,21 @@ class Tag_HistoryTheme extends Themelet {
$current_id = $fields['id']; $current_id = $fields['id'];
$current_tags = html_escape($fields['tags']); $current_tags = html_escape($fields['tags']);
$name = $fields['name']; $name = $fields['name'];
$setter = "<a href='".make_link("user/".url_escape($name))."'>".html_escape($name)."</a>"; $h_ip = $user->can("view_ip") ? " ".show_ip($fields['user_ip'], "Tagging Image #$image_id as '$current_tags'") : "";
if($user->is_admin()) { $setter = "<a href='".make_link("user/".url_escape($name))."'>".html_escape($name)."</a>$h_ip";
$setter .= " / " . $fields['user_ip'];
}
$selected = ($n == 2) ? " checked" : ""; $selected = ($n == 2) ? " checked" : "";
$history_list .= ' $history_list .= "
<li> <li>
<input type="radio" name="revert" id="'.$current_id.'" value="'.$current_id.'"$selected> <input type='radio' name='revert' id='$current_id' value='$current_id'$selected>
<label for="'.$current_id.'">'.$current_tags.' (Set by '.$setter.')</label> <label for='$current_id'>$current_tags (Set by $setter)</label>
</li> </li>
'; ";
} }
$end_string = " $end_string = "
</ul> </ul>
<input type='submit' value='Revert'> <input type='submit' value='Revert To'>
</form> </form>
</div> </div>
"; ";
@ -58,7 +57,7 @@ class Tag_HistoryTheme extends Themelet {
"; ";
$end_string = " $end_string = "
</ul> </ul>
<input type='submit' value='Revert'> <input type='submit' value='Revert To'>
</form> </form>
</div> </div>
"; ";