Respect cuts in the latest news widget.

        Patch by afuna. 

diffs (33 lines):

diff -r 861cff38f7de -r 54b7f59afe74 bin/upgrading/en.dat
--- a/bin/upgrading/en.dat      Thu Dec 03 05:29:36 2009 +0000
+++ b/bin/upgrading/en.dat      Thu Dec 03 05:31:37 2009 +0000
@@ -4387,8 +4387,6 @@ widget.latestinbox.title=Inbox
 
 widget.latestnews.comments=[[num_comments]] [[?num_comments|comment|comments]]
 
-widget.latestnews.more=(Read more...)
-
 widget.latestnews.subscribe.add=<a [[aopts]]>Add</a> [[news]] to your reading 
list
 
 widget.latestnews.subscribe.modify=<a [[aopts]]>Modify your subscription</a> 
to [[news]]
diff -r 861cff38f7de -r 54b7f59afe74 cgi-bin/DW/Widget/LatestNews.pm
--- a/cgi-bin/DW/Widget/LatestNews.pm   Thu Dec 03 05:29:36 2009 +0000
+++ b/cgi-bin/DW/Widget/LatestNews.pm   Thu Dec 03 05:31:37 2009 +0000
@@ -65,8 +65,15 @@ sub render_body {
 
     $ret .= "<div class='contents'>";
     $ret .= "<p><a href='" . $entry->url . "'>" . $entry->subject_html . 
"</a></p>";
-    $ret .= "<p>" . $entry->event_html_summary( 300 ) . "</p>";
-    $ret .= "<p><a href='" . $entry->url . "'>" . $class->ml( 
'widget.latestnews.more' ) . "</a></p>";
+
+    if ( $entry->event_raw =~ /<(?:lj-)?cut/ ) {
+        # if we have a cut, then use it
+        $ret .= $entry->event_html( { cuturl => $entry->url } );
+    } else {
+        # if we don't have a cut, we want to output in summary mode
+        $ret .= $entry->event_summary;
+    }
+
     $ret .= "</div>";
 
     return $ret;
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to