This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def testFlow = { | |
//Any steps | |
renderView { | |
render(view: '/views/testView') | |
on('next-step').to "nextStep" | |
on('back').to "previousStep" | |
} | |
//Any steps | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.taggd-wrapper { | |
position: relative; | |
} | |
.taggd-wrapper .taggd-button { | |
background-color: transparent; | |
cursor: pointer; | |
border: 5px solid #bde0e1; | |
opacity: 0.2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test</title> | |
%{--taggd path--}% | |
<link rel="stylesheet" href="your path/taggd-master/dist/taggd.css"/> | |
<script src="your path/taggd-master/dist/taggd.js"></script> | |
%{--custom styles path--}% | |
<link rel="stylesheet" href="your path/test.css"/> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User { | |
String email | |
String password | |
Locale locale | |
// other fields | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomLocaleResolver extends SessionLocaleResolver { | |
def springSecurityService = Holders.grailsApplication.mainContext.getBean('springSecurityService') | |
Locale resolveLocale(HttpServletRequest request) { | |
//getting locale from session | |
Locale locale = (Locale) WebUtils.getSessionAttribute(request, LOCALE_SESSION_ATTRIBUTE_NAME) | |
if (!locale) { | |
if (springSecurityService.isLoggedIn()) { | |
def user = springSecurityService.getCurrentUser() as User | |
locale = user.locale ?: determineDefaultLocale(request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomeController { | |
def springSecurityService | |
//... | |
def changeLocale(String locale) { | |
def user = springSecurityService.currentUser as User | |
user.locale = new Locale(locale) | |
user.save() | |
//put locale to lang param | |
redirect action: 'index', params: [lang: locale] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beans = { | |
localeResolver(CustomLocaleResolver) | |
//beans... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.realizeideas.oauth.bitbucket | |
import org.scribe.builder.api.DefaultApi10a | |
import org.scribe.model.Token | |
/** | |
* @author: Konstantin Khisamov | |
*/ | |
class BitbucketApi extends DefaultApi10a { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oauth: | |
providers: | |
bitbucket: #provider name | |
api: net.realizeideas.oauth.bitbucket.BitbucketApi #API path, it will be implemented bellow | |
key: 'xxxxxF5DfBeK9xxxxx' #API key received in the previous step | |
secret: 'xxxxxxGZKY8xqNUkjCyY7xxxxxxxxxxx' #API secret received in the previous step | |
successUri: '/' #App will be redirected there after successful getting Access Token | |
failureUri: '/' #App will be redirected there after failed getting Access Token | |
callback: '${grails.serverURL}/oauth/bitbucket/callback' #Oauth Controller is provided by Oauth Plugin, so you need to set a provider name only |