mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-27 20:38:48 +01:00
first pass at adding context menu for todos
This commit is contained in:
parent
6a038a6b3f
commit
06c4ea8a8c
4 changed files with 35 additions and 15 deletions
|
|
@ -5,9 +5,10 @@
|
|||
<% if @prefs.refresh != 0 -%>
|
||||
<meta http-equiv="Refresh" content="<%= @prefs["refresh"].to_i*60 %>;url=<%= request.request_uri %>">
|
||||
<% end -%>
|
||||
<%= javascript_include_tag "jquery-1.2.6.min" %>
|
||||
<% bundle do %>
|
||||
<%= javascript_include_tag *%w[
|
||||
jquery-1.2.6.min hoverIntent superfish prototype
|
||||
hoverIntent superfish prototype
|
||||
effects dragdrop controls application
|
||||
calendar calendar-en calendar-setup
|
||||
accesskey-hints todo-items niftycube
|
||||
|
|
@ -33,11 +34,16 @@ jQuery(document).ready(function() {
|
|||
dropShadows: false,
|
||||
speed: 'fast'
|
||||
});
|
||||
});
|
||||
window.onload=function(){
|
||||
jQuery('ul.sf-item-menu').superfish({
|
||||
delay: 250,
|
||||
animation: {opacity:'show',height:'show'},
|
||||
autoArrows: false,
|
||||
dropShadows: false,
|
||||
speed: 'fast'
|
||||
});
|
||||
Nifty("div#todo_new_action_container","normal");
|
||||
if ($('flash').visible()) { new Effect.Fade("flash",{duration:5.0}); }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<title><%= @page_title %></title>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,23 @@
|
|||
<%
|
||||
@todo = todo
|
||||
suppress_context ||= false
|
||||
suppress_project ||= false
|
||||
suppress_edit_button ||= false
|
||||
@todo = todo
|
||||
suppress_context ||= false
|
||||
suppress_project ||= false
|
||||
suppress_edit_button ||= false
|
||||
parameters = "_source_view=#{@source_view}"
|
||||
parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
|
||||
%>
|
||||
<div id="<%= dom_id(todo) %>" class="item-container">
|
||||
<div id="<%= dom_id(todo, 'line') %>">
|
||||
<%= remote_delete_icon %>
|
||||
<%= remote_edit_icon unless suppress_edit_button %>
|
||||
<%= remote_star_icon %>
|
||||
<%= remote_toggle_checkbox unless source_view_is :deferred %>
|
||||
<ul class="sf-menu sf-item-menu"><li>^<ul>
|
||||
<li><%= link_to_remote("Edit", :url => {:controller => 'todos', :action => 'edit', :id => @todo.id}, :method => 'get', :with => "'#{parameters}'") %></li>
|
||||
<li>Delete</li>
|
||||
<li><%= link_to_remote "Defer 1 day", :url => {:controller => 'todos', :action => 'defer', :id => @todo.id, :days => 1, :_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")} %></li>
|
||||
<li><%= link_to_remote "Defer 7 days", :url => {:controller => 'todos', :action => 'defer', :id => @todo.id, :days => 7, :_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")} %></li>
|
||||
</ul></ul>
|
||||
<div class="description<%= staleness_class( todo ) %>">
|
||||
<% unless @todo.completed? %><span class="defer-container"><%= defer_link(1) %> <%= defer_link(7) %></span><% end %>
|
||||
<%# unless @todo.completed? <span class="defer-container"><%= defer_link(1) %> <% # defer_link(7) </span><% end %>
|
||||
<%= date_span -%>
|
||||
<span class="todo.descr"><%= h sanitize(todo.description) %></span>
|
||||
<%= link_to(
|
||||
|
|
@ -26,8 +32,8 @@
|
|||
</div>
|
||||
<div id="<%= dom_id(todo, 'edit') %>" class="edit-form" style="display:none">
|
||||
<% form_remote_tag_edit_todo do -%>
|
||||
<% #note: edit form will load here remotely -%>
|
||||
<div class="placeholder"> </div>
|
||||
<% #note: edit form will load here remotely -%>
|
||||
<div class="placeholder"> </div>
|
||||
<% end -%>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -370,12 +370,13 @@ a.icon {
|
|||
|
||||
input.item-checkbox {
|
||||
float: left;
|
||||
margin-left: 10px;
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.description {
|
||||
margin-left: 85px;
|
||||
margin-left: 50px;
|
||||
position:relative
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,6 +85,13 @@ ul.sf-menu li li li.sfHover ul {
|
|||
-webkit-border-bottom-left-radius: 8px;
|
||||
}
|
||||
|
||||
.sf-item-menu li ul {
|
||||
-moz-border-radius-topleft: 8px;
|
||||
-moz-border-radius-topright: 8px;
|
||||
-webkit-border-top-right-radius: 8px;
|
||||
-webkit-border-top-left-radius: 8px;
|
||||
}
|
||||
|
||||
.sf-menu li ul li, .sf-menu li li {
|
||||
margin-bottom: 5px;
|
||||
margin-top: 5px;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue