Skip to content

Instantly share code, notes, and snippets.

@basicxman
Created November 29, 2011 01:32
Show Gist options
  • Select an option

  • Save basicxman/1402937 to your computer and use it in GitHub Desktop.

Select an option

Save basicxman/1402937 to your computer and use it in GitHub Desktop.
<tr id="<%= dom_id(@task) %>">
<input type="hidden" class="achieved" value="<%= @task.achieved_points %>" />
<input type="hidden" class="quota" value="<%= @task.required_points %>" />
<td class="task-controls">
<div class="graph-hidden"><%= image_tag image_path("graph_hidden.png"), :width => "30", :class => "graph-hidden graph-button", "data-task" => @task.name %></div>
<div class="graph-visible"><%= image_tag image_path("graph_visible.png"), :width => "30", :class => "graph-visible graph-button", "data-task" => @task.name %></div>
</td>
<td class="task-name"><span class="name"><%= @task.name %></span> (<span class="achieved"><%=n @task.achieved_points %></span> / <span class="quota"><%=n @task.required_points %></span>)</td>
<td class="task-bar pointer">
<%= render :partial => "progress", :locals => { :task => @task } %>
</td>
<td class="task-points">
<%= points_button(@task, 0.5, "small") %>
<%= points_button(@task, 1, "large") %>
<%= points_button(@task, -1, "large") %>
<%= points_button(@task, -0.5, "small") %>
</td>
</tr>
<tr id="panel-<%= dom_id(@task) %>" class="controls-panel">
<td colspan="4">
<% 1.upto(Task::NUMBER_OF_COLOURS) do |n| %>
<%= link_to "", change_colour_task_path(@task, :colour => "c#{n}"), :method => :post, :remote => true, :class => "change-colour c#{n}" %>
<% end %>
<%= form_for @task, :remote => true do |f| %>
<%= f.text_field :name %>
<%= f.text_field :required_points, :class => "numeric" %>
<%= f.text_field :custom_points, :class => "custom-points", :value => "0" %>
<%= f.submit "Update" %>
<% end %>
<%= button_to "Delete", task_path(@task), :method => :delete, :remote => true, :confirm => "Are you sure?", :class => "delete" %>
<div style="clear: both;"></div>
</td>
</tr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment