Просмотр исходного кода

Merge branch 'ptcms' of github.com:teodesian/tCMS into ptcms

Andy Baugh 5 лет назад
Родитель
Сommit
dadb48eb7f
6 измененных файлов с 38 добавлено и 11 удалено
  1. 9 2
      CHANGELOG
  2. 7 6
      lib/Trog/Data/DUMMY.pm
  3. 10 0
      www/scripts/post.js
  4. 4 1
      www/templates/posts.tx
  5. 4 1
      www/templates/profile.tx
  6. 4 1
      www/templates/tags.tx

+ 9 - 2
CHANGELOG

@@ -1,5 +1,12 @@
-Version 3.0 Perlized
-* TODO
+Version 3.0 Perlized [ALPHA]
+* Re-write with perl/psgi.
+* Re-architected to support multiple data backends, most important default one being elasticsearch
+* Simplified configuration model drastically
+* Multimedia content now first-class posts rather than junk in /fileman
+* Series of content now supported for easy category browsing
+* Private/Unlisted content now supported
+* User About pages now much easier to build
+* Theming massively simplified
 
 Version 2.0 IRONMAN SLOG development notes [ALPHA]:
 * tCMS now has an installer/updater in bin/installer. Makefile rules 'make install' and 'make update' also do this.

+ 7 - 6
lib/Trog/Data/DUMMY.pm

@@ -48,7 +48,7 @@ Posts generally need to have the following:
 
 =head2 new(Config::Simple $config)
 
-Try not to do expensive things here.  
+Try not to do expensive things here.
 
 =cut
 
@@ -129,7 +129,7 @@ sub get ($self, %request) {
     my $pages = int(scalar(@filtered) / ($offset || 1) );
 
     @filtered = splice(@filtered, ( int($request{page}) -1) * $offset, $offset) if $request{page} && $request{limit};
-    
+
     # Next, go ahead and build the "post type"
     @filtered = _add_post_type(@filtered);
     # Next, add the type of post this is
@@ -184,9 +184,10 @@ sub _add_media_type (@posts) {
     return map {
         my $post = $_;
         $post->{content_type} //= '';
-        $post->{is_video} = 1 if $post->{content_type} =~ m/^video\//;
-        $post->{is_audio} = 1 if $post->{content_type} =~ m/^audio\//;
-        $post->{is_image} = 1 if $post->{content_type} =~ m/^image\//;
+        $post->{is_video}   = 1 if $post->{content_type} =~ m/^video\//;
+        $post->{is_audio}   = 1 if $post->{content_type} =~ m/^audio\//;
+        $post->{is_image}   = 1 if $post->{content_type} =~ m/^image\//;
+        $post->{is_profile} = 1 if grep {$_ eq 'about' } @{$post->{tags}};
         $post
     } @posts;
 }
@@ -225,7 +226,7 @@ sub _process ($post) {
 
     $post->{href}      = _handle_upload($post->{file}, $post->{id})         if $post->{file};
     $post->{preview}   = _handle_upload($post->{preview_file}, $post->{id}) if $post->{preview_file};
-    $post->{wallpaper} = _handle_upload($post->{wallpaper}, $post->{id})    if $post->{wallpaper};
+    $post->{wallpaper} = _handle_upload($post->{wallpaper_file}, $post->{id})    if $post->{wallpaper_file};
     $post->{preview} = $post->{href} if $post->{app} eq 'image';
     delete $post->{app};
     delete $post->{file};

+ 10 - 0
www/scripts/post.js

@@ -6,3 +6,13 @@ function switchMenu(obj) {
         el.style.display = '';
     }
 }
+
+function add2tags(id) {
+    var select = document.getElementById( id + '-tags');
+    var input  = document.getElementById( id + '-customtag');
+    var newOption = document.createElement('option');
+    newOption.value = input.value;
+    newOption.innerText = input.value;
+    newOption.selected = true;
+    select.appendChild(newOption);
+}

+ 4 - 1
www/templates/posts.tx

@@ -12,6 +12,9 @@
     : if ( $post.aclname && $in_series ) {
     : next;
     : }
+    : if ( $post.is_profile && $post.user == 'Nobody' ) {
+    : next;
+    : }
     :if ( $tiled ) {
         <a href="<: $route :>/<: $post.id :>" class="tile">
         : if ($post.is_video) {
@@ -41,7 +44,7 @@
                 <span id="<: $post.id :>-<: $post.version :>-time" style="float:right;"><: $post.created :></span>
                 <a class='usericon <: $post.user :>' title='Posted by <: $post.user :>'></a>
             </h3>
-            : if ( !$post.video_href && !$post.is_image && !$post.is_video && !$post.wallpaper && $post.preview ) {
+            : if ( !$post.video_href && !$post.is_image && !$post.is_video && !$post.is_profile && $post.preview ) {
                 <div style="background-image:url(<: $post.preview :>);" class="responsive preview"></div>
             : }
             : if ( $post.video_href ) {

+ 4 - 1
www/templates/profile.tx

@@ -5,7 +5,10 @@
     : if ( $post.preview ) {
     <input type="hidden" name="preview" value="<: $post.preview :>" />
     : }
-    Wallpaper<br /><input type="file" class="cooltext" name="wallpaper" placeholder="PROMO.JPG" value="<: $post.background_image :>" />
+    Wallpaper<br /><input type="file" class="cooltext" name="wallpaper_file" placeholder="PROMO.JPG" />
+    : if ( $post.wallpaper ) {
+    <input type="hidden" name="wallpaper" value="<: $post.wallpaper :>" />
+    : }
     Title  <br /><input class="cooltext" type="text" name="title" value="<: $post.title :>" />
     : include "acls.tx";
     : include "tags.tx";

+ 4 - 1
www/templates/tags.tx

@@ -1,6 +1,9 @@
 Tags:<br />
-<select class="cooltext" multiple name="tags">
+<select class="cooltext" multiple name="tags" id="<: $post.id :>-tags" >
     : for $post.tags -> $tag {
         <option value="<: $tag :>" selected><: $tag :></option>
     : }
 </select>
+Add Custom Tag:<br />
+<input class="cooltext" type="text" id="<: $post.id :>-customtag" placeholder="MyTag" />
+<button style="float:right;" onclick="add2tags('<: $post.id :>'); return false;" class="coolbutton" >Add</button>