my_forum 0.0.1.beta60 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +1 -12
  3. data/Rakefile +3 -4
  4. data/app/assets/javascripts/my_forum/application.js +0 -6
  5. data/{spec/dummy/app/assets/stylesheets → app/assets/stylesheets/my_forum}/application.css +1 -1
  6. data/app/controllers/my_forum/application_controller.rb +0 -81
  7. data/app/helpers/my_forum/application_helper.rb +0 -43
  8. data/app/views/layouts/my_forum/application.html.erb +14 -0
  9. data/config/routes.rb +0 -48
  10. data/lib/my_forum/engine.rb +0 -31
  11. data/lib/my_forum/version.rb +1 -1
  12. data/lib/tasks/my_forum_tasks.rake +4 -155
  13. data/{spec → test}/dummy/README.rdoc +0 -0
  14. data/{spec → test}/dummy/Rakefile +0 -0
  15. data/{spec → test}/dummy/app/assets/javascripts/application.js +1 -1
  16. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  17. data/{spec → test}/dummy/app/controllers/application_controller.rb +0 -0
  18. data/{spec → test}/dummy/app/helpers/application_helper.rb +0 -0
  19. data/{spec → test}/dummy/app/views/layouts/application.html.erb +0 -0
  20. data/{spec → test}/dummy/bin/bundle +0 -0
  21. data/{spec → test}/dummy/bin/rails +0 -0
  22. data/{spec → test}/dummy/bin/rake +0 -0
  23. data/{spec → test}/dummy/config/application.rb +0 -0
  24. data/{spec → test}/dummy/config/boot.rb +0 -0
  25. data/{spec → test}/dummy/config/database.yml +0 -0
  26. data/{spec → test}/dummy/config/environment.rb +0 -0
  27. data/{spec → test}/dummy/config/environments/development.rb +0 -0
  28. data/{spec → test}/dummy/config/environments/production.rb +1 -1
  29. data/{spec → test}/dummy/config/environments/test.rb +1 -1
  30. data/{spec → test}/dummy/config/initializers/assets.rb +0 -0
  31. data/{spec → test}/dummy/config/initializers/backtrace_silencers.rb +0 -0
  32. data/{spec → test}/dummy/config/initializers/cookies_serializer.rb +0 -0
  33. data/{spec → test}/dummy/config/initializers/filter_parameter_logging.rb +0 -0
  34. data/{spec → test}/dummy/config/initializers/inflections.rb +0 -0
  35. data/{spec → test}/dummy/config/initializers/mime_types.rb +0 -0
  36. data/{spec → test}/dummy/config/initializers/session_store.rb +0 -0
  37. data/{spec → test}/dummy/config/initializers/wrap_parameters.rb +0 -0
  38. data/{spec → test}/dummy/config/locales/en.yml +0 -0
  39. data/{spec → test}/dummy/config/routes.rb +0 -0
  40. data/{spec → test}/dummy/config/secrets.yml +0 -0
  41. data/{spec → test}/dummy/config.ru +0 -0
  42. data/{spec → test}/dummy/public/404.html +0 -0
  43. data/{spec → test}/dummy/public/422.html +0 -0
  44. data/{spec → test}/dummy/public/500.html +0 -0
  45. data/{spec → test}/dummy/public/favicon.ico +0 -0
  46. data/test/integration/navigation_test.rb +10 -0
  47. data/test/my_forum_test.rb +7 -0
  48. data/test/test_helper.rb +15 -0
  49. metadata +84 -355
  50. data/app/assets/javascripts/my_forum/admin/categories.js.coffee +0 -0
  51. data/app/assets/javascripts/my_forum/admin/dashboard.js.coffee +0 -0
  52. data/app/assets/javascripts/my_forum/admin/forums.js.coffee +0 -0
  53. data/app/assets/javascripts/my_forum/admin/roles.js +0 -2
  54. data/app/assets/javascripts/my_forum/admin/users.js +0 -2
  55. data/app/assets/javascripts/my_forum/forums.js.coffee +0 -0
  56. data/app/assets/javascripts/my_forum/jquery.scrollTo.min.js +0 -7
  57. data/app/assets/javascripts/my_forum/jquery.selection.js +0 -354
  58. data/app/assets/javascripts/my_forum/my_forum.js.coffee +0 -118
  59. data/app/assets/javascripts/my_forum/posts.js.coffee +0 -20
  60. data/app/assets/javascripts/my_forum/topics.js.coffee +0 -0
  61. data/app/assets/javascripts/my_forum/users.js.coffee +0 -0
  62. data/app/assets/javascripts/my_forum/welcome.js.coffee +0 -0
  63. data/app/assets/stylesheets/my_forum/admin/categories.css.scss +0 -0
  64. data/app/assets/stylesheets/my_forum/admin/dashboard.css.scss +0 -3
  65. data/app/assets/stylesheets/my_forum/admin/forums.css.scss +0 -7
  66. data/app/assets/stylesheets/my_forum/admin/roles.css +0 -4
  67. data/app/assets/stylesheets/my_forum/admin/users.css +0 -4
  68. data/app/assets/stylesheets/my_forum/application.css.scss +0 -80
  69. data/app/assets/stylesheets/my_forum/forums.css.scss +0 -31
  70. data/app/assets/stylesheets/my_forum/posts.css.scss +0 -138
  71. data/app/assets/stylesheets/my_forum/private_messages.css.scss +0 -11
  72. data/app/assets/stylesheets/my_forum/topics.css.scss +0 -16
  73. data/app/assets/stylesheets/my_forum/users.css.scss +0 -3
  74. data/app/assets/stylesheets/my_forum/welcome.css.scss +0 -73
  75. data/app/controllers/my_forum/admin/categories_controller.rb +0 -36
  76. data/app/controllers/my_forum/admin/dashboard_controller.rb +0 -13
  77. data/app/controllers/my_forum/admin/emoticons_controller.rb +0 -65
  78. data/app/controllers/my_forum/admin/forums_controller.rb +0 -35
  79. data/app/controllers/my_forum/admin/mail_controller.rb +0 -31
  80. data/app/controllers/my_forum/admin/roles_controller.rb +0 -38
  81. data/app/controllers/my_forum/admin/users_controller.rb +0 -14
  82. data/app/controllers/my_forum/attachments_controller.rb +0 -30
  83. data/app/controllers/my_forum/forums_controller.rb +0 -39
  84. data/app/controllers/my_forum/images_controller.rb +0 -7
  85. data/app/controllers/my_forum/posts_controller.rb +0 -81
  86. data/app/controllers/my_forum/private_messages_controller.rb +0 -73
  87. data/app/controllers/my_forum/topics_controller.rb +0 -96
  88. data/app/controllers/my_forum/users_controller.rb +0 -145
  89. data/app/controllers/my_forum/welcome_controller.rb +0 -30
  90. data/app/helpers/my_forum/admin/dashboard_helper.rb +0 -4
  91. data/app/helpers/my_forum/admin/forums_helper.rb +0 -4
  92. data/app/helpers/my_forum/admin/roles_helper.rb +0 -4
  93. data/app/helpers/my_forum/admin/users_helper.rb +0 -4
  94. data/app/helpers/my_forum/emoticons_helper.rb +0 -7
  95. data/app/helpers/my_forum/forums_helper.rb +0 -44
  96. data/app/helpers/my_forum/posts_helper.rb +0 -72
  97. data/app/helpers/my_forum/private_messages_helper.rb +0 -25
  98. data/app/helpers/my_forum/topics_helper.rb +0 -18
  99. data/app/helpers/my_forum/users_helper.rb +0 -33
  100. data/app/helpers/my_forum/welcome_helper.rb +0 -4
  101. data/app/mailers/application_mailer.rb +0 -4
  102. data/app/mailers/my_forum/user_mailer.rb +0 -24
  103. data/app/models/my_forum/attachment.rb +0 -12
  104. data/app/models/my_forum/avatar.rb +0 -11
  105. data/app/models/my_forum/category.rb +0 -7
  106. data/app/models/my_forum/category_permission.rb +0 -6
  107. data/app/models/my_forum/emoticon.rb +0 -6
  108. data/app/models/my_forum/forum.rb +0 -50
  109. data/app/models/my_forum/image.rb +0 -5
  110. data/app/models/my_forum/log_read_mark.rb +0 -4
  111. data/app/models/my_forum/post.rb +0 -26
  112. data/app/models/my_forum/private_message.rb +0 -8
  113. data/app/models/my_forum/role.rb +0 -6
  114. data/app/models/my_forum/topic.rb +0 -41
  115. data/app/models/my_forum/user.rb +0 -71
  116. data/app/models/my_forum/user_group.rb +0 -13
  117. data/app/models/my_forum/user_group_link.rb +0 -6
  118. data/app/models/my_forum/user_roles.rb +0 -6
  119. data/app/views/layouts/mailer.html.erb +0 -5
  120. data/app/views/layouts/mailer.text.erb +0 -1
  121. data/app/views/layouts/my_forum/_guest_navbar.html.haml +0 -4
  122. data/app/views/layouts/my_forum/_user_navbar.html.haml +0 -19
  123. data/app/views/layouts/my_forum/admin_application.haml +0 -29
  124. data/app/views/layouts/my_forum/application.haml +0 -23
  125. data/app/views/my_forum/admin/categories/edit.haml +0 -9
  126. data/app/views/my_forum/admin/categories/new.haml +0 -5
  127. data/app/views/my_forum/admin/dashboard/index.haml +0 -0
  128. data/app/views/my_forum/admin/emoticons/edit.haml +0 -4
  129. data/app/views/my_forum/admin/emoticons/index.haml +0 -15
  130. data/app/views/my_forum/admin/emoticons/new.haml +0 -5
  131. data/app/views/my_forum/admin/forums/index.haml +0 -47
  132. data/app/views/my_forum/admin/forums/new.haml +0 -6
  133. data/app/views/my_forum/admin/mail/index.haml +0 -9
  134. data/app/views/my_forum/admin/roles/index.haml +0 -12
  135. data/app/views/my_forum/admin/roles/new.haml +0 -22
  136. data/app/views/my_forum/admin/users/index.haml +0 -10
  137. data/app/views/my_forum/forums/_topic_subject.html.haml +0 -16
  138. data/app/views/my_forum/forums/show.haml +0 -29
  139. data/app/views/my_forum/posts/edit.html.haml +0 -31
  140. data/app/views/my_forum/private_messages/_sidebar.haml +0 -10
  141. data/app/views/my_forum/private_messages/inbox.haml +0 -26
  142. data/app/views/my_forum/private_messages/new.haml +0 -21
  143. data/app/views/my_forum/private_messages/show.haml +0 -10
  144. data/app/views/my_forum/shared/_post_preview.haml +0 -15
  145. data/app/views/my_forum/shared/_upload_photo.haml +0 -45
  146. data/app/views/my_forum/shared/post_preview.js.coffee +0 -4
  147. data/app/views/my_forum/topics/_post.haml +0 -29
  148. data/app/views/my_forum/topics/_profile_popover.haml +0 -47
  149. data/app/views/my_forum/topics/_quick_answer.haml +0 -34
  150. data/app/views/my_forum/topics/_topic_header.haml +0 -4
  151. data/app/views/my_forum/topics/_user_info.haml +0 -9
  152. data/app/views/my_forum/topics/new.haml +0 -38
  153. data/app/views/my_forum/topics/show.haml +0 -60
  154. data/app/views/my_forum/user_mailer/custom_email.text.erb +0 -1
  155. data/app/views/my_forum/user_mailer/pm_notification.text.erb +0 -6
  156. data/app/views/my_forum/user_mailer/reset_password_email.haml +0 -1
  157. data/app/views/my_forum/user_mailer/reset_password_email.text.erb +0 -1
  158. data/app/views/my_forum/users/edit.haml +0 -36
  159. data/app/views/my_forum/users/forgot_password.haml +0 -10
  160. data/app/views/my_forum/users/new.haml +0 -14
  161. data/app/views/my_forum/users/signin.haml +0 -14
  162. data/app/views/my_forum/users/signout.haml +0 -0
  163. data/app/views/my_forum/welcome/index.haml +0 -37
  164. data/config/initializers/will_paginate.rb +0 -24
  165. data/config/locales/en.yml +0 -68
  166. data/config/locales/ru.yml +0 -196
  167. data/db/migrate/20141117122725_create_my_forum_forums.rb +0 -12
  168. data/db/migrate/20141117122742_create_my_forum_topics.rb +0 -17
  169. data/db/migrate/20141117122751_create_my_forum_posts.rb +0 -11
  170. data/db/migrate/20141118081021_create_my_forum_categories.rb +0 -8
  171. data/db/migrate/20141118131215_create_my_forum_users.rb +0 -34
  172. data/db/migrate/20141222094522_create_my_forum_roles.rb +0 -10
  173. data/db/migrate/20141222094538_create_my_forum_user_roles.rb +0 -9
  174. data/db/migrate/20150202115250_create_my_forum_log_read_marks.rb +0 -10
  175. data/db/migrate/20150215200453_create_my_forum_user_groups.rb +0 -15
  176. data/db/migrate/20150215204852_create_my_forum_user_group_links.rb +0 -9
  177. data/db/migrate/20150215212443_create_my_forum_category_permissions.rb +0 -9
  178. data/db/migrate/20150227210814_create_my_forum_private_messages.rb +0 -16
  179. data/db/migrate/20151012095554_create_my_forum_images.rb +0 -12
  180. data/db/migrate/20151218135729_add_is_deleted.rb +0 -6
  181. data/db/migrate/20151220121140_create_my_forum_emoticons.rb +0 -10
  182. data/db/migrate/20151221203243_my_forum_rename_user_avatar.rb +0 -5
  183. data/db/migrate/20151221205045_my_forum_change_user_avatar.rb +0 -5
  184. data/db/migrate/20160122202142_add_latest_post_info_for_topic.rb +0 -24
  185. data/db/migrate/20160210130805_add_indexes_for_topics.rb +0 -7
  186. data/db/migrate/20160214085201_add_edited_by_for_post.rb +0 -5
  187. data/spec/controllers/my_forum/admin/emoticons_controller_spec.rb +0 -7
  188. data/spec/controllers/my_forum/admin/mail_controller_spec.rb +0 -7
  189. data/spec/controllers/my_forum/private_messages_controller_spec.rb +0 -7
  190. data/spec/controllers/my_forum/users_controller_spec.rb +0 -76
  191. data/spec/dummy/db/development.sqlite3 +0 -0
  192. data/spec/dummy/db/schema.rb +0 -159
  193. data/spec/dummy/db/test.sqlite3 +0 -0
  194. data/spec/dummy/log/development.log +0 -12
  195. data/spec/helpers/my_forum/posts_helper_spec.rb +0 -24
  196. data/spec/helpers/my_forum/private_messages_helper_spec.rb +0 -17
  197. data/spec/models/my_forum/emoticon_spec.rb +0 -7
  198. data/spec/models/my_forum/private_message_spec.rb +0 -7
  199. data/spec/models/my_forum/user_spec.rb +0 -13
  200. data/spec/rails_helper.rb +0 -52
  201. data/spec/spec_helper.rb +0 -87
