New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replacing legacy functions with UJS #795
Conversation
…/daneshd/Markus into ujs Conflicts: app/views/submission_rules/grace_period/_grader_tab.html.erb
…ction to generate it anymore. ujsed up graders/_boot.js.erb
Hi, Very good work :) All tests pass for me. Good to be merged for me. Anyone ? |
@@ -34,7 +34,7 @@ class AssignmentsController < ApplicationController | |||
# Action called via Rails' remote_function from the test_result_window partial | |||
# Prepares test result and updates content in window. | |||
def render_test_result | |||
@assignment = Assignment.find(params[:aid]) | |||
@assignment = Assignment.find(params[:aid]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid trying to align '='. It's not maintainable long term. The usual convention is one space on each side of a mathematical sign.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood :)
@@ -3,7 +3,8 @@ | |||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |||
|
|||
<head> | |||
<%= csrf_meta_tag %> | |||
<%= csrf_meta_tag %> | |||
<%= javascript_tag "const AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line seems to repeat many times. I'm not super fond of this code duplication. Could we add this somewhere more prominently? Perhaps in a layout definition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, is there a header layout file that's featured in all pages? I couldn't figure which file did that, so I just added the meta_tag and related to all files that contained . It would be annoying to maintain in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps put in into the main layout. I forget what the name of it was. It's not "main" the other one :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now i'm making a new partial for things in tags that are called often. Any objections/comments?
Nice work! |
@@ -385,9 +378,9 @@ $("global_action_form").observe('ajax:success', function(evt, status, data, xhr) | |||
<%= I18n.t("groups.groupe_name") %> | |||
<input type="text" maxlength="30" id="new_group_name"></input> | |||
</fieldset> | |||
<p class="p_modal"> | |||
<p class="p_modal"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Is it possible to remove all blank spaces at end of lines ?
In order to keep the code as clean as possible.
Thx :)
…pages, like authentication token generation and meta tags
The rest of this looks good to me too. |
Feel free to merge. Ship it! |
Replacing legacy functions with UJS
In this branch, we replaced all deprecated javascript functions like link_to_remote, button_to_remote and remote_function with non-deprecated functions. Remote_function is now replaced using Ajax.Request. Link_to_remote and button_to_remote are now using link_to and button_to, respectively.
Related to #475 and #603