Skip to content

Instantly share code, notes, and snippets.

@elpeo elpeo/gist:1972632
Created Mar 4, 2012

Embed
What would you like to do?
search_control for section link
Index: ja/search_control.rb
===================================================================
--- ja/search_control.rb (リビジョン 3712)
+++ ja/search_control.rb (作業コピー)
@@ -61,6 +61,7 @@
Search_control_categories = [
[ '最新', 'latest' ],
[ '一日分', 'day' ],
+ [ 'セクション', 'section' ],
[ '一月分', 'month' ],
[ '長年', 'nyear' ],
[ 'カテゴリー', 'category' ]
Index: search_control.rb
===================================================================
--- search_control.rb (リビジョン 3712)
+++ search_control.rb (作業コピー)
@@ -38,6 +38,7 @@
{ # agent: generic
'latest' => 'f',
'day' => 't',
+ 'section' => 'f',
'month' => 'f',
'nyear' => 'f',
'category' => 'f',
@@ -45,6 +46,7 @@
{ # agent: 'Comaneci_bot'
'latest' => 't',
'day' => 'f',
+ 'section' => 'f',
'month' => 'f',
'nyear' => 'f',
'category' => 'f',
@@ -203,7 +205,9 @@
# view
view = ''
follow = 'follow'
- if /^(latest|day|month|nyear)$/ =~ @mode then
+ if section_mode? then
+ view = 'section'
+ elsif /^(latest|day|month|nyear)$/ =~ @mode then
view = @mode
elsif /^category/ =~ @mode then
view = 'category'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.