vieweditattachhistoryswikistopchangessearchhelp

検索仕様のブックシェルフの体裁調整



[shelf] → templates (shelf) → search "検索仕様のブックシェルフの体裁"

<?doctype?>
<html>
<head>
<title><?name?></title>
</head>
<body<?colorScheme?>>
<h2><?name?></h2>
<p><font color=gray>このブックシェルフには次の <?countSwikiBooks?> 冊の Swiki ブックが収められています。リストは更新順です。読みたい Swiki ブックの名前部分のリンクをクリックしてください。また、いくつかの Swiki ブックを選択して下の「検索」ボタンを押せば、興味のあるキーワードを含むページだけをリストアップすることもできます。</font><p>
<form action="<?toRoot?>" method="post">
<?searchSwikis?>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><input type="text" size=31 name="search">
<input type="submit" value="検索"><br>&nbsp;</td></tr>
<tr><td><input type="radio" name="casesensitive" value="true"<?caseTrue?>>&nbsp;&nbsp;大文字小文字を区別する&nbsp;&nbsp;&nbsp;<br>
<input type="radio" name="casesensitive" value="false"<?caseFalse?>>&nbsp;&nbsp;大文字小文字を区別しない&nbsp;&nbsp;&nbsp;</td>
<td><input type="radio" name="and" value="true"<?andTrue?>>&nbsp;&nbsp;キーワードおよびフレーズ(例: "I am a phrase")をもれなく含むページ<br>
<input type="radio" name="and" value="false"<?andFalse?>>&nbsp;&nbsp;キーワードもしくはフレーズを、ひとつでも含むページ</td></tr>
</table>
</form>
<?logo?>
</body>
</html>



[shelf] → actions (shelf) → searchSwikis "検索対象にする Swiki ブックを選択できる一覧表示"

| return swikis swikisCol swikis0 |
"Sort Swikis by its Modified Date and Time"
swikis0 _ shelf books select: [ :book |
  (book setup at: 'visible' ifAbsent: [true]) and: [book pages isNil]].
swikisCol _ (shelf books select: [ :book |
  (book setup at: 'visible' ifAbsent: [true])
    and: [book pages notNil]]) collect: [ :book |
      {book. (book pages asSortedCollection: [:x :y |
        (x date = y date) ifTrue: [x time > y time] ifFalse: [x date > y date]]) first}].
swikis _ (swikisCol asSortedCollection: [:x :y |
  (x last date = y last date)
    ifTrue: [x last time > y last time]
    ifFalse: [x last date > y last date]]) collect: [ :item | item first ].
swikis addAll: swikis0.
return _ WriteStream on: String new.
return
  nextPutAll: '<table border=0 cellpadding=0 cellspacing=0>';
  nextPutAll: String crlf.
swikis do: [:book | (book setup at: 'visible' ifAbsent: [true])
  ifTrue: [((book hasPrivAddress: 'searchable') and: [book formatPrivAddress: 'searchable' request: request response: response shelf: shelf])
    ifTrue: [
      return
        nextPutAll: '<tr><td valign=top><input type="checkbox" name="';
        nextPutAll: book showName;
        nextPutAll: '" value="true"'.
      (request fieldsHasKey: book name) ifTrue: [return
        nextPutAll: ' checked'].
      return
        nextPutAll: '>&nbsp;&nbsp;</td><td>';
        nextPutAll: (shelf formatBookTemplate: 'listing' request: request response: response book: book);
        nextPutAll: '</td></tr>';
        nextPutAll: String crlf]
    ifFalse: [return
      nextPutAll: '<tr><td>&nbsp;</td><td>';
      nextPutAll: (shelf formatBookTemplate: 'listing' request: request response: response book: book);
      nextPutAll: '</td></tr>';
      nextPutAll: String crlf]]].
return
  nextPutAll: '</table><br><hr><br>'.
return
  nextPutAll: '<input type="checkbox" name="searchall" value="true"'.
(request fieldsHasKey: 'searchall') ifTrue: [return
  nextPutAll: ' checked'].
return
  nextPutAll: '>&nbsp;&nbsp;<font color=gray>すべての Swiki ブックを検索対象とするときは、こちらをチェック</font>';
  nextPutAll: String crlf.
return nextPutAll: '<br><br>'.
return contents



[shelf] → templates (shelf) → foundBefore "検索結果画面の体裁(上半分)"

<?doctype?>
<html>
<head>
<title>検索結果</title>
</head>
<body<?colorScheme?>>
<h2>検索結果</h2>
<hr>



