my_forum 0.0.1.beta12 → 0.0.1.beta13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7fac8ff36e2ec2d618a17dc4feb5a8a4474f83a0
4
- data.tar.gz: 9a1c41aa8460c12b3adcd903d38d6a87494d82be
3
+ metadata.gz: 3d05bd4d494aa68f5d47341af87baf2596b8505b
4
+ data.tar.gz: 48609dd576844d2df68842e01b56b6e6e4aa79ad
5
5
  SHA512:
6
- metadata.gz: 6282d232de51ac4611b2b374d19d2e66d3c6c25b2e4a2d8a4dbfd20d344d91dd3bd6a245274fb39e116ada31b846fe5791075ebfc2731ab10558c9d00983303e
7
- data.tar.gz: 89cc16a59bd0bbf29c890e42b1a98596be41475d84fe35378fff875874373f93b24ea63ee3ed4c6d9af0c5f088e0db531dd9ffcc6aa61a7980ee6fec84141754
6
+ metadata.gz: 005dc4d10a8d3612d2882f15d2231415ba9b2c8f4677e0cccd8147781ad37948454af72bce152178ab288f70dd1d4b6f10de9f11c8045c322ecd7b3b379da55f
7
+ data.tar.gz: bd8ee7df43c42160f188e94aa89e344c4ff2ba196459e0dceb7b7ef79225f36827db3162809eb4181ae59800194780f1f5cb7806ded617ac717f2ae7170525ce
@@ -36,7 +36,7 @@ module MyForum
36
36
  if local_time.to_date == Time.now.to_date
37
37
  return t('my_forum.today', hhmm: local_time.strftime('%H:%M'))
38
38
  elsif local_time.to_date == (Time.now - 1.day).to_date
39
- return t('my_forum.yerstaday ', hhmm: local_time.strftime('%H:%M'))
39
+ return t('my_forum.yesterday ', hhmm: local_time.strftime('%H:%M'))
40
40
  end
41
41
 
42
42
  local_time.strftime('%Y-%m-%d %H:%M')
@@ -3,24 +3,26 @@ require_dependency "my_forum/application_controller"
3
3
  module MyForum
4
4
  class WelcomeController < ApplicationController
5
5
  def index
6
- return @forum_categories = Category.includes(:forums) if current_user && current_user.is_admin?
7
-
8
- @forum_categories = Category.includes(:forums, :user_groups).
9
- reject{|category| (category.user_groups.map(&:name) & (current_user_groups)).blank? }
6
+ @forum_categories = if current_user && current_user.is_admin?
7
+ Category.includes(:forums)
8
+ else
9
+ @forum_categories = Category.includes(:forums, :user_groups).
10
+ reject{|category| (category.user_groups.map(&:name) & (current_user_groups)).blank? }
11
+ end
10
12
 
11
13
 
12
14
  # Don`r forget permissions
13
15
  available_forum_ids = MyForum::Forum.where(category_id: @forum_categories.map(&:id)).pluck(:id)
14
16
  @recent_topics = if available_forum_ids.blank?
15
- []
16
- else
17
- Topic.find_by_sql("
18
- SELECT my_forum_topics.* FROM my_forum_topics
19
- JOIN my_forum_forums ON my_forum_forums.id = my_forum_topics.forum_id
20
- WHERE my_forum_forums.id IN (#{available_forum_ids.join(',')})
21
- ORDER BY my_forum_topics.updated_at DESC limit 10
22
- ")
23
- end
17
+ []
18
+ else
19
+ Topic.find_by_sql("
20
+ SELECT my_forum_topics.* FROM my_forum_topics
21
+ JOIN my_forum_forums ON my_forum_forums.id = my_forum_topics.forum_id
22
+ WHERE my_forum_forums.id IN (#{available_forum_ids.join(',')})
23
+ ORDER BY my_forum_topics.updated_at DESC limit 10
24
+ ")
25
+ end
24
26
 
25
27
  end
26
28
  end
@@ -13,16 +13,16 @@
13
13
  .col-md-2.col-sm-2.forum-info= forum_stat(forum)
14
14
  .col-md-3.col-sm-3.forum-last-message-info= forum_last_message_info(forum)
15
15
 
16
- #recent_topics
17
- %table.table
18
- %caption= t('.recent_topics')
19
- %thead
20
- %tr
21
- %th= t('.topic_name')
22
- %th= t('.last_message_from')
23
- %th= t('.date')
24
- %tbody
25
- - if @recent_topics
16
+ - if @recent_topics
17
+ #recent_topics
18
+ %table.table
19
+ %caption= t('.recent_topics')
20
+ %thead
21
+ %tr
22
+ %th= t('.topic_name')
23
+ %th= t('.last_message_from')
24
+ %th= t('.date')
25
+ %tbody
26
26
  -@recent_topics.each do |topic|
27
27
  %tr
28
28
  %td= link_to topic.name, forum_topic_path(topic.forum, topic)
@@ -2,7 +2,7 @@ ru:
2
2
  today: "Сегодня"
3
3
  my_forum:
4
4
  today: "Сегодня в %{hhmm}"
5
- yerstaday: "Вчера в %{hhmm}"
5
+ yesterday: "Вчера в %{hhmm}"
6
6
  create_new_pm: 'Написать личное сообщение'
7
7
  create_new_topic: 'Создать новую тему'
8
8
  bbquote:
@@ -1,3 +1,3 @@
1
1
  module MyForum
2
- VERSION = "0.0.1.beta12"
2
+ VERSION = "0.0.1.beta13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_forum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.beta12
4
+ version: 0.0.1.beta13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaly Omelchenko