2016-06-27 13:31:16 +03:00

30 lines
668 B
Groovy

package by.prominence.translations
class TranslationsOverviewController {
def bundleService
def index() {
render view: 'index', model: [bundles: bundleService.getBundles()]
}
def show() {
if (!params.bundleName) {
redirect action: 'index'
return
}
Bundle bundle = bundleService.findBundleByName(params.bundleName as String)
if (!bundle) {
render view: 'index', model: [message: g.message(code: 'plugin.translations.error.bundleNotFound', args: [params.bundleName as String])]
return
}
render view: 'show', model: [bundle: bundle]
}
}