[shelf] → templates (shelf) → foundMatch "見つかったときの画面"

<table border=0 cellpadding=3 cellspacing=3>
<tr>
<td align=left valign=middle><?emoteHappy?></td>
<td align=left valign=middle><b>条件を満たすページが見つかりました。</b></td>
</tr>
</table>



[shelf] → templates (shelf) → foundNoMatch "見つからなかったときの画面"

<table border=0 cellpadding=3 cellspacing=3>
<tr>
<td align=left valign=middle><?emoteSad?></td>
<td align=left valign=middle><b>条件を満たすページが見つかりません。</b></td>
</tr>
</table>



[shelf] → templates (shelf) → foundAfter "検索結果画面の体裁(下半分)"

<form action="<?toRoot?>" method="post">
<hr><br>
<font color=gray>本サイトには以下の <?countSwikiBooks?> 冊の Swiki ブックがあります。最近、更新されたものから順に表示しています。選択した Swiki ブックから、キーワードを含むページを探し出すこともできます。</font><br><br>
<?searchSwikis?>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><input type="text" size=31 value="<?searchString?>" name="search">
<input type="submit" value="検索"><br>&nbsp;</td></tr>
<tr><td><input type="radio" name="casesensitive" value="true"<?caseTrue?>>&nbsp;&nbsp;大文字小文字を区別する&nbsp;&nbsp;&nbsp;<br>
<input type="radio" name="casesensitive" value="false"<?caseFalse?>>&nbsp;&nbsp;大文字小文字を区別しない&nbsp;&nbsp;&nbsp;</td>
<td><input type="radio" name="and" value="true"<?andTrue?>>&nbsp;&nbsp;キーワードおよびフレーズ(例: "I am a phrase")をもれなく含むページ<br>
<input type="radio" name="and" value="false"<?andFalse?>>&nbsp;&nbsp;キーワードもしくはフレーズを、ひとつでも含むページ</td></tr>
</table>
</form>
<?logo?>
</body>
</html>



[shelf] → addresses (priv) → list "検索結果リスト表示体裁"

"Serve this if an index.html file is not available in /swiki/default/files/"
| hasMatch |
(shelf settingsAt: 'searchable' ifAbsent: [false])
  ifTrue: [(request fieldsHasKey: 'search')
    ifTrue: ["Decrement process priority since it is a search"
      Processor activeProcess priority: (ComancheService defaultSearchPriority).
      response at: 'cacheing' put: true.
      [:stream |
      stream nextPutAll: (shelf formatShelfTemplate: 'foundBefore' request: request response: response).
      hasMatch _ false.
      (shelf books asSortedCollection: [:a :b | (a name) < (b name)]) do: [:book | (((book hasPrivAddress: 'searchable') and: [book formatPrivAddress: 'searchable' request: request response: response shelf: shelf]) and: [(request fieldsHasKey: 'searchall') or: [request fieldsHasKey: book name]]) ifTrue: [book searchFor: (request fieldsKey: 'search') caseSensitive: (request fieldsAsBooleanKey: 'casesensitive') and: (request fieldsAsBooleanKey: 'and') matchBlock: [:page |
        hasMatch ifFalse: [
          hasMatch _ true.
          stream nextPutAll: (shelf formatShelfTemplate: 'foundMatch' request: request response: response).
          stream nextPutAll: '<ul>', String crlf].
        stream
          nextPutAll: '<li><a href="';
          nextPutAll: (request referenceShelf: shelf book: book page: page);
          nextPutAll: '">';
          nextPutAll: book showName;
          nextPutAll: ': ';
          nextPutAll: page showName;
          nextPutAll: '</a> <font color=gray size=-1>最終更新: ';
          nextPutAll: page printDate;
          nextPutAll: ', ';
          nextPutAll: page printTime;
          nextPutAll: ' &lt;';
          nextPutAll: page user;
          nextPutAll: '&gt;</font>', String crlf]]].
      hasMatch
        ifTrue: [stream nextPutAll: '</ul>', String crlf]
        ifFalse: [stream nextPutAll: (shelf formatShelfTemplate: 'foundNoMatch' request: request response: response)].
      stream nextPutAll: (shelf formatShelfTemplate: 'foundAfter' request: request response: response)]]
    ifFalse: [shelf formatShelfTemplate: 'search' request: request response: response]]
  ifFalse: [shelf formatShelfTemplate: 'list' request: request response: response]


このページを編集 (10563 bytes)


Congratulations! 以下の 1 ページから参照されています。

This page has been visited 2449 times.