George S. Baugh 4 年之前
父節點
當前提交
f660c989be
共有 4 個文件被更改,包括 19 次插入2 次删除
  1. 7 1
      bin/migrate3.pl
  2. 2 1
      lib/Trog/Routes/HTML.pm
  3. 8 0
      www/styles/screen.css
  4. 2 0
      www/templates/forms/series.tx

+ 7 - 1
bin/migrate3.pl

@@ -34,6 +34,12 @@ my $search_info = Trog::Data->new($conf);
 my @all = $search_info->get( raw => 1, limit => 0 );
 
 #TODO add in the various things we need to data
+foreach my $post (@all) {
+    next unless $post->{form} eq 'series.tx';
+    $post->{tiled} = scalar(grep { $_ eq $post->{local_href} } qw{/files /audio /video /image /series /about});
+    $search_info->add($post);
+}
+
 
 # Rebuild the index
 Trog::SQLite::TagIndex::build_index($search_info);
@@ -60,4 +66,4 @@ my $series = [
         },
 ];
 
-$search_info->add(@$series,@extra_series);
+#$search_info->add(@$series,@extra_series);

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

@@ -935,6 +935,7 @@ sub posts ($query, $render_cb, $direct=0) {
     close($dh);
 
     my $edittype = $query->{primary_post} ? $query->{primary_post}->{child_form} : $query->{form};
+    my $tiled    = $query->{primary_post} ? !$is_admin && $query->{primary_post}->{tiled} : 0;
 
     # Grab the rest of the tags to dump into the edit form
     state $data = Trog::Data->new($conf);
@@ -972,7 +973,7 @@ sub posts ($query, $render_cb, $direct=0) {
         older     => $older,
         sizes     => [25,50,100],
         rss       => !$query->{id} && !$query->{older},
-        tiled     => !$is_admin && scalar(grep { $_ eq $query->{route} } qw{/files /audio /video /image /series /about}),
+        tiled     => $tiled,
         category  => $ph,
         subhead   => $query->{subhead},
         header    => $header,

+ 8 - 0
www/styles/screen.css

@@ -199,6 +199,14 @@ span#clickme:hover {
  background-color: #333;
  width: 100%;
 }
+.coolcb {
+    height: 1.5rem !important;
+    width: 1.5rem !important;
+    display:inline !important;
+    margin-left: 1rem !important;
+    margin-bottom: 1rem !important;
+}
+
 .Submissions input, .Submissions textarea, .Submissions select {
  width: 95%;
  display: block;

+ 2 - 0
www/templates/forms/series.tx

@@ -33,6 +33,8 @@
         Title *<br /><input required class="cooltext" type="text" name="title" placeholder="Iowa Man Destroys Moon" value="<: $post.title :>" />
         URL *<br /><input required class="cooltext" type="text" name="local_href" placeholder="/someurl" value="<: $post.local_href :>" />
         ACL name *<br /><input required class="cooltext" type="text" name="aclname" value="<: $post.aclname :>" />
+        <label for="<: $post.id :>-tiled">Tile Display?<input id="<: $post.id :>-tiled" class="coolcb" type="checkbox" name="tiled" <: if ( $post.tiled ) { "checked" } :> /></label>
+        <br />
         Content Template *<br />
         <select required class="cooltext" name="child_form">
         : for $forms -> $form {