yokcel (yokcel) wrote in changelog,
yokcel
yokcel
changelog

[ljcom] r11607: LJSUP-10444: New Style - tasty food

Committer: ybuhvalova
LJSUP-10444: New Style - tasty food
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-20 12:28:34 UTC (rev 11606)
+++ trunk/bin/upgrading/s2layers/sup/themes.s2	2012-03-20 12:30:27 UTC (rev 11607)
@@ -2420,7 +2420,141 @@
         }
         "</li>";
     }
+}
 
+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>
+                        <h4>$_entry_title</h4>
+                        <div class="entry-date"><abbr class="updated" title="$isodate">$entrydate</abbr></div>
+""";
+                    }
+                    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() {

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