diff --git a/app/assets/stylesheets/style.css.scss b/app/assets/stylesheets/style.css.scss index ea9368e34..60bfc1bd3 100755 --- a/app/assets/stylesheets/style.css.scss +++ b/app/assets/stylesheets/style.css.scss @@ -144,8 +144,12 @@ div.main-header img { } /* Custom Form Styling */ +form#edit_editCourse { + margin-top: 80px; +} + .input-field{ - padding-bottom: 4vh !important; + padding-bottom: 3vh !important; } .input-field label{ @@ -162,6 +166,11 @@ input:not([type]):disabled, input[type=text]:disabled, input[type=password]:disa color: #666; } +input[type=text], input[type=email]{ + color: black; + font-weight: 400; +} + .tabs{ overflow-x: hidden; } @@ -171,7 +180,12 @@ input:not([type]):disabled, input[type=text]:disabled, input[type=password]:disa } .checkbox-input{ - margin-bottom: 5vh; + // margin-bottom: 5vh; + margin-top: 2vh; +} + +.btn-primary{ + //margin-top:3vh; } @@ -399,7 +413,7 @@ div#footer .right { div#footer a { display: inline-block; padding: 12px; - color: $autolab-highlight-gray; + color: #666; } div#footer div.fb-like.fb_iframe_widget { @@ -725,9 +739,9 @@ body.autolab { } } -input[type="text"], -input[type="email"], -input[type="password"], { +input[type=text], +input[type=email], +input[type=password], { /*border: none;*/ height: auto; margin-top: 0.8rem; @@ -737,19 +751,19 @@ input[type="password"], { box-shadow: 0 1px 0 0 #CCC; } -input[type="text"]:focus, -input[type="email"]:focus, -input[type="password"]:focus { +input[type=text]:focus, +input[type=email]:focus, +input[type=password]:focus { /*border: 1px solid rgba(133, 0, 0, 1);*/ outline: none; } -input[type="checkbox"] { +input[type=checkbox] { // For spacing between this and an adjacent label margin-right: 10px; } -input[type="search"] { +input[type=search] { border-bottom: 1px #CCC; box-shadow: 0 1px 0 0 #CCC; } @@ -795,17 +809,17 @@ textarea { } label.active { - font-size: inherit; + font-size: 20px; } } -input[type=text] { +input[type=text], input[type=email] { box-sizing: border-box; margin-bottom: 10px; } .help-block { - color: #4e4e4e; + color: black; font-size: 15px; margin-left: 8px; margin-top: 2px; diff --git a/app/controllers/assessment/autograde.rb b/app/controllers/assessment/autograde.rb index 10866e160..db81fa81d 100644 --- a/app/controllers/assessment/autograde.rb +++ b/app/controllers/assessment/autograde.rb @@ -76,7 +76,7 @@ def regradeBatch redirect_to([@course, @assessment, :submissions]) && return elsif job < 0 # autograding failed failed_jobs += 1 - failed_list += "#{@submission.filename}: autograding error.
" + failed_list += "#{submission.filename}: autograding error.
" end else failed_jobs += 1 @@ -119,7 +119,7 @@ def regradeAll redirect_to([@course, @assessment, :submissions]) && return elsif job < 0 # autograding failed failed_jobs += 1 - failed_list += "#{@submission.filename}: autograding error.
" + failed_list += "#{submission.filename}: autograding error.
" end else failed_jobs += 1 diff --git a/app/form_builders/form_builder_with_date_time_input.rb b/app/form_builders/form_builder_with_date_time_input.rb index 0b8988855..b985e3efd 100755 --- a/app/form_builders/form_builder_with_date_time_input.rb +++ b/app/form_builders/form_builder_with_date_time_input.rb @@ -4,7 +4,7 @@ # custom datetimepicker. In reality, it's goal is to wrap common form builder # methods in Bootstrap boilerplate code. class FormBuilderWithDateTimeInput < ActionView::Helpers::FormBuilder - %w(text_field text_area).each do |method_name| + %w(text_field text_area email_field).each do |method_name| # retain access to default textfield, etc. helpers alias_method "vanilla_#{method_name}", method_name diff --git a/app/views/assessments/new.html.erb b/app/views/assessments/new.html.erb index 58e56ee34..d7a5f39d2 100755 --- a/app/views/assessments/new.html.erb +++ b/app/views/assessments/new.html.erb @@ -19,11 +19,10 @@
<%= f.text_field :display_name, - help_text: "Name that will be displayed on the course home page. E.g., - 'Malloc Lab'" %> + help_text: "Name that will be displayed on the course home page.", placeholder: "Malloc Lab" %> -
+
<%= f.label :category_name, { :class=>"control-label" } %> <%= f.collection_select :category_name, @course.assessment_categories, :to_s, :to_s, {selected: @assessment.category_name} %>

