Skip to content

Commit

Permalink
link_to_remote fixes for results and test selector.
Browse files Browse the repository at this point in the history
  • Loading branch information
hansonywu authored and jerboaa committed Mar 13, 2012
1 parent 20db58b commit 1308af6
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
17 changes: 13 additions & 4 deletions app/views/results/common/_test_selector.html.erb
Expand Up @@ -2,10 +2,19 @@
# file when using this partial
%>
<%=label_tag "select_test_result_id", h(I18n.t("common.test_results")), :class => "inline_label" %>
<%= link_to_remote( image_tag("icons/cog_go.png", :alt => I18n.t("common.test_code"), :title => I18n.t("common.test_code"), :id => "test_icon"),
{:url => {:action => "index", :controller => "automated_tests", :assignment_id => @assignment.id,:result => @result},
:before => "$('running_tests').show();",
:complete => "$('running_tests').hide();$('tests_complete').show()"}) %>
<%= link_to image_tag("icons/cog_go.png", :alt => I18n.t("common.test_code"), :title => I18n.t("common.test_code"), :id => "test_icon"),
assignment_automated_test_path(:assignment_id => @assignment.id, :result => @result), :id => "test_select_link", :remote => true %>

<script type='text/javascript'>
$("test_select_link").observe('ajax:after', function(evt, status, data, xhr) {
$('running_tests').show();
});
$("test_select_link").observe('ajax:complete', function(evt, status, data, xhr) {
$('running_tests').hide();
$('tests_complete').show();
});
</script>

<select id="select_test_result_id" onchange="if ($(this).getValue() != '') { load_test_result($(this).getValue()); }">
<% if test_result_files.find_all_by_user_id(@current_user.id).empty? %>
<option value=""><%= I18n.t("test_result.no_files_available")%></option>
Expand Down
5 changes: 4 additions & 1 deletion app/views/results/marker/_extra_mark.html.erb
Expand Up @@ -10,6 +10,9 @@
<%=extra_mark.extra_mark %>
</td>
<td>
<%= link_to_remote I18n.t("remove"), :url => {:action => "remove_extra_mark", :id => extra_mark.id}, :confirm => I18n.t("marker.marks.confirm_remove_mark") %>
<%= button_to I18n.t("remove"),
remove_extra_mark_assignment_submission_result_path(:id => extra_mark.id),
:class => "table-button", :confirm => I18n.t("marker.marks.confirm_remove_mark"),
:remote => true %>
</td>
</tr>
5 changes: 4 additions & 1 deletion app/views/results/marker/_extra_percentage.html.erb
Expand Up @@ -10,6 +10,9 @@
<%=extra_percentage.extra_mark %>%
</td>
<td>
<%= link_to_remote I18n.t("remove"), :url => {:action => "remove_extra_mark", :id => extra_percentage.id}, :confirm => I18n.t("marker.marks.confirm_remove_percentage") %>
<%= button_to I18n.t("remove"),
remove_extra_percentage_assignment_submission_result_path(:id => extra_percentage.id),
:class => "table-button", :confirm => I18n.t("marker.marks.confirm_remove_percentage"),
:remote => true %>
</td>
</tr>
Expand Up @@ -35,7 +35,10 @@ class="float_left mark_criterion_expand expanded" >- &nbsp;
<tr>
<td id="mark_<%=mark.id%>_<%=num_levels%>" class="<%=td_class%>"
onclick="<%=remote_function :url => {:action => 'update_mark', :mark_id=>mark.id, :mark=>num_levels} %>">
<b><%=num_levels%>: <%=link_to_remote level_name, :url => {:action => 'update_mark', :mark_id=>mark.id, :mark=>num_levels}, :html => {:class => "rubric_criterion_link"} %></b> &nbsp;<%=level_desc%>
<b><%=num_levels%>: <%= link_to level_name,
update_mark_assignment_submission_results_path(:mark_id => mark.id, :mark => num_levels),
:class => "rubric_criterion_link", :remote => true %>
</b> &nbsp;<%=level_desc%>
</td>
</tr>
<% end -%>
Expand Down
6 changes: 6 additions & 0 deletions public/stylesheets/main.css
Expand Up @@ -1998,3 +1998,9 @@ pre#test_result_content {
#curent_time{
padding: 10px 0px 10px 0px;
}

.table-button {
margin: 2px;
padding: 2px;
min-width: 0px;
}

0 comments on commit 1308af6

Please sign in to comment.