madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22239: LJSUP-12562: Not delete Repost if Delete...

Committer: sbelyaev
LJSUP-12562: Not delete Repost if Deleted original entry
U   trunk/cgi-bin/LJ/Widget/EntryChooser.pm
U   trunk/templates/Widgets/entry_chooser.tmpl
Modified: trunk/cgi-bin/LJ/Widget/EntryChooser.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/EntryChooser.pm	2012-06-14 11:41:47 UTC (rev 22238)
+++ trunk/cgi-bin/LJ/Widget/EntryChooser.pm	2012-06-14 12:11:49 UTC (rev 22239)
@@ -27,7 +27,8 @@
         my $repost_entry_obj;
         my $replacement_event_text;
         my $repost_url;
-        my $removed; 
+        my $removed;
+        my $delete_real_attr_link;
         
         my $content =  { 'original_post_obj' => \$entry,
                          'event'             => \$replacement_event_text,
@@ -88,12 +89,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?" . 
+        if ($repost_entry_obj && !$repost_entry_obj) {
+            $delete_real_link = "$LJ::SITEROOT/editjournal.bml?" . 
                                'usejournal=' . $repost_entry_obj->journal->user . '&' .
                                'itemid=' . $repost_entry_obj->ditemid;
+        } elsif ($removed) {
+            $delete_real_attr_link = $entry->url;
         }
 
         my $entry_url =  $entry->url;
@@ -143,6 +146,7 @@
             'entry_taglist'      => $entry_taglist,
             'entry_reposted'     => $entry_reposted,
             'delete_real_link'   => $delete_real_link,
+            'delete_real_attr_link' => $delete_real_attr_link,
         };
     }
 

Modified: trunk/templates/Widgets/entry_chooser.tmpl
===================================================================
--- trunk/templates/Widgets/entry_chooser.tmpl	2012-06-14 11:41:47 UTC (rev 22238)
+++ trunk/templates/Widgets/entry_chooser.tmpl	2012-06-14 12:11:49 UTC (rev 22239)
@@ -27,7 +27,9 @@
 						<a href='<TMPL_VAR edit_link ESCAPE=HTML>' class='b-editentry-edit-btn b-editentry-ctrl-btn'></a>
 					<TMPL_ELSE>
                         <TMPL_IF entry_reposted>
-    						<a href='<TMPL_VAR delete_link ESCAPE=HTML>' class='b-editentry-del-btn b-editentry-del-repost-btn b-editentry-ctrl-btn'></a>
+    						<a href='<TMPL_VAR delete_link ESCAPE=HTML>' 
+                               data-url='<TMPL_VAR delete_real_attr_link>' 
+                              class='b-editentry-del-btn b-editentry-del-repost-btn b-editentry-ctrl-btn'></a>
                         <TMPL_ELSE>
                             <a href='<TMPL_VAR delete_link ESCAPE=HTML>' class='b-editentry-edit-btn b-editentry-ctrl-btn'></a>
                         </TMPL_IF>

Tags: 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