Skip to content

Commit

Permalink
Merge pull request #280 from duyth1993/task-fix-bug-i18n
Browse files Browse the repository at this point in the history
Fix convention and i18n
  • Loading branch information
dieunb committed Feb 2, 2016
2 parents 99e26f1 + bb910bb commit 3ad1b1a
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pickle-email-*.html
/config/database.yml
/public/uploads
config/settings.local.yml
config/settings/social_keys.yml
config/social_keys.yml
config/settings/*.local.yml
config/environments/*.local.yml
.DS_Store
Expand Down
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,3 @@ DEPENDENCIES
unicorn
web-console (~> 2.0)
websocket-rails

BUNDLED WITH
1.10.6
4 changes: 2 additions & 2 deletions app/views/admin/dashboard/home.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<% provide :title, t('admin.dashboards.home.title') %>
<% provide :title, t("admin.dashboards.home.title") %>

<div id='calendar'></div>
<div id="calendar"></div>
14 changes: 8 additions & 6 deletions app/views/admin/schedules/_schedule.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<div class="col-md-12"><%= schedule.start_time.to_date.to_s %></div>
</td>
<td>
<div class="col-md-12"><%= schedule.start_time.strftime('%H:%M') %></div>
<div class="col-md-12"><%= schedule.start_time.strftime("%H:%M") %></div>
</td>
<td>
<div class="col-md-12"><%= schedule.finish_time.strftime('%H:%M') %></div>
<div class="col-md-12"><%= schedule.finish_time.strftime("%H:%M") %></div>
</td>
<td>
<div class="col-md-12"><%= schedule.user.name %></div>
Expand All @@ -19,13 +19,15 @@
</td>
<td>
<div id="schedule_state_<%= schedule.id %>">
<% if schedule.state == 'accepted' %>
<% if schedule.state == "accepted" %>
<div class="accepted-event">accepted<div>
<% elsif schedule.state == 'rejected' %>
<% elsif schedule.state == "rejected" %>
<div class="rejected-event">rejected<div>
<% else %>
<%= link_to "Accept", admin_schedule_path(id: schedule.id, state: 'accepted'), method: :put, remote: true %>
<%= link_to "Reject", admin_schedule_path(id: schedule.id, state: 'rejected'), method: :put, remote: true %>
<%= link_to t("schedules.accept"), admin_schedule_path(id: schedule.id, state: "accepted"),
method: :put, remote: true %>
<%= link_to t("schedules.reject"), admin_schedule_path(id: schedule.id, state: "rejected"),
method: :put, remote: true %>
<% end %>
</div>
</td>
Expand Down
18 changes: 9 additions & 9 deletions app/views/admin/schedules/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<% provide :title, "List event" %>
<% provide :title, t("schedules.list_event") %>

<h1>Manager Events</h1>
<h1><%= t "schedules.manage_events" %></h1>

<table class="table table-bordered table-striped">
<thead>
<tr class="table-col">
<th> Event </th>
<th width="100px"> Day </th>
<th width="80px"> Start </th>
<th width="80px"> Finish </th>
<th> User </th>
<th width="120px"> Room </th>
<th width="80px"> State </th>
<th> <%= t "schedules.index.event" %> </th>
<th width="100px"> <%= t "schedules.index.listing.day" %> </th>
<th width="80px"> <%= t "schedules.index.listing.start" %> </th>
<th width="80px"> <%= t "schedules.index.listing.finish" %> </th>
<th> <%= t "schedules.index.listing.user" %> </th>
<th width="120px"> <%= t "schedules.index.listing.room" %> </th>
<th width="80px"> <%= t "schedules.index.listing.state" %> </th>
</tr>
</thead>
<tbody class="schedule-index">
Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/_event_preview_popup.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<th class="cb-key"><%= t "quick_event.title" %>:</th>
<td class="cb-value">
<span class="event-title"></span>
<a href="" class= "link-google"><%= t "quick_event.link_google" %></a>
<a href="javascript:void(0);" class= "link-google"><%= t "quick_event.link_google" %></a>
</td>
</tr>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_error_messages.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% if object.errors.any? %>
<div id="error_explanation">
<div class="alert alert-danger">
The form contains <%= pluralize(object.errors.count, "error") %>.
<%= t "flash.error_msg", num_errors: pluralize(object.errors.count, Settings.error) %>
</div>
<ul>
<% object.errors.full_messages.each do |msg| %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/shared/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<header class="navbar navbar-fixed-top">
<div class="child-header" data-no-turbolink="true">
<%= link_to "Room Book System", root_path, id: "logo" %>
<%= link_to t("header.room_book_system"), root_path, id: "logo" %>
<% if user_signed_in? %>
<div class="search-box"><%= render "shared/search_box" %></div>
<% end %>
Expand All @@ -9,7 +9,7 @@
<ul class="nav navbar-nav navbar-right">
<% if user_signed_in? %>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">
<div class="profile-image">
<%= current_user.name %>&nbsp
<%= image_tag current_user.avatar.url, width: "35", heigth: "35", class: "img-circle" %>
Expand Down
9 changes: 9 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ en:
update: Event was updated!
warning: "Invalid search"
not_synch: "Failed to synch from google calendar"
error_msg: "The form contains %{num_errors}"
header:
loading: Loading...
room_book_system: Room Book System

invalid:
avatar: "should be less than %{max_avatar_file_size}MB"
Expand Down Expand Up @@ -116,6 +118,10 @@ en:
announce_upcoming_event: Upcoming Event Announcement
announce_updated_event: Updated Event Announcement
edit_event_title: Edit event
list_event: List event
manage_events: Manage Events
accept: Accept
reject: Reject
form:
announced_before: Announce members before
compose_description: Compose description...
Expand Down Expand Up @@ -144,6 +150,9 @@ en:
start: Start
state: State
title: Title
event: Event
day: Day
user: User
new:
title: New event!
repeat_schedule_notice_mail: "You are member for events"
Expand Down
7 changes: 7 additions & 0 deletions config/locales/vi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ vi:
sign_up_now: Dang nhap ngay!

schedules:
list_event: Danh sach event
manage_events: Quan tri Events
accept: Chap nhan
reject: Tu choi
form:
event_name: Ten event
event_title: Tieu de cua event
Expand All @@ -55,6 +59,9 @@ vi:
finish: Ket thuc
state: Trang thai
action: Hanh dong
event: Event
day: Ngay
user: Nguoi dung

new:
title: Event moi
Expand Down
1 change: 1 addition & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ no_room: "-1"
calendar: "calendar"
version: "v3"
avatar_extension_white_list: ["jpeg", "jpg", "png"]
error: "error"

0 comments on commit 3ad1b1a

Please sign in to comment.