Skip to content

Commit

Permalink
references #64 Fill out home page with explanation of the system.
Browse files Browse the repository at this point in the history
* Add footer to with support email address.
  • Loading branch information
mgurley committed Mar 1, 2017
1 parent d1fc5ab commit 8863e3f
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 72 deletions.
30 changes: 30 additions & 0 deletions app/assets/stylesheets/disburser.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
.disburser_logo {
@include hide-for-only(small);
}
margin-bottom: 2rem;
}

.field_with_errors {
Expand Down Expand Up @@ -63,4 +64,33 @@

.required:after {
content:" *";
}

#home {
@include grid-row();
.disburser-welcome {
@include grid-row();

.instructions {
@include grid-row();
.new_user {
@include grid-column(
$columns: 12
);
}
.existing_user {
@include grid-column(
$columns: 12
);
}
}
}
}

.footer {
text-align: center;
background-color: $light-gray;
width: 100%;
position: fixed;
bottom: 0;
}
2 changes: 1 addition & 1 deletion app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="field">
<%= f.label :username %><br />
<%= f.label :username, 'NetID' %><br />
<%= f.text_field :username, autofocus: true %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/disburser_requests/_disburser_request.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
= f.check_box :feasibility
%label{for: 'disburser_request_feasibility'} Feasibility?
%span{ id: 'feasibilityHelpText', class: 'help-text' }
Only aggregrate numbers will be provided for feasability requests. No approved IRB protocol is required.
Only aggregrate numbers will be provided for feasibility requests. No approved IRB protocol is required.
- if @disburser_request.use_custom_request_form
.row
.custom_request_form{class: 'small-24 columns' }
Expand Down
98 changes: 69 additions & 29 deletions app/views/home/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,32 +1,72 @@
- content_for(:title) do
Repositories

#repositories
.repositories_header
%h4
Repositories
= form_tag root_url, method: 'get', id: 'search_repositories_form' do
.search_box{ class: 'large-offset-12 large-8 columns' }
%label{for: 'search' }
Search
= text_field_tag :search, (params[:search].nil? ? '' : params[:search]), type: 'search'
.search_buttons{ class: 'large-4 columns' }
%button{ type: 'submit', id: 'search_repositories_button', class: 'tiny button' }
Search
= link_to 'Clear', root_url(mine: params[:mine])
.repositories_list
= will_paginate @repositories, renderer: FoundationPagination::Rails
%table
%thead
%tr
%th.name{ width: 200 }
= sortable 'name'
%th.edit{ width: 100 }
%tbody
- @repositories.each do |respository|
= content_tag_for(:tr, respository) do
%td.name
= respository.name
%td.view
= link_to 'View', repository_url(respository), { class: 'show_repository_link' }
= will_paginate @repositories, renderer: FoundationPagination::Rails
#home
.disburser-welcome
%h1
Welcome
.introduction
%p
Thank you for your interest in
= link_to 'Disburser:', root_url()
the Disbursement Managment System of the
= link_to 'Robert H. Lurie Comprehensive Cancer Center of Northwestern University.', 'http://cancer.northwestern.edu/home/index.cfm'
%p
This system is a centralized location for investigators to view available Cancer-focused clinical research repositories across Northwestern campus and make disbursement requests for clinical data and specimens.
.instructions
.new_user
%h2
New User?
%ul
%li
Browse the list of available clinical research repositories below.
%li
- if user_signed_in?
Login.
- else
= link_to "Login.", new_user_session_path
%li
Create a disbursement request.
.existing_user
%h2
Existing User?
%ul
%li
- if user_signed_in?
Sign in.
- else
= link_to "Login.", new_user_session_path
%li
And new a new disbursement request.
%li
Check the status of existing disbursement requests.
%hr
#repositories
.repositories_header
= form_tag root_url, method: 'get', id: 'search_repositories_form' do
%h4{ class: 'large-4 columns' }
Repositories
.search_box{ class: 'large-offset-8 large-8 columns' }
%label{for: 'search' }
Search
= text_field_tag :search, (params[:search].nil? ? '' : params[:search]), type: 'search'
.search_buttons{ class: 'large-4 columns' }
%button{ type: 'submit', id: 'search_repositories_button', class: 'tiny button' }
Search
= link_to 'Clear', root_url
.repositories_list
= will_paginate @repositories, renderer: FoundationPagination::Rails
%table
%thead
%tr
%th.name{ width: 200 }
= sortable 'name'
%th.edit{ width: 100 }
%tbody
- @repositories.each do |respository|
= content_tag_for(:tr, respository) do
%td.name
= respository.name
%td.view
= link_to 'View', repository_url(respository), { class: 'show_repository_link' }
= will_paginate @repositories, renderer: FoundationPagination::Rails
8 changes: 8 additions & 0 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@
= csrf_meta_tags
%body{ class: "#{controller_name} #{action_name}"}
= render 'shared/navigation'
.footer
Created by
= link_to 'CDSI', 'https://nucats.northwestern.edu/centers-programs/cdsi'
for the
= link_to 'Robert H. Lurie Comprehensive Cancer Center of Northwestern University', 'http://cancer.northwestern.edu/home/index.cfm'

