changeset 243:466ea3e4b039

Search box localted to the top of home page.
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 10 Jul 2016 20:39:37 +0859
parents 7dd85c224bbb
children 6a3e03ab19a6
files examples/common/default/default.css examples/common/default/home.m4.html s4-funcs.sh
diffstat 3 files changed, 24 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/examples/common/default/default.css	Fri Jul 08 19:26:09 2016 +0859
+++ b/examples/common/default/default.css	Sun Jul 10 20:39:37 2016 +0859
@@ -125,8 +125,14 @@
 div.xy120x120 {min-width: 120px; min-height: 140px;}
 div.xy96x96 {min-width: 96px; min-height: 116px;}
 div.xy50x50 {min-width: 50px; min-height: 70px;}
-div.right {clear: both; float: right;}
+div.right, div.search {clear: both; float: right;}
 *.clear {clear: both;}
+div.search input[type="text"] {
+    border: solid 1px #bbb; border-radius: 0.5ex; min-height: 20px;
+    margin: 1em; padding: 0 0.5ex; padding-left: 18px;
+    background: url("../../img/loupe.png") left center no-repeat
+		   rgba(242,240,240,0.7);
+}
 
 /*
  * PR Web
--- a/examples/common/default/home.m4.html	Fri Jul 08 19:26:09 2016 +0859
+++ b/examples/common/default/home.m4.html	Sun Jul 10 20:39:37 2016 +0859
@@ -1,3 +1,4 @@
+<div class="search">_SEARCH_</div>
 <h1>_TITLE_</h1>
 <p class="profimg">_PROFIMG_</p>
 <div class="home">
--- a/s4-funcs.sh	Fri Jul 08 19:26:09 2016 +0859
+++ b/s4-funcs.sh	Sun Jul 10 20:39:37 2016 +0859
@@ -1421,6 +1421,18 @@
 EOF
 }
 
+search_form() {
+  cat<<-EOF
+	<div class="fr">
+	<form action="$myname">
+	<input type="text" name="kwd" value=""
+	 placeholder=" 全記事からの検索 " width="10">
+	<input type="hidden" name="stage" value="searchart">
+	</form>
+	</div>
+	EOF
+}
+
 showhome() {
   # $1=userRowIdToShow
   err showhome \$1=$1
@@ -1450,8 +1462,9 @@
   fi
   . ./s4-blog.sh
 
-  tf=$tmpd/title.$$ pf=$tmpd/profile.$$ bf=$tmpd/blogs.$$
-  echo "$gecos さん" > $tf
+  tf=$tmpd/title.$$ pf=$tmpd/profile.$$ bf=$tmpd/blogs.$$ sf=$tmpd/search.$$
+  search_form		> $sf
+  echo "$gecos さん"	> $tf
   viewtable $formdir/user.def user $1	> $pf
 
   sqcond="WHERE name='$uname' AND key='profimg' AND type LIKE 'file:image%'"
@@ -1472,6 +1485,7 @@
 	    -D_PROFILE_="spaste(\`$pf')$conflink" \
 	    -D_PROFIMG_="spaste(\`$imf')" \
 	    -D_BLOGS_="spaste(\`$bf')" \
+	    -D_SEARCH_="spaste(\`$sf')" \
 	    -D_NBLOG_="$nblog" \
 	    -D_GROUPS_="syscmd(\`cat')" \
 	    $layout/html.m4.html $layout/home.m4.html
@@ -1532,18 +1546,6 @@
 	</div>
 	EOF
     fi
-    cat<<EOF
-<div class="fold">
-`cgi_checkbox srchall yes id="sa"`<label
- for="sa">SNS全体から検索</label>
-<div>
-EOF
-    cgi_form searchart<<EOF
-<label>`cgi_text kwd`という語を含む記事を全部から検索</label>
-EOF
-    cat<<EOF
-</div></div>
-EOF
   fi
   #
   # Record access log

yatex.org