Sha256: 22141440d128077145fd7845200c79e8aa4f44b5d68aa28a0f129d48988db330

Contents?: true

Size: 1.24 KB

Versions: 30

Compression:

Stored size: 1.24 KB

Contents

var Profile = angular.module("Profile", []);

Profile.config(["$routeProvider", function($routeProvider){

    $routeProvider.
        when("/auth/profile/edit",{
            templateUrl: template("auth/profile/edit"),
            controller: "ProfileController"
        });
}]);



Profile.controller("ProfileController",  ["$scope","Restangular","$location" ,"$routeParams", "gettext", "catch_error", function($scope, API, $location , $routeParams, gettext, catch_error){
    var obj = API.one("profile").get()
            .then(function(data){
                $scope.first_name = data.first_name;
                $scope.last_name = data.last_name;
                $scope.email = data.email;

            });
    $scope.save = function() {
        var user = {
            first_name: $scope.first_name,
            last_name: $scope.last_name,
            email: $scope.email,
            password: $scope.password,
            password_confirmation: $scope.password_confirmation
        };
        API.one("profile").patch(user).then(function(){
            success_message(gettext("Profile updated successfully."));
        }).catch(catch_error);
    };

    $scope.cancel = function(){
        $(".form input").val("");
        $location.path("/");
    };

}]);

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
faalis-1.0.0.alpha1 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-1.0.0.alpha0 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.26.3 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.26.2 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.26.1 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.26.0 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.25.1 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.25.0 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.24.4 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.24.3 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.24.2 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.24.0 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.23.0 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.22.0 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.21.1 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.21.0 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.20.0 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.19.0 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.18.1 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
faalis-0.18.0 app/assets/javascripts/faalis/dashboard/modules/auth/profile.js