madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20968: LJSUP-10432: removing functionality from...

Committer: sbelyaev
LJSUP-10432: removing functionality from edittags.bml.
U   trunk/cgi-bin/LJ/Widget/EntryChooser.pm
U   trunk/htdocs/edittags.bml
U   trunk/templates/Widgets/entry_chooser.tmpl
Modified: trunk/cgi-bin/LJ/Widget/EntryChooser.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/EntryChooser.pm	2012-01-24 10:46:43 UTC (rev 20967)
+++ trunk/cgi-bin/LJ/Widget/EntryChooser.pm	2012-01-24 11:35:10 UTC (rev 20968)
@@ -21,6 +21,7 @@
     my @entries_display;
 
     foreach my $entry (@$entries) {
+        my $entry_id = $entry->is_delayed ? $entry->delayedid : $entry->itemid ;
         my $entry_can_edit = 
             $entry->poster->equals($remote) &&
             ! $entry->journal->is_readonly &&
@@ -48,16 +49,12 @@
             }
         }
 
-        my ($edittags_link, $entry_can_edittags);
         my $edit_link_base = "$LJ::SITEROOT/editjournal.bml?";
         my $usejournal = $entry->journal->username;
         $edit_link_base .= 'usejournal=' . $usejournal . '&';
 
         if ( $entry->is_delayed ) {
             $edit_link_base .= 'delayedid=' . $entry->delayedid . '&';
-            $edittags_link  = "$LJ::SITEROOT/edittags.bml?" .
-                              "journal=$usejournal&delayedid=" .
-                              $entry->delayedid;
         } else {
             $edit_link_base .= 'itemid=' . $entry->ditemid . '&';
         }
@@ -96,19 +93,14 @@
             $entry_taglist = join( ', ', @taglist );
         }
 
-        if ( $entry->is_delayed ) {
-            $entry_can_edittags = $entry_can_edit;
-        }
-
         push @entries_display, {
+            'entry_id'           => $entry_id,
             'entry_can_edit'     => $entry_can_edit,
-            'entry_can_edittags' => $entry_can_edittags,
             'poster_ljuser'      => $poster_ljuser,
             'entry_is_delayed'   => $entry_is_delayed,
             'entry_is_sticky'    => $entry_is_sticky,
             'entry_security'     => $entry_security,
             'edit_link'          => $edit_link,
-            'edittags_link'      => $edittags_link,
             'delete_link'        => $delete_link,
             'entry_url'          => $entry_url,
             'entry_subject'      => $entry_subject,

Modified: trunk/htdocs/edittags.bml
===================================================================
--- trunk/htdocs/edittags.bml	2012-01-24 10:46:43 UTC (rev 20967)
+++ trunk/htdocs/edittags.bml	2012-01-24 11:35:10 UTC (rev 20968)
@@ -34,21 +34,9 @@
 
     return $err->($ML{'.invalid.entry'}) unless ($jitemid || $delayedid);
 
-    my $entry;
-    if ($delayedid) {
-        $entry = LJ::DelayedEntry->get_entry_by_id($u, $delayedid);
-    } else {
-        $entry = LJ::Entry->new($u, ditemid=>$ditemid);
-    }
+    my $entry = LJ::Entry->new($u, ditemid=>$ditemid);
+    my $logrow = LJ::get_log2_row($u, $jitemid);
 
-    my $logrow;
-
-    if ($delayedid) {
-        $logrow = $entry->get_log2_row();
-    } else {
-        $logrow = LJ::get_log2_row($u, $jitemid);
-    }
-
     return $err->($ML{'.invalid.entry'}) unless $logrow;
     return $err->($ML{'.invalid.entry'}) 
                     unless ($logrow->{anum} == $anum || $delayedid);
@@ -71,30 +59,20 @@
 
         my $tagerr = "";
         my $skipped_tags = [];
-        my $rv;
-        if ($delayedid) {
-            $rv = $entry->update_tags($POST{edittags});
-            $ditemid = "$delayedid";
-        } else {
-            $rv = LJ::Tags::update_logtags($u, $jitemid, {
-                                    set_string => $POST{edittags},
-                                    remote => $remote,
-                                    err_ref => \$tagerr,
-                                    skipped_tags => $skipped_tags, # do all possible and report impossible
-                                });
-        }
+
+        my $rv = LJ::Tags::update_logtags($u, $jitemid, {
+                                            set_string => $POST{edittags},
+                                            remote => $remote,
+                                            err_ref => \$tagerr,
+                                            skipped_tags => $skipped_tags, # do all possible and report impossible
+                                        });
+
         return $err->($tagerr) unless $rv;
         return "<?h1 $ML{'.warning.title'} h1?><?p " . LJ::Lang::ml('/update.bml.tags.skipped', { 'tags' => join(', ', @$skipped_tags),
                                                              'limit' => $u->get_cap('tags_max') } ) . " p?>"
             if @$skipped_tags;
 
-        my $redirect_url = '';
-        if ($entry->is_delayed) {
-            $redirect_url = $entry->url;
-        } else {
-            $redirect_url = LJ::journal_base($u) . "/$ditemid.html";
-        }
-
+        my $redirect_url = LJ::journal_base($u) . "/$ditemid.html";
         BML::redirect( $redirect_url );
         #$msg = "<div class='update_good'>Tags successfully updated.</div>";
     }
