summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--data/style.css19
-rw-r--r--lib/VNDB/Handler/Producers.pm5
-rw-r--r--lib/VNDB/Handler/Releases.pm5
-rw-r--r--lib/VNDB/Handler/Tags.pm12
-rw-r--r--lib/VNDB/Handler/VNBrowse.pm5
-rw-r--r--lib/VNDB/Util/CommonHTML.pm19
7 files changed, 43 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 61e1f401..c3d842e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@
- Allow search queries with only one character
- Removed category filter from /v/all
- Added expand/collapse feature to the history browser
+ - Added tabs on v/r/p/g search fields
2.3 - 2009-04-01
- No page reload needed when changing rlist status from vn page
diff --git a/data/style.css b/data/style.css
index aa99acdf..ce510235 100644
--- a/data/style.css
+++ b/data/style.css
@@ -441,6 +441,24 @@ fieldset.search {
fieldset.search .submit {
padding: 0 1px;
}
+p.searchtabs {
+ width: 84%;
+ padding-right: 15%;
+ text-align: center;
+ height: 12px;
+}
+p.searchtabs a {
+ padding: 2px 6px 2px 6px;
+ margin: 0 2px;
+ color: $maintext$!important;
+}
+p.searchtabs a:hover, p.searchtabs a.sel {
+ border: 1px solid $secborder$;
+ border-bottom: none;
+ padding: 1px 5px 2px 5px;
+ background: $secbg$ url($_boxbg$) repeat;
+}
+#q { width: 350px }
/* history browser */
div.mainbox.history td.tc1_1 {
@@ -797,7 +815,6 @@ a.help {
.vnbrowse .tc2 { text-align: right; padding: 0; }
.vnbrowse .tc3 { padding: 0; }
.vnbrowse .tc5 { text-align: right; padding-right: 10px; }
-#q { width: 300px }
#advselect {
text-align: center;
display: block;
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index 2aaa241d..5977ac1e 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -172,10 +172,7 @@ sub list {
div class => 'mainbox';
h1 'Browse producers';
form action => '/p/all', 'accept-charset' => 'UTF-8', method => 'get';
- fieldset class => 'search';
- input type => 'text', name => 'q', id => 'q', class => 'text', value => $f->{q};
- input type => 'submit', class => 'submit', value => 'Search!';
- end;
+ $self->htmlSearchBox('p', $f->{q});
end;
p class => 'browseopts';
for ('all', 'a'..'z', 0) {
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm
index e816b080..6b773c9f 100644
--- a/lib/VNDB/Handler/Releases.pm
+++ b/lib/VNDB/Handler/Releases.pm
@@ -563,10 +563,7 @@ sub _filters {
div class => 'mainbox';
h1 'Browse releases';
- fieldset class => 'search';
- input type => 'text', name => 'q', id => 'q', class => 'text', value => $f->{q};
- input type => 'submit', class => 'submit', value => 'Search!';
- end;
+ $self->htmlSearchBox('r', $f->{q});
a id => 'advselect', href => '#';
lit '<i>'.($shown?'&#9662;':'&#9656;').'</i> filters';
diff --git a/lib/VNDB/Handler/Tags.pm b/lib/VNDB/Handler/Tags.pm
index 6838e7c7..a6d02698 100644
--- a/lib/VNDB/Handler/Tags.pm
+++ b/lib/VNDB/Handler/Tags.pm
@@ -368,11 +368,8 @@ sub taglist {
div class => 'mainbox';
h1 $title;
form action => '/g/list', 'accept-charset' => 'UTF-8', method => 'get';
- fieldset class => 'search';
- input type => 'hidden', name => 't', value => $f->{t};
- input type => 'text', name => 'q', id => 'q', class => 'text', value => $f->{q};
- input type => 'submit', class => 'submit', value => 'Search!';
- end;
+ input type => 'hidden', name => 't', value => $f->{t};
+ $self->htmlSearchBox('g', $f->{q});
end;
p class => 'browseopts';
a href => "/g/list?q=$f->{q};t=-1", $f->{t} == -1 ? (class => 'optselected') : (), 'All';
@@ -590,10 +587,7 @@ sub tagindex {
a class => 'addnew', href => "/g/new", ($self->authCan('tagmod')?'Create':'Request').' new tag' if $self->authCan('tag');
h1 'Search tags';
form action => '/g/list', 'accept-charset' => 'UTF-8', method => 'get';
- fieldset class => 'search';
- input type => 'text', name => 'q', id => 'q', class => 'text';
- input type => 'submit', class => 'submit', value => 'Search!';
- end;
+ $self->htmlSearchBox('g', '');
end;
end;
diff --git a/lib/VNDB/Handler/VNBrowse.pm b/lib/VNDB/Handler/VNBrowse.pm
index 24fa8508..5eb8e4f8 100644
--- a/lib/VNDB/Handler/VNBrowse.pm
+++ b/lib/VNDB/Handler/VNBrowse.pm
@@ -103,10 +103,7 @@ sub _filters {
div class => 'mainbox';
h1 'Browse visual novels';
form action => '/v/all', 'accept-charset' => 'UTF-8', method => 'get';
- fieldset class => 'search';
- input type => 'text', name => 'q', id => 'q', class => 'text', value => $f->{q};
- input type => 'submit', class => 'submit', value => 'Search!';
- end;
+ $self->htmlSearchBox('v', $f->{q});
end;
p class => 'browseopts';
for ('all', 'a'..'z', 0) {
diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm
index 1d6ae43b..7421b1c0 100644
--- a/lib/VNDB/Util/CommonHTML.pm
+++ b/lib/VNDB/Util/CommonHTML.pm
@@ -12,7 +12,7 @@ use POSIX 'ceil';
our @EXPORT = qw|
htmlMainTabs htmlDenied htmlHiddenMessage htmlBrowse htmlBrowseNavigate
- htmlRevision htmlEditMessage htmlItemMessage htmlVoteStats htmlHistory
+ htmlRevision htmlEditMessage htmlItemMessage htmlVoteStats htmlHistory htmlSearchBox
|;
@@ -518,4 +518,21 @@ sub htmlHistory {
}
+sub htmlSearchBox {
+ my($self, $sel, $v) = @_;
+
+ p class => 'searchtabs';
+ a href => '/v/all', $sel eq 'v' ? (class => 'sel') : (), 'Visual novels';
+ a href => '/r', $sel eq 'r' ? (class => 'sel') : (), 'Releases';
+ a href => '/p/all', $sel eq 'p' ? (class => 'sel') : (), 'Producers';
+ a href => '/g', $sel eq 'g' ? (class => 'sel') : (), 'Tags';
+ end;
+ fieldset class => 'search';
+ input type => 'text', name => 'q', id => 'q', class => 'text', value => $v;
+ input type => 'submit', class => 'submit', value => 'Search!';
+ end;
+}
+
+
+
1;