[dw-free] Keep 'link' in the entry management links at all times, not just before comments
[commit: http://hg.dwscoalition.org/dw-free/rev/4fff89dcba6e]
http://bugs.dwscoalition.org/show_bug.cgi?id=2183
Set the permalink URL to always display. Also make it no longer append the
nc=... argument if the option is enabled for that user (nc=... now only
shows up in the readlink). This exposes a new property in CommentInfo,
called permalink_url, for s2 layouts
Patch, joint effort by
kareila and
ninetydegrees.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2183
Set the permalink URL to always display. Also make it no longer append the
nc=... argument if the option is enabled for that user (nc=... now only
shows up in the readlink). This exposes a new property in CommentInfo,
called permalink_url, for s2 layouts
Patch, joint effort by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- bin/upgrading/s2layers/core1.s2
- bin/upgrading/s2layers/core2.s2
- cgi-bin/LJ/S2.pm
- cgi-bin/LJ/S2/EntryPage.pm
- htdocs/preview/entry.bml
-------------------------------------------------------------------------------- diff -r 3b3c90cae87d -r 4fff89dcba6e bin/upgrading/s2layers/core1.s2 --- a/bin/upgrading/s2layers/core1.s2 Sun Mar 14 08:57:41 2010 -0700 +++ b/bin/upgrading/s2layers/core1.s2 Sun Mar 14 09:13:57 2010 -0700 @@ -227,6 +227,7 @@ class CommentInfo { var readonly string read_url "URL pointer to the 'Read Comments' view."; var readonly string post_url "URL pointer to the 'Post Comments' view."; + var readonly string permalink_url "Permanent URL for the entry."; var int count "Current number of comments available to be read by the viewer."; var bool screened "Set to true if there are screened comments and remote user can unscreen them."; var bool enabled "Set to false if comments disabled journal-wide or just on this item."; diff -r 3b3c90cae87d -r 4fff89dcba6e bin/upgrading/s2layers/core2.s2 --- a/bin/upgrading/s2layers/core2.s2 Sun Mar 14 08:57:41 2010 -0700 +++ b/bin/upgrading/s2layers/core2.s2 Sun Mar 14 09:13:57 2010 -0700 @@ -243,6 +243,7 @@ class CommentInfo { var readonly string read_url "URL pointer to the 'Read Comments' view."; var readonly string post_url "URL pointer to the 'Post Comments' view."; + var readonly string permalink_url "Permanent URL for the entry."; var int count "Current number of comments available to be read by the viewer."; var bool screened "Set to true if there are screened comments and remote user can unscreen them."; var bool enabled "Set to false if comments disabled journal-wide or just on this item."; @@ -4981,17 +4982,16 @@ function CommentInfo::print_postlink() { } function CommentInfo::print() { """<ul class="entry-interaction-links">\n"""; + """<li class="entry-permalink first-item"><a href="$.permalink_url">$*text_permalink</a></li>\n"""; if ($.show_readlink) { - """<li class="entry-readlink first-item">"""; + """<li class="entry-readlink">"""; $this->print_readlink(); - "</li>\n"; - } else { - """<li class="entry-permalink first-item"><a href="$.read_url">$*text_permalink</a></li>\n"""; + "</li>\n"; } if ($.show_postlink and $.enabled) { """<li class="entry-replylink">"""; $this->print_postlink(); - "</li>\n"; + "</li>\n"; } "</ul>"; } diff -r 3b3c90cae87d -r 4fff89dcba6e cgi-bin/LJ/S2.pm --- a/cgi-bin/LJ/S2.pm Sun Mar 14 08:57:41 2010 -0700 +++ b/cgi-bin/LJ/S2.pm Sun Mar 14 09:13:57 2010 -0700 @@ -1971,6 +1971,7 @@ sub Entry_from_entryobj my $replycount = $entry_obj->reply_count; my $nc; $nc = "nc=$replycount" if $replycount && $remote && $remote->prop( 'opt_nctalklinks' ); + my $linkurl = LJ::Talk::talkargs( $permalink, $style_args ); my $readurl = LJ::Talk::talkargs( $permalink, $nc, $style_args ); my $posturl = LJ::Talk::talkargs( $permalink, 'mode=reply', $style_args ); @@ -1981,6 +1982,7 @@ sub Entry_from_entryobj my $comments = CommentInfo({ read_url => $readurl, post_url => $posturl, + permalink_url => $linkurl, count => $replycount, maxcomments => ( $replycount >= $u->count_maxcomments ) ? 1 : 0, enabled => $comments_enabled, diff -r 3b3c90cae87d -r 4fff89dcba6e cgi-bin/LJ/S2/EntryPage.pm --- a/cgi-bin/LJ/S2/EntryPage.pm Sun Mar 14 08:57:41 2010 -0700 +++ b/cgi-bin/LJ/S2/EntryPage.pm Sun Mar 14 09:13:57 2010 -0700 @@ -479,12 +479,14 @@ sub EntryPage_entry my $userpic = Image_userpic($pu, $entry->userpic ? $entry->userpic->picid : 0, $pickw); my $permalink = $entry->url; - my $readurl = LJ::Talk::talkargs($permalink, $nc, $style_arg); - my $posturl = LJ::Talk::talkargs($permalink, "mode=reply", $style_arg); + my $linkurl = LJ::Talk::talkargs( $permalink, $style_arg ); + my $readurl = LJ::Talk::talkargs( $permalink, $nc, $style_arg ); + my $posturl = LJ::Talk::talkargs( $permalink, "mode=reply", $style_arg ); my $comments = CommentInfo({ 'read_url' => $readurl, 'post_url' => $posturl, + 'permalink_url' => $linkurl, 'count' => $replycount, 'maxcomments' => ( $replycount >= $u->count_maxcomments ) ? 1 : 0, 'enabled' => ($viewall || ($u->{'opt_showtalklinks'} eq "Y" && !$entry->prop("opt_nocomments"))) ? 1 : 0, diff -r 3b3c90cae87d -r 4fff89dcba6e htdocs/preview/entry.bml --- a/htdocs/preview/entry.bml Sun Mar 14 08:57:41 2010 -0700 +++ b/htdocs/preview/entry.bml Sun Mar 14 09:13:57 2010 -0700 @@ -269,6 +269,7 @@ _c?> my $comments = LJ::S2::CommentInfo({ 'read_url' => "#", 'post_url' => "#", + 'permalink_url' => "#", 'count' => "0", 'maxcomments' => 0, 'enabled' => ($u->{'opt_showtalklinks'} eq "Y" && ! --------------------------------------------------------------------------------