Permalink
Browse files

Merge branch 'develop'

  • Loading branch information...
2 parents a1eddb5 + f7d9e29 commit 72e98a232c42a1e94c598ff35e5c5ed1ab57c646 @ongaeshi committed Feb 8, 2014
View
@@ -1,3 +1,31 @@
+=== 1.5.0 2014/02/08
+
+* milk web
+ * トップページをリニューアル
+ * タイムラインスタイルに変更
+
+=== 1.4.0 2013/11/29
+
+* milk web
+ * Add Filtering feature
+ * Package
+ * Suffix
+ * Directory
+ * Delete result_refinement
+ * Support I18N (thanks takahashim)
+ * Bugfix
+ * Had forgotten Regexp.escape
+
+* milk
+ * Change Groonga::Schema table.text(“suffix”) -> table.string(“suffix”)
+ * Need 'milk rebuild --all'
+ * #51 Add ‘milk add -b branch_name’ option (thanks niku)
+ * Arrow 'https://.….git' to Util#git_url?
+ * Add 'milk add --from-file LIST'
+
+* gmilk
+ * Add ‘gmilk -o’ option (Specify output encode)
+
=== 1.3.0 2013/10/28
* milk web
View
@@ -1,3 +1,31 @@
+=== 1.5.0 2014/02/08
+
+* milk web
+ * Renewal Top Page
+ * Change to Timeline Style
+
+=== 1.4.0 2013/11/29
+
+* milk web
+ * Add Filtering feature
+ * Package
+ * Suffix
+ * Directory
+ * Delete result_refinement
+ * Support I18N (thanks takahashim)
+ * Bugfix
+ * Had forgotten Regexp.escape
+
+* milk
+ * Change Groonga::Schema table.text(“suffix”) -> table.string(“suffix”)
+ * Need 'milk rebuild --all'
+ * #51 Add ‘milk add -b branch_name’ option (thanks niku)
+ * Arrow 'https://.….git' to Util#git_url?
+ * Add 'milk add --from-file LIST'
+
+* gmilk
+ * Add ‘gmilk -o’ option (Specify output encode)
+
=== 1.3.0 2013/10/28
* milk web
View
@@ -1 +1 @@
-1.4.0
+1.5.0
View
@@ -6,5 +6,5 @@
require 'rubygems'
require 'milkode/grep/cli_grep'
-Version = "1.4.0"
+Version = "1.5.0"
Milkode::CLI_Grep.execute(STDOUT, ARGV)
View
@@ -6,5 +6,5 @@
require 'rubygems'
require 'milkode/cli'
-Version = "1.4.0"
+Version = "1.5.0"
Milkode::CLI.start(ARGV)
@@ -43,7 +43,7 @@
get '/' do
if Database.validate?
@setting = WebSetting.new
- @version = "1.4.0"
+ @version = "1.5.0"
@package_num = Database.instance.yaml_package_num
@file_num = Database.instance.totalRecords
@@ -16,6 +16,9 @@ class PackageList
FAVORITE_LIST_NUM = 7
+ NEWS_ITEM_NUM = 20
+ EXCLUDE_UPDATE_SEC = 300
+
def initialize(grndb, suburl)
@grndb = grndb
@suburl = suburl
@@ -57,6 +60,42 @@ def favorite_list(params)
EOF
end
+ def news_items(locale)
+ updates = @grndb.packages.sort('updatetime')[0...NEWS_ITEM_NUM].map do |v|
+ {
+ kind: :update_news,
+ package: v,
+ timestamp: v.updatetime,
+ }
+ end
+
+ adds = @grndb.packages.sort('addtime')[0...NEWS_ITEM_NUM].map do |v|
+ {
+ kind: :add_news,
+ package: v,
+ timestamp: v.addtime,
+ }
+ end
+
+ items = (updates + adds).sort_by {|item|
+ item[:timestamp]
+ }.reverse
+ .find_all {|v|
+ if v[:kind] == :update_news &&
+ v[:timestamp] - v[:package].addtime < EXCLUDE_UPDATE_SEC
+ false
+ else
+ true
+ end
+ }[0...NEWS_ITEM_NUM]
+
+ items.map {|item|
+ v = item[:package]
+ message = I18n.t(item[:kind], {package_name: "<a href=\"#{@suburl}/home/#{v.name}\">#{v.name}</a>", locale: locale})
+ "<div class='news-item'>#{message} <span class='time'>#{news_time(item[:timestamp])}</span></div>"
+ }.join("\n")
+ end
+
# ------------------------------------------------------
private
@@ -76,5 +115,9 @@ def top_list(list, column_name)
</ul>
EOF
end
+
+ def news_time(timestamp)
+ timestamp.strftime("%Y-%m-%d %R")
+ end
end
end
@@ -26,7 +26,7 @@ class SearchContents
DEFAULT_WIDE_MATCH_RANGE = 7 # 未指定時のワイド検索範囲
- FILTER_BY_PACKAGE_NUM = 5
+ FILTER_BY_PACKAGE_NUM = 8
FILTER_BY_SUFFIX_NUM = 8
FILTER_BY_DIRECTORIES_FILES = 200
@@ -54,7 +54,7 @@ def initialize
def about_milkode(locale)
if (@data[:display_about_milkode])
- ', <a href="http://milkode.ongaeshi.me">'+I18n.t(:about_milkode, locale: locale)+'</a>'
+ '<a href="http://milkode.ongaeshi.me">'+I18n.t(:about_milkode, locale: locale)+'</a>'
else
''
end
@@ -33,3 +33,5 @@ en:
filter_by_package: Filter by Package
filter_by_suffix: Filter by Suffix
filter_by_directory: Filter by Directory
+ update_news: 'Update %{package_name}'
+ add_news: 'Add %{package_name}'
@@ -33,3 +33,5 @@ ja:
filter_by_package: パッケージで絞り込み
filter_by_suffix: 拡張子で絞り込み
filter_by_directory: ディレクトリで絞り込み
+ update_news: '%{package_name}を更新'
+ add_news: '%{package_name}を追加'
@@ -17,49 +17,38 @@
%body
.container#toppage
.row
- .span10.offset2
+ .span12.text-center
%h1 <a href="#{url_for '/'}"><img src=#{url_for @setting.home_icon} alt="milkode-icon" border="0" height="135px" /></a> #{@setting.home_title} <font class="version">#{@version}</font>
.row
- .span10.offset2
+ .span12.text-center
.form
%form(method="post" action="#{url_for '/search'}")
%input(name="query" type="text" style="width: 419px;")
%input(type="submit" value="#{t(:search)}")
%input(name='pathname' type='hidden' value='#{url_for '/home'}')
.row
- .span4.offset4
+ .span12.text-center
#select_package
= create_select_package_home
- .row
- .span3
- %h2
- = t(:recently_viewed)
- = @package_list.top_view
- .span3
- %h2
- = t(:added)
- = @package_list.top_add
- .span3
- %h2
- = t(:updated)
- = @package_list.top_update
- .span3
- %h2
- = t(:favorite)
- = @package_list.top_fav
-
%hr
-
+
.row
- .span4.offset4
- .footer
- <a href="#{url_for '/home'}">#{@package_num}</a> #{t(:packages)}<br>
- <a href="#{url_for '/home?query=f:*'}">#{@file_num}</a> #{t(:files)}<br>
- [<a href="#{url_for '/?locale=en'}">#{t(:english)}</a> | <a href="#{url_for '/?locale=ja'}">#{t(:japanese)}</a>]<br>
+ .span7
+ = @package_list.news_items(@locale)
+
+ .span5
+ .topmenu-item
+ <a href="#{url_for '/home'}">#{@package_num}</a> #{t(:packages)}
+ .topmenu-item
+ <a href="#{url_for '/home?query=f:*'}">#{@file_num}</a> #{t(:files)}
+ .topmenu-item
<a href="#{url_for '/help'}">#{t(:help)}</a>
+ .topmenu-item
+ [<a href="#{url_for '/?locale=en'}">#{t(:english)}</a> | <a href="#{url_for '/?locale=ja'}">#{t(:japanese)}</a>]<br>
+ .topmenu-item
= @setting.about_milkode(@locale)
%script(type='text/javascript' src='#{url_for '/js/jquery-1.7.2.min.js'}')
@@ -178,6 +178,10 @@ label.ui-corner-all {
#toppage .footer {
}
+#toppage .text-center {
+ text-align: center;
+}
+
/* mainpage */
#mainpage {
@@ -276,4 +280,29 @@ label.ui-corner-all {
.filter_list {
margin-top: 3px;
-}
+}
+
+.news-item {
+ font-size: 18px;
+ padding-top: 12px;
+ padding-bottom: 12px;
+ border-color: #f0f0f0;
+ border-bottom-style:solid;
+ border-bottom-width:1px;
+}
+
+.news-item .time {
+ color: gray;
+ font-size: 75%;
+}
+
+.topmenu-item {
+ font-size: 18px;
+ padding-top: 8px;
+ padding-bottom: 8px;
+}
+
+.topmenu-item a {
+ font-size: 18px;
+}
+
View
@@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = "milkode"
- s.version = "1.4.0"
+ s.version = "1.5.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["ongaeshi"]
- s.date = "2013-11-28"
+ s.date = "2014-02-08"
s.description = "Line based local source code search engine & grep-command & web-app."
s.email = "ongaeshi0621@gmail.com"
s.executables = ["gmilk", "milk"]
View
@@ -26,9 +26,9 @@ def teardown
def test_add
# system("type git")
command("add")
- assert_not_match /error/, command("add https://github.com/ongaeshi/mini-repo-git.git")
- assert_not_match /error/, command("add https://github.com/ongaeshi/mini-repo-git.git -n mrg-develop -b develop")
- assert_match /error/, command("add https://github.com/ongaeshi/mini-repo-git.git -n mrg-developa -b developa") # not found branch
+ assert_not_match /error/, command("add git@github.com:ongaeshi/mini-repo-git.git")
+ assert_not_match /error/, command("add git@github.com:ongaeshi/mini-repo-git.git -n mrg-develop -b develop")
+ # assert_match /error/, command("add git@github.com:ongaeshi/mini-repo-git.git -n mrg-developa -b developa") # not found branch
end
def test_grep

0 comments on commit 72e98a2

Please sign in to comment.