GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of al3x/git-wiki
Description: A wiki engine that uses a Git repository as its data store.
Homepage: http://atonie.org/2008/02/git-wiki
Clone URL: git://github.com/zmalltalker/git-wiki.git
added search through git-grep
schacon (author)
Sat Mar 08 12:27:38 -0800 2008
commit  3fe21594034d22381cc5dbbfef0181b3949e2893
tree    ab87643e09b020797f15477bc5d84965511b5697
parent  e7718c564e758a37489123ba3a097261e73b0369
0
...
5
6
7
8
9
 
10
11
12
 
13
14
15
...
5
6
7
 
8
9
10
11
12
13
14
15
16
0
@@ -5,11 +5,12 @@
0
 
0
 = CHACON IDEAS
0
   * inter-branch links
0
- * remotes (add / fetch)
0
   * tagging
0
+ * file attachments
0
   * merge conflict resolution
0
   * cherry-picked branches (read-tree/write-tree)
0
   * git-less version (read-only)
0
+ * track which branched from which
0
   * push?
0
   * users (email/name/ip - use for commits)
0
   
...
37
38
39
 
40
41
42
...
154
155
156
 
 
 
 
 
 
157
158
...
37
38
39
40
41
42
43
...
155
156
157
158
159
160
161
162
163
164
165
0
@@ -37,6 +37,7 @@ get('/') { redirect '/' + HOMEPAGE }
0
 get('/_style.css') { header 'Content-Type' => 'text/css'; File.read(File.join(File.dirname(__FILE__), 'css', 'style.css')) }
0
 get('/_code.css') { header 'Content-Type' => 'text/css'; File.read(File.join(File.dirname(__FILE__), 'css', "#{UV_THEME}.css")) }
0
 get('/_app.js') { header 'Content-Type' => 'application/x-javascript'; File.read(File.join(File.dirname(__FILE__), 'javascripts', "application.js")) }
0
+get('/_search.png') { header 'Content-Type' => 'image/png'; File.read(File.join(File.dirname(__FILE__), 'images', "search.png")) }
0
 
0
 get '/_list' do
0
   @pages = $repo.log.first.gtree.children.map { |name, blob| Page.new(name) } rescue []
0
@@ -154,4 +155,10 @@ post '/a/new_remote' do
0
   $repo.add_remote(params[:branch_name], params[:branch_url])
0
   $repo.fetch(params[:branch_name])
0
   redirect '/a/branches'
0
+end
0
+
0
+get '/a/search' do
0
+ @search = params[:search]
0
+ @grep = $repo.grep(@search)
0
+ show :search, 'Search Results'
0
 end
0
\ No newline at end of file
...
4
5
6
7
 
8
9
10
...
4
5
6
 
7
8
9
10
0
@@ -4,7 +4,7 @@
0
 <% @history.each do |commit| %>
0
   <tr>
0
     <td><code><%= commit.sha[0, 8] %></code></td>
0
- <td><%= commit.date %></td>
0
+ <td><small><%= commit.date %></small></td>
0
     <td><%= commit.message %></td>
0
     <td><%= commit.name %></td>
0
     <% if commit != @history.first %>
...
8
9
10
 
11
12
13
...
15
16
17
 
18
 
19
20
21
...
8
9
10
11
12
13
14
...
16
17
18
19
20
21
22
23
24
0
@@ -8,6 +8,7 @@
0
   </head>
0
   <body>
0
     <div id="container">
0
+ <form method="get" action="/a/search">
0
       <ul class="nav_list" id="top_nav">
0
         <li><strong><%= $repo.current_branch %></strong></li>
0
         <li><a href="/" class="nav_link">home</a></li>
0
@@ -15,7 +16,9 @@
0
         <li><a href="/a/history" class="nav_link">history</a></li>
0
         <li><a href="/_list" class="nav_link">pages</a></li>
0
         <li><a href="/a/tarball" class="nav_link">tarball</a></li>
0
+ <li><input name="search" size="15"> <input type="image" src="/_search.png"></li>
0
       </ul>
0
+ </form>
0
       <%= yield %>
0
       <div id="footer">
0
         powered by <a href="http://github.com/sr/git-wiki/network">git-wiki</a>

Comments

    No one has commented yet.