George S. Baugh 5 rokov pred
rodič
commit
84735b282e

+ 6 - 1
lib/Trog/Routes/HTML.pm

@@ -226,6 +226,9 @@ sub index ($query,$render_cb, $content = '', $i_styles = []) {
 
     my @styles = ('/styles/avatars.css');
     if ($theme_dir) {
+        if ($query->{embed}) {
+            unshift(@styles, _themed_style("embed.css")) if -f 'www/'._themed_style("embed.css");
+        }
         unshift(@styles, _themed_style("screen.css"))    if -f 'www/'._themed_style("screen.css");
         unshift(@styles, _themed_style("structure.css")) if -f 'www/'._themed_style("structure.css");
     }
@@ -235,7 +238,8 @@ sub index ($query,$render_cb, $content = '', $i_styles = []) {
 
     my $search_info = Trog::Data->new($conf);
 
-    return $render_cb->('index.tx', {
+    my $tmpl = $query->{embed} ? 'embed.tx' : 'index.tx';
+    return $render_cb->( $tmpl, {
         code        => $query->{code},
         user        => $query->{user},
         search_lang => $search_info->lang(),
@@ -252,6 +256,7 @@ sub index ($query,$render_cb, $content = '', $i_styles = []) {
         category_links => _pick_processor("templates/categories.tx", $processor,$t_processor)->render("categories.tx",$query),
         stylesheets => \@styles,
         show_madeby => $Theme::show_madeby ? 1 : 0,
+        embed       => $query->{embed} ? 1 : 0,
     });
 }
 

+ 3 - 0
www/styles/embed.css

@@ -0,0 +1,3 @@
+.subhead {
+    display: none;
+}

+ 3 - 0
www/templates/embed.tx

@@ -0,0 +1,3 @@
+<div id="kontent" class="kontained">
+    <: $content | mark_raw :>
+</div>

+ 4 - 0
www/templates/header.tx

@@ -9,6 +9,10 @@
         <link rel="stylesheet" type="text/css" href="/styles/structure.css" />
         <link rel="stylesheet" type="text/css" href="/styles/screen.css" media="screen" />
         <link rel="stylesheet" type="text/css" href="/styles/print.css" media="print" />
+        : if ($embed) {
+        <base target="_blank" />
+        <link rel="stylesheet" type="text/css" href="/styles/embed.css" media="screen" />
+        : }
         <!-- Stylesheets !-->
         : for $stylesheets -> $stylesheet {
         <link rel="stylesheet" type="text/css" href="<: $stylesheet :>" media="screen" />

+ 2 - 2
www/templates/paginator.tx

@@ -1,7 +1,7 @@
 :if ( $pages ) {
-<div>
+<div id="paginator">
 : } else {
-<div class="disabled">
+<div id="paginator" class="disabled">
 : }
     : if ( $older ) {
     <div style="float:left; margin-top:.5rem;"> <: $limit :> most recent posts older than <span id="paginatorTime"><: $older :></span></div>

+ 2 - 2
www/templates/posts.tx

@@ -5,9 +5,9 @@
 : }
 </span>
 : if ( $in_series && $rss ) {
-     <p class="subhead">
+     <div class="subhead">
      <: $subhead | mark_raw :>
-     </p>
+     </div>
 : }
 
 : if ( $header ) {