Skip to content

Commit

Permalink
Merge pull request #185 from sparc-request/jw_help_faq_link
Browse files Browse the repository at this point in the history
help/faq button is now a link to the SPARC FAQs. There is no longer a…
  • Loading branch information
jwiel86 committed Oct 30, 2015
2 parents 80113b3 + 78eb552 commit cad71c2
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 56 deletions.
39 changes: 0 additions & 39 deletions app/assets/javascripts/cart.js.coffee.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,42 +62,3 @@ $(document).ready ->
$(this).hide()
removeService(sr_id, id, false)
)

# Build out cart FAQ from i18n yaml file. Pretty hackish to get HTML temlating done. CEA
helpList = "<ul>"
<% I18n.translate(:cart_help)[:questions].each_with_index do |question, idx| %>
<% answer_id = "help_answer_#{idx + 1}" %>
<% q_span = "<span onclick=\"$(\\'##{answer_id}\\').toggle();\" class=\"help_question\">#{question['question_text']}</span>" %>
<% a_span = "<span id=\"#{answer_id}\" class=\"help_answer\" style=\"display:none;\">#{question['answer_text']}</span>" %>
<% faq_li = "<li>" + q_span + a_span + "</li>" %>
helpList += '<%= faq_li %>'
<% end %>
helpList += "</ul>"

$('.faq-button').qtip
content:
text: helpList
title:
text: "Help"
button: "X"

position:
corner:
target: "topRight"
tooltip: "bottomLeft"

adjust: screen: true

show:
when: "click"
solo: true

hide: false
style:
tip: true
border:
width: 0
radius: 4

name: "light"
width: 250
4 changes: 2 additions & 2 deletions app/views/service_requests/_right_navigation.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
-# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.ask-a-question-button.blue-button.btn.btn-primary.btn-lg.btn-block= t(:right_navigation)[:ask_a_question]
= link_to t(:right_navigation)[:dashboard], USER_PORTAL_LINK, :class => "dashboard-button blue-button btn btn-primary btn-lg btn-block"
.faq-button.blue-button.btn.btn-primary.btn-lg.btn-block= t(:right_navigation)[:faq]
= link_to t(:right_navigation)[:dashboard], USER_PORTAL_LINK, :class => "dashboard-button blue-button btn btn-primary btn-lg btn-block"
= link_to t(:right_navigation)[:faq], FAQ_URL, :class => "faq-button blue-button btn btn-primary btn-lg btn-block", :target => "blank"
.feedback-button.blue-button.btn.btn-primary.btn-lg.btn-block= t(:right_navigation)[:feedback]

#feedback-form{:style => 'display: none', :title => 'Give Us Your Feedback!'}
Expand Down
2 changes: 2 additions & 0 deletions config/application.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ development:
# constants_yml_override: -institution
use_news_feed: true
calendar_url: https://www.google.com/calendar/ical/sparcrequest%40gmail.com/public/basic.ics
faq_url: http://academicdepartments.musc.edu/sctr/sparc_request/faq.html
send_authorized_user_emails: true
no_reply_from: "no-reply@musc.edu"
use_separate_audit_database: false # needs to be false at outset since new institutions may not use a separate audit database
Expand Down Expand Up @@ -98,6 +99,7 @@ test:
# constants_yml_override: -institution
use_news_feed: true
calendar_url: https://www.google.com/calendar/ical/sparcrequest%40gmail.com/public/basic.ics
faq_url: http://academicdepartments.musc.edu/sctr/sparc_request/faq.html
send_authorized_user_emails: true
no_reply_from: "no-reply@musc.edu"
system_satisfaction_survey: true
Expand Down
1 change: 1 addition & 0 deletions config/initializers/obis_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
USE_GOOGLE_CALENDAR = application_config['use_google_calendar']
USE_NEWS_FEED = application_config['use_news_feed']
CALENDAR_URL = application_config['calendar_url']
FAQ_URL = application_config['faq_url']
SEND_AUTHORIZED_USER_EMAILS = application_config['send_authorized_user_emails']
CUSTOM_ASSET_PATH = application_config['custom_asset_path']
LOCALE_OVERRIDE = application_config['locale_override']
Expand Down
15 changes: 0 additions & 15 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,6 @@ en:
action: "Action"
all_on_request: "All Services on Request Have Been Deleted"

# Tooltip help dialogs
cart_help:
questions:
- question_text: "May I submit a request for services for multiple research studies/projects simultaneously?"
answer_text: "No. Please browse and select services for only one research study/project at a time."
- question_text: "May I select and add services from multiple Service Providers and Programs at one time?"
answer_text: "Yes. Please feel free to browse, select, and add services from any Service Provider, Program, and/or Core displayed in the system for any given research study/project."
- question_text: "How many Authorized Users can I add?"
answer_text: "Add as many Authorized Users as you feel is pertinent. There is no limit."
- question_text: "What is the difference between a Research Study and a Project?"
answer_text: "A Research Study is an individual research protocol with defined aims and outcomes."
- question_text: "How is SPARC Request calculating my indirect costs?"
answer_text: "The original requester for your study/project defined both the funding source of the study/project and the indirect cost rate. SPARC Request uses this data to calculate your total overall indirect costs."
- question_text: "I\\'m stuck! Who can I contact for assistance with SPARC Request?"
answer_text: "The SUCCESS Center is happy to assist you! Please contact us at <a href=\"mailto:success@musc.edu\">success@musc.edu</a> or (843) 792-3357."
# indirect cost rates, default values used to prepopulate forms
indirect_cost_rates:
internal_and_college: "0"
Expand Down
14 changes: 14 additions & 0 deletions spec/features/help_faqs_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'rails_helper'

RSpec.feature "Help/FAQs", js: true do
before :each do
visit root_path
end

describe 'clicking the button' do

it 'should take user to SPARC FAQ link' do
find(:xpath, "//a[@href='http://academicdepartments.musc.edu/sctr/sparc_request/faq.html']").click
end
end
end

0 comments on commit cad71c2

Please sign in to comment.