Use I18n for card notice messages
This commit is contained in:
@@ -14,7 +14,8 @@ class Admin::Widget::CardsController < Admin::BaseController
|
|||||||
def create
|
def create
|
||||||
@card = ::Widget::Card.new(card_params)
|
@card = ::Widget::Card.new(card_params)
|
||||||
if @card.save
|
if @card.save
|
||||||
notice = "Success"
|
notice = t("admin.site_customization.pages.cards.create.notice")
|
||||||
|
|
||||||
if params[:page_id] != 0
|
if params[:page_id] != 0
|
||||||
redirect_to admin_site_customization_page_cards_path(page), notice: notice
|
redirect_to admin_site_customization_page_cards_path(page), notice: notice
|
||||||
else
|
else
|
||||||
@@ -32,7 +33,7 @@ class Admin::Widget::CardsController < Admin::BaseController
|
|||||||
def update
|
def update
|
||||||
@card = ::Widget::Card.find(params[:id])
|
@card = ::Widget::Card.find(params[:id])
|
||||||
if @card.update(card_params)
|
if @card.update(card_params)
|
||||||
notice = "Updated"
|
notice = t("admin.site_customization.pages.cards.update.notice")
|
||||||
if params[:page_id] != 0
|
if params[:page_id] != 0
|
||||||
redirect_to admin_site_customization_page_cards_path(page), notice: notice
|
redirect_to admin_site_customization_page_cards_path(page), notice: notice
|
||||||
else
|
else
|
||||||
@@ -47,7 +48,7 @@ class Admin::Widget::CardsController < Admin::BaseController
|
|||||||
@card = ::Widget::Card.find(params[:id])
|
@card = ::Widget::Card.find(params[:id])
|
||||||
@card.destroy
|
@card.destroy
|
||||||
|
|
||||||
notice = "Removed"
|
notice = t("admin.site_customization.pages.cards.delete.notice")
|
||||||
if params[:page_id] != 0
|
if params[:page_id] != 0
|
||||||
redirect_to admin_site_customization_page_cards_path(page), notice: notice
|
redirect_to admin_site_customization_page_cards_path(page), notice: notice
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1434,6 +1434,13 @@ en:
|
|||||||
description: Description
|
description: Description
|
||||||
link_text: Link text
|
link_text: Link text
|
||||||
link_url: Link URL
|
link_url: Link URL
|
||||||
|
create:
|
||||||
|
notice: "Success"
|
||||||
|
update:
|
||||||
|
notice: "Updated"
|
||||||
|
destroy:
|
||||||
|
notice: "Removed"
|
||||||
|
|
||||||
homepage:
|
homepage:
|
||||||
title: Homepage
|
title: Homepage
|
||||||
description: The active modules appear in the homepage in the same order as here.
|
description: The active modules appear in the homepage in the same order as here.
|
||||||
|
|||||||
Reference in New Issue
Block a user