Skip to content

Commit

Permalink
#6 Use locales for media index page
Browse files Browse the repository at this point in the history
  • Loading branch information
marjinal1st committed Jan 21, 2014
1 parent d91ed23 commit 81ab3ea
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/controllers/kebapage/media_controller.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require_dependency "kebapage/application_controller"
require_dependency 'kebapage/application_controller'

module Kebapage
class MediaController < ApplicationController

def index
@media = Medium.all
@media = Medium.order('attachment_updated_at DESC')
@medium = Medium.new
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/kebapage/static_pages_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_dependency "kebapage/application_controller"
require_dependency 'kebapage/application_controller'

module Kebapage
class StaticPagesController < ApplicationController
Expand Down
12 changes: 6 additions & 6 deletions app/views/kebapage/media/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
.panel.panel-default.grid
.panel-heading
%i.icon-table.icon-large
Media Manager Index Page
#{I18n.t('kebapage.media_manager')}

%table.table
%thead
%tr
%th #
%th Filetype
%th File size
%th Upload date
%th #{I18n.t('kebapage.file_type')}
%th #{I18n.t('kebapage.file_size')}
%th #{I18n.t('kebapage.upload_date')}
%th.actions
Actions
#{I18n.t('kebapage.action')}

%t.body.success
- @media.each do |media|
Expand All @@ -33,7 +33,7 @@
%td
= "#{(media.attachment_file_size.to_i / 1024)} KB"
%td
= media.attachment_updated_at
= media.attachment_updated_at.to_date
%td.action
%a.btn.btn-success{href: media.attachment.url }
%i.icon-zoom-in
6 changes: 5 additions & 1 deletion config/locales/kebapage.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ en:
content_placeholder: "Type yours page's content"
action: 'Action'
submit: 'Submit'
cancel: 'Cancel'
cancel: 'Cancel'
media_manager: 'Media Manager'
file_type: 'File Type'
file_size: 'File Size'
upload_date: 'Upload Date'
6 changes: 5 additions & 1 deletion config/locales/kebapage.tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ tr:
content_placeholder: "Sayfanızın içeriği"
action: 'Eylemler'
submit: 'Gönder'
cancel: 'Vazgeç'
cancel: 'Vazgeç'
media_manager: 'Ortam Yöneticisi'
file_type: 'Dosya Tipi'
file_size: 'Dosya Büyüklüğü'
upload_date: 'Yükleme Tarihi'

0 comments on commit 81ab3ea

Please sign in to comment.