@@ -1,196 +0,0 @@
1
- ru:
2
- today: "Сегодня"
3
- my_forum:
4
- pm:
5
- sent: 'Сообщение отправленно'
6
- mailer:
7
- new_pm_notification_subject: 'Уведомление о новом личном сообщении'
8
- shared:
9
- post_preview:
10
- preview: 'Предпросмотр сообщения'
11
- additional_info:
12
- real_name: 'Ваше имя'
13
- phone: 'Контактный телефон'
14
- website_url: 'Ваш сайт'
15
- personal_text: 'Подпись'
16
- car_info: 'Марка и модель авто'
17
-
18
- profile_popover:
19
- posts_count: 'Сообщений: '
20
- registered_at: 'Регистрация: '
21
- status: 'Статус:'
22
- online: 'на форуме'
23
- offline: 'не на форуме'
24
- last_online: 'Был на форуме:'
25
- user_name: 'Имя'
26
- phone: 'Телефон'
27
- car_info: 'Марка авто'
28
- write_pm: 'Написать ЛС'
29
- only_for_registereg_users: 'Доступно только зарегестрированным пользователям'
30
-
31
- today: "Сегодня в %{hhmm}"
32
- yesterday: "Вчера в %{hhmm}"
33
- create_new_pm: 'Написать личное сообщение'
34
- create_new_topic: 'Создать новую тему'
35
- reply_for_pm: 'Ответить на сообщение'
36
- successfull_aploaded: 'Файлы успешно загружены'
37
-
38
- attachments:
39
- allowed_extensions: "Разрешенные расширения файлов: %{ext}"
40
-
41
- bbquote:
42
- wrote: 'написал'
43
-
44
- admin:
45
- forums:
46
- index:
47
- create_category: 'Создать новую категорию'
48
-
49
- roles:
50
- new:
51
- role_name: 'Название роли'
52
-
53
-
54
- categories:
55
- new:
56
- create_new_category: 'Создать новую категорию'
57
- category_name: 'Название категории'
58
-
59
-
60
- forums:
61
- new:
62
- create_new_forum: 'Создать новый форум'
63
- forum_name: 'Название форума'
64
- forum_description: 'Описание форума'
65
-
66
-
67
- welcome:
68
- index:
69
- topics_count: "%{topics_count} тем"
70
- messages_count: "%{messages_count} сообщений"
71
- last_answer_from: 'Последний ответ от: '
72
- in_forum: 'в '
73
- users_online: 'Сейчас на форуме: '
74
- today_online: 'Сегодня на форуме были: '
75
- recent_topics: 'Последние сообщения'
76
- topic_name: 'Тема:'
77
- last_message_from: 'Последнее сообщение от:'
78
- date: 'Дата:'
79
-
80
- forums:
81
- show:
82
- subject: 'Тема'
83
- author: 'Автор'
84
- answers: 'Ответов'
85
- viewa: 'Просмотров'
86
- mark_all_as_read: 'Отметить все как прочитанное'
87
- last_message: 'Последний ответ'
88
- topic_subject:
89
- author: "Автор: %{author}"
90
-
91
- topics:
92
- new:
93
- name: 'Название темы'
94
- description: 'Описание'
95
- post_text: ''
96
- create_new_topic_in: "Создать новую тему в '%{topic_name}'"
97
- show:
98
- messages_in_topic: "Сообщений в теме: %{count}"
99
- pin_topic: 'Закрепить тему'
100
- unpin_topic: 'Открепить тему'
101
- lock_topic: 'Закрыть тему'
102
- unlock_topic: 'Открыть тему'
103
- delete_topic: 'Удалить тему'
104
- are_you_sure?: 'Вы уверены?'
105
- warning_closed_topic: 'Внимание! Эта тема закрыта, никто кроме вас, не сможет ответить!'
106
- user_info:
107
- user_posts_count: "%{count} сообщений"
108
- quick_answer:
109
- quick_answer: 'Быстрый ответ'
110
- quick_answer_preview: 'Предварительный просмотр'
111
- advanced_answer: 'Расширенный ответ'
112
- post:
113
- edited_by: "Было отредактированно %{login}, %{date}"
114
- sent: "Отправленно: %{datetime}"
115
- number: "Сообщение #%{post_number}"
116
- quote: 'Цитировать'
117
- edit: 'изменить'
118
- delete: 'удалить'
119
-
120
- posts:
121
- edit:
122
- post_text: 'Текст поста'
123
- edit_post_in: "Редактировать пост в '%{topic_name}'"
124
-
125
- users:
126
- signin:
127
- sign_in_head: 'Вход на форум'
128
- login: 'Логин'
129
- password: 'Пароль'
130
- enter: 'Войти'
131
- forgot_password: 'Восстановить пароль'
132
- new:
133
- login: 'Логин'
134
- email: 'E-mail'
135
- password: 'Пароль'
136
- register_new_user: 'Регистрация нового участника'
137
- register: 'Зарегестрироваться'
138
- forgot_password:
139
- forgot_password_head: 'Восстановление пароля'
140
- reset_password: 'Сбросить пароль'
141
- new_password_sent: 'Новый пароль отправлен на указанный email'
142
- edit:
143
- edit_profile: 'Редактирование персональных данных'
144
- email: 'Электронная почта'
145
- current_password: 'Текущий пароль'
146
- new_password: 'Новый пароль'
147
- avatar: 'Аватар'
148
- avatar_upload_description: 'Загрузите свой аватар или укажите ссылку'
149
- update: 'Обновить'
150
- update_avatar: 'Обновить аватар'
151
- edit_additional_info: 'Дополнительная информация'
152
-
153
-
154
- private_messages:
155
- sidebar:
156
- inbox: 'Входящие'
157
- outbox: 'Отправленные'
158
- deleted: 'Удаленные'
159
- new:
160
- recipient: 'Кому'
161
- subject: 'Тема'
162
- body: 'Сообщение'
163
- new_private_message: 'Написать личное сообщение'
164
- send: 'Отправить'
165
- create:
166
- cant_find_recipient: 'Ошибка, пользователя адресата не существует'
167
-
168
-
169
- layouts:
170
- my_forum:
171
- user_navbar:
172
- welcome_to_forum: 'Добро пожаловать'
173
- private_messages: 'Личные сообщения'
174
- new_forum_messages: 'Непрочитанные темы'
175
- user_profile: 'Профиль'
176
- logout: 'Выход'
177
- guest_navbar:
178
- login: 'Войти'
179
- register: 'Зарегестрироваться'
180
-
181
-
182
- will_paginate:
183
- previous_label: 'Назад'
184
- next_label: 'Вперед'
185
- page_gap: ''
186
-
187
-
188
- activerecord:
189
- errors:
190
- models:
191
- my_forum/user:
192
- attributes:
193
- login:
194
- taken: 'Занят'
195
- email:
196
- taken: 'Занят'
@@ -1,12 +0,0 @@
1
- class CreateMyForumForums < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_forums do |t|
4
- t.integer :category_id
5
- t.string :name
6
- t.string :description
7
- t.integer :topics_count
8
- t.integer :posts_count
9
- t.timestamps null: false
10
- end
11
- end
12
- end
@@ -1,17 +0,0 @@
1
- class CreateMyForumTopics < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_topics do |t|
4
- t.integer :forum_id
5
- t.integer :user_id
6
- t.integer :latest_post_id
7
- t.string :name
8
- t.string :description
9
- t.integer :views
10
- t.integer :posts_count, default: 0
11
- t.boolean :pinned, default: false
12
- t.boolean :closed, default: false
13
- t.boolean :deleted, default: false
14
- t.timestamps null: false
15
- end
16
- end
17
- end
@@ -1,11 +0,0 @@
1
- class CreateMyForumPosts < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_posts do |t|
4
- t.integer :user_id
5
- t.integer :topic_id
6
- t.integer :forum_id
7
- t.text :text, :limit => 4294967295
8
- t.timestamps null: false
9
- end
10
- end
11
- end
@@ -1,8 +0,0 @@
1
- class CreateMyForumCategories < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_categories do |t|
4
- t.string :name
5
- t.timestamps null: false
6
- end
7
- end
8
- end
@@ -1,34 +0,0 @@
1
- class CreateMyForumUsers < ActiveRecord::Migration
2
- def self.up
3
- create_table :my_forum_users do |t|
4
- t.string :login
5
- t.string :password
6
- t.string :salt
7
- t.string :real_name
8
- t.integer :gender
9
- t.date :birthdate
10
- t.text :signature
11
- t.string :avatar
12
- t.string :location
13
- t.string :user_ip
14
- t.text :additional_info
15
- t.string :email
16
- t.integer :posts_count
17
- t.boolean :activated, default: false
18
- t.boolean :is_admin, default: false
19
- t.boolean :is_moderator, default: false
20
- t.boolean :is_deleted, default: false
21
- t.boolean :permanently_banned, default: false
22
- t.timestamps null: false
23
- t.timestamp :last_logged_in
24
- end
25
-
26
- MyForum::User.reset_column_information
27
- user = MyForum::User.new(login: 'admin', password: 'admin', is_admin: true, email: 'admin@example.com')
28
- user.save
29
- end
30
-
31
- def self.down
32
- drop_table :my_forum_users
33
- end
34
- end
@@ -1,10 +0,0 @@
1
- class CreateMyForumRoles < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_roles do |t|
4
- t.string :name
5
- t.string :color
6
- t.text :rights
7
- t.timestamps null: false
8
- end
9
- end
10
- end
@@ -1,9 +0,0 @@
1
- class CreateMyForumUserRoles < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_user_roles do |t|
4
- t.integer :user_id
5
- t.integer :role_id
6
- t.timestamps null: false
7
- end
8
- end
9
- end
@@ -1,10 +0,0 @@
1
- class CreateMyForumLogReadMarks < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_log_read_marks do |t|
4
- t.integer :user_id
5
- t.integer :topic_id
6
- t.integer :post_id
7
- t.timestamps null: false
8
- end
9
- end
10
- end
@@ -1,15 +0,0 @@
1
- class CreateMyForumUserGroups < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_user_groups do |t|
4
- t.string :name
5
- t.string :html_color
6
- t.boolean :default, default: false
7
- t.timestamps null: false
8
- end
9
-
10
- MyForum::UserGroup.create!(name: 'Guests')
11
- MyForum::UserGroup.create!(name: 'Member', default: true)
12
- MyForum::UserGroup.create!(name: 'Moderator')
13
- MyForum::UserGroup.create!(name: 'Admin')
14
- end
15
- end
@@ -1,9 +0,0 @@
1
- class CreateMyForumUserGroupLinks < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_user_group_links do |t|
4
- t.integer :user_id
5
- t.integer :user_group_id
6
- t.timestamps null: false
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- class CreateMyForumCategoryPermissions < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_category_permissions do |t|
4
- t.integer :user_group_id
5
- t.integer :category_id
6
- t.timestamps null: false
7
- end
8
- end
9
- end
@@ -1,16 +0,0 @@
1
- class CreateMyForumPrivateMessages < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_private_messages do |t|
4
- t.integer :sender_id
5
- t.string :sender_login
6
- t.integer :recipient_id
7
- t.string :recipient_login
8
- t.boolean :sender_deleted, :default => false
9
- t.boolean :recipient_deleted, :default => false
10
- t.boolean :unread, :default => true
11
- t.string :subject
12
- t.text :body
13
- t.timestamps null: false
14
- end
15
- end
16
- end
@@ -1,12 +0,0 @@
1
- class CreateMyForumImages < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_images do |t|
4
- t.integer :user_id
5
- t.integer :post_id
6
- t.string :file_name
7
- t.integer :file_size
8
- t.string :type
9
- t.timestamps null: false
10
- end
11
- end
12
- end
@@ -1,6 +0,0 @@
1
- class AddIsDeleted < ActiveRecord::Migration
2
- def change
3
- add_column :my_forum_posts, :is_deleted, :boolean, default: false
4
- add_column :my_forum_topics, :is_deleted, :boolean, default: false
5
- end
6
- end
@@ -1,10 +0,0 @@
1
- class CreateMyForumEmoticons < ActiveRecord::Migration
2
- def change
3
- create_table :my_forum_emoticons do |t|
4
- t.string :file_name
5
- t.string :code
6
- t.boolean :is_active, default: true
7
- t.timestamps null: false
8
- end
9
- end
10
- end
@@ -1,5 +0,0 @@
1
- class MyForumRenameUserAvatar < ActiveRecord::Migration
2
- def change
3
- rename_column :my_forum_users, :avatar, :avatar_url
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class MyForumChangeUserAvatar < ActiveRecord::Migration
2
- def change
3
- change_column :my_forum_users, :avatar_url, :text, length: 350
4
- end
5
- end
@@ -1,24 +0,0 @@
1
- class AddLatestPostInfoForTopic < ActiveRecord::Migration
2
- def change
3
- add_column :my_forum_topics, :latest_post_created_at, :datetime
4
- add_column :my_forum_topics, :latest_post_login, :string
5
- add_column :my_forum_topics, :latest_post_user_id, :integer
6
-
7
- count = MyForum::Topic.count
8
- MyForum::Topic.find_in_batches do |group|
9
- group.each do |topic|
10
- puts "#{count-=1} Try to update #{topic.name}"
11
- latest_post = topic.posts.last
12
- latest_post_user = latest_post.user
13
- next unless latest_post_user
14
-
15
- topic.update(
16
- latest_post_created_at: latest_post.created_at,
17
- latest_post_login: latest_post_user.login,
18
- latest_post_user_id: latest_post_user.id
19
- )
20
- end
21
- end
22
-
23
- end
24
- end
@@ -1,7 +0,0 @@
1
- class AddIndexesForTopics < ActiveRecord::Migration
2
- def change
3
- add_index :my_forum_topics, :latest_post_created_at, name: 'index_topics_latest_created_post'
4
- add_index :my_forum_topics, [:deleted, :latest_post_created_at], name: 'index_topics_deleted_latest_created_post'
5
- add_index :my_forum_topics, [:pinned, :latest_post_created_at, :deleted], name: 'index_topics_pinned_deleted_latest_created_post'
6
- end
7
- end
@@ -1,5 +0,0 @@
1
- class AddEditedByForPost < ActiveRecord::Migration
2
- def change
3
- add_column :my_forum_posts, :edited_by, :string, default: nil
4
- end
5
- end
@@ -1,7 +0,0 @@
1
- require 'rails_helper'
2
-
3
- module MyForum
4
- RSpec.describe Admin::EmoticonsController, type: :controller do
5
-
6
- end
7
- end
@@ -1,7 +0,0 @@
1
- require 'rails_helper'
2
-
3
- module MyForum
4
- RSpec.describe Admin::MailController, type: :controller do
5
-
6
- end
7
- end
@@ -1,7 +0,0 @@
1
- require 'rails_helper'
2
-
3
- module MyForum
4
- RSpec.describe PrivateMessagesController, type: :controller do
5
-
6
- end
7
- end
@@ -1,76 +0,0 @@
1
- require 'rails_helper'
2
-
3
- module MyForum
4
- RSpec.describe UsersController, type: :controller do
5
- routes { MyForum::Engine.routes }
6
-
7
- describe 'Loggin in' do
8
- it 'should login user by password' do
9
- user = User.create!(login: 'demo', password: '12345678', email: 'demo@example.com')
10
-
11
- post :signin, user: { login: 'demo', password: '12345678' }
12
- expect(session[:user_id]).to eq(user.id)
13
- expect(response).to redirect_to(root_path)
14
- end
15
-
16
- it 'should not login user if login or password incorrect' do
17
- post :signin, user: { login: '', password: '' }
18
- expect(response).to render_template(:signin)
19
- expect(session[:user_id]).to eq(nil)
20
-
21
- post :signin, user: { login: 'wrong', password: 'credentials' }
22
- expect(response).to render_template(:signin)
23
- expect(session[:user_id]).to eq(nil)
24
- end
25
- end
26
-
27
- describe "#forgot_password" do
28
- it 'should send new generated password for user' do
29
- user = User.create!(login: 'demo', password: '12345678', email: 'demo@example.com')
30
- session[:user_id] = user.id
31
- expect(user.valid_password?('12345678')).to be true
32
-
33
- post :forgot_password, user: { email: 'demo@example.com'}
34
- expect(user.reload.valid_password?('12345678')).to be false
35
-
36
- last_delivery = ActionMailer::Base.deliveries.last
37
- new_password = last_delivery.text_part.body.decoded.split(' ').last
38
- expect(user.reload.valid_password?(new_password)).to be true
39
- end
40
- end
41
-
42
- describe "#edit" do
43
- before :each do
44
- @user = User.create!(login: 'demo', password: '12345678', email: 'demo@example.com')
45
- session[:user_id] = @user.id
46
- end
47
-
48
- it 'should not change password' do
49
- patch :update, id: @user.id, user: {email: 'abc@google.com', password: ''}
50
- expect(@user.reload.valid_password?('12345678')).to be true
51
- expect(@user.reload.email).to eq('abc@google.com')
52
- end
53
-
54
- it 'should not change password if old password not given' do
55
- patch :update, id: @user.id, user: {email: 'abc@google.com', password: 'new_password'}
56
- expect(@user.reload.valid_password?('new_password')).to be false
57
- end
58
-
59
- it 'should update user with password' do
60
- expect(@user.reload.valid_password?('12345678')).to be true
61
- patch :update, id: @user.id, user: {email: 'abc@google.com', password: '12345678', new_password: 'new_password'}
62
- expect(@user.reload.valid_password?('new_password')).to be true
63
- expect(@user.reload.email).to eq('abc@google.com')
64
- end
65
- end
66
-
67
- describe "#create" do
68
- it 'should create new user' do
69
- post :create, user: {email: 'new_user@google.com', password: 'new_user_pass', login: 'new_user'}
70
- user = User.find_by_email('new_user@google.com')
71
- expect(user.login).to eq('new_user')
72
- expect(user.valid_password?('new_user_pass')).to be true
73
- end
74
- end
75
- end
76
- end
Binary file