Skip to content

Commit 81ab3ea

Browse files
committed
#6 Use locales for media index page
1 parent d91ed23 commit 81ab3ea

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

app/controllers/kebapage/media_controller.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
require_dependency "kebapage/application_controller"
1+
require_dependency 'kebapage/application_controller'
22

33
module Kebapage
44
class MediaController < ApplicationController
55

66
def index
7-
@media = Medium.all
7+
@media = Medium.order('attachment_updated_at DESC')
88
@medium = Medium.new
99
end
1010

app/controllers/kebapage/static_pages_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require_dependency "kebapage/application_controller"
1+
require_dependency 'kebapage/application_controller'
22

33
module Kebapage
44
class StaticPagesController < ApplicationController

app/views/kebapage/media/index.html.haml

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
.panel.panel-default.grid
1212
.panel-heading
1313
%i.icon-table.icon-large
14-
Media Manager Index Page
14+
#{I18n.t('kebapage.media_manager')}
1515

1616
%table.table
1717
%thead
1818
%tr
1919
%th #
20-
%th Filetype
21-
%th File size
22-
%th Upload date
20+
%th #{I18n.t('kebapage.file_type')}
21+
%th #{I18n.t('kebapage.file_size')}
22+
%th #{I18n.t('kebapage.upload_date')}
2323
%th.actions
24-
Actions
24+
#{I18n.t('kebapage.action')}
2525

2626
%t.body.success
2727
- @media.each do |media|
@@ -33,7 +33,7 @@
3333
%td
3434
= "#{(media.attachment_file_size.to_i / 1024)} KB"
3535
%td
36-
= media.attachment_updated_at
36+
= media.attachment_updated_at.to_date
3737
%td.action
3838
%a.btn.btn-success{href: media.attachment.url }
3939
%i.icon-zoom-in

config/locales/kebapage.en.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ en:
1414
content_placeholder: "Type yours page's content"
1515
action: 'Action'
1616
submit: 'Submit'
17-
cancel: 'Cancel'
17+
cancel: 'Cancel'
18+
media_manager: 'Media Manager'
19+
file_type: 'File Type'
20+
file_size: 'File Size'
21+
upload_date: 'Upload Date'

config/locales/kebapage.tr.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ tr:
1414
content_placeholder: "Sayfanızın içeriği"
1515
action: 'Eylemler'
1616
submit: 'Gönder'
17-
cancel: 'Vazgeç'
17+
cancel: 'Vazgeç'
18+
media_manager: 'Ortam Yöneticisi'
19+
file_type: 'Dosya Tipi'
20+
file_size: 'Dosya Büyüklüğü'
21+
upload_date: 'Yükleme Tarihi'

0 commit comments

Comments
 (0)