Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbevi committed Jul 24, 2014
2 parents 7c28cd0 + 8ee8681 commit 63458e9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 23 deletions.
17 changes: 7 additions & 10 deletions app/controllers/articles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ArticlesController < ApplicationController
include WatchersHelper

before_filter :find_project_by_project_id, :authorize
before_filter :get_article, :only => [:add_attachment, :show, :edit, :update, :add_comment, :destroy, :destroy_comment, :diff, :revert, :version]
before_filter :get_article, :except => [:index, :new, :create, :preview, :comment, :tagged, :rate]

rescue_from ActionView::MissingTemplate, :with => :force_404
rescue_from ActiveRecord::RecordNotFound, :with => :force_404
Expand Down Expand Up @@ -53,7 +53,7 @@ def create
@article = KbArticle.new(params[:article])
@article.category_id = params[:category_id]
@article.author_id = User.current.id
@article.project_id=KbCategory.find(params[:category_id]).project_id
@article.project_id = KbCategory.find(params[:category_id]).project_id
@categories = @project.categories.find(:all)
# don't keep previous comment
@article.version_comments = params[:article][:version_comments]
Expand Down Expand Up @@ -116,14 +116,14 @@ def add_comment
show
render :action => 'show'
end
end
end
end

def destroy_comment
@article.without_locking do
@article.comments.find(params[:comment_id]).destroy
redirect_to :action => 'show', :id => @article, :project_id => @project
end
end
end

def destroy
Expand All @@ -140,13 +140,10 @@ def add_attachment

def tagged
@tag = params[:id]
my_direction = params[:direction]
my_sort = params[:sort]
if my_sort && my_direction
my_order = "#{my_sort} #{my_direction}"
@list = @project.articles.order(my_order).tagged_with(@tag)
@list = if params[:sort] && params[:direction]
@project.articles.order("#{params[:sort]} #{params[:direction]}").tagged_with(@tag)
else
@list = @project.articles.tagged_with(@tag)
@project.articles.tagged_with(@tag)
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/views/articles/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
</div>

<% if @project.categories.count == 0 %>
</br>
<h2><%= l(:knowledgebase_title) %></h2>
<p class="nodata"><%= l(:message_no_categories) %></p>

<% elsif @project.articles.count == 0 %>
</br>
<h2><%= l(:knowledgebase_title) %></h2>
<p class="nodata"><%= l(:message_no_articles) %></p>

<% else %>
Expand Down
22 changes: 11 additions & 11 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,32 +57,32 @@ ja:
label_title: 件名
label_title_articles: 記事
label_title_category: カテゴリ
label_updated_who: "Updated by %{updater} %{age} ago"
label_updated_who: "%{updater}によって%{age}に更新"
message_no_articles: ナレッジベースに追加された記事はありません.早速作りましょう!
message_no_categories: 定義されたカテゴリがありません.新しいカテゴリを作成するにはログインする必要があります.
message_no_permissions: 記事やカテゴリの閲覧権限がありません.管理者にお問い合わせください.
message_summary_count_not_available: "Summary Count Not Available!"
message_summary_count_not_available: サマリーの集計が有効ではありません!
permission_comment_and_rate_articles: 記事のコメントとレーティング
permission_create_article_categories: 記事のカテゴリ追加
permission_create_articles: 記事の追加
permission_edit_articles: 記事の編集
permission_manage_article_categories: 記事のカテゴリ管理
permission_manage_article_history: "manage article history"
permission_manage_article_history: 記事の履歴管理
permission_manage_articles: 記事の管理
permission_manage_articles_comments: 記事のコメント管理
permission_view_article_history: "view article history"
permission_view_article_history: 記事履歴の閲覧
permission_view_articles: 記事の閲覧
permission_view_kb_articles: "View articles"
permission_view_most_popular_articles: "view most popular articles"
permission_view_recent_articles: "View recent articles"
permission_view_top_rated_articles: "view top rated articles"
permission_watch_articles: "Watch articles"
permission_watch_categories: "Watch categories"
permission_view_kb_articles: 記事の閲覧
permission_view_most_popular_articles: 人気記事の閲覧
permission_view_recent_articles: 最近の記事閲覧
permission_view_top_rated_articles: トップレート記事の閲覧
permission_watch_articles: 記事のウォッチ
permission_watch_categories: カテゴリのウォッチ
project_module_knowledgebase: Knowledgebase
show_category_totals: ツリーの全てのカテゴリを表示する
summary_item_limit: ナレッジベースに表示する記事数
text_confirm_versions_delete: このドキュメントの新しいバージョンが存在する場合、記事は逆戻りして削除されます.よろしいですか?
text_current_version: Current
text_current_version: 現在のバージョン
title_add_comment: コメントを追加
title_article_rating: 評価レート
title_browse_by_category: カテゴリ別一覧
Expand Down

0 comments on commit 63458e9

Please sign in to comment.