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