This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('page:load', function(){ | |
$("input:checkbox:not(:checked)").each(function() { | |
var column = "table ." + $(this).attr("name"); | |
$(column).hide(); | |
}); | |
$("input:checkbox").click(function(){ | |
var column = "table ." + $(this).attr("name"); | |
$(column).toggle(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="well"> | |
<p><input type="checkbox" name="basic" class="box" /> Basic</p> | |
<p><input type="checkbox" name="address" class="box" /> Address</p> | |
<p><input type="checkbox" name="phone" class="box" /> Phone</p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DrugAssessmentMethods | |
@users = User.all | |
@users_array = User.where(loginable_type: 'Student').includes(:loginable).all.map { |u| [u.full_name, u.loginable.id] } | |
if current_user.loginable_type == 'Student' | |
@sid = current_user.loginable.id | |
elsif current_user.loginable_type != 'Student' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3>Result Sets</h3> | |
<div class="span12" style="width:100%;margin:5px;"> | |
<% if ResultSet.where(:user_id => current_user.id).count == 0 %> | |
You have not taken any surveys yet. | |
<% else %> | |
<% if current.loginable_type != 'Student' %> | |
<%= simple_form_for(result_sets_path, :method =>'get', :html => { :class => 'form-horizontal' }) do %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DrugAssessmentMethods | |
def index | |
@users = User.all | |
@users_array = User.where(loginable_type: 'Student').includes(:loginable).all.map { |u| [u.full_name, u.loginable.id] } | |
if current_user.loginable_type == 'Student' | |
@sid = current_user.loginable.id | |
elsif current_user.loginable_type != 'Student' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index | |
@users_array_id = User.where(loginable_type: 'Counselor').includes(:loginable).all.map { |u| [u.full_name, u.loginable.id] }.uniq | |
runquery = Counselor.joins(:user) | |
runquery = runquery.where(:users => {:first_name => params[:first_name]}) if params[:first_name].present? | |
runquery = runquery.where(:users => {:last_name => params[:last_name]}) if params[:last_name].present? | |
runquery = runquery.where(:users => {:loginable_id => params[:id]}) if params[:id].present? | |
runquery = runquery.where(:users => {:active => params[:active]}) if params[:active].present? | |
runquery = runquery.select('counselors.*, users.*') | |
@query = runquery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="span12" style="width:100%;margin:5px;"> | |
<div> | |
<div class="well" style="float:left;"> | |
<% if is_student %> | |
<%= button_to 'New Drug Assessment', new_drug_assessment_path, :class => 'btn btn-success', :style => 'float:right;', :method => :get %> | |
<% end %> | |
<% if is_counselor || is_admin %> | |
<%= simple_form_for(drug_assessments_filter_path , :method => 'post', :html => { :class => 'form-horizontal' }) do %> | |
<%= select_tag 'drug_assessment[student_id]', options_for_select(@users_array, @users_array), { :prompt => 'Select a student', class: 'chosen-select'} %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= simple_fields_for @user do |u| %> | |
<%= u.error_notification %> | |
<h4>User Fields:</h4> | |
<%= u.input :first_name %> | |
<%= u.input :middle_name %> | |
<%= u.input :last_name %> | |
<%= u.input :email %> | |
<%= u.input :social_security_no %> | |
<%= u.input :sex %> | |
<%= u.input :date_of_birth, as: :date_picker, input_html: { id: 'dp1', } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@quiz_user_name = ResultSet.all.map { |u| [u.user.full_name, u.user_id]}.uniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rb-inotify' | |
require 'json' | |
require 'rest_client' | |
require 'crack' | |
require 'active_support/all' | |
#0 Notifier Start | |
notified = INotify::Notifier.new | |
#1 File is placed within the folder (by Epitomax) |