diff --git a/Gemfile b/Gemfile
index 0efc113..006de6d 100644
--- a/Gemfile
+++ b/Gemfile
@@ -3,55 +3,19 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '3.1.2'
-# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '~> 7.0.4'
-
-# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'
-
-# Use sqlite3 as the database for Active Record
-
-# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '~> 5.0'
-
-# Bundle and transpile JavaScript [https://github.com/rails/jsbundling-rails]
gem 'jsbundling-rails'
-
-# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem 'turbo-rails'
-
-# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem 'stimulus-rails'
-
-# Bundle and process CSS [https://github.com/rails/cssbundling-rails]
gem 'cssbundling-rails'
-
-# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem 'jbuilder'
-
-# Use Redis adapter to run Action Cable in production
-# gem "redis", "~> 4.0"
-
-# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
-# gem "kredis"
-
-# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
-# gem "bcrypt", "~> 3.1.7"
-
-# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
-
-# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false
-
-# Use Sass to process CSS
-# gem "sassc-rails"
-
-# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
gem 'image_processing', '~> 1.2'
group :development, :test do
- # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem 'byebug'
gem 'debug', platforms: %i[mri mingw x64_mingw]
gem 'factory_bot_rails'
@@ -60,19 +24,11 @@ group :development, :test do
end
group :development do
- # Use console on exceptions pages [https://github.com/rails/web-console]
gem 'web-console'
-
- # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
- # gem "rack-mini-profiler"
-
- # Speed up commands on slow machines / big apps [https://github.com/rails/spring]
- # gem "spring"
gem 'faker'
end
group :test do
- # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem 'capybara'
gem 'database_cleaner-active_record', '~> 2.1.0'
gem 'rails-controller-testing'
diff --git a/Gemfile.lock b/Gemfile.lock
index b1f399d..aef8972 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -163,7 +163,7 @@ GEM
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
- pagy (6.1.0)
+ pagy (6.2.0)
parallel (1.23.0)
parser (3.2.2.4)
ast (~> 2.4.1)
diff --git a/app/assets/images/flags.png b/app/assets/images/flags.png
index cb57957..9b80429 100644
Binary files a/app/assets/images/flags.png and b/app/assets/images/flags.png differ
diff --git a/app/assets/stylesheets/application.bootstrap.scss b/app/assets/stylesheets/application.bootstrap.scss
index cc96de0..4fe5160 100644
--- a/app/assets/stylesheets/application.bootstrap.scss
+++ b/app/assets/stylesheets/application.bootstrap.scss
@@ -302,6 +302,10 @@ body {
background-position: -1px -17px;
}
+.be-flag {
+ background-position: -1px -34px;
+}
+
.nav {
.flag {
position: relative;
diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb
index ef3a643..4235507 100644
--- a/app/controllers/articles_controller.rb
+++ b/app/controllers/articles_controller.rb
@@ -15,6 +15,7 @@ def new
def create
@article = Article.new(article_params)
+ @article.images.attach(params[:article][:images]) if params[:article][:images].present?
if @article.save
redirect_to article_path(@article), notice: t('notice.create.success')
@@ -25,6 +26,8 @@ def create
def update
if @article.update(article_params)
+ @article.images.attach(params[:article][:images]) if params[:article][:images].present?
+
redirect_to article_path(@article), notice: t('notice.update.success')
else
render :edit, status: :unprocessable_entity
@@ -46,6 +49,6 @@ def set_article
def article_params
params.require(:article).permit(I18n.available_locales.map do |l|
[:"name_#{Mobility.normalize_locale(l)}", :"description_#{Mobility.normalize_locale(l)}"]
- end.flatten, images: [])
+ end.flatten, :images)
end
end
diff --git a/app/models/article.rb b/app/models/article.rb
index a875593..b8acf10 100644
--- a/app/models/article.rb
+++ b/app/models/article.rb
@@ -10,6 +10,5 @@ class Article < ApplicationRecord
has_many_attached :images
validates :name, presence: true, length: { minimum: 3, maximum: 250 }
- validates :description, presence: true, length: { minimum: 5 }
validates :images, presence: true
end
diff --git a/app/views/articles/_form.html.erb b/app/views/articles/_form.html.erb
index a38ce1a..9bdef56 100644
--- a/app/views/articles/_form.html.erb
+++ b/app/views/articles/_form.html.erb
@@ -1,6 +1,6 @@
<%= form_with(model: article, data: { turbo: false }, class: 'form-width-avg') do |form| %>
<% if article.errors.any? %>
-
+
<%= t('.errors') %>
<% article.errors.each do |error| %>
@@ -25,7 +25,7 @@
<% end %>
- <%= form.label :photo %>
+ <%= form.label :images %>
<%= form.file_field :images, multiple: true, class: 'form-control-file' %>
diff --git a/app/views/artworks/_form.html.erb b/app/views/artworks/_form.html.erb
index 0b60554..f633c34 100644
--- a/app/views/artworks/_form.html.erb
+++ b/app/views/artworks/_form.html.erb
@@ -1,6 +1,6 @@
<%= form_with(model: artwork, url: [person, artwork], data: { turbo: false }, class: 'form-width-avg') do |form| %>
<% if artwork.errors.any? %>
-
+
<%= t('.errors') %>
<% artwork.errors.each do |error| %>
diff --git a/app/views/buildings/_form.html.erb b/app/views/buildings/_form.html.erb
index a157dd8..61d9ea7 100644
--- a/app/views/buildings/_form.html.erb
+++ b/app/views/buildings/_form.html.erb
@@ -1,6 +1,6 @@
<%= form_with(model: building, data: { turbo: false }, class: 'form-width-avg') do |form| %>
<% if building.errors.any? %>
-
+
<%= t('.errors') %>
<% building.errors.each do |error| %>
diff --git a/app/views/monuments/_form.html.erb b/app/views/monuments/_form.html.erb
index 6374c76..48683f1 100644
--- a/app/views/monuments/_form.html.erb
+++ b/app/views/monuments/_form.html.erb
@@ -1,6 +1,6 @@
<%= form_with(model: monument, data: { turbo: false }, class: 'form-width-avg') do |form| %>
<% if monument.errors.any? %>
-
+
<%= t('.errors') %>
<% monument.errors.each do |error| %>
diff --git a/app/views/museums/_form.html.erb b/app/views/museums/_form.html.erb
index 6b524b4..82bbe4f 100644
--- a/app/views/museums/_form.html.erb
+++ b/app/views/museums/_form.html.erb
@@ -1,6 +1,6 @@
<%= form_with(model: museum, data: { turbo: false }, class: 'form-width-avg') do |form| %>
<% if museum.errors.any? %>
-
+
<%= t('.errors') %>
<% museum.errors.each do |error| %>
diff --git a/app/views/people/_form.html.erb b/app/views/people/_form.html.erb
index e0435a2..28a6c34 100644
--- a/app/views/people/_form.html.erb
+++ b/app/views/people/_form.html.erb
@@ -1,6 +1,6 @@
<%= form_with(model: person, data: { turbo: false }, class: 'form-width-avg') do |form| %>
<% if person.errors.any? %>
-
+
<%= t('.errors') %>
<% person.errors.each do |error| %>
diff --git a/config/application.rb b/config/application.rb
index c1bd66f..944d3e9 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -13,7 +13,7 @@ class Application < Rails::Application
config.active_storage.variable_content_type = %w(image/png image/jpg image/jpeg)
config.active_storage.silence_invalid_content_types_warning = true
- config.i18n.available_locales = %i[ru en]
+ config.i18n.available_locales = %i[ru en be]
config.i18n.default_locale = :ru
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
diff --git a/config/locales/be.yml b/config/locales/be.yml
new file mode 100644
index 0000000..efa00fc
--- /dev/null
+++ b/config/locales/be.yml
@@ -0,0 +1,11 @@
+be:
+ en: 'Англійская'
+ ru: 'Руская'
+ be: 'Беларуская'
+ notice:
+ create:
+ success: 'Артыкул быў паспяхова створаны.'
+ update:
+ success: 'Артыкул быў паспяхова абноўлены.'
+ destroy:
+ success: 'Артыкул быў паспяхова знішчаны.'
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 10ae556..34c92c5 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,10 +1,11 @@
en:
en: 'English'
ru: 'Russian'
+ be: 'Belarusian'
notice:
create:
success: 'The article was successfully created.'
update:
success: 'The article was successfully updated.'
destroy:
- success: 'The article was succesully destroyed'
\ No newline at end of file
+ success: 'The article was succesully destroyed'
diff --git a/config/locales/models/article/be.yml b/config/locales/models/article/be.yml
new file mode 100644
index 0000000..68ef17f
--- /dev/null
+++ b/config/locales/models/article/be.yml
@@ -0,0 +1,15 @@
+be:
+ activerecord:
+ models:
+ article: 'Артыкул'
+ attributes:
+ article:
+ name: 'Назва'
+ name_en: 'Назва (Англійская)'
+ name_ru: 'Назва (Руская)'
+ name_be: 'Назва (Беларуская)'
+ description: 'Змест'
+ description_en: 'Змест (Англійская)'
+ description_ru: 'Змест (Руская)'
+ description_be: 'Змест (Беларуская)'
+ images: 'Фота'
diff --git a/config/locales/models/article/en.yml b/config/locales/models/article/en.yml
index e867cc1..f09ef3c 100644
--- a/config/locales/models/article/en.yml
+++ b/config/locales/models/article/en.yml
@@ -7,7 +7,9 @@ en:
name: 'Name'
name_en: 'Name (English)'
name_ru: 'Name (Russian)'
+ name_be: 'Name (Belarusian)'
description: 'Description'
description_en: 'Description (English)'
description_ru: 'Description (Russian)'
- photo: 'Photo'
+ description_be: 'Description (Belarusian)'
+ images: 'Photo'
diff --git a/config/locales/models/article/ru.yml b/config/locales/models/article/ru.yml
index c85f55a..7772a7c 100644
--- a/config/locales/models/article/ru.yml
+++ b/config/locales/models/article/ru.yml
@@ -7,7 +7,9 @@ ru:
name: 'Название'
name_en: 'Название (Английский)'
name_ru: 'Название (Русский)'
+ name_be: 'Название (Белорусский)'
description: 'Содержание'
description_en: 'Содержание (Английский)'
description_ru: 'Содержание (Русский)'
+ description_be: 'Содержание (Белорусский)'
images: 'Фото'
diff --git a/config/locales/models/artwork/be.yml b/config/locales/models/artwork/be.yml
new file mode 100644
index 0000000..d926ab8
--- /dev/null
+++ b/config/locales/models/artwork/be.yml
@@ -0,0 +1,15 @@
+be:
+ activerecord:
+ models:
+ artwork: "Праца"
+ attributes:
+ artwork:
+ title: "Назва"
+ title_en: "Назва (Англійская)"
+ title_ru: "Назва (Руская)"
+ title_be: "Назва (Беларуская)"
+ description: "Апісанне"
+ description_en: "Апісанне (Англійская)"
+ description_ru: "Апісанне (Руская)"
+ description_be: "Апісанне (Беларуская)"
+ photo: "Фота"
diff --git a/config/locales/models/artwork/en.yml b/config/locales/models/artwork/en.yml
index d926f61..9530ee4 100644
--- a/config/locales/models/artwork/en.yml
+++ b/config/locales/models/artwork/en.yml
@@ -7,7 +7,9 @@ en:
title: "Title"
title_en: "Title (English)"
title_ru: "Title (Russian)"
+ title_be: "Title (Belarusian)"
description: "Description"
description_en: "Description (English)"
description_ru: "Description (Russian)"
+ description_be: "Description (Belarusian)"
photo: "Photo"
diff --git a/config/locales/models/artwork/ru.yml b/config/locales/models/artwork/ru.yml
index 8b67b69..7555b34 100644
--- a/config/locales/models/artwork/ru.yml
+++ b/config/locales/models/artwork/ru.yml
@@ -7,7 +7,9 @@ ru:
title: "Название"
title_en: "Название (Английский)"
title_ru: "Название (Русский)"
+ title_be: "Название (Белорусский)"
description: "Описание"
description_en: "Описание (Английский)"
description_ru: "Описание (Русский)"
+ description_be: "Описание (Белорусский)"
photo: "Фото"
diff --git a/config/locales/models/building/be.yml b/config/locales/models/building/be.yml
new file mode 100644
index 0000000..10b0962
--- /dev/null
+++ b/config/locales/models/building/be.yml
@@ -0,0 +1,15 @@
+be:
+ activerecord:
+ models:
+ building: 'Месца'
+ attributes:
+ building:
+ name: 'Назва'
+ name_en: 'Назва (Англійская)'
+ name_ru: 'Назва (Руская)'
+ name_be: 'Назва (Беларуская)'
+ description: 'Апicанне'
+ description_en: 'Апісанне (Англійская)'
+ description_ru: 'Апісанне (Руская)'
+ description_be: 'Апісанне (Беларуская)'
+ photo: 'Фота'
diff --git a/config/locales/models/building/en.yml b/config/locales/models/building/en.yml
index 936003e..f779bb6 100644
--- a/config/locales/models/building/en.yml
+++ b/config/locales/models/building/en.yml
@@ -7,7 +7,9 @@ en:
name: 'Name'
name_en: 'Name (English)'
name_ru: 'Name (Russian)'
+ name_be: 'Name (Belarusian)'
description: 'Description'
description_en: 'Description (English)'
description_ru: 'Description (Russian)'
+ description_be: 'Description (Belarusian)'
photo: 'Photo'
diff --git a/config/locales/models/building/ru.yml b/config/locales/models/building/ru.yml
index b585d7e..6d69280 100644
--- a/config/locales/models/building/ru.yml
+++ b/config/locales/models/building/ru.yml
@@ -7,7 +7,9 @@ ru:
name: 'Название'
name_en: 'Название (Английский)'
name_ru: 'Название (Русский)'
+ name_be: 'Название (Белорусский)'
description: 'Описание'
description_en: 'Описание (Английский)'
description_ru: 'Описание (Русский)'
+ description_be: 'Описание (Белорусский)'
photo: 'Фото'
diff --git a/config/locales/models/monument/be.yml b/config/locales/models/monument/be.yml
new file mode 100644
index 0000000..fa07d5d
--- /dev/null
+++ b/config/locales/models/monument/be.yml
@@ -0,0 +1,15 @@
+be:
+ activerecord:
+ models:
+ monument: 'Помнік'
+ attributes:
+ monument:
+ name: 'Назва'
+ name_en: 'Назва (Англійская)'
+ name_ru: 'Назва (Руская)'
+ name_be: 'Назва (Беларуская)'
+ description: 'Апiсанне'
+ description_en: 'Апісанне (Англійская)'
+ description_ru: 'Апісанне (Руская)'
+ description_be: 'Апісанне (Беларуская)'
+ photo: 'Фота'
diff --git a/config/locales/models/monument/en.yml b/config/locales/models/monument/en.yml
index 5338edb..0da608d 100644
--- a/config/locales/models/monument/en.yml
+++ b/config/locales/models/monument/en.yml
@@ -7,7 +7,9 @@ en:
name: 'Name'
name_en: 'Name (English)'
name_ru: 'Name (Russian)'
+ name_be: 'Name (Belarusian)'
description: 'Description'
description_en: 'Description (English)'
description_ru: 'Description (Russian)'
+ description_be: 'Description (Belarusian)'
photo: 'Photo'
diff --git a/config/locales/models/monument/ru.yml b/config/locales/models/monument/ru.yml
index 06f88aa..664393a 100644
--- a/config/locales/models/monument/ru.yml
+++ b/config/locales/models/monument/ru.yml
@@ -7,7 +7,9 @@ ru:
name: 'Название'
name_en: 'Название (Английский)'
name_ru: 'Название (Русский)'
+ name_be: 'Название (Белорусский)'
description: 'Описание'
description_en: 'Описание (Английский)'
description_ru: 'Описание (Русский)'
+ description_be: 'Описание (Белорусский)'
photo: 'Фото'
diff --git a/config/locales/models/museum/be.yml b/config/locales/models/museum/be.yml
new file mode 100644
index 0000000..5a0cace
--- /dev/null
+++ b/config/locales/models/museum/be.yml
@@ -0,0 +1,15 @@
+be:
+ activerecord:
+ models:
+ museum: 'Музей'
+ attributes:
+ museum:
+ name: 'Назва'
+ name_en: 'Назва (Англійская)'
+ name_ru: 'Назва (Руская)'
+ name_be: 'Назва (Беларуская)'
+ description: 'Апicанне'
+ description_en: 'Апісанне (Англійская)'
+ description_ru: 'Апісанне (Руская)'
+ description_be: 'Апісанне (Беларуская)'
+ photo: 'Фота'
diff --git a/config/locales/models/museum/en.yml b/config/locales/models/museum/en.yml
index 442f4f6..cb054cc 100644
--- a/config/locales/models/museum/en.yml
+++ b/config/locales/models/museum/en.yml
@@ -7,7 +7,9 @@ en:
name: 'Name'
name_en: 'Name (English)'
name_ru: 'Name (Russian)'
+ name_be: 'Name (Belarusian)'
description: 'Description'
description_en: 'Description (English)'
description_ru: 'Description (Russian)'
+ description_be: 'Description (Belarusian)'
photo: 'Photo'
diff --git a/config/locales/models/museum/ru.yml b/config/locales/models/museum/ru.yml
index b6af2a5..93d03a2 100644
--- a/config/locales/models/museum/ru.yml
+++ b/config/locales/models/museum/ru.yml
@@ -7,7 +7,9 @@ ru:
name: 'Название'
name_en: 'Название (Английский)'
name_ru: 'Название (Русский)'
+ name_be: 'Название (Белорусский)'
description: 'Описание'
description_en: 'Описание (Английский)'
description_ru: 'Описание (Русский)'
+ description_ru: 'Описание (Белорусский)'
photo: 'Фото'
diff --git a/config/locales/models/person/be.yml b/config/locales/models/person/be.yml
new file mode 100644
index 0000000..acae471
--- /dev/null
+++ b/config/locales/models/person/be.yml
@@ -0,0 +1,15 @@
+be:
+ activerecord:
+ models:
+ person: "Чалавек"
+ attributes:
+ person:
+ name: "Імя"
+ name_en: "Імя (Англійская)"
+ name_ru: "Імя (Руская)"
+ name_be: "Імя (Беларуская)"
+ bio: "Біяграфія"
+ bio_en: "Біяграфія (Англійская)"
+ bio_ru: "Біяграфія (Руская)"
+ bio_be: "Біяграфія (Беларуская)"
+ photo: "Фота"
diff --git a/config/locales/models/person/en.yml b/config/locales/models/person/en.yml
index 5a9737e..8cab584 100644
--- a/config/locales/models/person/en.yml
+++ b/config/locales/models/person/en.yml
@@ -7,7 +7,9 @@ en:
name: "Name"
name_en: "Name (English)"
name_ru: "Name (Russian)"
+ name_be: "Name (Belarusian)"
bio: "Biography"
bio_en: "Biography (English)"
bio_ru: "Biography (Russian)"
+ bio_be: "Biography (Belarusian)"
photo: "Photo"
diff --git a/config/locales/models/person/ru.yml b/config/locales/models/person/ru.yml
index f89beb2..41a0858 100644
--- a/config/locales/models/person/ru.yml
+++ b/config/locales/models/person/ru.yml
@@ -7,7 +7,9 @@ ru:
name: "Имя"
name_en: "Имя (Английский)"
name_ru: "Имя (Русский)"
+ name_be: "Имя (Белорусский)"
bio: "Биография"
bio_en: "Биография (Английский)"
bio_ru: "Биография (Русский)"
+ bio_be: "Биография (Белорусский)"
photo: "Фото"
diff --git a/config/locales/ru.yml b/config/locales/ru.yml
index 2543b3c..8bef093 100644
--- a/config/locales/ru.yml
+++ b/config/locales/ru.yml
@@ -1,10 +1,11 @@
ru:
en: 'Английский'
ru: 'Русский'
+ be: 'Белорусский'
notice:
create:
success: 'Статья была успешно создана.'
update:
success: 'Статья была успешно обновлена.'
destroy:
- success: 'Статья была успешно уничтожена.'
\ No newline at end of file
+ success: 'Статья была успешно уничтожена.'
diff --git a/config/locales/views/articles/be.yml b/config/locales/views/articles/be.yml
new file mode 100644
index 0000000..0ffc2db
--- /dev/null
+++ b/config/locales/views/articles/be.yml
@@ -0,0 +1,25 @@
+be:
+ articles:
+ index:
+ main_text: 'Наш каледж'
+ buttons:
+ new_article: 'Новы артыкул аб каледжы'
+ go_to_home: 'На галоўную'
+ visit_article: 'Паглядзець'
+ edit:
+ main_text: 'Змяніць артыкул аб каледжы'
+ save: 'Захаваць'
+ back: 'Назад'
+ new:
+ main_text: 'Новы артыкул аб каледжы'
+ create_article: 'Стварыць артыкул'
+ back: 'Назад'
+ show:
+ edit_this_article: 'Адрэдагаваць артыкул'
+ delete_this_article: 'Выдаліць артыкул'
+ delete_confirmation: 'Вы ўпэўнены?'
+ back: 'Назад'
+ form:
+ errors: 'Памылкі:'
+
+
diff --git a/config/locales/views/artworks/be.yml b/config/locales/views/artworks/be.yml
new file mode 100644
index 0000000..af9f184
--- /dev/null
+++ b/config/locales/views/artworks/be.yml
@@ -0,0 +1,25 @@
+be:
+ artworks:
+ index:
+ main_text: ": працы"
+ buttons:
+ new_artwork: "Новая праца"
+ go_to_home: "На галоўную"
+ back_to_person: "Вярнуцца на старонку аўтара"
+ visit_artwork: "Паглядзець"
+ edit:
+ main_text: "Змяніць інфармацыю аб працы"
+ save: "Захаваць"
+ back: "Назад"
+ new:
+ main_text: "Новая праца"
+ create_article: "Стварыць працу"
+ back: "Назад"
+ show:
+ edit_this_article: "Адрэдагаваць працу"
+ delete_this_article: "Выдаліць працу"
+ delete_confirmation: "Вы ўпэўнены?"
+ back: "Назад"
+ back_to_person: "Вярнуцца на старонку аўтара"
+ form:
+ errors: "Памылкі:"
diff --git a/config/locales/views/buildings/be.yml b/config/locales/views/buildings/be.yml
new file mode 100644
index 0000000..619f6f1
--- /dev/null
+++ b/config/locales/views/buildings/be.yml
@@ -0,0 +1,23 @@
+be:
+ buildings:
+ index:
+ main_text: 'Значныя месцы горада'
+ buttons:
+ new_article: 'Новы артыкул аб месцы'
+ go_to_home: 'На галоўную'
+ visit_article: 'Паглядзець'
+ edit:
+ main_text: 'Змяніць інфармацыю аб месцы'
+ save: 'Захаваць'
+ back: 'Назад'
+ new:
+ main_text: 'Новы артыкул аб месцы'
+ create_article: 'Стварыць артыкул'
+ back: 'Назад'
+ show:
+ edit_this_article: 'Адрэдагаваць артыкул'
+ delete_this_article: 'Выдаліць артыкул'
+ delete_confirmation: 'Вы ўпэўнены?'
+ back: 'Назад'
+ form:
+ errors: 'Памылкі:'
diff --git a/config/locales/views/devise/be.yml b/config/locales/views/devise/be.yml
new file mode 100644
index 0000000..675fe2b
--- /dev/null
+++ b/config/locales/views/devise/be.yml
@@ -0,0 +1,6 @@
+be:
+ log_in: 'Увайсці'
+ back: 'Назад'
+ form:
+ email: 'Email'
+ password: 'Пароль'
diff --git a/config/locales/views/monuments/be.yml b/config/locales/views/monuments/be.yml
new file mode 100644
index 0000000..3c256b3
--- /dev/null
+++ b/config/locales/views/monuments/be.yml
@@ -0,0 +1,23 @@
+be:
+ monuments:
+ index:
+ main_text: 'Помнікі Віцебску'
+ buttons:
+ new_article: 'Новы артыкул пра помнік'
+ go_to_home: 'На галоўную'
+ visit_article: 'Паглядзець'
+ edit:
+ main_text: 'Змяніць інфармацыю аб помніку'
+ save: 'Захаваць'
+ back: 'Назад'
+ new:
+ main_text: 'Новы артыкул пра помнік'
+ create_article: 'Стварыць артыкул'
+ back: 'Назад'
+ show:
+ edit_this_article: 'Адрэдагаваць артыкул'
+ delete_this_article: 'Выдаліць артыкул'
+ delete_confirmation: 'Вы ўпэўнены?'
+ back: 'Назад'
+ form:
+ errors: 'Памылкі:'
diff --git a/config/locales/views/museums/be.yml b/config/locales/views/museums/be.yml
new file mode 100644
index 0000000..924084f
--- /dev/null
+++ b/config/locales/views/museums/be.yml
@@ -0,0 +1,23 @@
+be:
+ museums:
+ index:
+ main_text: 'Музеі Віцебска'
+ buttons:
+ new_article: 'Новы артыкул аб музеі'
+ go_to_home: 'На галоўную'
+ visit_article: 'Паглядзець'
+ edit:
+ main_text: 'Змяніць інфармацыю аб музеі'
+ save: 'Захаваць'
+ back: 'Назад'
+ new:
+ main_text: 'Новы артыкул аб музеі'
+ create_article: 'Стварыць артыкул'
+ back: 'Назад'
+ show:
+ edit_this_article: 'Адрэдагаваць артыкул'
+ delete_this_article: 'Выдаліць артыкул'
+ delete_confirmation: 'Вы ўпэўнены?'
+ back: 'Назад'
+ form:
+ errors: 'Памылкі:'
diff --git a/config/locales/views/pages/be.yml b/config/locales/views/pages/be.yml
new file mode 100644
index 0000000..503cce1
--- /dev/null
+++ b/config/locales/views/pages/be.yml
@@ -0,0 +1,23 @@
+be:
+ pages:
+ index:
+ title: 'Гістарычная даведка'
+ first_paragraph: 'Як і большасць старажытных гарадоў Усходняй Еўропы, Віцебск узнік у зліцці дзвюх рэк - Заходняй Дзвіны, якая нясе свае воды ў Балтыйскае мора і Віцьбы, ад якой і пайшла назва горада.'
+ second_paragraph: 'Паводле легенды, горад быў закладзены кіеўскай княгіняй Вольгай у 974 годзе і ў старажытнарускіх летапісах згадваецца з 1021 года. Размешчаны на перакрыжаванні найважнейшых гандлёвых шляхоў старажытнасці («з варагаў у грэкі» і Вялікага Волжскага (Булгарскага), да канца XII стагоддзя Віцебск ператвараецца ў цэнтр рамяства і гандлю, становіцца цэнтрам удзельнага княства, якое падпарадкоўваецца Полацкім, а часам, Смаленскім).'
+ third_paragraph: 'На Замкавай гары знаходзілася рэзідэнцыя князя, а ніжэй жыў люд прасцей - гандляры і рамеснікі. Ужо ў XII стагоддзі ў горадзе быў пабудаваны першы каменны храм - праваслаўная Свята-Благавешчанская царква, дзе захоўваліся эталоны мер вагі і доўгія, якія выкарыстоўваюцца пры гандлёвых аперацыях; перапісваліся кнігі, летапісы; навучаліся дзеці.'
+ old_photo_alt: 'Старое фота Віцебска'
+ old_photos_alt: 'Старыя фота Віцебска'
+ prev_carousel: 'Назад'
+ next_carousel: 'Наперад'
+ quote_text: 'Наогул, Віцебск мае выгляд задаволенасці і дабрабыту. Ва ўсім
+ парадак. На вуліцах відаць прыгожыя экіпажы і прыстойна апранутыя людзі. У
+ крамах шмат тавара, наогул рускіх фабрык. Дамы пафарбаваны, дахі ў
+ спраўнасці. На кожным кроку прыкметна апека аб добраўпарадкаванні,
+ бакавыя вуліцы забудаваны чыстымі і прыгожымі драўлянымі хатамі.
+ Каталіцкія касцёлы, як гіганты, стаяць паміж прыватнымі будынкамі.
+ Фасады гэтых касцёлаў належаць да італьянскай архітэктуры. Густ
+ грэцкі змешаны з гатычнымі формамі. Гэтая архітэктура мне
+ надзвычай падабаецца, і я не магу налюбавацца на касцёлы.'
+ quote_author: 'Ф. Булгарын. «Дарожныя нататкі на паездку з Дэрпта ў Беларусь і
+ назад вясной 1835 года»'
+
diff --git a/config/locales/views/people/be.yml b/config/locales/views/people/be.yml
new file mode 100644
index 0000000..a532e65
--- /dev/null
+++ b/config/locales/views/people/be.yml
@@ -0,0 +1,31 @@
+be:
+ people:
+ index:
+ main_text: 'Вядомыя людзі Віцебшчыны'
+ buttons:
+ new_article: 'Новы артыкул пра чалавека'
+ go_to_home: 'На галоўную'
+ visit_article: 'Паглядзець'
+ filter:
+ show_all: 'Паказаць усіх'
+ show_artists: 'Паказаць мастакоў'
+ show_musicians: 'Паказаць музыкаў'
+ show_writers: 'Паказаць пісьменнікаў'
+ edit:
+ main_text: 'Змяніць інфармацыю аб чалавеку'
+ save: 'Захаваць'
+ back: 'Назад'
+ new:
+ main_text: 'Новы артыкул пра чалавека'
+ create_article: 'Стварыць артыкул'
+ back: 'Назад'
+ show:
+ edit_this_article: 'Адрэдагаваць артыкул'
+ delete_this_article: 'Выдаліць артыкул'
+ delete_confirmation: 'Вы ўпэўнены?'
+ back: 'Назад'
+ artworks:
+ show_artworks: 'Паказаць працы'
+ add_artwork: 'Дадаць працу'
+ form:
+ errors: 'Памылкі:'
diff --git a/config/locales/views/shared/be.yml b/config/locales/views/shared/be.yml
new file mode 100644
index 0000000..24ee4ed
--- /dev/null
+++ b/config/locales/views/shared/be.yml
@@ -0,0 +1,16 @@
+be:
+ header:
+ brand_name: 'Віцебск - мой горад'
+ alt_icon_text: 'Васілёк'
+ home_link: 'Галоўная'
+ menu_link: 'Меню'
+ menu:
+ places_link: 'Значныя месцы горада'
+ monuments_link: 'Помнікі Віцебску'
+ museums_link: 'Музеі Віцебска'
+ famous_people_link: 'Вядомыя людзі Віцебшчыны'
+ articles_link: 'Мой горад - мой каледж'
+ admin_panel:
+ destroy_session: 'Выйсці'
+ new_session: 'Уваход для адміністратара'
+ year_of_peace_alt_text: 'Год міру і стварэння'
diff --git a/spec/controllers/articles_controller_spec.rb b/spec/controllers/articles_controller_spec.rb
index c15d200..06e26e6 100644
--- a/spec/controllers/articles_controller_spec.rb
+++ b/spec/controllers/articles_controller_spec.rb
@@ -37,8 +37,10 @@
expect do
post :create, params: { article: { name_ru: created_article.name_ru,
name_en: created_article.name_en,
+ name_be: created_article.name_be,
description_ru: created_article.description_ru,
description_en: created_article.description_en,
+ description_be: created_article.description_be,
images: [file] } }
end.to change(Article, :count).by(1)
expect(response).to redirect_to(assigns(:article))
diff --git a/spec/factories/articles.rb b/spec/factories/articles.rb
index b6f3ea0..82cd550 100644
--- a/spec/factories/articles.rb
+++ b/spec/factories/articles.rb
@@ -5,13 +5,16 @@
FactoryBot.define do
factory :article do
link_to_default_image = Rails.root.join('spec/files/images/image6.jpg')
+
name_ru { Faker::Lorem.characters(number: 10) }
name_en { Faker::Lorem.characters(number: 10) }
+ name_be { Faker::Lorem.characters(number: 10) }
description_ru { Faker::Lorem.characters(number: 30) }
description_en { Faker::Lorem.characters(number: 30) }
+ description_be { Faker::Lorem.characters(number: 30) }
after :build do |article|
- article.images.attach(io: File.open(Rails.root.join(link_to_default_image)), filename: 'image6.jpg', content_type: 'image/jpg')
+ article.images.attach(io: File.open(link_to_default_image), filename: 'image6.jpg', content_type: 'image/jpg')
end
end
end
diff --git a/spec/models/article_spec.rb b/spec/models/article_spec.rb
index 89b446f..837c683 100644
--- a/spec/models/article_spec.rb
+++ b/spec/models/article_spec.rb
@@ -10,12 +10,8 @@
it { is_expected.to validate_length_of(:name).is_at_least(3).is_at_most(250) }
- it { is_expected.to validate_length_of(:description).is_at_least(5) }
-
it { is_expected.to validate_presence_of(:name) }
- it { is_expected.to validate_presence_of(:description) }
-
it { is_expected.to validate_presence_of(:images) }
end
@@ -34,11 +30,6 @@
article.name = nil
expect(article).not_to be_valid
end
-
- it 'is not valid without description' do
- article.description = nil
- expect(article).not_to be_valid
- end
end
describe 'attribute length' do
@@ -53,18 +44,6 @@
expect(article).not_to be_valid
end
end
-
- describe 'description length validation' do
- it 'is not valid with a description less than 5 symbols' do
- article.description = Faker::Lorem.characters(number: 3)
- expect(article).not_to be_valid
- end
-
- it 'is valid with any number of symbols greater than 5' do
- article.description = Faker::Lorem.characters(number: 100)
- expect(article).to be_valid
- end
- end
end
end
end
diff --git a/storage/cm/np/cmnpuhg04m93t8m4h2cz5xca4ggl b/storage/cm/np/cmnpuhg04m93t8m4h2cz5xca4ggl
new file mode 100644
index 0000000..692b2c8
Binary files /dev/null and b/storage/cm/np/cmnpuhg04m93t8m4h2cz5xca4ggl differ
diff --git a/storage/fc/ew/fcewrwtchqeq2g1cj0tnb9k9v76z b/storage/fc/ew/fcewrwtchqeq2g1cj0tnb9k9v76z
new file mode 100644
index 0000000..692b2c8
Binary files /dev/null and b/storage/fc/ew/fcewrwtchqeq2g1cj0tnb9k9v76z differ