yokcel (yokcel) wrote in changelog,
yokcel
yokcel
changelog

[ljcom] r11631: LJSUP-11630: Sticks for comments

Committer: ybuhvalova
LJSUP-11630: Sticks for comments
U   trunk/bin/upgrading/s2layers/sup/themes.s2
Modified: trunk/bin/upgrading/s2layers/sup/themes.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sup/themes.s2	2012-03-26 11:28:19 UTC (rev 11630)
+++ trunk/bin/upgrading/s2layers/sup/themes.s2	2012-03-26 12:29:18 UTC (rev 11631)
@@ -2607,4 +2607,266 @@
     </div>
 """;
     _Footer();
+}
+
+function EntryPage::print_comment_full (Comment c) {
+    var Page p = get_page();
+    var string poster = defined $c.poster ? _user_print($c.poster, "microformatted") : "<em>$*text_poster_anonymous</em>";
+    var string evenodd = $c.depth % 2 ? "odd" : "even";
+    if (defined $c.userpic and $*comment_userpic_style != "off") {
+        var int w = $c.userpic.width;
+        var int h = $c.userpic.height;
+        """<div class="comment-head $evenodd"><div class="comment-upic"><img src="$c.userpic.url" width="$w" height="$h" alt="$c.userpic.alttext" /></div>""";
+    } else {
+        """<div class="comment-head $evenodd cwoup">""";
+    }
+    
+    if ($*old_s1) {
+        """<div class="comment-head-in">""";
+        if (defined $c.subject_icon or $c.subject != "") {
+            """<h3>$c.subject_icon $c.subject</h3>""";
+        }
+        "<p>$poster</p>";
+        "<p>" + $c->time_display();
+        if ($c.metadata{"poster_ip"}) { " (" + $c.metadata{"poster_ip"} + ") "; }
+        """ (<a class="comment-permalink" href="$c.permalink_url">$*text_permalink</a>) """;
+        $c->print_linkbar();
+        if ($this.multiform_on) {
+            $c->print_multiform_check();
+            print safe """ <label for="ljcomsel_$c.talkid">$*text_multiform_check_clean</label>""";
+        }
+        "</p>";
+        "</div>";
+    } else {
+        """<div class="comment-head-in">""";
+        if (defined $c.subject_icon or $c.subject != "") {
+            """<h3>$c.subject_icon $c.subject</h3>""";
+        }
+        "<p>$poster</p>";
+        """<p><a class="comment-permalink" href="$c.permalink_url">""" + $c->time_display() +    "</a>";
+        if ($this.multiform_on) {
+            print safe """ <label for="ljcomsel_$c.talkid">$*text_multiform_check</label>""";
+            $c->print_multiform_check();
+        }
+        $c->print_linkbar();
+        "</p>";
+        if ($c.metadata{"poster_ip"}) { "<p>(" + $c.metadata{"poster_ip"} + ")</p>"; }
+        "</div>";
+    }
+    
+    "</div>";
+
+    """<div class="comment-text">"""; $c->print_text(); "</div>";
+    """<div class="comment-menu">""";
+    if ($c.frozen) {
+        print safe "<span>$*text_comment_frozen</span> ";
+    } elseif($c.screened) {
+        var Link link = $c->get_link("unscreen_to_reply");
+        """<span><a class="unscreen-to-reply" href="$link.url" title="$link.caption">$link.caption</a></span> """;
+    } elseif ((not $c.spam) or ($p.showspam)) {
+        $c->print_reply_link({"linktext" => $*text_comment_reply}); " ";
+    }
+    if ($c.parent_url != "") { print safe """<span><a href="$c.parent_url">$*text_comment_parent</a></span> """; }
+    if (($c.thread_url != "") and (not $c.spam)) {
+        print safe """<span><a href="$c.thread_url">$*text_comment_thread</a></span> """;
+        if ($c.parent_url != "") {
+            $c->print_expand_collapse_links({ "expand"=>"<span>%_</span>", "collapse"=>"<span>%_</span>"}); 
+        }
+    }
+    """</div><div class="hr"><hr /></div>""";
+}
+
+#NEWLAYER: sup/friendstimes
+layerinfo "type" = "theme";
+layerinfo "name" = "Friendstimes";
+layerinfo "redist_uniq" = "sup/friendstimes";
+set theme_css = "friendstimes.css";
+
+function _print_entry(Entry e) {
+    var Page p = get_page();
+    var string entrydate = _dateTime($e.time);
+    var string isodate = $e.time->date_format("%%yyyy%%-%%mm%%-%%dd%%T%%HH%%:%%min%%:%%sec%%+03:00");
+    var string entrydate_year = $e.time->date_format("%%yyyy%%");
+    var string entrydate_month = $e.time->date_format("%%mm%%");
+    var string entrydate_day = $e.time->date_format("%%dd%%");
+    var string olds1date = """<a href="$*base_url/$entrydate_year/">$entrydate_year</a>-<a href="$*base_url/$entrydate_year/$entrydate_month/">$entrydate_month</a>-<a href="$*base_url/$entrydate_year/$entrydate_month/$entrydate_day">$entrydate_day</a> """ + $e.time->date_format("%%HH%%:%%min%%:%%sec%%");
+    var string extraclasses = "";
+    #cornerz things need refactoring, cause now it's so messed up
+    var string corners1 = "";
+    var string corners1_2 = "";
+    var string corners1_3 = "";
+    var string corners2 = "";
+    
+
+    var string _entry_title = "$e.delayed_icon" + "$e.sticky_icon" + "$e.security_icon" + 
+        ($p.view=="entry" or $p.view=="reply"
+        ? ($e.subject == "" ? $*text_nosubject : $e.subject) + """<a href="$e.permalink_url" rel="bookmark" style="display:none;"></a>"""
+        : ($e.subject == "" ? ("""<a href="$e.permalink_url" class="subj-link" rel="bookmark">$*text_nosubject</a>""") : $e -> formatted_subject({"class"=>"subj-link","rel"=>"bookmark"})) + "$corners1_2");
+    if (not $e.comments.enabled) {
+        $extraclasses = $extraclasses + " disabledcomments";
+    }
+
+"""
+                <div class="entry-wrap">$corners1
+                <dl class="entry hentry$extraclasses" id="post-$e.journal.username-$e.itemid">
+""";
+    if ($p.view=="entry" or $p.view=="reply") {
+        if ($*old_s1) {
+            """
+            <dl class="vcard author author-olds1">
+                """;
+                if ($e.userpic) { """<dt"""; if ($e.poster.username!=$e.journal.username and not ($p.journal.journal_type == "C" and $p.view == "recent" )){ print " data-journal=\"" + $e.journal->base_url() + "\""; }""">"""; $e.userpic->print(); """</dt>"""; } else { """<dt></dt>"""; }
+                """
+                <dd class="username">$e.journal.name """; if ($e.poster.username!=$e.journal.username and not ($p.journal.journal_type == "C" and $p.view == "recent" )){ print _user_print_journal($e.poster, "inside", $e.journal.username); " $*text_user_posts_in "; print _user_print($e.journal,"simple");} else { print _user_print($e.poster,"inside"); } """</dd>
+                <dd class="entry-date"><abbr class="updated" title="$isodate">@ $olds1date</abbr></dd>
+            </dl>
+            """;
+        }
+        """<dt class="entry-title entry-linkbar"><span class="entry-linkbar-inner">""";
+        $e->print_linkbar();
+        """$corners1_2</span></dt>""";
+    }
+
+"""
+                    <dt class="entry-title">""";
+                    if ((not $*old_s1) or ($*old_s1 and $p.view!="entry" and $p.view!="reply")) {
+"""
+                        <dl class="vcard author">
+                            """;
+                            if ($e.userpic) { """<dt"""; if ($e.poster.username!=$e.journal.username and not ($p.journal.journal_type == "C" and $p.view == "recent" )){ print " data-journal=\"" + $e.journal->base_url() + "\""; }""">"""; $e.userpic->print(); """</dt>"""; } else { """<dt></dt>"""; }
+                            """
+                            <dd class="username">"""; if ($e.poster.username!=$e.journal.username and not ($p.journal.journal_type == "C" and $p.view == "recent" )){ print _user_print_journal($e.poster, "inside", $e.journal.username); " $*text_user_posts_in "; print _user_print($e.journal,"simple");} else { print _user_print($e.poster,"inside"); } """</dd>
+                        </dl>
+                        <div class="entry-date"><abbr class="updated" title="$isodate">$entrydate</abbr></div>
+                        <h4>$_entry_title</h4>
+                        
+""";
+                    }
+                    else{
+"""
+                        $_entry_title
+""";
+                    }
+"""
+                    </dt>
+                    <dd class="entry-text">
+""";
+                    
+$e->print_metadata();
+"""<div class="entry-content">""";$e->print_text();"""</div>""";
+"""
+                    </dd>
+""";
+    if ($p.view!="entry" and $p.view!="reply") {
+"""
+            <dd class="entrymenu"><ul>""";
+    
+            $e.comments->print();
+            
+            var Link link;
+            var string url = "";
+            var string text = "";
+            var string{} link_caption = {
+                "edit_entry" => $*text_edit_entry,
+                "edit_tags" => $*text_edit_tags,
+                "mem_add" => $*text_mem_add,
+                "share" => $*text_share,
+                "flag" => $*text_flag,
+                "watch_comments" => $*text_watch_comments,
+                "unwatch_comments" => $*text_unwatch_comments
+            };
+            foreach var string link_key ($e.link_keyseq) {
+                $link = $e->get_link($link_key);
+                if (defined $link) {
+                    $url = $link.url;
+                    $text = $link_caption{$link_key} != "" ? $link_caption{$link_key} : $link.caption;
+                    print safe """<li class="$link_key"><a class="btn btn-simple" href="$url"><span><span><span>$text</span></span></span></a></li>""";
+                    $link->print_raw();
+                }
+                if ($link_key == "give_button") {
+                    print safe """<li class="$link_key btn btn-simple"><span><span><span>""";
+                    $e->print_give_button("string");
+                    print safe """</span></span></span></li>""";
+                }
+            }
+
+            #I LIKE THIS
+            if ($e->is_eventrate_enable()) {
+                if ($p.view!="entry" and $p.view!="reply" and viewer_logged_in()) {
+                    """<li class="i_like_this i_like_this_$e.itemid""";
+                    if ($e->is_myvoice()) {""" i_dont_like_this""";}
+                    """"><a href="#" class="btn btn-simple" onclick="return ILikeThis.rate(event,this,'$e.itemid','$e.journal.username')" title="$*text_i_like_this"><span><span><span>+1""";
+                    if ($e->is_myvoice()) {"""<i class="i_like_this_already">/</i>""";}
+                    """</span></span></span></a></li>""";
+                } else {
+                    if ($p.view!="entry" and $p.view!="reply") {
+                        """<li class="i_like_this"><a href="$*SITEROOT/login.bml?ret=1" class="btn btn-simple" title="$*text_i_like_this"><span><span><span>+1</span></span></span></a></li>""";
+                    }
+                }
+                print """<li class="we_like_this we_like_this_$e.itemid"><a onclick="return ILikeThis.showList(event,this,'$e.itemid','$e.journal.username')" href="$*SITEROOT/alleventrates.bml?journal=$e.journal.username&itemid=$e.itemid" class="btn btn-simple" title="$*text_we_like_this"><span><span><span>"""; print $e->get_eventratescounters(); """</span></span></span></a></li>""";
+            }
+                
+
+                    """</ul></dd>
+""";
+    }
+"""
+                </dl>
+                $corners2</div>
+
+                <div class="hr"><hr /></div>
+""";
+}
+
+function Page::print() {
+    if ($.view == "recent") {$*_RecentPage = $this as RecentPage;} elseif ($.view == "friends") {$*_FriendsPage = $this as FriendsPage;} elseif ($.view == "day") {$*_DayPage = $this as DayPage;} elseif ($.view == "month") {$*_MonthPage = $this as MonthPage;} elseif ($.view == "archive") {$*_YearPage = $this as YearPage;}
+    _global_init_();
+    var string _upic = $.journal.default_pic?"""<div class="userpic"><div class="userpic-in"><img alt="${.journal.default_pic.alttext}" width="${.journal.default_pic.width}" height="${.journal.default_pic.height}" """+ ($*active_theme == "x2" or $*active_theme == "x4"?"style=\"margin-top:"+ (100-${.journal.default_pic.height})/2 +"px;\"":"") +"""src="${.journal.default_pic.url}" /></div></div>""":"";
+    var string _h1 = "<h1>" + _user_print($.journal, "microformatted") + "</h1>";
+    var string _nav = """ <li class="item item-recent""" + (($.view == "recent")?" item-selected":"") + """"><a""" + (($*exact_view != "recent_first")?" rel=\"home\" href=\"$*base_url\"":"") + """>$*text_view_recent</a></li> <li class="item item-friends""" + (($.view == "friends")?" item-selected":"") + """"><a""" + (($*exact_view != "friends_first")?" href=\"$*base_url/friends\"":"") + """>$*text_view_friends</a></li> <li class="item item-archive""" + (($.view == "archive" or $.view == "month" or $.view == "day")?" item-selected":"") + """"><a""" + (($*exact_view != "archive_first")?" href=\"$*base_url/calendar\"":"") + """>$*text_view_archive</a></li> <li class="item item-profile"><a href="$*base_url/profile">$*text_view_userinfo</a></li> """;
+    var string rsslink = ($.data_link{"rss"})?($.data_link{"rss"}.url):"$*base_url/data/rss";
+    var Link addlink = $.journal -> get_link("add_friend");
+    
+    var string addfriend = (not viewer_is_owner() and $addlink.url != "") ? $addlink.url : "";
+    var string _nav_sub = ($addfriend ? """ <li class="item item-addfriend"><a class="btn btn-add" href="$addfriend"><span><span><span>$*text_friend_add</span></span></span></a></li> """ : "") + """ <li class="item item-rss"><a class="btn btn-rss" href="$rsslink"><span><span><span>RSS</span></span></span></a></li>""";
+    if ($*active_theme == "x3") { $_nav_sub = ($addfriend ? """ <li class="item item-addfriend"><a href="$addfriend">$*text_friend_add</a></li> """ : "") + """ <li class="item item-rss"><a href="$rsslink">RSS</a></li> """; }
+    var string _h2 = """<h2><span>$.global_title</span></h2>""";
+    var string _h3 = "";
+    if ($.view == "friends" and $*_FriendsPage.friends_title != "") {
+        $_h3 = "<h3><span>$*_FriendsPage.friends_title</span></h3>";
+    } elseif ($.global_subtitle != "") {
+        $_h3 = "<h3><span>$.global_subtitle</span></h3>";
+    }
+    var string _hfeed = ($.view=="recent" or $.view=="friends" or $.view=="day")?" hfeed":"";
+    _Header();
+"""
+<div id="page">
+    <div class="layout">
+    <div class="layout-inner">
+
+            <div class="header">
+                $_upic
+                $_h2
+                $_h3
+
+                <ul class="nav">
+                    $_nav
+                    $_nav_sub
+                </ul>
+                <div class="hr hr-afterhead"><hr /></div>
+            </div>
+            <div class="content$_hfeed">
+                <div class="content-inner">
+                    """;$this->print_body();"""
+                </div>
+            </div>
+
+""";
+            _Sidebar();
+"""
+        </div>
+        </div>
+    </div>
+""";
+    _Footer();
 }
\ No newline at end of file

Tags: ljcom, s2, ybuhvalova, yokcel
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