@@ -125,12 +103,7 @@
     $evt =~ s/<\?/&lt;?/g;
     $evt =~ s/\?>/?&gt;/g;
 
-    my $logtags;
-    if ($delayedid) { 
-        $logtags = $entry->get_tags();
-    } else {
-        $logtags = LJ::Tags::get_logtags($u, $jitemid);
-    }
+    my $logtags = LJ::Tags::get_logtags($u, $jitemid);
 
     my $usertags = LJ::Tags::get_usertags($u, { remote => $remote }) || {};
     $logtags = $logtags->{$jitemid} || $logtags->{$delayedid} || {};
@@ -191,17 +164,12 @@
         $view_url = LJ::journal_base($u) . "/$ditemid.html";
     }
 
-
     $ret .= BML::ml('.view', { aopts => 'href="' . $view_url  . '"' });
     $ret .= "</td></tr>";
 
     $ret .= '</table>';
     $ret .= LJ::html_hidden('journal', $journal);
-    if ($delayedid) {
-        $ret .= LJ::html_hidden('delayedid', $GET{delayedid} || $POST{delayedid});
-    } else {
-        $ret .= LJ::html_hidden('itemid', $GET{itemid} || $POST{itemid});
-    }
+    $ret .= LJ::html_hidden('itemid', $GET{itemid} || $POST{itemid});
 
     $ret .= '</form>';
 

Modified: trunk/templates/Widgets/entry_chooser.tmpl
===================================================================
--- trunk/templates/Widgets/entry_chooser.tmpl	2012-01-24 10:46:43 UTC (rev 20967)
+++ trunk/templates/Widgets/entry_chooser.tmpl	2012-01-24 11:35:10 UTC (rev 20968)
@@ -21,12 +21,8 @@
 <TMPL_IF entries>
 	<ul class='b-editentries'>
 		<TMPL_LOOP entries>
-			<li class='b-editentry'>
-
+			<li id="entry_<TMPL_VAR entry_id>" class='b-editentry'>
 				<p class='b-editentry-ctrls'>
-					<TMPL_IF entry_can_edittags>
-						<a href='<TMPL_VAR edittags_link ESCAPE=HTML>' class='b-editentry-edittags-btn b-editentry-ctrl-btn'></a>
-					</TMPL_IF>
 					<TMPL_IF entry_can_edit>
 						<a href='<TMPL_VAR edit_link ESCAPE=HTML>' class='b-editentry-edit-btn b-editentry-ctrl-btn'></a>
 					<TMPL_ELSE>

Tags: bml, livejournal, madeon, pm, sbelyaev, tmpl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments