Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
warm_city
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mykhailo Makohin
warm_city
Commits
669352b5
Commit
669352b5
authored
Sep 30, 2019
by
Mykhailo Makohin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish to translate adctiveadmin projects
parent
99124ecf
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
260 additions
and
196 deletions
+260
-196
Gemfile.lock
Gemfile.lock
+0
-4
projects.rb
app/admin/projects.rb
+92
-77
users.rb
app/admin/users.rb
+2
-2
project.rb
app/models/project.rb
+23
-25
user.rb
app/models/user.rb
+1
-1
active_admin.en.yml
config/locales/active_admin/active_admin.en.yml
+71
-2
active_admin.uk.yml
config/locales/active_admin/active_admin.uk.yml
+71
-2
projects.en.yml
config/locales/active_admin/projects/projects.en.yml
+0
-40
projects.uk.yml
config/locales/active_admin/projects/projects.uk.yml
+0
-43
Screenshot_from_2019-09-04_11-54-53.png
.../project/photo/18/Screenshot_from_2019-09-04_11-54-53.png
+0
-0
thumb_small_Screenshot_from_2019-09-04_11-54-53.png
...to/18/thumb_small_Screenshot_from_2019-09-04_11-54-53.png
+0
-0
Screenshot_from_2019-09-30_14-04-28.png
.../project/photo/19/Screenshot_from_2019-09-30_14-04-28.png
+0
-0
thumb_small_Screenshot_from_2019-09-30_14-04-28.png
...to/19/thumb_small_Screenshot_from_2019-09-30_14-04-28.png
+0
-0
Screenshot_from_2019-09-30_14-04-28.png
.../photo_preview/18/Screenshot_from_2019-09-30_14-04-28.png
+0
-0
thumb_small_Screenshot_from_2019-09-30_14-04-28.png
...ew/18/thumb_small_Screenshot_from_2019-09-30_14-04-28.png
+0
-0
Screenshot_from_2019-09-27_14-43-18.png
.../photo_preview/19/Screenshot_from_2019-09-27_14-43-18.png
+0
-0
thumb_small_Screenshot_from_2019-09-27_14-43-18.png
...ew/19/thumb_small_Screenshot_from_2019-09-27_14-43-18.png
+0
-0
No files found.
Gemfile.lock
View file @
669352b5
...
...
@@ -77,8 +77,6 @@ GEM
image_processing (~> 1.1)
mimemagic (>= 0.3.0)
mini_mime (>= 0.1.3)
ckeditor (5.0.0)
orm_adapter (~> 0.5.0)
cocoon (1.2.14)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
...
...
@@ -294,7 +292,6 @@ DEPENDENCIES
byebug
cancancan
carrierwave
ckeditor
cocoon
coffee-rails (~> 4.2)
devise
...
...
@@ -303,7 +300,6 @@ DEPENDENCIES
jbuilder (~> 2.5)
jquery-rails
listen (~> 3.0.5)
mini_magick
mysql2 (>= 0.3.18, < 0.6.0)
omniauth
omniauth-facebook
...
...
app/admin/projects.rb
View file @
669352b5
ActiveAdmin
.
register
Project
do
menu
label:
'Project'
menu
label:
proc
{
I18n
.
t
"active_admin.models.project.other"
}
filter
:photo
,
label:
I18n
.
t
(
"active_admin.attributes.project.photo"
)
filter
:types
,
label:
I18n
.
t
(
"active_admin.attributes.project.types"
)
filter
:status
,
label:
I18n
.
t
(
"active_admin.attributes.project.status"
)
filter
:individual_type_uk
,
label:
I18n
.
t
(
"active_admin.attributes.project.individual_type_uk"
)
filter
:individual_type_en
,
label:
I18n
.
t
(
"active_admin.attributes.project.individual_type_en"
)
filter
:title_uk
,
label:
I18n
.
t
(
"active_admin.attributes.project.title_uk"
)
filter
:title_en
,
label:
I18n
.
t
(
"active_admin.attributes.project.title_en"
)
filter
:site
,
label:
I18n
.
t
(
"active_admin.attributes.project.site"
)
filter
:link_to_facebook
,
label:
I18n
.
t
(
"active_admin.attributes.project.link_to_facebook"
)
filter
:required_amount
,
label:
I18n
.
t
(
"active_admin.attributes.project.required_amount"
)
filter
:related_links_uk
,
label:
I18n
.
t
(
"active_admin.attributes.project.related_links_uk"
)
filter
:related_links_en
,
label:
I18n
.
t
(
"active_admin.attributes.project.related_links_en"
)
filter
:created_at
,
label:
I18n
.
t
(
"active_admin.attributes.project.created_at"
)
filter
:updated_at
,
label:
I18n
.
t
(
"active_admin.attributes.project.updated_at"
)
controller
do
...
...
@@ -29,7 +44,7 @@ ActiveAdmin.register Project do
:text_quote
,
:text_below_quote_uk
,
:text_below_quote
,
:_destroy
],
project_links_attributes:
[
:id
,
:project_id
,
:site
,
:title_uk
,
:title_en
,
:_destroy
],
project_vid
os_attributes:
[
:id
,
:project_id
,
:video_fiel
,
:video_link
,
:short_description_uk
,
project_vid
eos_attributes:
[
:id
,
:project_id
,
:video_file
,
:video_link
,
:short_description_uk
,
:short_description_en
,
:description_uk
,
:description_en
,
:_destroy
],
project_documents_attributes:
[
:id
,
:project_id
,
:document_uk
,
:document_en
,
:document_name_uk
,
:document_name_en
,
:_destroy
])
...
...
@@ -38,81 +53,81 @@ ActiveAdmin.register Project do
form
html:
{
multipart:
true
}
do
|
f
|
f
.
inputs
do
f
.
input
:photo
,
label:
"
Photo
"
,
f
.
input
:photo
,
label:
"
#{
t
"active_admin.attributes.project.photo"
}
"
,
hint:
f
.
object
.
photo
.
present?
?
image_tag
(
f
.
object
.
photo
.
url
(:
thumb_small
))
:
content_tag
(
:span
,
"no file yet"
)
f
.
input
:photo_preview
,
label:
"
Preview for main page
"
,
f
.
input
:photo_preview
,
label:
"
#{
t
"active_admin.attributes.project.photo_preview"
}
"
,
hint:
f
.
object
.
photo_preview
.
present?
?
image_tag
(
f
.
object
.
photo_preview
.
url
(:
thumb_small
))
:
content_tag
(
:span
,
"no file yet"
)
f
.
input
:photo_before
,
label:
"
Before photo
"
,
f
.
input
:photo_before
,
label:
"
#{
t
"active_admin.attributes.project.photo_before"
}
"
,
hint:
f
.
object
.
photo_before
.
present?
?
image_tag
(
f
.
object
.
photo_before
.
url
(:
thumb_small
))
:
content_tag
(
:span
,
"no file yet"
)
f
.
input
:remove_photo_before
,
as: :boolean
f
.
input
:photo_after
,
label:
"
After photo
"
,
f
.
input
:remove_photo_before
,
as: :boolean
,
label:
"
#{
t
"active_admin.attributes.project.remove_photo"
}
"
f
.
input
:photo_after
,
label:
"
#{
t
"active_admin.attributes.project.photo_after"
}
"
,
hint:
f
.
object
.
photo_after
.
present?
?
image_tag
(
f
.
object
.
photo_after
.
url
(:
thumb_small
))
:
content_tag
(
:span
,
"no file yet"
)
f
.
input
:remove_photo_after
,
as: :boolean
f
.
input
:types
,
label:
"
Type
"
f
.
input
:status
,
label:
"
Status
"
f
.
input
:individual_type_uk
,
label:
"
Individual type uk
"
f
.
input
:individual_type_en
,
label:
"
Individual type en
"
f
.
input
:title_uk
,
label:
"
Title uk
"
f
.
input
:title_en
,
label:
"
Title en
"
f
.
input
:slug
,
label:
"
Slug
"
f
.
input
:heading_uk
,
label:
"
Heading uk
"
f
.
input
:heading_en
,
label:
"
Heading en
"
f
.
input
:short_description_uk
,
label:
"
Short description uk
"
f
.
input
:short_description_en
,
label:
"
Short description en
"
f
.
input
:description_uk
,
label:
"
Description uk
"
f
.
input
:description_en
,
label:
"
Description en
"
f
.
input
:site
,
label:
"
Site
"
f
.
input
:link_to_facebook
,
label:
"
Link to Facebook
"
f
.
input
:required_amount
,
label:
"
Required amount
"
f
.
input
:related_links_uk
,
label:
"
Related links uk
"
f
.
input
:related_links_en
,
label:
"
Related links en
"
f
.
input
:footer_photo
,
label:
"
Footer photo
"
,
f
.
input
:remove_photo_after
,
as: :boolean
,
label:
"
#{
t
"active_admin.attributes.project.remove_photo"
}
"
f
.
input
:types
,
label:
"
#{
t
"active_admin.attributes.project.types"
}
"
f
.
input
:status
,
label:
"
#{
t
"active_admin.attributes.project.status"
}
"
f
.
input
:individual_type_uk
,
label:
"
#{
t
"active_admin.attributes.project.individual_type_uk"
}
"
f
.
input
:individual_type_en
,
label:
"
#{
t
"active_admin.attributes.project.individual_type_en"
}
"
f
.
input
:title_uk
,
label:
"
#{
t
"active_admin.attributes.project.title_uk"
}
"
f
.
input
:title_en
,
label:
"
#{
t
"active_admin.attributes.project.title_en"
}
"
f
.
input
:slug
,
label:
"
#{
t
"active_admin.attributes.project.slug"
}
"
f
.
input
:heading_uk
,
label:
"
#{
t
"active_admin.attributes.project.heading_uk"
}
"
f
.
input
:heading_en
,
label:
"
#{
t
"active_admin.attributes.project.heading_en"
}
"
f
.
input
:short_description_uk
,
label:
"
#{
t
"active_admin.attributes.project.short_description_uk"
}
"
f
.
input
:short_description_en
,
label:
"
#{
t
"active_admin.attributes.project.short_description_en"
}
"
f
.
input
:description_uk
,
label:
"
#{
t
"active_admin.attributes.project.description_uk"
}
"
f
.
input
:description_en
,
label:
"
#{
t
"active_admin.attributes.project.description_en"
}
"
f
.
input
:site
,
label:
"
#{
t
"active_admin.attributes.project.site"
}
"
f
.
input
:link_to_facebook
,
label:
"
#{
t
"active_admin.attributes.project.link_to_facebook"
}
"
f
.
input
:required_amount
,
label:
"
#{
t
"active_admin.attributes.project.required_amount"
}
"
f
.
input
:related_links_uk
,
label:
"
#{
t
"active_admin.attributes.project.related_links_uk"
}
"
f
.
input
:related_links_en
,
label:
"
#{
t
"active_admin.attributes.project.related_links_en"
}
"
f
.
input
:footer_photo
,
label:
"
#{
t
"active_admin.attributes.project.footer_photo"
}
"
,
hint:
f
.
object
.
footer_photo
.
present?
?
image_tag
(
f
.
object
.
footer_photo
.
url
(:
thumb_small
))
:
content_tag
(
:span
,
"no file yet"
)
f
.
input
:remove_footer_photo
,
as: :boolean
f
.
input
:remove_footer_photo
,
as: :boolean
,
label:
"
#{
t
"active_admin.attributes.project.remove_photo"
}
"
f
.
has_many
:project_galeries
,
heading:
false
,
new_record:
true
do
|
project_galaries_form
|
project_galaries_form
.
input
:photo
project_galaries_form
.
input
:name_uk
project_galaries_form
.
input
:name_en
project_galaries_form
.
input
:_destroy
,
as: :boolean
project_galaries_form
.
input
:photo
,
label:
"
#{
t
"active_admin.attributes.project_galeries.photo"
}
"
project_galaries_form
.
input
:name_uk
,
label:
"
#{
t
"active_admin.attributes.project_galeries.name_uk"
}
"
project_galaries_form
.
input
:name_en
,
label:
"
#{
t
"active_admin.attributes.project_galeries.name_en"
}
"
project_galaries_form
.
input
:_destroy
,
as: :boolean
,
label:
"
#{
t
"active_admin.attributes.project._destroy"
}
"
end
f
.
has_many
:project_qoutes
,
heading:
false
,
new_record:
true
do
|
project_qoutes_form
|
project_qoutes_form
.
input
:text_over_quote_uk
project_qoutes_form
.
input
:text_over_quote_en
project_qoutes_form
.
input
:background_color_quote_text
,
input_html:
{
class:
'colorpicker'
}
project_qoutes_form
.
input
:icon
project_qoutes_form
.
input
:text_quote_uk
project_qoutes_form
.
input
:text_quote
project_qoutes_form
.
input
:text_below_quote_uk
project_qoutes_form
.
input
:text_below_quote
project_qoutes_form
.
input
:_destroy
,
as: :boolean
project_qoutes_form
.
input
:text_over_quote_uk
,
label:
"
#{
t
"active_admin.attributes.project_qoutes.text_over_quote_uk"
}
"
project_qoutes_form
.
input
:text_over_quote_en
,
label:
"
#{
t
"active_admin.attributes.project_qoutes.text_over_quote_en"
}
"
project_qoutes_form
.
input
:background_color_quote_text
,
input_html:
{
class:
'colorpicker'
}
,
label:
"
#{
t
"active_admin.attributes.project_qoutes.background_color_quote_text"
}
"
project_qoutes_form
.
input
:icon
,
label:
"
#{
t
"active_admin.attributes.project_qoutes.icon"
}
"
project_qoutes_form
.
input
:text_quote_uk
,
label:
"
#{
t
"active_admin.attributes.project_qoutes.text_quote_uk"
}
"
project_qoutes_form
.
input
:text_quote
,
label:
"
#{
t
"active_admin.attributes.project_qoutes.text_quote"
}
"
project_qoutes_form
.
input
:text_below_quote_uk
,
label:
"
#{
t
"active_admin.attributes.project_qoutes.text_below_quote_uk"
}
"
project_qoutes_form
.
input
:text_below_quote
,
label:
"
#{
t
"active_admin.attributes.project_qoutes.text_below_quote"
}
"
project_qoutes_form
.
input
:_destroy
,
as: :boolean
,
label:
"
#{
t
"active_admin.attributes.project._destroy"
}
"
end
f
.
has_many
:project_photos
,
heading:
false
,
new_record:
true
do
|
project_photos_form
|
project_photos_form
.
input
:photo
project_photos_form
.
input
:title_uk
project_photos_form
.
input
:title_en
project_photos_form
.
input
:_destroy
,
as: :boolean
project_photos_form
.
input
:photo
,
label:
"
#{
t
"active_admin.attributes.project_photos.photo"
}
"
project_photos_form
.
input
:title_uk
,
label:
"
#{
t
"active_admin.attributes.project_photos.title_uk"
}
"
project_photos_form
.
input
:title_en
,
label:
"
#{
t
"active_admin.attributes.project_photos.title_en"
}
"
project_photos_form
.
input
:_destroy
,
as: :boolean
,
label:
"
#{
t
"active_admin.attributes.project._destroy"
}
"
end
f
.
has_many
:project_links
,
heading:
false
,
new_record:
true
do
|
project_links_form
|
project_links_form
.
input
:site
project_links_form
.
input
:title_uk
project_links_form
.
input
:title_en
project_links_form
.
input
:_destroy
,
as: :boolean
project_links_form
.
input
:site
,
label:
"
#{
t
"active_admin.attributes.project_links.site"
}
"
project_links_form
.
input
:title_uk
,
label:
"
#{
t
"active_admin.attributes.project_links.title_uk"
}
"
project_links_form
.
input
:title_en
,
label:
"
#{
t
"active_admin.attributes.project_links.title_en"
}
"
project_links_form
.
input
:_destroy
,
as: :boolean
,
label:
"
#{
t
"active_admin.attributes.project._destroy"
}
"
end
f
.
has_many
:project_documents
,
heading:
false
,
new_record:
true
do
|
project_documents_form
|
project_documents_form
.
input
:document_uk
project_documents_form
.
input
:document_en
project_documents_form
.
input
:document_name_uk
project_documents_form
.
input
:document_name_en
project_documents_form
.
input
:_destroy
,
as: :boolean
project_documents_form
.
input
:document_uk
,
label:
"
#{
t
"active_admin.attributes.project_documents.document_uk"
}
"
project_documents_form
.
input
:document_en
,
label:
"
#{
t
"active_admin.attributes.project_documents.document_en"
}
"
project_documents_form
.
input
:document_name_uk
,
label:
"
#{
t
"active_admin.attributes.project_documents.document_name_uk"
}
"
project_documents_form
.
input
:document_name_en
,
label:
"
#{
t
"active_admin.attributes.project_documents.document_name_en"
}
"
project_documents_form
.
input
:_destroy
,
as: :boolean
,
label:
"
#{
t
"active_admin.attributes.project._destroy"
}
"
end
f
.
has_many
:project_videos
,
heading:
false
,
new_record:
true
do
|
project_videos_form
|
project_videos_form
.
input
:short_description_uk
project_videos_form
.
input
:short_description_en
project_videos_form
.
input
:video_file
project_videos_form
.
input
:video_link
project_videos_form
.
input
:description_uk
project_videos_form
.
input
:description_en
project_videos_form
.
input
:_destroy
,
as: :boolean
project_videos_form
.
input
:short_description_uk
,
label:
"
#{
t
"active_admin.attributes.project_videos.short_description_uk"
}
"
project_videos_form
.
input
:short_description_en
,
label:
"
#{
t
"active_admin.attributes.project_videos.short_description_en"
}
"
project_videos_form
.
input
:video_file
,
label:
"
#{
t
"active_admin.attributes.project_videos.video_file"
}
"
project_videos_form
.
input
:video_link
,
label:
"
#{
t
"active_admin.attributes.project_videos.video_link"
}
"
project_videos_form
.
input
:description_uk
,
label:
"
#{
t
"active_admin.attributes.project_videos.description_uk"
}
"
project_videos_form
.
input
:description_en
,
label:
"
#{
t
"active_admin.attributes.project_videos.description_en"
}
"
project_videos_form
.
input
:_destroy
,
as: :boolean
,
label:
"
#{
t
"active_admin.attributes.project._destroy"
}
"
end
end
f
.
actions
...
...
@@ -126,46 +141,46 @@ ActiveAdmin.register Project do
image_tag
p
.
photo_url
,
height:
'50'
end
end
column
"Type
"
do
|
p
|
p
.
types
column
I18n
.
t
"active_admin.attributes.project.types
"
do
|
p
|
t
"
#{
p
.
types
}
"
end
column
"S
tatus"
do
|
p
|
p
.
status
column
I18n
.
t
"active_admin.attributes.project.s
tatus"
do
|
p
|
t
"
#{
p
.
status
}
"
end
column
"Individual type
"
do
|
p
|
column
I18n
.
t
"active_admin.attributes.project.individual_type_uk
"
do
|
p
|
p
.
individual_type_uk
end
column
"Individual type
en"
do
|
p
|
column
I18n
.
t
"active_admin.attributes.project.individual_type_
en"
do
|
p
|
p
.
individual_type_en
end
column
"Title
"
do
|
p
|
column
I18n
.
t
"active_admin.attributes.project.title_uk
"
do
|
p
|
p
.
title_uk
end
column
"Title
en"
do
|
p
|
column
I18n
.
t
"active_admin.attributes.project.title_
en"
do
|
p
|
p
.
title_en
end
column
"S
ite"
do
|
p
|
column
I18n
.
t
"active_admin.attributes.project.s
ite"
do
|
p
|
p
.
site
end
column
"Facebook lin
k"
do
|
p
|
column
I18n
.
t
"active_admin.attributes.project.link_to_faceboo
k"
do
|
p
|
p
.
link_to_facebook
end
column
"Required
amount"
do
|
p
|
column
I18n
.
t
"active_admin.attributes.project.required_
amount"
do
|
p
|
p
.
required_amount
end
column
"Related links
uk"
do
|
p
|
column
I18n
.
t
"active_admin.attributes.project.related_links_
uk"
do
|
p
|
p
.
related_links_uk
end
column
"Related links
en"
do
|
p
|
column
I18n
.
t
"active_admin.attributes.project.related_links_
en"
do
|
p
|
p
.
related_links_en
end
column
"Footer
photo"
do
|
p
|
column
I18n
.
t
"active_admin.attributes.project.footer_
photo"
do
|
p
|
p
.
footer_photo
end
column
"Created
"
do
|
p
|
column
I18n
.
t
"active_admin.attributes.project.created_at
"
do
|
p
|
p
.
created_at
end
column
"Updated
"
do
|
p
|
column
I18n
.
t
"active_admin.attributes.project.updated_at
"
do
|
p
|
p
.
updated_at
end
actions
...
...
app/admin/users.rb
View file @
669352b5
...
...
@@ -34,7 +34,7 @@ ActiveAdmin.register User do
u
.
updated_at
end
column
I18n
.
t
"active_admin.attributes.user.role"
do
|
u
|
(
t
"active_admin.attributes.user/role.
#{
u
.
role
}
"
)
"
#{
t
"active_admin.user/role.
#{
u
.
role
}
"
}
"
end
actions
end
...
...
@@ -52,7 +52,7 @@ ActiveAdmin.register User do
u
.
location
end
row
I18n
.
t
"active_admin.attributes.user.role"
do
|
u
|
(
t
"active_admin.attributes.user/role.
#{
u
.
role
}
"
)
"
#{
t
"active_admin.user/role.
#{
u
.
role
}
"
}
"
end
row
I18n
.
t
"active_admin.attributes.user.created_at"
do
|
u
|
u
.
created_at
...
...
app/models/project.rb
View file @
669352b5
class
Project
<
ApplicationRecord
mount_uploader
:photo
,
AvatarUploader
mount_uploader
:photo_preview
,
AvatarUploader
mount_uploader
:photo_before
,
AvatarUploader
mount_uploader
:photo_after
,
AvatarUploader
mount_uploader
:footer_photo
,
AvatarUploader
mount_uploader
:photo
,
AvatarUploader
mount_uploader
:photo_preview
,
AvatarUploader
mount_uploader
:photo_before
,
AvatarUploader
mount_uploader
:photo_after
,
AvatarUploader
mount_uploader
:footer_photo
,
AvatarUploader
enum
types:
[
:program
,
:project
]
enum
status:
[
:in_progress
,
:implemented
]
enum
types:
[
:program
,
:project
]
enum
status:
[
:in_progress
,
:implemented
]
has_many
:project_galeries
,
inverse_of: :project
,
dependent: :destroy
has_many
:project_qoutes
,
inverse_of: :project
,
dependent: :destroy
has_many
:project_photos
,
inverse_of: :project
,
dependent: :destroy
has_many
:project_links
,
inverse_of: :project
,
dependent: :destroy
has_many
:project_documents
,
inverse_of: :project
,
dependent: :destroy
has_many
:project_videos
,
inverse_of: :project
,
dependent: :destroy
accepts_nested_attributes_for
:project_galeries
,
reject_if: :all_blank
,
allow_destroy:
true
accepts_nested_attributes_for
:project_qoutes
,
reject_if: :all_blank
,
allow_destroy:
true
accepts_nested_attributes_for
:project_photos
,
reject_if: :all_blank
,
allow_destroy:
true
accepts_nested_attributes_for
:project_links
,
reject_if: :all_blank
,
allow_destroy:
true
accepts_nested_attributes_for
:project_documents
,
reject_if: :all_blank
,
allow_destroy:
true
accepts_nested_attributes_for
:project_videos
,
reject_if: :all_blank
,
allow_destroy:
true
has_many
:project_galeries
,
inverse_of: :project
,
dependent: :destroy
has_many
:project_qoutes
,
inverse_of: :project
,
dependent: :destroy
has_many
:project_photos
,
inverse_of: :project
,
dependent: :destroy
has_many
:project_links
,
inverse_of: :project
,
dependent: :destroy
has_many
:project_documents
,
inverse_of: :project
,
dependent: :destroy
has_many
:project_videos
,
inverse_of: :project
,
dependent: :destroy
accepts_nested_attributes_for
:project_galeries
,
reject_if: :all_blank
,
allow_destroy:
true
accepts_nested_attributes_for
:project_qoutes
,
reject_if: :all_blank
,
allow_destroy:
true
accepts_nested_attributes_for
:project_photos
,
reject_if: :all_blank
,
allow_destroy:
true
accepts_nested_attributes_for
:project_links
,
reject_if: :all_blank
,
allow_destroy:
true
accepts_nested_attributes_for
:project_documents
,
reject_if: :all_blank
,
allow_destroy:
true
accepts_nested_attributes_for
:project_videos
,
reject_if: :all_blank
,
allow_destroy:
true
validates
:photo
,
:photo_preview
,
:types
,
:status
,
:title_uk
,
:short_description_uk
,
validates
:photo
,
:photo_preview
,
:types
,
:status
,
:title_uk
,
:short_description_uk
,
:description_uk
,
:required_amount
,
presence:
true
validates_length_of
:individual_type_uk
,
:individual_type_en
,
:title_uk
,
:title_en
,
validates_length_of
:individual_type_uk
,
:individual_type_en
,
:title_uk
,
:title_en
,
:heading_uk
,
:heading_en
,
:site
,
:link_to_facebook
,
:related_links_uk
,
:related_links_en
,
maximum:
200
validates_length_of
:short_description_uk
,
:short_description_en
,
maximum:
2000
validates_length_of
:description_uk
,
:description_en
,
maximum:
5000
validates_length_of
:short_description_uk
,
:short_description_en
,
maximum:
2000
validates_length_of
:description_uk
,
:description_en
,
maximum:
5000
end
app/models/user.rb
View file @
669352b5
class
User
<
ApplicationRecord
attr_accessor
:skip_password_validation
after_initialize
:set_default_role
,
:if
=>
:new_record?
mount_uploader
:avatar
,
AvatarUploader
enum
role:
[
:user
,
:admin
]
after_initialize
:set_default_role
,
:if
=>
:new_record?
def
set_default_role
self
.
role
||=
:user
...
...
config/locales/active_admin/
users/users
.en.yml
→
config/locales/active_admin/
active_admin
.en.yml
View file @
669352b5
en
:
user
:
"
User"
admin
:
"
Admin"
formtastic
:
actions
:
create
:
"
Create
my
%{model}"
...
...
@@ -9,6 +7,12 @@ en:
cancel
:
"
Cancel
and
go
back"
dummie
:
"
Launch!"
active_admin
:
project/types
:
program
:
"
Program"
project
:
"
Project"
project/status
:
in_progress
:
"
In
progress"
implemented
:
"
Implemented"
user/role
:
admin
:
"
Admin"
user
:
"
User"
...
...
@@ -16,6 +20,9 @@ en:
user
:
one
:
"
User"
other
:
"
Users"
project
:
one
:
"
Project"
other
:
"
Projects"
attributes
:
user
:
email
:
"
Email"
...
...
@@ -27,6 +34,68 @@ en:
password
:
"
Password"
password_confirmation
:
"
Password
confirmation"
avatar
:
"
Avatar"
project
:
photo
:
"
Photo"
photo_preview
:
"
Preview
for
main
page"
photo_before
:
"
Photo
for
blinds
(before)"
remove_photo
:
"
Remove
photo"
photo_after
:
"
Photo
for
blinds
(after)"
types
:
"
Type"
status
:
"
Status"
individual_type_uk
:
"
Individual
type"
individual_type_en
:
"
Individual
type
(en)"
title_uk
:
"
Title"
title_en
:
"
Title
(en)"
heading_uk
:
"
Heading"
heading_en
:
"
Heading
(en)"
slug
:
"
Slug"
short_description_uk
:
"
Short
description"
short_description_en
:
"
Short
description
(en)"
description_uk
:
"
Description"
description_en
:
"
Description
(en)"
site
:
"
Site"
link_to_facebook
:
"
Link
to
Facebook"
required_amount
:
"
Required
amount"
related_links_uk
:
"
Related
links"
related_links_en
:
"
Related
links
(en)"
footer_photo
:
"
Footer
photo"
created_at
:
"
Created"
updated_at
:
"
Updated"
_destroy
:
"
Destroy"
project_galeries
:
photo
:
"
Photo"
name_uk
:
"
Name"
name_en
:
"
Name
en"
project_photos
:
photo
:
"
Photo"
title_uk
:
"
Name"
title_en
:
"
Name
en"
project_qoutes
:
text_over_quote_uk
:
"
Text
over
quote"
text_over_quote_en
:
"
Text
over
quote
(en)"
background_color_quote_text
:
"
Color"
icon
:
"
Icon"
text_quote_uk
:
"
Text
quote"
text_quote
:
"
Text
quote
(en)"
text_below_quote_uk
:
"
Text
below
quote"
text_below_quote
:
"
Text
below
quote
(en)"
project_links
:
site
:
"
Site"
title_uk
:
"
Title"
title_en
:
"
Title
(en)"
project_videos
:
video_file
:
"
Video
file"
video_link
:
"
Video
link"
short_description_uk
:
"
Short
description"
short_description_en
:
"
Short
description
(en)"
description_uk
:
"
Description"
description_en
:
"
Description
(en)"
project_documents
:
document_uk
:
"
Document"
document_en
:
"
Document
(en)"
document_name_uk
:
"
Document
name"
document_name_en
:
"
Document
name
(en)"
dashboard
:
Dashboard
dashboard_welcome
:
welcome
:
"
Welcome
to
Active
Admin.
This
is
the
default
dashboard
page."
...
...
config/locales/active_admin/
users/users
.uk.yml
→
config/locales/active_admin/
active_admin
.uk.yml
View file @
669352b5
uk
:
user
:
"
Користувач"
admin
:
"
Адмін"
formtastic
:
actions
:
create
:
"
Створити"
...
...
@@ -16,9 +14,18 @@ uk:
user
:
one
:
"
Користувач"
other
:
"
Користувачі"
project
:
one
:
"
Проект"
other
:
"
Проекти"
user/role
:
admin
:
"
Адмін"
user
:
"
Користувач"
project/types
:
program
:
"
Програма"
project
:
"
Проект"
project/status
:
in_progress
:
"
Триває"
implemented
:
"
Реалізовано"
attributes
:
user
:
email
:
"
Email"
...
...
@@ -30,6 +37,68 @@ uk:
password
:
"
Пароль"
password_confirmation
:
"
Підтвердження
паролю"
avatar
:
"
Аватар"
project
:
photo
:
"
Фото"
photo_preview
:
"
Прев'ю
для
головної"
photo_before
:
"
Фото
для
шторки
(до)"
remove_photo
:
"
Видалити
фото"
photo_after
:
"
Фото
для
шторки
(після)"
types
:
"
Тип"
status
:
"
Статус"
individual_type_uk
:
"
Індивідуальний
тип"
individual_type_en
:
"
Індивідуальний
тип
(анг)"
title_uk
:
"
Назва"
title_en
:
"
Назва
(анг)"
heading_uk
:
"
Заголовок"
heading_en
:
"
Заголовок
(анг)"
slug
:
"
Slug"
short_description_uk
:
"
Короткий
опис"
short_description_en
:
"
Короткий
опис
(анг)"
description_uk
:
"
Опис"
description_en
:
"
Опис
(анг)"
site
:
"
Сайт"
link_to_facebook
:
"
Посилання
Facebook"
required_amount
:
"
Необхідна
сума"
related_links_uk
:
"
Корисні
лінки"
related_links_en
:
"
Корисні
лінки
(анг)"
footer_photo
:
"
Фото
для
футера"
created_at
:
"
Створено"
updated_at
:
"
Оновлено"
_destroy
:
"
Видалити"
project_galeries
:
photo
:
"
Фото"
name_uk
:
"
Назва"
name_en
:
"
Назва
(анг)"
project_photos
:
photo
:
"
Фото"
title_uk
:
"
Назва"
title_en
:
"
Назва
(анг)"
project_qoutes
:
text_over_quote_uk
:
"
Текст
над
цитатою"
text_over_quote_en
:
"
Текст
над
цитатою
(анг)"
background_color_quote_text
:
"
Color"
icon
:
"
Іконка"
text_quote_uk
:
"
Текст
цитати"
text_quote
:
"
Текст
цитати
(анг)"
text_below_quote_uk
:
"
Текст
після
цитати"
text_below_quote
:
"
Текст
після
цитати
(анг)"
project_links
:
site
:
"
Сайт"
title_uk
:
"
Назва"
title_en
:
"
Назва
(анг)"
project_videos
:
video_file
:
"
Відео
файл"
video_link
:
"
Посилання
на
відео"
short_description_uk
:
"
Короткий
опис"
short_description_en
:
"
Короткий
опис
(анг)"
description_uk
:
"
Опис"
description_en
:
"
Опис
(анг)"
project_documents
:
document_uk
:
"
Документ"
document_en
:
"
Документ
(анг)"
document_name_uk
:
"
Назва
документу"
document_name_en
:
"
Назва
документу
(анг)"
dashboard
:
"
Панель
керування"
dashboard_welcome
:
welcome
:
"
Ласкаво
просимо
до
Active
Admin.
Це
стандартна
сторінка
керування
сайтом."
...
...
config/locales/active_admin/projects/projects.en.yml
deleted
100644 → 0
View file @
99124ecf
en
:
active_admin
:
project/types
:
program
:
"
Program"
project
:
"
Project"
project/status
:
in_progress
:
"
In
progress"
implemented
:
"
Implemented"
models
:
project
:
one
:
"
Project"
other
:
"
Projects"
attributes
:
project
:
photo
:
"
Photo"
photo_preview
:
"
Preview
for
main
page"
photo_before
:
"
Photo
for
blinds
(before)"
photo_after
:
"
Photo
for
blinds
(after)"
types
:
"
Type"
status
:
"
Status"
individual_type_uk
:
"
Individual
type"
individual_type_en
:
"
Individual
type
(en)"
title_uk
:
"
Title"
title_en
:
"
Title(en)"
heading_uk
:
"
Heading"
heading_en
:
"
Heading
(en)"
slug
:
"
Slug"
short_description_uk
:
"
Short
description"
short_description_en0
:
"
Short
description
(en)"
description_uk
:
"
Description"
description_en
:
"
Description
(en)"
site
:
"
Site"
link_to_facebook
:
"
Link
to
Facebook"
required_amount
:
"
Required
amount"
related_links_uk
:
"
Related
links"
related_links_en
:
"
Related
links
(en)"
footer_photo
:
"
Footer
photo"
created_at
:
"
Created"
updated_at
:
"
Updated"
config/locales/active_admin/projects/projects.uk.yml
deleted
100644 → 0
View file @
99124ecf
uk
:
program
:
"
Програма"
time
:
formats
:
long
:
"
%Y-%m-%d
%H:%M:%S"
active_admin
:
project
:
one
:
"
Проект"
other
:
"
Проекти"
project/types
:
program
:
"
Програма"
project
:
"
Проект"
project/status
:
in_progress
:
"
Триває"
implemented
:
"
Реалізовано"
models
:
attributes
:
project
:
photo
:
"
Фото"
photo_preview
:
"
Прев'ю
для
головної"
photo_before
:
"
Фото
для
шторки
(до)"
photo_after
:
"
Фото
для
шторки
(після)"
types
:
"
Тип"
status
:
"
Статус"
individual_type_uk
:
"
Індивідуальний
тип"
individual_type_en
:
"
Індивідуальний
тип
(анг)"
title_uk
:
"
Назва"
title_en
:
"
Назва
(анг)"
heading_uk
:
"
Заголовок"
heading_en
:
"
Заголовок
(анг)"
slug
:
"
Slug"
short_description_uk
:
"
Короткий
опис"
short_description_en0
:
"
Короткий
опис
(анг)"
description_uk
:
"
Опис"
description_en
:
"
Опис
(анг)"
site
:
"
Сайт"
link_to_facebook
:
"
Посилання
Facebook"
required_amount
:
"
Необхідна
сума"
related_links_uk
:
"
Корисні
лінки"
related_links_en
:
"
Корисні
лінки
(анг)"
footer_photo
:
"
Фото
для
футера"
created_at
:
"
Створено"
updated_at
:
"
Оновлено"
public/uploads/project/photo/18/Screenshot_from_2019-09-04_11-54-53.png
0 → 100644
View file @
669352b5
208 KB
public/uploads/project/photo/18/thumb_small_Screenshot_from_2019-09-04_11-54-53.png
0 → 100644
View file @
669352b5
24.6 KB
public/uploads/project/photo/19/Screenshot_from_2019-09-30_14-04-28.png
0 → 100644
View file @
669352b5
536 KB
public/uploads/project/photo/19/thumb_small_Screenshot_from_2019-09-30_14-04-28.png
0 → 100644
View file @
669352b5
63.5 KB
public/uploads/project/photo_preview/18/Screenshot_from_2019-09-30_14-04-28.png
0 → 100644
View file @
669352b5
536 KB
public/uploads/project/photo_preview/18/thumb_small_Screenshot_from_2019-09-30_14-04-28.png
0 → 100644
View file @
669352b5
63.5 KB
public/uploads/project/photo_preview/19/Screenshot_from_2019-09-27_14-43-18.png
0 → 100644
View file @
669352b5
446 KB
public/uploads/project/photo_preview/19/thumb_small_Screenshot_from_2019-09-27_14-43-18.png
0 → 100644
View file @
669352b5
55.5 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment