Procházet zdrojové kódy

fix /config route again

George S. Baugh před 4 roky
rodič
revize
6f14160607
3 změnil soubory, kde provedl 15 přidání a 11 odebrání
  1. 7 7
      Makefile
  2. 6 2
      lib/Trog/Routes/HTML.pm
  3. 2 2
      lib/Trog/SQLite/TagIndex.pm

+ 7 - 7
Makefile

@@ -44,10 +44,10 @@ reset: reset-remove install
 
 .PHONY: reset-remove
 reset-remove:
-	rm -rf data
-	rm -rf www/themes
-	rm -rf www/assets
-	rm config/auth.db
-	rm config/main.cfg
-	rm config/has_users
-	rm config/setup
+	rm -rf data; /bin/true
+	rm -rf www/themes; /bin/true
+	rm -rf www/assets; /bin/true
+	rm config/auth.db; /bin/true
+	rm config/main.cfg; /bin/true
+	rm config/has_users; /bin/true
+	rm config/setup; /bin/true

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

@@ -448,6 +448,7 @@ sub _setup_initial_db ($dat, $user) {
             user         => $user,
             form         => 'series.tx',
             child_form   => 'series.tx',
+            aliases      => [],
         },
         {
             "aclname"    => "about",
@@ -464,13 +465,14 @@ sub _setup_initial_db ($dat, $user) {
             user         => $user,
             form         => 'series.tx',
             child_form   => 'profile.tx',
+            aliases      => [],
         },
         {
-            "aclname"      => "admin",
+            "aclname"      => "config",
             acls           => [],
             "callback"     => "Trog::Routes::HTML::config",
             'method'       => 'GET',
-            "content_type" => "text/plain",
+            "content_type" => "text/html",
             "data"         => "Config",
             "href"         => "/config",
             "local_href"   => "/config",
@@ -479,6 +481,7 @@ sub _setup_initial_db ($dat, $user) {
             visibility     => 'private',
             "title"        => "Configure tCMS",
             user           => $user,
+            aliases        => [],
         },
         {
             title      => $user,
@@ -493,6 +496,7 @@ sub _setup_initial_db ($dat, $user) {
             method     => 'GET',
             user       => $user,
             form       => 'profile.tx',
+            aliases    => [],
         },
     );
 }

+ 2 - 2
lib/Trog/SQLite/TagIndex.pm

@@ -62,7 +62,7 @@ sub build_index($data_obj,$posts=[]) {
     $posts = $data_obj->read({ limit => 0, acls => ['admin'] }) unless @$posts;
 
     my @tags = uniq map { @{$_->{tags}} } @$posts;
-    Trog::SQLite::bulk_insert($dbh,'tag', ['name'], 'IGNORE', @tags); 
+    Trog::SQLite::bulk_insert($dbh,'tag', ['name'], 'IGNORE', @tags);
     my $t = $dbh->selectall_hashref("SELECT id,name FROM tag", 'name');
     foreach my $k (keys(%$t)) { $t->{$k} = $t->{$k}->{id} };
 
@@ -91,7 +91,7 @@ sub build_routes($data_obj,$posts=[]) {
     } @$posts;
 
     my @routes = map { ($_->{local_href}, $_->{method_id}, $_->{callback_id} ) } @$posts;
-    Trog::SQLite::bulk_insert($dbh,'routes', [qw{route method_id callback_id}], 'IGNORE', @routes); 
+    Trog::SQLite::bulk_insert($dbh,'routes', [qw{route method_id callback_id}], 'IGNORE', @routes);
 
     # Now, compile the post aliases
     my %routes_actual = routes();