| For support issues, please email:
= mail_to Rails.configuration.custom.app_config['support']['sender_address'], Rails.configuration.custom.app_config['support']['sender_address']
78 changes: 39 additions & 39 deletions app/views/shared/_navigation.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,44 @@
.disburser_logo{ class: 'large-6 columns text-right' }
%a{ :href => 'http://cancer.northwestern.edu/home/index.cfm' }
= image_tag('rhlccc_small_2.png', alt: 'Robert H. Lurie Comprehensive Cancer Center of Northwestern University')
.off-canvas-wrapper
.off-canvas-wrapper-inner{"data-off-canvas-wrapper" => ""}
/ off-canvas title bar for 'small' screen
.title-bar{"data-hide-for" => "medium", "data-responsive-toggle" => "widemenu"}
.title-bar-left
%button.menu-icon{"data-open" => "offCanvasLeft", :type => "button"}
%span.title-bar-title Disburser
.title-bar-right
%span.title-bar-title
- if user_signed_in?
Profile
- else
Login
%button.menu-icon{"data-open" => "offCanvasRight", :type => "button"}
/ off-canvas left menu
#offCanvasLeft.off-canvas.position-left{"data-off-canvas" => ""}
%ul.vertical.menu
= render 'shared/navigation_left'
/ off-canvas right menu
#offCanvasRight.off-canvas.position-right{"data-off-canvas" => "", "data-position" => "right"}
%ul.vertical.menu
= render 'shared/navigation_right'
/ "wider" top-bar menu for 'medium' and up
#widemenu.top-bar
.top-bar-left
%ul.menu
.off-canvas-wrapper
.off-canvas-wrapper-inner{"data-off-canvas-wrapper" => ""}
/ off-canvas title bar for 'small' screen
.title-bar{"data-hide-for" => "medium", "data-responsive-toggle" => "widemenu"}
.title-bar-left
%button.menu-icon{"data-open" => "offCanvasLeft", :type => "button"}
%span.title-bar-title Disburser
.title-bar-right
%span.title-bar-title
- if user_signed_in?
Profile
- else
Login
%button.menu-icon{"data-open" => "offCanvasRight", :type => "button"}
/ off-canvas left menu
#offCanvasLeft.off-canvas.position-left{"data-off-canvas" => ""}
%ul.vertical.menu
= render 'shared/navigation_left'
.top-bar-right
%ul.menu
/ off-canvas right menu
#offCanvasRight.off-canvas.position-right{"data-off-canvas" => "", "data-position" => "right"}
%ul.vertical.menu
= render 'shared/navigation_right'
/ original content goes in this container
.off-canvas-content{"data-off-canvas-content" => ""}
.flash.small-centered{ 'data-closable' => true }
- flash.each do |name, msg|
- if msg.is_a?(String)
= content_tag :div, class: "callout small #{name}" do
%button.close-button{"aria-label" => "dismiss alert", "data-close" => "", :type => "button"}
%span{"aria-hidden" => "true"} ×
= msg
.row.column
= yield
/ "wider" top-bar menu for 'medium' and up
#widemenu.top-bar
.top-bar-left
%ul.menu
= render 'shared/navigation_left'
.top-bar-right
%ul.menu
= render 'shared/navigation_right'
/ original content goes in this container
.off-canvas-content{"data-off-canvas-content" => ""}
.flash.small-centered{ 'data-closable' => true }
- flash.each do |name, msg|
- if msg.is_a?(String)
= content_tag :div, class: "callout small #{name}" do
%button.close-button{"aria-label" => "dismiss alert", "data-close" => "", :type => "button"}
%span{"aria-hidden" => "true"} ×
= msg
.row.column
= yield
17 changes: 15 additions & 2 deletions spec/features/disburser_requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,8 @@
fill_in('Cohort Criteria', with: disburser_request[:cohort_criteria])
fill_in('Data for cohort', with: disburser_request[:data_for_cohort])

