work on notes js
This commit is contained in:
28
app/views/notes/index_by_note.html.erb
Normal file
28
app/views/notes/index_by_note.html.erb
Normal file
@@ -0,0 +1,28 @@
|
||||
<div id="c-notes">
|
||||
<div id="a-index">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Post</th>
|
||||
<th>Created by</th>
|
||||
<th>Created at</th>
|
||||
<th>Active?</th>
|
||||
<th>Body</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @notes.each do |note| %>
|
||||
<tr>
|
||||
<td><%= link_to note.post_id, post_path(note.post_id) %></td>
|
||||
<td><%= link_to note.creator.name, user_path(note.creator_id) %></td>
|
||||
<td><%= time_ago_in_words(note.created_at) %> ago</td>
|
||||
<td><%= note.is_active? %></td>
|
||||
<td><%= format_text(note.body) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "notes/secondary_links" %>
|
||||
0
app/views/notes/index_by_post.html.erb
Normal file
0
app/views/notes/index_by_post.html.erb
Normal file
0
app/views/notes/search.html.erb
Normal file
0
app/views/notes/search.html.erb
Normal file
11
app/views/pools/search.html.erb
Normal file
11
app/views/pools/search.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<div id="c-pools">
|
||||
<div id="a-search">
|
||||
<%= simple_form_for @search, :method => :get do |f| %>
|
||||
<%= f.input :name_contains, :label => "Name", :required => false %>
|
||||
<%= f.input :description_contains, :label => "Description", :required => false %>
|
||||
<%= f.button :submit, "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
40
app/views/static/jquery_test.html.erb
Normal file
40
app/views/static/jquery_test.html.erb
Normal file
@@ -0,0 +1,40 @@
|
||||
<div id="jquery-test">
|
||||
<div class="note" id="lots-of-text-1">
|
||||
Lorem ipsum
|
||||
</div>
|
||||
|
||||
<div class="note" id="lots-of-text-2" style="left: 400px;">
|
||||
Lorem ipsum
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var body = $("#lots-of-text-2");
|
||||
body.css({height: "auto", minWidth: 140});
|
||||
|
||||
var w = body[0].offsetWidth;
|
||||
var h = body[0].offsetHeight;
|
||||
var lo = null;
|
||||
var hi = null;
|
||||
var x = null;
|
||||
var last = null;
|
||||
|
||||
if (body[0].scrollWidth <= body[0].clientWidth) {
|
||||
lo = 20, hi = w
|
||||
|
||||
do {
|
||||
x = (lo+hi)/2
|
||||
body.css({minWidth: x});
|
||||
|
||||
if (body[0].offsetHeight > h) {
|
||||
lo = x;
|
||||
} else {
|
||||
hi = x;
|
||||
}
|
||||
} while ((hi - lo) > 4);
|
||||
|
||||
if (body[0].offsetHeight > h) {
|
||||
body.css({minWidth: hi});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user