Skip to content

Commit

Permalink
ui work
Browse files Browse the repository at this point in the history
  • Loading branch information
gnugeek committed Dec 27, 2008
1 parent 6d8acf6 commit 686b608
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 54 deletions.
15 changes: 0 additions & 15 deletions views/index.erb
@@ -1,16 +1 @@
<div class='intro'>
Welcome to Wordnatra
<br />
To get started, search for a word.
<br />
For information on this project, see the following:
<ul>
<li><a href="http://github.com/gnugeek/wordnatra/tree/master">Wordnatra</a></li>
<li><a href="http://wordnet.princeton.edu/">Wordnet</a></li>

<li><a href="http://www.ruby-lang.org/">Ruby</a></li>
<li><a href="http://www.mysql.com">MySQL</a></li>
<li><a href="http://sinatra.rubyforge.org/">Sinatra</a></li>
<li><a href="http://datamapper.org/doku.php">DataMapper</a></li>
</ul>
</div>
6 changes: 3 additions & 3 deletions views/layout.erb
Expand Up @@ -7,14 +7,14 @@
</head>
<body>
<div id='banner'>

Wordnatra
</div>
<div id='search'>
<form action='/' method='post'>
<form id="wordsearch" action='/' method='post'>
<input id='lemma-search' name='lemma' size='40' type='text' />
<input type='submit' value='word' />
</form>
</div>
<div id='content'>
<%= yield %>
<%= yield %>
</div>
54 changes: 18 additions & 36 deletions views/word.erb
@@ -1,53 +1,35 @@
<div id='results-word'>
<table class='word_results' summary='Wordnet search results for word hello'>
<caption class='word_results'>Word: hello</caption>
<tbody class='word_results'>
<div id='word'>
<table id='word_table' summary='Wordnet search results for word hello'>
<caption id='word_caption'>Word: @wordid.lemma</caption>
<tbody class='word_tbody'>
<tr>
<th>wordid:</th>
<td><%= @word.wordid %></td>
<th id='wordid_header'>wordid:</th>
<td id='wordid_data'><%= @word.wordid %></td>

<tr></tr>
<th>lemma:</th>
<td><%= @word.lemma %></td>
<th id='word_lemma_header'>lemma:</th>
<td id='owrd_lemma_data'><%= @word.lemma %></td>
</tr>
</tbody>
</table>
</div>
<div id='results-synsets'>

<table class='synset_results' summary='Wordnet search results - senses for word hello'>
<caption class='synset_results'>Synsets for hello</caption>
<tbody class='synset_results'>
<div id='synsets'>
<table id='synsets_table' summary='Wordnet search results - senses for word hello'>
<caption id='synsets_caption'>Synsets for hello</caption>
<tbody id='synsets_tbody'>
<tr>
<th>category</th>
<th>definition</th>
<th>samples</th>


<th id='category_header'>category</th>
<th id='definition_header'>definition</th>
<th id='samples_header'>samples</th>
</tr>
<% @word.senses.each do |sense| %>
<tr>
<td>noun.communication</td>
<td><%= sense.synset.definition %></td>
<td><%= show_samples(sense.synset) %></td>
<td id='category_<%= @word.lemma %>' class='category_data'>sense.category_def.name</td>
<td id='definition_<%= @word.lemma %>' class='definition'><%= sense.synset.definition %></td>
<td class='sample'><%= show_samples(sense.synset) %></td>
</tr>
<% end %>
</tbody>

</table>
</div>
<script>
$(document).ready(function(){
$("caption.word_results").click(function(event) {
$("tbody.word_results").toggle()
});
});
</script>

<script>
$(document).ready(function(){
$("caption.synset_results").click(function(event) {
$("tbody.synset_results").toggle()
});
});
</script>

0 comments on commit 686b608

Please sign in to comment.