Permalink
Browse files

investigator search now loads investigator directly if only one found

  • Loading branch information...
1 parent ca1bc75 commit 723228b15bd717f9089210f7d8204eed184626fd Warren A. Kibbe committed Apr 19, 2012
Showing with 51 additions and 42 deletions.
  1. +33 −33 LatticeGrid.tmproj
  2. +11 −4 app/controllers/investigators_controller.rb
  3. +5 −5 doc/example_loads.txt
  4. +2 −0 doc/irb_process.txt
View
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>currentDocument</key>
- <string>doc/example_loads.txt</string>
+ <string>config/initializers/latticegrid.rb</string>
<key>documents</key>
<array>
<dict>
@@ -21,6 +21,36 @@
<integer>384</integer>
<key>metaData</key>
<dict>
+ <key>app/models/investigator_abstract.rb</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>0</integer>
+ <key>line</key>
+ <integer>3</integer>
+ </dict>
+ <key>columnSelection</key>
+ <false/>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ <key>selectFrom</key>
+ <dict>
+ <key>column</key>
+ <integer>0</integer>
+ <key>line</key>
+ <integer>1</integer>
+ </dict>
+ <key>selectTo</key>
+ <dict>
+ <key>column</key>
+ <integer>0</integer>
+ <key>line</key>
+ <integer>3</integer>
+ </dict>
+ </dict>
<key>app/views/graphs/org_nodes.rxml</key>
<dict>
<key>caret</key>
@@ -93,36 +123,6 @@
<integer>15</integer>
</dict>
</dict>
- <key>doc/example_loads.txt</key>
- <dict>
- <key>caret</key>
- <dict>
- <key>column</key>
- <integer>0</integer>
- <key>line</key>
- <integer>7</integer>
- </dict>
- <key>columnSelection</key>
- <false/>
- <key>firstVisibleColumn</key>
- <integer>0</integer>
- <key>firstVisibleLine</key>
- <integer>0</integer>
- <key>selectFrom</key>
- <dict>
- <key>column</key>
- <integer>0</integer>
- <key>line</key>
- <integer>6</integer>
- </dict>
- <key>selectTo</key>
- <dict>
- <key>column</key>
- <integer>0</integer>
- <key>line</key>
- <integer>7</integer>
- </dict>
- </dict>
<key>doc/publications_scripts.txt</key>
<dict>
<key>caret</key>
@@ -159,11 +159,11 @@
<string>doc/publications_scripts.txt</string>
<string>config/routes.rb</string>
<string>config/initializers/latticegrid.rb</string>
- <string>doc/example_loads.txt</string>
+ <string>app/models/investigator_abstract.rb</string>
</array>
<key>showFileHierarchyDrawer</key>
<true/>
<key>windowFrame</key>
- <string>{{10, 0}, {1283, 1028}}</string>
+ <string>{{387, 0}, {1283, 1028}}</string>
</dict>
</plist>
@@ -185,7 +185,7 @@ def show_all_tags
@total_entries=@abstracts.total_entries
@include_all_mesh = true
respond_to do |format|
- format.html { render :action => :show}
+ format.html { render :action => :show }
end
end
end
@@ -336,9 +336,16 @@ def investigators_search
end
if !params[:id].blank? then
@investigators = Investigator.investigators_tsearch(params[:id])
- @heading = "There were #{@investigators.length} matches to search term <i>"+params[:id].downcase+"</i>"
- @include_mesh=false
- render :action => :index, :layout => "searchable"
+ if @investigators.length == 1
+ params[:investigator_id] = @investigators[0].username
+ params[:page] = 1
+ show
+ render :action => :show
+ else
+ @heading = "There were #{@investigators.length} matches to search term <i>"+params[:id].downcase+"</i>"
+ @include_mesh=false
+ render :action => :index, :layout => "searchable"
+ end
else
logger.error "search did not have a defined keyword"
year_list # includes a render
View
@@ -1,10 +1,10 @@
# March 2012 loads, RHLCCC
bundle exec rake importInvestigators file=db/imports/RHLCCC/new_faculty_Mar2012.txt
-bundle exec rake importProgramMembership file=db/imports/RHLCCC/RHLCCCProgramMembershipsMar2012.txt
-bundle exec rake getAllMembers
-bundle exec rake checkForInvestigatorsWithNoPrograms
-bundle exec rake deleteInvestigatorsWithNoPrograms
-bundle exec rake importInvestigatorPubmedIDs file=db/imports/Feinberg/pubmed_ids_Mar2012.txt
+bundle exec rake RAILS_ENV=production importProgramMembership file=db/imports/RHLCCC/RHLCCCProgramMembershipsMar2012.txt
+bundle exec rake RAILS_ENV=production getAllMembers
+bundle exec rake RAILS_ENV=production checkForInvestigatorsWithNoPrograms
+bundle exec rake RAILS_ENV=production deleteInvestigatorsWithNoPrograms
+bundle exec rake RAILS_ENV=production importInvestigatorPubmedIDs file=db/imports/Feinberg/pubmed_ids_Mar2012.txt
#rake importInvestigatorDescriptions file=db/imports/RHLCCC/example_summaries_nov2011.txt
View
@@ -9,3 +9,5 @@ rake reports:netids_to_orgs file=db/imports/IRB/fsm_policy_no_acks_20120220.txt
rake reports:netids_to_orgs file=db/imports/IRB/core_survey_netids_20120227.txt > core_survey_20120227_report.txt
rake reports:netids_to_orgs file=db/imports/IRB/fsm_no_acks_20120301.txt > fsm_no_acks_20120301_report.txt
+
+rake reports:netids_to_orgs file=db/imports/IRB/fsm_no_acks_20120406.txt > fsm_no_acks_report.txt

0 comments on commit 723228b

Please sign in to comment.