Resend confirmation instructions
+Resend confirmation instructions
-<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> + <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), + html: { method: :post, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> -- <%= f.email_field :email, autofocus: true %>
lecturers Index
+ + \ No newline at end of file diff --git a/tutor/app/views/lecturers/passwords/edit.html.erb b/tutor/app/views/lecturers/passwords/edit.html.erb index 3ab4deb8..586ba0fd 100644 --- a/tutor/app/views/lecturers/passwords/edit.html.erb +++ b/tutor/app/views/lecturers/passwords/edit.html.erb @@ -1,16 +1,23 @@ -Change your password
+Change your password
-<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> - <%= f.hidden_field :reset_password_token %> + <%= form_for(resource, as: resource_name, url: password_path(resource_name), + html: { method: :put, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> + <%= f.hidden_field :reset_password_token %> -- <%= f.password_field :password, autofocus: true, autocomplete: "off" %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
Forgot your password?
+Forgot your password?
-<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> + <%= form_for(resource, as: resource_name, url: password_path(resource_name), + html: { method: :post, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> -- <%= f.email_field :email, autofocus: true %>
Edit <%= resource_name.to_s.humanize %>
- -<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> - -- <%= f.email_field :email, autofocus: true %>
- <%= f.password_field :password, autocomplete: "off" %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
- <%= f.password_field :current_password, autocomplete: "off" %>
Cancel my account
- -Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>
- -<%= link_to "Back", :back %> diff --git a/tutor/app/views/lecturers/registrations/new.html.erb b/tutor/app/views/lecturers/registrations/new.html.erb index 80ada924..221650d5 100644 --- a/tutor/app/views/lecturers/registrations/new.html.erb +++ b/tutor/app/views/lecturers/registrations/new.html.erb @@ -1,21 +1,51 @@ -Sign up
+Sign up
+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name), + :html => { :multipart => true, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> + +- <%= f.text_field :degree%>
- <%= f.email_field :email, autofocus: true %>
- <%= f.password_field :password, autocomplete: "off" %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
+ <%= f.date_select :dob, {:start_year => Date.today.year-90, :end_year => Date.today.year} %> +
Sign in
+Sign in
-<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> -- <%= f.email_field :email, autofocus: true %>
+
+ <% end %> -
- <%= f.password_field :password, autocomplete: "off" %>
+ <%= link_to "Sign in", new_session_path(resource_name) %>
<% end -%> <%- if devise_mapping.registerable? && controller_name != 'registrations' %> - <%= link_to "Sign up", new_registration_path(resource_name) %>
+ <%= link_to "Sign up", new_registration_path(resource_name) %>
<% end -%> <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> - <%= link_to "Forgot your password?", new_password_path(resource_name) %>
+ <%= link_to "Forgot your password?", new_password_path(resource_name) %>
<% end -%> <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
<% end -%> <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
<% end -%> <%- if devise_mapping.omniauthable? %> - <%- resource_class.omniauth_providers.each do |provider| %> - <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
- <% end -%> + <%- resource_class.omniauth_providers.each do |provider| %> + <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
+ <% end -%> <% end -%> diff --git a/tutor/app/views/lecturers/show.html.erb b/tutor/app/views/lecturers/show.html.erb new file mode 100644 index 00000000..456e3b28 --- /dev/null +++ b/tutor/app/views/lecturers/show.html.erb @@ -0,0 +1,62 @@ +
+ <%= image_tag(@lecturer.profile_image_url.to_s) if @lecturer.profile_image? %> + <%= @lecturer.name %>'s Profile +
+Name | +Code | +Options | ++ |
---|---|---|---|
+ <%= link_to course.name, + :controller => 'courses', + :action => 'show', + :id => course.id, :method => :get, + class: "btn btn-success" %> + | +<%= course.code %> | + <% if current_lecturer %> ++ <%= link_to "Manage Course", + { + :controller => 'courses', + :action => 'edit', + :method => :get, + :id => course.id + }, + class: "btn btn-success", + style: "text-decoration:none" %> + | + <% end %> ++ <%= link_to "Discussion Board", + { + :controller => 'discussion_boards', + :action => 'show', + :id => course.id + }, + class: "btn btn-success", + method: :get, + style: "text-decoration:none" %> + | +
Name: <%= @lecturer.name %>
+Email: <%= @lecturer.email %>
+Resend unlock instructions
+Resend unlock instructions
-<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> + <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), + html: { method: :post, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> -- <%= f.email_field :email, autofocus: true %>
- <%= link_to "Create New Model Answer",
+ {:controller => 'model_answers', :action => 'new',
+ :problem_id => @problem.id }, {class: 'btn btn-primary btn'} %>
+ Previous Answers + -
You have no previous answers
+ <% end %> + <% if !@answers.empty? %> +Title | +Created At | +Updated At | +View/Edit | +Remove | +||
---|---|---|---|---|---|---|
<%= answer1.title %> | +<%= answer1.created_at %> | +<%= answer1.updated_at %> | +<%= link_to "View/Edit", {:controller => 'model_answers', + :action => 'edit', :method => :get, :id => answer1.id}, + {class: 'btn btn-primary btn-xs', + style: "text-decoration:none"} %> | +Delete | +<%= button_to "Delete", {controller: :hints, action: :destroy, id: hint1.id}, + :method => :delete, class: 'btn btn-primary btn-xs' %> | +Delete | +
Previous Answers
-<%= answer1.answer %> | -
-
Please Insert your model answer
- <%= f.text_area :answer %> - <%= f.hidden_field :problem_id, value: params[:id] %> - -- <%= f.submit %> -
-<% end %> \ No newline at end of file diff --git a/tutor/app/views/model_answers/edit.html.erb b/tutor/app/views/model_answers/edit.html.erb new file mode 100644 index 00000000..f4b123fa --- /dev/null +++ b/tutor/app/views/model_answers/edit.html.erb @@ -0,0 +1,26 @@ +<% provide(:title, "Edit Answer") %> +<%= form_for(@answer) do |f| %> + <% if @answer.errors.any? %> +<%= pluralize(@answer.errors.count, "error") %> prohibited this course from being saved:
+-
+ <% @answer.errors.full_messages.each do |msg| %>
+
- <%= msg %> + <% end %> +
- <%= link_to "Back to edit problem page",
+ :controller => 'problems', :action => 'edit', :id => @answer.problem_id,
+ :method => :get, class: 'btn btn-default btn-xs' %>
<%= f.label :Title %> + <%= f.text_field :title %> +
<%= f.label :Answer %> +
<%= f.text_area :answer, :cols => "50", :rows => "15" %>
+ <%= f.submit "Save changes", class: "btn btn-large btn-primary" %> +<%= render partial: "tips/index" %> +
<%= render partial: "hints/index" %> +<% end %> \ No newline at end of file diff --git a/tutor/app/views/model_answers/index.html.erb b/tutor/app/views/model_answers/index.html.erb deleted file mode 100644 index 6a016e67..00000000 --- a/tutor/app/views/model_answers/index.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -
Previous Answers
- -Title | -Text | -
---|---|
<%= answer1.answer %> | -<%= answer1.answer %> | -
<%= pluralize(@new_answer.errors.count, "error") %> prohibited this course from being saved: +
+-
+ <% @new_answer.errors.full_messages.each do |msg| %>
+
- <%= msg %> + <% end %> +
+
Please Insert your model answer
+<%= f.label :Title %> + <%= f.text_field :title %> +
<%= f.label :Answer %> + <%= f.text_area :answer, :cols => "50", :rows => "15" %> + +
+<%= f.submit "Save Model Answer", class: "btn btn-large btn-primary" %> + +<% end %> \ No newline at end of file diff --git a/tutor/app/views/posts/create.html.erb b/tutor/app/views/posts/create.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/tutor/app/views/posts/edit.html.erb b/tutor/app/views/posts/edit.html.erb new file mode 100644 index 00000000..2a22740a --- /dev/null +++ b/tutor/app/views/posts/edit.html.erb @@ -0,0 +1,41 @@ + + +
Edit Post
++ <% if @post.errors.any? %> +
+ <%= pluralize(@post.errors.count, "error") %> + prohibited the Post from being edited: +
+-
+ <% @post.errors.full_messages.each do |msg| %>
+
- + <%= msg %> + + <% end %> +
+ <%= form_for :post, url: {action: "update", :id => @post.id} do |f| %> +
+ <%= f.label "Title" %>
+ <%= f.text_field :title, autofocus: true, class:"form-control", style: "width:300px", placeholder: "Title",:value => @post.title %>
+
+ <%= f.label :content %>
+ <%= f.text_area :content, class:"form-control", style: "margin-left:auto;
+ margin-right:auto;height:200px;width:500px;resize:none",
+ placeholder: "Enter your post",:value => @post.content %>
+
+ <%= f.submit "Update Post", class: "btn btn-success" %> +
+ <% end %> + <%= button_to "Delete Post", {:action => 'destroy', :id => params[:id]}, method: :delete, + class: 'btn btn-primary', :confirm => "Are you sure??" %> +New Post
++ <% if @new_post.errors.any? %> +
+ <%= pluralize(@new_post.errors.count, "error") %> + prohibited the Post from being saved: +
+-
+ <% @new_post.errors.full_messages.each do |msg| %>
+
- + <%= msg %> + + <% end %> +
+ <%= form_for :post, url: {action: "create"} do |f| %> +
+ <%= f.label "Title" %>
+ <%= f.text_field :title, autofocus: true, class:"form-control",
+ style: "width:300px", placeholder: "Title",:value => @new_post.title %>
+
+ <%= f.label :content %>
+ <%= f.text_area :content, class:"form-control",
+ style: "height:200px;width:500px",
+ placeholder: "Enter your post",
+ :value => @new_post.content %>
+ <%= f.hidden_field :discussion_board_id,
+ value: params[:discussion_board_id],
+ :value => @discussion_board.id %>
+
+ <%= f.submit "Save", class: "btn btn-success"%> +
+ <% end %> +<%=@post.title%>
+ <%= @post.content %> ++ <% unless @replies.blank? %> + <% @replies.each do |reply| %> +
+
+ <% end %> + <% else %> + No Replies in this post yet . + <% end %> +
<%= @problem.description %>
+<%= form_for :Problem, url: problem_path(@problem), method: :patch, remote: true do |problem| %> + <%= problem.text_area :description, :cols => "50", :rows => "10" %> ++ <%= problem.submit('update description') %> +
+ <%= problem.hidden_field :title, value: @problem.title %> +<% end %> \ No newline at end of file diff --git a/tutor/app/views/problems/_failure_options.html.erb b/tutor/app/views/problems/_failure_options.html.erb new file mode 100644 index 00000000..d935cf31 --- /dev/null +++ b/tutor/app/views/problems/_failure_options.html.erb @@ -0,0 +1 @@ +<%= button_to 'Save as Incomplete', track_path(:id => @problem.track_id), method: :get %> \ No newline at end of file diff --git a/tutor/app/views/problems/_flash.html.erb b/tutor/app/views/problems/_flash.html.erb new file mode 100644 index 00000000..ff4bdef0 --- /dev/null +++ b/tutor/app/views/problems/_flash.html.erb @@ -0,0 +1,3 @@ +<% if flash[:notice] %> +<% end %> \ No newline at end of file diff --git a/tutor/app/views/problems/_title.html.erb b/tutor/app/views/problems/_title.html.erb new file mode 100644 index 00000000..f21b5c39 --- /dev/null +++ b/tutor/app/views/problems/_title.html.erb @@ -0,0 +1,6 @@ +
<%= @problem.title %>
+<%= form_for :Problem, url: problem_path(@problem), method: :patch, remote: true do |problem| %> + <%= problem.text_field :title %> + <%= problem.hidden_field :description, value: @problem.description %> + <%= problem.submit('update title') %> +<% end %> \ No newline at end of file diff --git a/tutor/app/views/problems/done.js.erb b/tutor/app/views/problems/done.js.erb new file mode 100644 index 00000000..7aacef6d --- /dev/null +++ b/tutor/app/views/problems/done.js.erb @@ -0,0 +1 @@ +$('#div1').html("<%= escape_javascript(render 'problems/flash') %>"); \ No newline at end of file diff --git a/tutor/app/views/problems/edit.html.erb b/tutor/app/views/problems/edit.html.erb index 61b4f592..6bf63c14 100644 --- a/tutor/app/views/problems/edit.html.erb +++ b/tutor/app/views/problems/edit.html.erb @@ -1,11 +1,40 @@ - -<%= @problem.title %>
-<%= @problem.description %>
+<%= @problem.title %>
+ <%= form_for :Problem, url: problem_path(@problem), method: :patch, remote: true do |problem| %> + <%= problem.text_field :title %> + <%= problem.hidden_field :description, value: @problem.description %> + <%= problem.submit('update title') %> + <% end %> +<%= @problem.description %>
+ <%= form_for :Problem, url: problem_path(@problem), method: :patch, remote: true do |problem| %> + <%= problem.text_area :description, :cols => "50", :rows => "10" %> ++ <%= problem.submit('update description') %> +
+ <%= problem.hidden_field :title, value: @problem.title %> + <% end %> +Add a problem
- -<%= form_for :Problem, url: {action: "create"} do |p| %> -
- <%= p.label :title %>
- <%= p.text_field :title %>
-
- <%= p.label :description %>
- <%= p.text_area :description , :cols => "50", :rows => "10" %>
-
- <%= p.submit %> -
-<% end %> - + <%= form_for :Problem, url: {action: "create"} do |problem| %> +
+ <%= problem.label :title %>
+ <%= problem.text_field :title %>
+
+ <%= problem.label :description %>
+ <%= problem.text_area :description, :cols => "50", :rows => "10" %>
+
+ <%= problem.submit %> +
+ <% end %> <% if flash[:notice] %>-
+ Memory Contents: + +
Hints:
<%= render partial: "hints/give" %>
diff --git a/tutor/app/views/problems/update.js.erb b/tutor/app/views/problems/update.js.erb new file mode 100644 index 00000000..b5f2b5c2 --- /dev/null +++ b/tutor/app/views/problems/update.js.erb @@ -0,0 +1,3 @@ +$('#div1').html("<%= escape_javascript(render 'problems/flash') %>"); +$('#div2').html("<%= escape_javascript(render 'problems/title') %>"); +$('#div3').html("<%= escape_javascript(render 'problems/description') %>"); \ No newline at end of file diff --git a/tutor/app/views/solutions/_new.html.erb b/tutor/app/views/solutions/_new.html.erb index 1428ee66..6549dc93 100644 --- a/tutor/app/views/solutions/_new.html.erb +++ b/tutor/app/views/solutions/_new.html.erb @@ -1,13 +1,10 @@ - -
<%= flash[:success] %>
-<%= flash[:alert] %>
- +<%= flash[:alert] %>
Time spent: 0:00 - -<%= form_for :solution, url: {controller: 'solutions', action: 'create'}, - html: {method: 'post'} do |f| %> +<%= form_for :solution, + :url => { :controller => "solutions", :action => "create" }, + :html => {:method => :post} do |f| %><%= flash[:msg] %>
+ <% if flash[:msg_2] %> + <% flash[:msg_2].each do |message| %> +<%= message %>
+ <% end %> + <% end %><%= flash[:exp] %>
+ <% if flash[:exp_2] %> + <% flash[:exp_2].each do |message| %> +<%= message %>
+ <% end %> + <% end %><%= flash[:compiler_success] %>
-<%= flash[:compiler_fail] %>
-<%= flash[:compiler_feedback] %>
+<%= flash[:compiler_success] %>
+<%= flash[:compiler_fail] %>
+ <% if flash[:compiler_success_2] %> + <% flash[:compiler_success_2].each do |message| %> +<%= message %>
+ <% end %> + <% end %> + <% if flash[:compiler_fail_2] %> + <% flash[:compiler_fail_2].each do |message| %> +<%= message %>
+ <% end %> + <% end %> +<%= flash[:compiler_feedback] %>
Method Constrains | ++ | <%= f.text_field :method_return, placeholder: "Return Type" %> | ++ | <%= f.text_field :method_name, placeholder: "Method Name" %> | +||
---|---|---|---|---|---|---|
Method Parameter | ++ | <%= u.text_field :params_type, placeholder: "Variable Type", id:"params_type" %> | ++ | <%= u.text_field :parameter, placeholder: "Variable Name", id:"params_name" %> | ++ | <%= image_tag "add_buttom.png", id:"params", + style: "width:15%;height:15%;margin_top:10px;cursor:pointer", + onclick: "add_params(this);" %> | + <% end %> +
Paramter
+No paramters
++ <%= f.submit "Save Changes", class: "btn btn-default", onclick:"submitParams();" %> +<% end %> \ No newline at end of file diff --git a/tutor/app/views/solutions_constraints/_edit_variable.html.erb b/tutor/app/views/solutions_constraints/_edit_variable.html.erb new file mode 100644 index 00000000..a9356ba1 --- /dev/null +++ b/tutor/app/views/solutions_constraints/_edit_variable.html.erb @@ -0,0 +1,14 @@ +<%= form_for :@variables do |f| %> +
Variable Constraints | ++ | <%= f.text_field :variable_type, placeholder: "Variable Type" %> | ++ | <%= f.text_field :variable_name, placeholder: "Variable Name" %> | ++ |
---|
+ <%= f.submit "Save Changes", class: "btn btn-default "%> +<% end %> \ No newline at end of file diff --git a/tutor/app/views/solutions_constraints/_form.html.erb b/tutor/app/views/solutions_constraints/_form.html.erb new file mode 100644 index 00000000..68380f1d --- /dev/null +++ b/tutor/app/views/solutions_constraints/_form.html.erb @@ -0,0 +1,63 @@ +<%= form_for :@constrain, url:{action:"create"} do |f| %> +
Method Constrains | ++ | <%= f.text_field :method_return, placeholder: "Return Type" %> | ++ | <%= f.text_field :method_name, placeholder: "Method Name" %> | +||
---|---|---|---|---|---|---|
Method Parameter | ++ | <%= u.text_field :params_type, placeholder: "Variable Type", id:"params_type" %> | ++ | <%= u.text_field :parameter, placeholder: "Variable Name", id:"params_name" %> | ++ | <%= image_tag "add_buttom.png", + style: "width:15%;height:15%;margin_top:10px;cursor:pointer", + onclick: "add_params(this);" %> | + <% end %> +
+ Add Variable Constraints++ |
+ ||||||
Variable Constraints | ++ | <%= u.text_field :variable_type, placeholder: "Variable Type", id:"variable_type" %> | ++ | <%= u.text_field :variable_name, placeholder: "Variable Name", id:"variable_name" %> | ++ | <%= image_tag "add_buttom.png", + style: "width:15%;height:15%;margin_top:10px;cursor:pointer", + onclick: "add_variable(this);" %> | + <% end %> +
Paramters Constraints
+No paramters
+Variables Constraints
+No variables
++ <%= button_tag "Save Changes", type: "button", + class: "btn btn-large btn-success", onclick:"submitParams();" %> +<% end %> \ No newline at end of file diff --git a/tutor/app/views/solutions_constraints/new.html.erb b/tutor/app/views/solutions_constraints/new.html.erb new file mode 100644 index 00000000..c732821c --- /dev/null +++ b/tutor/app/views/solutions_constraints/new.html.erb @@ -0,0 +1,11 @@ +
Add Method Constraints
++<%= render 'form' %> \ No newline at end of file diff --git a/tutor/app/views/students/confirmations/new.html.erb b/tutor/app/views/students/confirmations/new.html.erb index 7d4c997d..24c61fbb 100644 --- a/tutor/app/views/students/confirmations/new.html.erb +++ b/tutor/app/views/students/confirmations/new.html.erb @@ -1,12 +1,16 @@ -
Resend confirmation instructions
+Resend confirmation instructions
-<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> + <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), + html: { method: :post, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> -- <%= f.email_field :email, autofocus: true %>
students Index
+ + \ No newline at end of file diff --git a/tutor/app/views/students/passwords/edit.html.erb b/tutor/app/views/students/passwords/edit.html.erb index d302a497..e23e77b2 100644 --- a/tutor/app/views/students/passwords/edit.html.erb +++ b/tutor/app/views/students/passwords/edit.html.erb @@ -1,16 +1,23 @@ -Change your password
+Change your password
-<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> - <%= f.hidden_field :reset_password_token %> + <%= form_for(resource, as: resource_name, url: password_path(resource_name), + html: { method: :put, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> + <%= f.hidden_field :reset_password_token %> -- <%= f.password_field :password, autofocus: true, autocomplete: "off" %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
Forgot your password?
+Forgot your password?
-<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> + <%= form_for(resource, as: resource_name, url: password_path(resource_name), + html: { method: :post, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> -- <%= f.email_field :email, autofocus: true %>
Edit <%= resource_name.to_s.humanize %>
- -<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> - -- <%= f.email_field :email, autofocus: true %>
- <%= f.password_field :password, autocomplete: "off" %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
- <%= f.password_field :current_password, autocomplete: "off" %>
Cancel my account
- -Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>
- -<%= link_to "Back", :back %> diff --git a/tutor/app/views/students/registrations/new.html.erb b/tutor/app/views/students/registrations/new.html.erb index 1204ea98..1d0d9265 100644 --- a/tutor/app/views/students/registrations/new.html.erb +++ b/tutor/app/views/students/registrations/new.html.erb @@ -1,18 +1,55 @@ -Sign up
+Sign up
+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name), + :html => { :multipart => true, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> + +- <%= f.email_field :email, autofocus: true %>
- <%= f.password_field :password, autocomplete: "off" %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
+ <%= f.date_select :dob, {:start_year => Date.today.year-90, :end_year => Date.today.year} %> +
Sign in
+Sign in
-<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> -- <%= f.email_field :email, autofocus: true %>
+
+ <% end %> -
- <%= f.password_field :password, autocomplete: "off" %>
+ <%= link_to "Sign in", new_session_path(resource_name) %>
<% end -%> <%- if devise_mapping.registerable? && controller_name != 'registrations' %> - <%= link_to "Sign up", new_registration_path(resource_name) %>
+ <%= link_to "Sign up", new_registration_path(resource_name) %>
<% end -%> <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> - <%= link_to "Forgot your password?", new_password_path(resource_name) %>
+ <%= link_to "Forgot your password?", new_password_path(resource_name) %>
<% end -%> <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
<% end -%> <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
<% end -%> <%- if devise_mapping.omniauthable? %> - <%- resource_class.omniauth_providers.each do |provider| %> - <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
- <% end -%> + <%- resource_class.omniauth_providers.each do |provider| %> + <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
+ <% end -%> <% end -%> diff --git a/tutor/app/views/students/show.html.erb b/tutor/app/views/students/show.html.erb new file mode 100644 index 00000000..1edd8475 --- /dev/null +++ b/tutor/app/views/students/show.html.erb @@ -0,0 +1,74 @@ +
+ <%= image_tag(@student.profile_image_url.to_s) if @student.profile_image? %> + <%= @student.name %>'s Profile +
+-
+
- Course +
- Info +
- Performance +
Name | +Code | +Options | ++ |
---|---|---|---|
+ <%= link_to course.name, + :controller => 'courses', + :action => 'show', + :id => course.id, + :method => :get, + class: "btn btn-success" %> + | +<%= course.code %> | + <% if current_lecturer %> ++ <%= link_to "Manage Course", + { + :controller => 'courses', + :action => 'edit', + :method => :get, + :id => course.id + }, + class: "btn btn-success", + style: "text-decoration:none" %> + | + <% end %> ++ <%= link_to "Discussion Board", + { + :controller => 'discussion_boards', + :action => 'show', + :id => course.id + }, + class: "btn btn-success", + method: :get, + style: "text-decoration:none" %> + | +
Name: <%= @student.name %>
+Email: <%= @student.email %>
+Resend unlock instructions
+Resend unlock instructions
-<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> + <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), + html: { method: :post, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> -- <%= f.email_field :email, autofocus: true %>
We miss you at our Tutors website, <%= @user.name %>
+
+ Your beloved Tutors website has missed you !
+
+ To login to the site, just follow this link: <%= @url %>. +
++ <%= suggestion = @user.get_a_system_suggested_problem + if suggestion != nil then + link_to "And if you are still up to it can you solve this problem ? ;) ", suggestion + end %> +
+Hoping to see you soon and have a great day!
+ + diff --git a/tutor/app/views/teaching_assistants/confirmations/new.html.erb b/tutor/app/views/teaching_assistants/confirmations/new.html.erb index f6b80b4d..34205f98 100644 --- a/tutor/app/views/teaching_assistants/confirmations/new.html.erb +++ b/tutor/app/views/teaching_assistants/confirmations/new.html.erb @@ -1,12 +1,16 @@ -Resend confirmation instructions
+Resend confirmation instructions
-<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> + <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), + html: { method: :post, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> -- <%= f.email_field :email, autofocus: true %>
The Course's Teaching Assistants
+ ++ <% if flash[:notice] -%> +
+ + +
Name | +|
---|---|
<%= teaching_assistant.name %> | +<%= teaching_assistant.email %> | +
Add a Teaching Assistant
+ ++<% if flash[:failure_notice] %> +
+ +<%= form_for :teaching_assistant, url: {action: "create"} do |f| %> + <% if @checkbox == true %> +
+ <%= select("teaching_assistant", "id", TeachingAssistant.find(:all).collect{|p| [p.name ,p.id ] }, {:prompt => 'Select'}) %> +
+ <% else %> ++ <%= select("teaching_assistant", "id", current_lecturer.worked_with.find(:all).collect{|p| [p.name ,p.id ] }, {:prompt => 'Select'}) %> +
+ <% end %> ++ <%= f.submit "Add TA", class: "btn btn-success"%> +
+<% end %> + +Change your password
+Change your password
-<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> - <%= f.hidden_field :reset_password_token %> + <%= form_for(resource, as: resource_name, url: password_path(resource_name), + html: { method: :put, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> + <%= f.hidden_field :reset_password_token %> -- <%= f.password_field :password, autofocus: true, autocomplete: "off" %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
Forgot your password?
+Forgot your password?
-<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> + <%= form_for(resource, as: resource_name, url: password_path(resource_name), + html: { method: :post, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> -- <%= f.email_field :email, autofocus: true %>
Edit <%= resource_name.to_s.humanize %>
- -<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> - -- <%= f.email_field :email, autofocus: true %>
- <%= f.password_field :password, autocomplete: "off" %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
- <%= f.password_field :current_password, autocomplete: "off" %>
Cancel my account
- -Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>
- -<%= link_to "Back", :back %> diff --git a/tutor/app/views/teaching_assistants/registrations/new.html.erb b/tutor/app/views/teaching_assistants/registrations/new.html.erb index 305592e1..4043f1d0 100644 --- a/tutor/app/views/teaching_assistants/registrations/new.html.erb +++ b/tutor/app/views/teaching_assistants/registrations/new.html.erb @@ -1,18 +1,59 @@ -Sign up
+Sign up
+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name), + :html => { :multipart => true, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> + +- <%= f.email_field :email, autofocus: true %>
- <%= f.password_field :password, autocomplete: "off" %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
+ <%= f.date_select :dob, {:start_year => Date.today.year-90, :end_year => Date.today.year} %> +
Sign in
+Sign in
-<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> -- <%= f.email_field :email, autofocus: true %>
+
+ <% end %> -
- <%= f.password_field :password, autocomplete: "off" %>
+ <%= link_to "Sign in", new_session_path(resource_name) %>
<% end -%> <%- if devise_mapping.registerable? && controller_name != 'registrations' %> - <%= link_to "Sign up", new_registration_path(resource_name) %>
+ <%= link_to "Sign up", new_registration_path(resource_name) %>
<% end -%> <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> - <%= link_to "Forgot your password?", new_password_path(resource_name) %>
+ <%= link_to "Forgot your password?", new_password_path(resource_name) %>
<% end -%> <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
<% end -%> <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
<% end -%> <%- if devise_mapping.omniauthable? %> - <%- resource_class.omniauth_providers.each do |provider| %> - <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
- <% end -%> -<% end -%> + <%- resource_class.omniauth_providers.each do |provider| %> + <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
+ <% end -%> +<% end -%> \ No newline at end of file diff --git a/tutor/app/views/teaching_assistants/show.html.erb b/tutor/app/views/teaching_assistants/show.html.erb new file mode 100644 index 00000000..ddeae09a --- /dev/null +++ b/tutor/app/views/teaching_assistants/show.html.erb @@ -0,0 +1,62 @@ +
+ <%= image_tag(@teaching_assistant.profile_image_url.to_s) + if @teaching_assistant.profile_image? %> <%= @teaching_assistant.name %>'s Profile +
+Name | +Code | +Options | ++ |
---|---|---|---|
+ <%= link_to course.name, + :controller => 'courses', + :action => 'show', :id => course.id, + :method => :get, + class: "btn btn-success" %> + | +<%= course.code %> | + <% if current_lecturer %> ++ <%= link_to "Manage Course", + { + :controller => 'courses', + :action => 'edit', + :method => :get, + :id => course.id + }, + class: "btn btn-success", + style: "text-decoration:none" %> + | + <% end %> ++ <%= link_to "Discussion Board", + { + :controller => 'discussion_boards', + :action => 'show', + :id => course.id + }, + class: "btn btn-success", + method: :get, + style: "text-decoration:none" %> + | +
Name: <%= @teaching_assistant.name %>
+Email: <%= @teaching_assistant.email %>
+Resend unlock instructions
+Resend unlock instructions
-<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> + <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), + html: { method: :post, :class => 'form-devise' }) do |f| %> + <%= devise_error_messages! %> -- <%= f.email_field :email, autofocus: true %>
Previous tips
\ No newline at end of file diff --git a/tutor/app/views/topics/new.html.erb b/tutor/app/views/topics/new.html.erb index ad67820c..1ba306b9 100644 --- a/tutor/app/views/topics/new.html.erb +++ b/tutor/app/views/topics/new.html.erb @@ -2,23 +2,30 @@ Author: Ahmed Akram --> -New Topic
-- <% if flash[:notice] -%> -
+ <%= form_for :topic, url: {action: "create"} do |f| %>
<%= f.label "Title" %>
+ <% unless @new_topic.errors[:title].blank? %>
+
+ Name <%= @new_topic.errors[:title].join(", ") %>
+
+
+ <% end %>
<%= f.text_field :title, autofocus: true, class:"form-control", style: "width:300px", placeholder: "Title", :value => @new_topic.title %>
<%= f.label :description %>
- <%= f.text_area :description, class:"form-control", style: "margin-left:auto;
- margin-right:auto;height:200px;width:500px;resize:none", placeholder: "Description", :value => @new_topic.description %>
+ <% unless @new_topic.errors[:description].blank? %>
+
+ Description <%= @new_topic.errors[:description].join(", ") %>
+
+
+ <% end %>
+ <%= f.text_area :description, class:"form-control", style: "height:200px;width:500px;resize:none", placeholder: "Description", :value => @new_topic.description %>
<%= f.submit "Save", class: "btn btn-success"%> diff --git a/tutor/app/views/tracks/show.html.erb b/tutor/app/views/tracks/show.html.erb index 68a11dbf..1ac3eb72 100644 --- a/tutor/app/views/tracks/show.html.erb +++ b/tutor/app/views/tracks/show.html.erb @@ -14,34 +14,82 @@ <% end %>
No Results match
+-
+ <% objects.each do |object| %>
+
- + <%= link_to object.name, class: 'color' %> + + <% end %> +
No Result match
+Search Results :
+" + item[this.propertyToSearch] + "
"+settings.searchingText+"
"); + show_dropdown(); + } + } + + function show_dropdown_hint () { + if(settings.hintText) { + dropdown.html(""+settings.hintText+"
"); + show_dropdown(); + } + } + + // Highlight the query part of the search term + function highlight_term(value, term) { + return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"); + } + + function find_value_and_highlight_term(template, value, term) { + return template.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + value + ")(?![^<>]*>)(?![^&;]+;)", "g"), highlight_term(value, term)); + } + + // Populate the results dropdown with some results + function populate_dropdown (query, results) { + if(results && results.length) { + dropdown.empty(); + var dropdown_ul = $("- ")
+ .appendTo(dropdown)
+ .mouseover(function (event) {
+ select_dropdown_item($(event.target).closest("li"));
+ })
+ .mousedown(function (event) {
+ add_token($(event.target).closest("li").data("tokeninput"));
+ hidden_input.change();
+ return false;
+ })
+ .hide();
+
+ $.each(results, function(index, value) {
+ var this_li = settings.resultsFormatter(value);
+
+ this_li = find_value_and_highlight_term(this_li ,value[settings.propertyToSearch], query);
+
+ this_li = $(this_li).appendTo(dropdown_ul);
+
+ if(index % 2) {
+ this_li.addClass(settings.classes.dropdownItem);
+ } else {
+ this_li.addClass(settings.classes.dropdownItem2);
+ }
+
+ if(index === 0) {
+ select_dropdown_item(this_li);
+ }
+
+ $.data(this_li.get(0), "tokeninput", value);
+ });
+
+ show_dropdown();
+
+ if(settings.animateDropdown) {
+ dropdown_ul.slideDown("fast");
+ } else {
+ dropdown_ul.show();
+ }
+ } else {
+ if(settings.noResultsText) {
+ dropdown.html("
"+settings.noResultsText+"
"); + show_dropdown(); + } + } + } + + // Highlight an item in the results dropdown + function select_dropdown_item (item) { + if(item) { + if(selected_dropdown_item) { + deselect_dropdown_item($(selected_dropdown_item)); + } + + item.addClass(settings.classes.selectedDropdownItem); + selected_dropdown_item = item.get(0); + } + } + + // Remove highlighting from an item in the results dropdown + function deselect_dropdown_item (item) { + item.removeClass(settings.classes.selectedDropdownItem); + selected_dropdown_item = null; + } + + // Do a search and show the "searching" dropdown if the input is longer + // than settings.minChars + function do_search() { + var query = input_box.val().toLowerCase(); + + if(query && query.length) { + if(selected_token) { + deselect_token($(selected_token), POSITION.AFTER); + } + + if(query.length >= settings.minChars) { + show_dropdown_searching(); + clearTimeout(timeout); + + timeout = setTimeout(function(){ + run_search(query); + }, settings.searchDelay); + } else { + hide_dropdown(); + } + } + } + + // Do the actual search + function run_search(query) { + var cache_key = query + computeURL(); + var cached_results = cache.get(cache_key); + if(cached_results) { + populate_dropdown(query, cached_results); + } else { + // Are we doing an ajax search or local data search? + if(settings.url) { + var url = computeURL(); + // Extract exisiting get params + var ajax_params = {}; + ajax_params.data = {}; + if(url.indexOf("?") > -1) { + var parts = url.split("?"); + ajax_params.url = parts[0]; + + var param_array = parts[1].split("&"); + $.each(param_array, function (index, value) { + var kv = value.split("="); + ajax_params.data[kv[0]] = kv[1]; + }); + } else { + ajax_params.url = url; + } + + // Prepare the request + ajax_params.data[settings.queryParam] = query; + ajax_params.type = settings.method; + ajax_params.dataType = settings.contentType; + if(settings.crossDomain) { + ajax_params.dataType = "jsonp"; + } + + // Attach the success callback + ajax_params.success = function(results) { + if($.isFunction(settings.onResult)) { + results = settings.onResult.call(hidden_input, results); + } + cache.add(cache_key, settings.jsonContainer ? results[settings.jsonContainer] : results); + + // only populate the dropdown if the results are associated with the active search query + if(input_box.val().toLowerCase() === query) { + populate_dropdown(query, settings.jsonContainer ? results[settings.jsonContainer] : results); + } + }; + + // Make the request + $.ajax(ajax_params); + } else if(settings.local_data) { + // Do the search through local data + var results = $.grep(settings.local_data, function (row) { + return row[settings.propertyToSearch].toLowerCase().indexOf(query.toLowerCase()) > -1; + }); + + if($.isFunction(settings.onResult)) { + results = settings.onResult.call(hidden_input, results); + } + cache.add(cache_key, results); + populate_dropdown(query, results); + } + } + } + + // compute the dynamic URL + function computeURL() { + var url = settings.url; + if(typeof settings.url == 'function') { + url = settings.url.call(); + } + return url; + } +}; + +// Really basic cache for the results +$.TokenList.Cache = function (options) { + var settings = $.extend({ + max_size: 500 + }, options); + + var data = {}; + var size = 0; + + var flush = function () { + data = {}; + size = 0; + }; + + this.add = function (query, results) { + if(size > settings.max_size) { + flush(); + } + + if(!data[query]) { + size += 1; + } + + data[query] = results; + }; + + this.get = function (query) { + return data[query]; + }; +}; +}(jQuery)); diff --git a/tutor/vendor/assets/stylesheets/bootstrap.css b/tutor/vendor/assets/stylesheets/bootstrap.css index 9d5b6e0e..338f20c3 100644 --- a/tutor/vendor/assets/stylesheets/bootstrap.css +++ b/tutor/vendor/assets/stylesheets/bootstrap.css @@ -3639,8 +3639,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { } .navbar { position: relative; - min-height: 60px; - margin-bottom: 21px; + min-height: 50px; border: 1px solid transparent; } @media (min-width: 768px) { @@ -3936,7 +3935,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { } } .navbar-default { - background-color: #2c3e50; + background-color: #333333; border-color: transparent; } .navbar-default .navbar-brand { @@ -4058,10 +4057,10 @@ select[multiple].input-group-sm > .input-group-btn > .btn { } .navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { - background-color: #128f76; + background-color: #333333; } .navbar-inverse .navbar-toggle .icon-bar { - background-color: #ffffff; + background-color: #333333; } .navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { @@ -4085,7 +4084,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { - color: #2c3e50; + color: #333333; background-color: transparent; } .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,