Skip to content

Commit db7e8ba

Browse files
committed
#5 Add date field for static pages table
1 parent 81ab3ea commit db7e8ba

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

app/controllers/kebapage/static_pages_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class StaticPagesController < ApplicationController
66
skip_before_filter :authenticate_admin!, only: [:show]
77

88
def index
9-
@static_pages = StaticPage.all
9+
@static_pages = StaticPage.order('updated_at DESC')
1010
end
1111

1212
def show

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

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
%tr
99
%th #
1010
%th #{I18n.t('kebapage.title')}
11+
%th #{I18n.t('kebapage.date')}
1112
%th.actions
1213
#{I18n.t('kebapage.action')}
1314
%tbody.success
@@ -17,6 +18,8 @@
1718
= (@static_pages.index static_page) + 1
1819
%td
1920
= static_page.title
21+
%td
22+
= static_page.updated_at.to_date
2023
%td.action
2124
%a.btn.btn-success{href: main_app.pages_path(static_page), data: { toggle: 'tooltip'}, title: I18n.t('kebapage.show')}
2225
%i.icon-zoom-in

config/locales/kebapage.en.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ en:
1919
file_type: 'File Type'
2020
file_size: 'File Size'
2121
upload_date: 'Upload Date'
22+
date: 'Date'

config/locales/kebapage.tr.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ tr:
1818
media_manager: 'Ortam Yöneticisi'
1919
file_type: 'Dosya Tipi'
2020
file_size: 'Dosya Büyüklüğü'
21-
upload_date: 'Yükleme Tarihi'
21+
upload_date: 'Yükleme Tarihi'
22+
date: 'Tarih'

0 commit comments

Comments
 (0)