or

diff --git a/app/views/course_user_data/_fields.html.erb b/app/views/course_user_data/_fields.html.erb new file mode 100644 index 000000000..d3c2f79b6 --- /dev/null +++ b/app/views/course_user_data/_fields.html.erb @@ -0,0 +1,42 @@ +<%= f.fields_for :user, cud.user do |u| %> + <%= u.email_field :email, disabled: true, placeholder: "johndoe@example.com" %> + + <%= u.text_field :first_name, disabled: true, placeholder: "John" %> + <%= u.text_field :last_name, disabled: true, placeholder: "Doe" %> + + <% end %> + + <%= f.text_field :nickname, help_text: "Anonymizing nickname to display on the public scoreboards", placeholder: "batman" %> + + <%= isDisabled = false + if !@cud.instructor? then + isDisabled = true + end + f.text_field :lecture, help_text: "The lecture number", placeholder: "15213", disabled: isDisabled %> + + <%= isDisabled = false + if !@cud.instructor? then + isDisabled = true + end + f.text_field :section, help_text: "A course assistant can see the gradebook and bulk-release grades for their assigned lecture and section.", placeholder: "A", disabled: isDisabled %> + + <% if @cud.instructor? then %> + + + Course average tweak: + + <%= f.fields_for :tweak, cud.tweak do |t| %> + <%= t.text_field :value, size: 18, value: "0", placeholder: "0"%> + <%= t.select :kind, options_for_select({"points" => "points", "%" => "percent"}, :selected => (cud.tweak ? cud.tweak.kind : "points")) %> + <% end %> + + A tweak is a positive or negative value that adjusts the student's course average.
Ex: A tweak of 5 points would increase the student's course average by 5 points. + + + <%= f.check_box :dropped, help_text: "Dropping a student from a course prevents them from handing in submissions or downloading assessments. Additionally they do not appear in any gradebook. None of their account information or submissions are deleted." %> + + <%= f.check_box :instructor, help_text: "Instructors have full read/write access to the course." %> + + <%= f.check_box :course_assistant, help_text: "Course assistants can assign scores to problems and nothing else." %> + + <% end %> \ No newline at end of file diff --git a/app/views/course_user_data/edit.html.erb b/app/views/course_user_data/edit.html.erb index f402f382b..284e78a22 100755 --- a/app/views/course_user_data/edit.html.erb +++ b/app/views/course_user_data/edit.html.erb @@ -1,4 +1,4 @@ -<% @title = "Editing Account Details for " + @editCUD.user.email %> +<% @title = "Editing Enrollment for " + @editCUD.user.full_name %> <% content_for :javascripts do %> <% end %> -<%= form_for @editCUD, url: course_course_user_datum_path(@course, @editCUD) do |f| %> +
+

Editing <%= @editCUD.user.full_name %>'s Enrollment in <%= @course.display_name %>

+ +<%= form_for @editCUD, url: course_course_user_datum_path(@course, @editCUD), builder: FormBuilderWithDateTimeInput do |f| %> <% if @editCUD.errors.any? %>

<%= pluralize(@editCUD.errors.count, "error") %> @@ -46,57 +49,9 @@

<% end %> - - - - <%= f.fields_for :user, @editCUD.user do |u| %> - - - - <% end %> - - - - - - - - - - - - - - - - - - - - <% if @cud.instructor? then %> - - - - btn primary handin-btn - - - - - - - - - - - - <% end %> +