scroll_to_bottom_of_the_page

within('.disburser_request_details') do
click_link('Add')
end
Expand All @@ -970,7 +972,7 @@
within(".disburser_request_detail:nth-of-type(1) .comments") do
find('textarea').set(disburser_request_detail[:comments])
end

scroll_to_bottom_of_the_page
choose('Submitted')
click_button('Save')
sleep(1)
Expand Down Expand Up @@ -1059,6 +1061,7 @@
click_link('Make a request!')
expect(page).to have_css('.submitter', text: @moomintroll_user.full_name)

scroll_to_bottom_of_the_page
within('.disburser_request_details') do
click_link('Add')
end
Expand All @@ -1070,6 +1073,7 @@
find('textarea').set(disburser_request_detail[:comments])
end

scroll_to_bottom_of_the_page
click_button('Save')

within(".flash .callout") do
Expand All @@ -1084,6 +1088,7 @@

attach_file('Methods/Justifications', Rails.root + 'spec/fixtures/files/methods_justificatons.docx')

scroll_to_bottom_of_the_page
click_button('Save')

expect(page).to have_css('.investigator .field_with_errors')
Expand Down Expand Up @@ -1121,7 +1126,7 @@
expect(page).to have_css('.custom_request_form .field_with_errors')

attach_file('Custom Request Form', Rails.root + 'spec/fixtures/files/custom_request_form.docx')

scroll_to_bottom_of_the_page
click_button('Save')

expect(page).to have_css('.investigator .field_with_errors')
Expand Down Expand Up @@ -1191,6 +1196,7 @@
disburser_request_detail[:volume] = '20 mg'
disburser_request_detail[:comments] = 'Moominmama specimen'

scroll_to_bottom_of_the_page
within('.disburser_request_details') do
click_link('Add')
end
Expand All @@ -1216,6 +1222,7 @@
expect(all('.disburser_request_detail')[1].find_field('Volume', with: disburser_request_detail[:volume])).to be_truthy
expect(all('.disburser_request_detail')[1].find_field('Comments', with: disburser_request_detail[:comments])).to be_truthy

scroll_to_bottom_of_the_page
click_button('Save')

all('.disburser_request')[0].find('.edit_disburser_request_link').click
Expand All @@ -1230,6 +1237,7 @@
expect(page.has_field?('Data for cohort', with: disburser_request[:data_for_cohort])).to be_truthy
sleep(1)

scroll_to_bottom_of_the_page
within(".disburser_request_detail:nth-of-type(1)") do
click_link('Remove')
end
Expand Down Expand Up @@ -1299,6 +1307,7 @@
expect(page).to have_css('.disburser_request_detail:nth-of-type(1) .quantity .field_with_errors')
sleep(1)
check('Feasibility?')
scroll_to_bottom_of_the_page
click_button('Save')
sleep(1)
expect(page).to_not have_css('.irb_number .field_with_errors')
Expand Down Expand Up @@ -1785,6 +1794,9 @@
login_as(harold_user, scope: :user)
visit committee_disburser_requests_path
find("#disburser_request_#{disburser_request.id}").click_link('Review')
sleep(1)

scroll_to_bottom_of_the_page

click_button('Save')
sleep(1)
Expand All @@ -1809,6 +1821,7 @@
end

expect(all('.disburser_request_vote_history .disburser_request_vote').size).to eq(0)
scroll_to_bottom_of_the_page
choose('Approve')
comments = 'Help the moomins!'
fill_in('Vote Comments', with: comments)
Expand Down
Loading

0 comments on commit 8863e3f

Please sign in to comment.