George S. Baugh 5 лет назад
Родитель
Сommit
21894262a4
3 измененных файлов с 10 добавлено и 2 удалено
  1. 3 2
      lib/Trog/Data/DUMMY.pm
  2. 1 0
      lib/Trog/Routes/HTML.pm
  3. 6 0
      www/templates/profile.tx

+ 3 - 2
lib/Trog/Data/DUMMY.pm

@@ -170,8 +170,9 @@ sub _add_post_type (@posts) {
     return map {
         my $post = $_;
         my $type = 'file';
-        $type = 'blog' if grep { $_ eq 'blog' } @{$post->{tags}};
-        $type = 'microblog' if grep { $_ eq 'news' } @{$post->{tags}};
+        $type = 'blog'      if grep { $_ eq 'blog' }    @{$post->{tags}};
+        $type = 'microblog' if grep { $_ eq 'news' }    @{$post->{tags}};
+        $type = 'profile'   if grep { $_ eq 'profile' } @{$post->{tags}};
         $post->{type} = $type;
         $post
     } @posts;

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

@@ -292,6 +292,7 @@ sub config ($query, $input, $render_cb) {
         data_models        => _get_data_models(),
         current_theme      => $conf->param('general.theme') // '',
         current_data_model => $conf->param('general.data_model') // 'DUMMY',
+        post_visibilities  => [qw{public private unlisted}],
         route       => '/about',
         category    => '/about',
         types       => ['profile'],

+ 6 - 0
www/templates/profile.tx

@@ -4,6 +4,12 @@
     Avatar *<br /><input class="cooltext" type="file" name="file" />
     Wallpaper<br /><input type="file" class="cooltext" name="wallpaper" placeholder="PROMO.JPG"></input>
     Title  <br /><input class="cooltext" type="text" name="title" />
+    Visibility<br />
+    <select class="cooltext" name="visibility">
+        : for $post_visibilities -> $visibility {
+            <option value="<: $visibility :>"><: $visibility :></option>
+        : }
+    </select>
     Content<br /><textarea class="cooltext" name="comment" placeholder="Potzrebie"></textarea>
     <input type="hidden" name="app" value="file" />
     <input class="coolbutton" type="submit" value="Publish" text="Publish" />