+ <%= render partial: "fields", locals: {f: f, cud: @editCUD} %> -
Course<%= @editCUD.course.display_name %>
First name: <%= u.text_field :first_name %>
Last name: <%= u.text_field :last_name %>
Email: <%= u.text_field :email %>
Nickname: <%= f.text_field :nickname %>Anonymizing nickname to display on the public scoreboards
School<%= @editCUD.user.school or "N/A" %>Ex: SCS/CIT
Major<%= @editCUD.user.major or "N/A"%>Ex: CS/ECE
Year<%= @editCUD.user.year or "N/A" %>Ex: 3
Lecture<%= if @cud.instructor? then f.text_field :lecture else @editCUD.lecture end %>Ex: 15213/18213
Section<%= if (@cud.instructor?) or (@editCUD.course.name == "15213-s11") then f.text_field :section else @editCUD.section end%>Ex: C<% if @cud.instructor? %>. A course assistant can see the gradebook and bulk-release grades for their assigned lecture and section.<% end %>
Course average tweak: - <%= f.fields_for :tweak, @editCUD.tweak do |t| %> - <%= t.text_field :value, :size => 18 %> - <%= t.select :kind, options_for_select({"points" => "points", "%" => "percent"}, :selected => (@editCUD.tweak ? @editCUD.tweak.kind : "points")) %> - <% end %> - A tweak is a positive or negative value that adjusts the student's course average.
Ex: A tweak of 5 points would increase the student's course average by 5 points.
Dropped?<%= f.check_box :dropped %>Dropping a student from a course prevents them from handing in submissions or downloading assessments. Additionally they do not appear in any gradebook. None of their account information or submissions are deleted.
Instructor?<%= f.check_box :instructor %>Instructors have full read/write access to the course.
Course assistant?<%= f.check_box :course_assistant %>Course assistants can assign scores to problems and nothing else.


diff --git a/app/views/course_user_data/new.html.erb b/app/views/course_user_data/new.html.erb index ebe162fdb..7ab59186c 100755 --- a/app/views/course_user_data/new.html.erb +++ b/app/views/course_user_data/new.html.erb @@ -1,7 +1,7 @@ <% content_for :javascripts do %> <% end %> -

Add New User to Course

-
* Indicates a required field
-<%= form_for @newCUD, url: course_course_user_data_path do |f| %> +<% @title="Enroll User" %> + +

Enroll User in <%= @course.display_name %>

+ +
+ +<%= form_for @newCUD, url: course_course_user_data_path, builder: FormBuilderWithDateTimeInput do |f| %> <% if @newCUD.errors.any? %>
@@ -46,55 +50,8 @@
<% end %> - - - - <%= f.fields_for :user, @newCUD.user do |u| %> - - - - - - - - - <% end %> - - - - - - - - - - - <% if @cud.instructor? then %> - - - - - - - - - - - - - - - - <% end %> - + <%= render partial: "fields", locals: {f: f, cud: @newCUD} %> -
Course<%= @course.display_name %>
User Email: *<%= u.email_field :email %>User Lookup - (Enter email, then click this link to fill in user info from records)
First Name *<%= u.text_field :first_name %>
Last Name *<%= u.text_field :last_name %>
Nickname: <%= f.text_field :nickname %>Anonymizing nickname to display on the public scoreboards
Lecture<%= if @cud.instructor? then f.text_field :lecture else @newCUD.lecture end %>Ex: 15213/18213
Section<%= if (@cud.instructor?) or (@newCUD.course.name == "15213-s11") then f.text_field :section else @newCUD.section end%>Ex: C<% if @cud.instructor? %>. A course assistant can see the gradebook and bulk-release grades for their assigned lecture and section.<% end %>
Course average tweak: - <%= f.fields_for :tweak, @newCUD.tweak do |t| %> - <%= t.text_field :value, :size => 18, :value => "0" %> - <%= t.select :kind, options_for_select({"points" => "points", "%" => "percent"}, :selected => (@newCUD.tweak ? @newCUD.tweak.kind : "points")) %> - <% end %> - A tweak is a positive or negative value that adjusts the student's course average.
Ex: A tweak of 5 points would increase the student's course average by 5 points.
Dropped?<%= f.check_box :dropped %>Dropping a student from a course prevents them from handing in submissions or downloading assessments. Additionally they do not appear in any gradebook. None of their account information or submissions are deleted.
Instructor?<%= f.check_box :instructor %>Instructors have full read/write access to the course.
Course assistant?<%= f.check_box :course_assistant %>Course assistants can assign scores to problems and nothing else.

