Browse Source

Various fixes to the release icons feature

It's been a while since I had static/f/ in git, so I had to adjust
.gitignore a bit.

The CSS changes are purely opinion, but it does integrate better with
the existing layout.

Everything else are bug fixes.
Yorhel 10 months ago
parent
commit
c42d62b6e3
4 changed files with 11 additions and 5 deletions
  1. 2
    0
      .gitignore
  2. 0
    0
      data/global.pl
  3. 3
    2
      data/style.css
  4. 6
    3
      lib/VNDB/Handler/VNPage.pm

+ 2
- 0
.gitignore View File

@@ -5,6 +5,8 @@
5 5
 /data/icons/icons.css
6 6
 /static/f/js/
7 7
 /static/f/icons.png
8
+/static/f/vndb.js
9
+/static/f/vndb.js.gz
8 10
 /static/feeds/
9 11
 /static/s/*/style.css
10 12
 /static/s/*/style.css.gz

+ 0
- 0
data/global.pl View File


+ 3
- 2
data/style.css View File

@@ -366,6 +366,7 @@ div#vntags                    { margin: 15px 30px 0 30px; border-top: 1px solid
366 366
 .releases td.tc1       { padding-left: 30px; width: 80px; }
367 367
 .releases td.tc2       { text-align: center; width: 50px; }
368 368
 .releases td.tc3       { text-align: right; padding: 0; width: 90px; }
369
+.releases td.tc_icons  { padding: 0 4px }
369 370
 .releases td.tc5       { width: 70px; }
370 371
 .releases td.tc5 a     { color: $maintext$; border: 0; }
371 372
 .releases td.tc6       { text-align: right; width: 25px; padding: 0; }
@@ -913,8 +914,8 @@ a .icons { cursor: pointer }
913 914
 $iconcss$
914 915
 
915 916
 
916
-.release_icons_container { width: 18px; height: 18px; float: right; margin-left: 4px; }
917
-.release_icons { width: 18px; height: 18px; }
917
+.release_icons_container { width: 16px; height: 16px; float: right; margin-left: 4px; }
918
+.release_icons { width: 16px; height: 16px; }
918 919
 .release_icons.not_voiced, .story_not_animated, .ero_not_animated { }
919 920
 .release_icons.ero_voiced, .story_simple_animated, .ero_simple_animated { filter: hue-rotate(30deg); }
920 921
 .release_icons.partially_voiced, .story_some_fully_animated, .ero_some_fully_animated { filter: invert(100%) hue-rotate(240deg) }

+ 6
- 3
lib/VNDB/Handler/VNPage.pm View File

@@ -783,7 +783,7 @@ sub _releases {
783 783
    table;
784 784
     for my $l (@lang) {
785 785
       Tr class => 'lang';
786
-       td colspan => 6;
786
+       td colspan => 7;
787 787
         cssicon "lang $l", $self->{languages}{$l};
788 788
         txt $self->{languages}{$l};
789 789
        end;
@@ -1007,7 +1007,7 @@ sub add_release_info_icons {
1007 1007
 
1008 1008
     my $ero_anim_code = $releases_data->{ani_ero};
1009 1009
     if($ero_anim_code > 0) {
1010
-        release_info_icon("release_icons ".$self->{icons_ero_animated}[$ero_anim_code], "Story: $self->{animated}[$ero_anim_code]", "ero_animated.svg");
1010
+        release_info_icon("release_icons ".$self->{icons_ero_animated}[$ero_anim_code], "Ero: $self->{animated}[$ero_anim_code]", "ero_animated.svg");
1011 1011
     }
1012 1012
 
1013 1013
     # Cost column
@@ -1027,7 +1027,7 @@ sub add_release_info_icons {
1027 1027
     }
1028 1028
 
1029 1029
     # Media column
1030
-    if (length($releases_data->{media}) > 0 and length($releases_data->{media}[0]->{medium}) > 0) {
1030
+    if (@{$releases_data->{media}}) {
1031 1031
         my $first_medium = $releases_data->{media}[0]->{medium};
1032 1032
         my $media_type = $first_medium eq "in" ? "download" :
1033 1033
             $first_medium eq "cd" || $first_medium eq "dvd" || $first_medium eq "gdr" || $first_medium eq "blr" ? 'disk' : 'cartridge';
@@ -1036,6 +1036,9 @@ sub add_release_info_icons {
1036 1036
     }
1037 1037
 
1038 1038
     # Notes column
1039
+    # TODO: The notes text should to through a bb2html() to strip the tags. But
1040
+    # showing HTML inside a 'title' attribute won't work, and bb2html() doesn't
1041
+    # have a plain text output option.
1039 1042
     if (defined $releases_data->{notes} and length $releases_data->{notes}) {
1040 1043
         release_info_icon "release_icons notes", $releases_data->{notes}, "notes.svg";
1041 1044
     }