madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22226: LJSUP-12544: Cannot delete repost from e...

Committer: sbelyaev
LJSUP-12544: Cannot delete repost from editjournal.bml
U   trunk/cgi-bin/LJ/Entry/Repost.pm
U   trunk/cgi-bin/LJ/Widget/EntryChooser.pm
U   trunk/htdocs/editjournal.bml
Modified: trunk/cgi-bin/LJ/Entry/Repost.pm
===================================================================
--- trunk/cgi-bin/LJ/Entry/Repost.pm	2012-06-13 09:19:38 UTC (rev 22225)
+++ trunk/cgi-bin/LJ/Entry/Repost.pm	2012-06-13 11:41:14 UTC (rev 22226)
@@ -435,8 +435,7 @@
             my $event = LJ::Lang::ml( 'entry.reference.journal.delete',
                                       'datetime'     => $entry_obj->eventtime_mysql, 
                                       'url'          => $fake_entry->url);
-
-
+            
             ${$opts->{'event'}} = $event;
             return 1;    
         }

Modified: trunk/cgi-bin/LJ/Widget/EntryChooser.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/EntryChooser.pm	2012-06-13 09:19:38 UTC (rev 22225)
+++ trunk/cgi-bin/LJ/Widget/EntryChooser.pm	2012-06-13 11:41:14 UTC (rev 22226)
@@ -25,13 +25,22 @@
 
     foreach my $entry (@$entries) {
         my $repost_entry_obj;
+        my $replacement_event_text;\
+        my $repost_url; 
+        
         my $content =  { 'original_post_obj' => \$entry,
+                         'event'             => \$replacement_event_text,
                          'repost_obj'        => \$repost_entry_obj, };
 
+        # substute content of original post
         my $entry_reposted = LJ::Entry::Repost->substitute_content( $entry, $content );
+
+        # can we show it?
         if ($entry_reposted && !$entry->visible_to($remote)) {
-            $entry = $repost_entry_obj,
-            $repost_entry_obj = undef;
+            $repost_url             = $entry->url;
+            $entry                  = $repost_entry_obj;
+            $replacement_event_text = $entry->event_raw;
+            $repost_entry_obj       = undef;
         }
 
         my $entry_id = $entry->is_delayed ? $entry->delayedid : $entry->ditemid;
@@ -40,7 +49,7 @@
             ! $entry->journal->is_readonly &&
             ! $entry->poster->is_readonly;
 
-        $entry_can_edit = 0 if $entry_reposted && !$repost_entry_obj;
+        $entry_can_edit = 0 if $entry_reposted;
 
         my $poster_ljuser = $opts->{'show_posters'}
             ? $entry->poster->ljuser_display
@@ -76,7 +85,14 @@
 
         my $edit_link   = $edit_link_base . 'mode=edit';
         my $delete_link = $edit_link_base . 'mode=delete';
+        my $delete_real_link;
 
+        if ($repost_entry_obj) {
+           $delete_real_link = "$LJ::SITEROOT/editjournal.bml?" . 
+                               'usejournal=' . $repost_entry_obj->journal->user . '&' .
+                               'itemid=' . $repost_entry_obj->ditemid;
+        }
+
         my $entry_url =  $entry->url;
         my $entry_subject = $entry->subject_text;
 
@@ -112,12 +128,14 @@
             'entry_security'     => $entry_security,
             'edit_link'          => $edit_link,
             'delete_link'        => $delete_link,
-            'entry_url'          => $entry_url,
+            'entry_url'          => $repost_url ? $repost_url :  $entry_url,
             'entry_subject'      => $entry_subject,
             'date_display'       => $date_display,
-            'entry_text_display' => $entry_text_display,
+            'entry_text_display' => $replacement_event_text ? $replacement_event_text :
+                                                              $entry_text_display,
             'entry_taglist'      => $entry_taglist,
             'entry_reposted'     => $entry_reposted,
+            'delete_real_link'   => $delete_real_link,
         };
     }
 

Modified: trunk/htdocs/editjournal.bml
===================================================================
--- trunk/htdocs/editjournal.bml	2012-06-13 09:19:38 UTC (rev 22225)
+++ trunk/htdocs/editjournal.bml	2012-06-13 11:41:14 UTC (rev 22226)
@@ -38,7 +38,8 @@
     my $ret;
     my $getextra = undef;
 
-    my $editprivacy_link = "<p class='i-bubble b-bubble-lite b-bubble-editprivacy b-bubble-noarrow'>" . BML::ml('.editprivacy', { aopts => "href='editprivacy.bml'" }) . "</p>";
+    my $editprivacy_link = "<p class='i-bubble b-bubble-lite b-bubble-editprivacy b-bubble-noarrow'>" . 
+                           BML::ml('.editprivacy', { aopts => "href='editprivacy.bml'" }) . "</p>";
 
     LJ::Controller::Post->rte_langmap();
 
@@ -67,8 +68,12 @@
     } else {
         LJ::need_res(qw(
                         stc/editjournal.css
+                        js/jquery/jquery.lj.confirmbubble.js
+                        templates/Widgets/popupcontent.tmpl
                         ));
-        LJ::need_string(qw/repost.confirm.delete/);
+        LJ::need_string(qw/repost.confirm.delete
+                        confirm.bubble.yes
+                        confirm.bubble.no/);
     }
 
     # append months names tranlation to Site.ml_text['month.names.long']  

Tags: bml, livejournal, madeon, pm, sbelyaev
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