diff --git a/app/views/courses/_courseFields.html.erb b/app/views/courses/_courseFields.html.erb index 51dbdf81c..b3c12e0ed 100755 --- a/app/views/courses/_courseFields.html.erb +++ b/app/views/courses/_courseFields.html.erb @@ -1,9 +1,3 @@ -<%= stylesheet_link_tag "https://unpkg.com/flatpickr/dist/flatpickr.min.css" %> - -<% content_for :javascripts do %> - <%= javascript_include_tag "https://unpkg.com/flatpickr" %> -<% end %> - <%= f.text_field :name, help_text: "The course ID used in URLs and DB keys. This field must be unique and URL-able. Typically includes the course number and semester. Examples: @@ -26,7 +20,6 @@ <%= f.score_adjustment_input :late_penalty, optional: true, help_text: "The penalty applied to late submissions after a student runs out of grace days. It represents an amount of points or a percentage of the total score removed per day, and must be a non-negative number. This field can be overriden on a per-assessment basis.", placeholder: "E.g. 15%" %> - <%= f.text_field :version_threshold, help_text: "If a submission's version is greater than this threshold, it is penalized according to the version penalty. If set to -1, no submissions are penalized. This is required, but can be overridden on a per-assessment basis.", placeholder: "E.g. 10" %> diff --git a/app/views/courses/edit.html.erb b/app/views/courses/edit.html.erb index 3b080b441..50e8ffd2c 100755 --- a/app/views/courses/edit.html.erb +++ b/app/views/courses/edit.html.erb @@ -20,7 +20,7 @@
-
+
<%= render :partial=>"courseFields", :locals=>{:f=>f, :course=>@course} %>
diff --git a/app/views/users/_fields.html.erb b/app/views/users/_fields.html.erb new file mode 100644 index 000000000..6aa6dfee5 --- /dev/null +++ b/app/views/users/_fields.html.erb @@ -0,0 +1,13 @@ +<%= f.email_field :email, disabled: true, placeholder: "johndoe@example.com" %> + +<%= f.text_field :first_name, placeholder: "John" %> + +<%= f.text_field :last_name, placeholder: "Doe" %> + +<%= f.text_field :school, placeholder: "School of Computer Science" %> + +<%= f.text_field :major, placeholder: "Computer Science" %> + +<% if current_user.administrator? then %> + <%= f.check_box :administrator, help_text: "Administrators have total access to change anything in the system." %> +<% end %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 5dda1b9ea..8c99a716a 100755 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,5 +1,7 @@ +

+

Editing Account Details for <%= @user.email %>

-<%= form_for @user, url: user_path(@user) do |f| %> +<%= form_for @user, url: user_path(@user), builder: FormBuilderWithDateTimeInput do |f| %> <% if @user.errors.any? %>
@@ -14,25 +16,16 @@
<% end %> - - - - - - +
- <% if current_user.administrator? then %> - - <% end %> + <%= render partial: "fields", locals: {f: f} %> -
Email<%= f.email_field :email, readonly: true %>
First name: <%= f.text_field :first_name %>
Last name: <%= f.text_field :last_name %>
Administrator?<%= f.check_box :administrator %> -

<%= f.submit 'Save Changes', { :class=>"btn primary"} %> <% end %> <% if current_user.administrator? %> -
+



Admin Only

<%= link_to raw('Delete User'), user_path(@user), method: :delete, confirm: "Are you sure!?" %> <% end %>