Skip to content

Instantly share code, notes, and snippets.

@elpeo
Created March 4, 2012 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elpeo/1972632 to your computer and use it in GitHub Desktop.
Save elpeo/1972632 to your computer and use it in GitHub Desktop.
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