diff options
-rw-r--r-- | css/v2.css | 7 | ||||
-rw-r--r-- | elm/ReleaseEdit.elm | 12 | ||||
-rw-r--r-- | lib/VNWeb/Releases/Edit.pm | 3 | ||||
-rw-r--r-- | lib/VNWeb/Releases/Lib.pm | 10 | ||||
-rw-r--r-- | lib/VNWeb/Releases/Page.pm | 9 | ||||
-rw-r--r-- | sql/schema.sql | 6 | ||||
-rw-r--r-- | static/f/ero.svg | 10 | ||||
-rw-r--r-- | util/updates/2022-04-05-releases-has-ero.sql | 5 |
8 files changed, 46 insertions, 16 deletions
@@ -460,7 +460,8 @@ div.postsearch td.tc3 { width: 90px; } .releases tr.vn > td { background: $boxbg; font-weight: bold; } .releases tr.vn .ulist-widget-icon { padding-right: 10px } .releases td.tc1 { padding-left: 30px; width: 80px; white-space: nowrap } -.releases td.tc2 { text-align: center; width: 50px; white-space: nowrap } +.releases td.tc2 { width: 70px; white-space: nowrap } +.releases td.tc2 .release_icons { float: none } .releases td.tc3 { text-align: right; padding: 0; width: 120px; } .releases td.tc_icons { padding: 0 4px } .releases td.tc_prod { color: $grayedout; white-space: nowrap; width: 50px } @@ -1356,9 +1357,9 @@ a .icons { cursor: pointer } @import 'data/icons/icons'; .release_icons { width: 16px; height: 16px; float: right; margin-left: 4px; } -.release_icon_voiced2, .release_icon_anim2 { filter: hue-rotate(30deg); } +.release_icon_voiced2, .release_icon_anim2, .release_icon_erocen { filter: hue-rotate(30deg); } .release_icon_voiced3, .release_icon_anim3 { filter: invert(100%) hue-rotate(240deg); } -.release_icon_voiced4, .release_icon_anim4 { filter: hue-rotate(80deg); } +.release_icon_voiced4, .release_icon_anim4, .release_icon_erounc { filter: hue-rotate(80deg); } /* Relation graph colors */ svg .border { fill: none; stroke: $border } diff --git a/elm/ReleaseEdit.elm b/elm/ReleaseEdit.elm index 7bdb4779..aa30a06f 100644 --- a/elm/ReleaseEdit.elm +++ b/elm/ReleaseEdit.elm @@ -38,6 +38,7 @@ type alias Model = , official : Bool , patch : Bool , freeware : Bool + , hasEro : Bool , doujin : Bool , lang : List GRE.RecvLang , plat : Set.Set String @@ -83,6 +84,7 @@ init d = , official = d.official , patch = d.patch , freeware = d.freeware + , hasEro = d.has_ero , doujin = d.doujin , lang = d.lang , plat = Set.fromList <| List.map (\e -> e.platform) d.platforms @@ -131,6 +133,7 @@ encode model = , official = model.official , patch = model.patch , freeware = model.freeware + , has_ero = model.hasEro , doujin = model.doujin , lang = model.lang , platforms = List.map (\l -> {platform=l}) <| Set.toList model.plat @@ -179,6 +182,7 @@ type Msg | Official Bool | Patch Bool | Freeware Bool + | HasEro Bool | Lang Int String | LangMtl Int Bool | LangDel Int @@ -228,6 +232,7 @@ update msg model = Official b -> ({ model | official = b }, Cmd.none) Patch b -> ({ model | patch = b }, Cmd.none) Freeware b -> ({ model | freeware = b }, Cmd.none) + HasEro b -> ({ model | hasEro = b }, Cmd.none) Lang n s -> ({ model | lang = if s /= "" && n == List.length model.lang then model.lang ++ [{lang=s, mtl=False}] else modidx n (\l -> { l | lang = s }) model.lang }, Cmd.none) LangMtl n b-> ({ model | lang = modidx n (\l -> { l | mtl = b }) model.lang }, Cmd.none) LangDel n -> ({ model | lang = delidx n model.lang }, Cmd.none) @@ -365,10 +370,11 @@ viewGen model = ] , tr [ class "newpart" ] [ td [] [] ] - , formField "minage::Age rating" [ inputSelect "minage" model.minage Minage [] ((Nothing, "Unknown") :: List.map (Tuple.mapFirst Just) GT.ageRatings), text " (*)" ] , formField "" [ label [] [ inputCheck "" model.official Official, text " Official (i.e. sanctioned by the original developer of the visual novel)" ] ] , formField "" [ label [] [ inputCheck "" model.patch Patch , text " This release is a patch to another release.", text " (*)" ] ] , formField "" [ label [] [ inputCheck "" model.freeware Freeware, text " Freeware (i.e. available at no cost)" ] ] + , formField "" [ label [] [ inputCheck "" model.hasEro HasEro , text " Contains erotic scenes", text " (*)" ] ] + , formField "minage::Age rating" [ inputSelect "minage" model.minage Minage [] ((Nothing, "Unknown") :: List.map (Tuple.mapFirst Just) GT.ageRatings) ] , formField "Release date" [ D.view model.released False False Released, text " Leave month or day blank if they are unknown." ] , tr [ class "newpart" ] [ td [ colspan 2 ] [ text "Format" ] ] @@ -418,7 +424,7 @@ viewGen model = ] , if model.patch then text "" else formField "voiced::Voiced" [ inputSelect "voiced" model.voiced Voiced [] GT.voiced ] - , if model.minage /= Just 18 then text "" else + , if not model.hasEro then text "" else formField "uncensored::Censoring" [ inputSelect "uncensored" model.uncensored Uncensored [] [ (Nothing, "Unknown") @@ -438,7 +444,7 @@ viewGen model = , td [] <| [ b [] [ text "Cutscenes:" ], br [] [] ] ++ viewAnimation True " No cutscenes" AniCutscene model.ani_cutscene ] ] ] - , if model.minage /= Just 18 then text "" else + , if not model.hasEro then text "" else formField "Erotic scenes" [ table [] [ tr [] [ td [ style "width" "170px" ] <| [ b [] [ text "Character sprites:" ], br [] [] ] ++ viewAnimation False " No sprites" AniEroSp model.ani_ero_sp , td [] <| [ b [] [ text "CGs:" ], br [] [] ] ++ viewAnimation False " No CGs" AniEroCg model.ani_ero_cg diff --git a/lib/VNWeb/Releases/Edit.pm b/lib/VNWeb/Releases/Edit.pm index 1025f246..30005150 100644 --- a/lib/VNWeb/Releases/Edit.pm +++ b/lib/VNWeb/Releases/Edit.pm @@ -11,6 +11,7 @@ my $FORM = { patch => { anybool => 1 }, freeware => { anybool => 1 }, doujin => { anybool => 1 }, + has_ero => { anybool => 1 }, lang => { minlength => 1, sort_keys => 'lang', aoh => { lang => { enum => \%LANGUAGE }, mtl => { anybool => 1 }, @@ -154,7 +155,7 @@ elm_api ReleaseEdit => $FORM_OUT, $FORM_IN, sub { $data->{ani_story_sp} = $data->{ani_story_cg} = $data->{ani_cutscene} = $data->{ani_ero_sp} = $data->{ani_ero_cg} = $data->{ani_face} = $data->{ani_bg} = undef; $data->{engine} = ''; } - if(!defined $data->{minage} || $data->{minage} != 18) { + if(!$data->{has_ero}) { $data->{uncensored} = undef; $data->{ani_ero} = 0; $data->{ani_ero_sp} = $data->{ani_ero_cg} = undef; diff --git a/lib/VNWeb/Releases/Lib.pm b/lib/VNWeb/Releases/Lib.pm index 1f9de9e5..67d4ec25 100644 --- a/lib/VNWeb/Releases/Lib.pm +++ b/lib/VNWeb/Releases/Lib.pm @@ -28,7 +28,7 @@ sub releases_by_vn { sub enrich_release { my($r) = @_; enrich_merge id => - 'SELECT id, title, original, notes, minage, official, freeware, doujin, reso_x, reso_y, voiced, uncensored + 'SELECT id, title, original, notes, minage, official, freeware, has_ero, reso_x, reso_y, voiced, uncensored , ani_story, ani_ero, ani_story_sp, ani_story_cg, ani_cutscene, ani_ero_sp, ani_ero_cg, ani_face, ani_bg FROM releases WHERE id IN', $r; enrich_merge id => sub { sql 'SELECT id, MAX(rtype) AS rtype FROM releases_vn WHERE id IN', $_, 'GROUP BY id' }, grep !$_->{rtype}, ref $r ? @$r : $r; @@ -122,13 +122,17 @@ sub release_row_ { icon_ "resolution_$type", resolution $r; } icon_ $MEDIUM{ $r->{media}[0]{medium} }{icon}, join ', ', map fmtmedia($_->{medium}, $_->{qty}), $r->{media}->@* if $r->{media}->@*; - icon_ 'uncensor', 'Uncensored' if $r->{uncensored}; icon_ 'notes', bb_format $r->{notes}, text => 1 if $r->{notes}; } tr_ $mtl ? (class => 'mtl') : (), sub { td_ class => 'tc1', sub { rdate_ [grep $_->{lang} eq $opt->{lang}, $opt->{lang}?$r->{lang}->@*:()]->[0]{released}//$r->{released} }; - td_ class => 'tc2', defined $r->{minage} ? minage $r->{minage} : ''; + td_ class => 'tc2', sub { + txt_ defined $r->{minage} ? minage $r->{minage} : ''; + icon_ 'ero', + $r->{uncensored} ? 'Contains uncensored erotic scenes' : defined $r->{uncensored} ? 'Contains erotic scenes with optical censoring' : 'Contains erotic scenes', + $r->{uncensored} ? 'erounc' : defined $r->{uncensored} ? 'erocen' : '' if $r->{has_ero}; + }; td_ class => 'tc3', sub { platform_ $_ for $r->{platforms}->@*; if(!$opt->{lang}) { diff --git a/lib/VNWeb/Releases/Page.pm b/lib/VNWeb/Releases/Page.pm index 3dcb3925..27b9d4ef 100644 --- a/lib/VNWeb/Releases/Page.pm +++ b/lib/VNWeb/Releases/Page.pm @@ -25,7 +25,7 @@ sub _rev_ { # The old ani_* fields are automatically inferred from the new ani_* fields # for edits made after the fields were introduced. Hide the old fields for # such revisions to remove some clutter. - my $newani = $r->{chid} > 1110896; # <- TODO: Update this to latest chid on release + my $newani = $r->{chid} > 1110896; revision_ $r, \&enrich_item, [ vn => 'Relations', fmt => sub { abbr_ class => "icons rt$_->{rtype}", title => $_->{rtype}, ' '; @@ -35,6 +35,7 @@ sub _rev_ { [ official => 'Official', fmt => 'bool' ], [ patch => 'Patch', fmt => 'bool' ], [ freeware => 'Freeware', fmt => 'bool' ], + [ has_ero => 'Has ero', fmt => 'bool' ], [ doujin => 'Doujin', fmt => 'bool' ], [ uncensored => 'Uncensored', fmt => 'bool' ], [ title => 'Title (Romaji)' ], @@ -220,9 +221,9 @@ sub _infotable_ { } if defined $r->{minage}; tr_ sub { - td_ 'Censoring'; - td_ $r->{uncensored} ? 'No optical censoring (like mosaics)' : 'Includes optical censoring (e.g. mosaics)'; - } if defined $r->{uncensored}; + td_ 'Erotic content'; + td_ $r->{uncensored} ? 'Contains uncensored erotic scenes' : defined $r->{uncensored} ? 'Contains erotic scenes with optical censoring' : 'Contains erotic scenes', + } if $r->{has_ero}; for my $t (qw|developer publisher|) { my @prod = grep $_->{$t}, @{$r->{producers}}; diff --git a/sql/schema.sql b/sql/schema.sql index 2e6e851a..034decf8 100644 --- a/sql/schema.sql +++ b/sql/schema.sql @@ -436,7 +436,8 @@ CREATE TABLE releases ( -- dbentry_type=r ani_ero_sp animation, -- [pub] ani_ero_cg animation, -- [pub] ani_bg boolean, -- [pub] - ani_face boolean -- [pub] + ani_face boolean, -- [pub] + has_ero boolean NOT NULL DEFAULT FALSE -- [pub] ); -- releases_hist @@ -498,7 +499,8 @@ CREATE TABLE releases_hist ( ani_ero_sp animation, ani_ero_cg animation, ani_bg boolean, - ani_face boolean + ani_face boolean, + has_ero boolean NOT NULL DEFAULT FALSE ); -- releases_lang diff --git a/static/f/ero.svg b/static/f/ero.svg new file mode 100644 index 00000000..2f1fce66 --- /dev/null +++ b/static/f/ero.svg @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 451.731 451.731"> +<path fill="#914040" opacity="1.00" d="M144.814,228.249l-40.308,20.638c-8.908,4.561-19.414,3.968-27.713-1.317l-0.228,12.415 c-0.229,12.46,9.687,22.747,22.147,22.975c15.164,0.279,27.552,0.506,42.785,0.785c-1.177-12.487-0.984-25.444,0.624-38.807 C142.783,239.442,143.682,233.875,144.814,228.249z"/> +<path fill="#914040" opacity="1.00" d="M122.2,173.67l11.286-28.925l-5.112,44.924L85.44,211.653c-6.854,3.51-9.565,11.912-6.056,18.767 c3.511,6.858,11.915,9.565,18.767,6.057l49.588-25.39c4.156-2.128,6.971-6.195,7.499-10.835l5.957-52.351l3.127,21.351 c9.827-21.642,20.615-39.138,27.844-49.885l-18.391-13.678c-10-7.438-24.135-5.36-31.573,4.639l-24.015,32.288 C110.914,152.395,112.762,166.114,122.2,173.67z"/> +<circle fill="#914040" opacity="1.00" cx="95.472" cy="100.425" r="33.403"/> +<path fill="#914040" opacity="1.00" d="M433.672,344.782H177.559c-5.692,0-19.696-2.01-26.782-20.634c-3.322-8.731-5.811-17.802-7.487-27.169 H12.5c-6.903,0-12.5,5.597-12.5,12.5v47.303c0,6.903,5.597,12.5,12.5,12.5h21.786v7.325c0,4.476,3.628,8.104,8.104,8.104h40.652 c4.476,0,8.104-3.628,8.104-8.104v-7.325h272.08v7.325c0,4.476,3.628,8.104,8.104,8.104h40.652c4.476,0,8.104-3.628,8.104-8.104 v-7.325h19.146c6.903,0,12.5-5.597,12.5-12.5v-18.531C446.829,342.355,440.519,344.782,433.672,344.782z"/> +<path fill="#914040" opacity="1.00" d="M169.469,317.035c1.542,4.051,3.756,7.747,8.09,7.747h256.113c3.974,0,7.361-2.881,7.999-6.803 l5.171-31.802c5.05-31.058-16.426-57.291-46.657-66.021c-61.268-17.692-68.334-86.872-183.894-100.206 C216.291,119.951,134.372,224.8,169.469,317.035z"/> +<path fill="#914040" opacity="1.00" d="M32.927,272.295c19.491,0.358,35.31-16.033,33.926-35.771c-1.209-17.255-15.427-30.708-32.7-31.025 c-18.445-0.339-33.672,14.34-34.011,32.785C-0.196,256.729,14.482,271.956,32.927,272.295z"/> +</svg> diff --git a/util/updates/2022-04-05-releases-has-ero.sql b/util/updates/2022-04-05-releases-has-ero.sql new file mode 100644 index 00000000..f31d9f04 --- /dev/null +++ b/util/updates/2022-04-05-releases-has-ero.sql @@ -0,0 +1,5 @@ +ALTER TABLE releases ADD COLUMN has_ero boolean NOT NULL DEFAULT FALSE; +ALTER TABLE releases_hist ADD COLUMN has_ero boolean NOT NULL DEFAULT FALSE; +UPDATE releases SET has_ero = TRUE WHERE minage = 18; +UPDATE releases_hist SET has_ero = TRUE WHERE minage = 18; +\i sql/editfunc.sql |