Skip to content

Commit

Permalink
first Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Chkhikvadze committed Sep 23, 2015
0 parents commit d53baaa
Show file tree
Hide file tree
Showing 199 changed files with 105,013 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
.idea/*
node_modules/*

admin/node_modules/*
admin/bower_components/*
admin/public/uploads/*
admin/assets/bower_components/*

server/node_modules/*
server/public/uploads/*

client-test/*
server-test/node_modules/*

*.pdf
*.log
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# README #

This README would normally document whatever steps are necessary to get your application up and running.

### What is this repository for? ###

* Quick summary
* Version
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)

### How do I get set up? ###

* Summary of set up
* Configuration
* Dependencies
* Database configuration
* How to run tests
* Deployment instructions

### Contribution guidelines ###

* Writing tests
* Code review
* Other guidelines

### Who do I talk to? ###

* Repo owner or admin
* Other community or team contact
55 changes: 55 additions & 0 deletions admin/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/// <reference path="../typings/node/node.d.ts"/>

var express = require('express');
var path = require('path');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');


var app = express();


app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'assets')));
app.use(express.static(path.join(__dirname, 'app')));


// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});

// error handlers

// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: err
});
});
}

// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: {}
});
});




module.exports = app;
152 changes: 152 additions & 0 deletions admin/app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/// <reference path="../../typings/angularjs/angular.d.ts"/>

var myApp = angular.module('myApp',
['ngRoute', 'ngResource', 'ui.bootstrap', 'ngAnimate', 'ngCookies', "ngTable", 'ui.select', 'ngSanitize', 'ui.bootstrap',
'ui.grid', 'ui.grid.resizeColumns', 'ui.grid.moveColumns',
'ui.grid.selection', 'ui.grid.cellNav', 'ui.grid.pinning',
'ui.grid.resizeColumns', 'ui.grid.edit', 'ui.grid.pagination', 'ui.grid.expandable','ngFileUpload']);


// routes
myApp.config(function ($routeProvider) {

$routeProvider

.when("/", {
controller: "homeController",
templateUrl: "/components/home/home.html"
})
.when("/login", {
controller: "loginController",
templateUrl: "/components/login/login.html"
})
.when("/signup", {
controller: "signupController",
templateUrl: "/components/signup/signup.html"
})

.when("/profile", {
controller: "profileController",
templateUrl: "/components/profile/profile.tpl.html"
})

.when("/courses", {
templateUrl: '/components/course/course.tpl.html',
controller: "courseController"
})
.when("/learn" + '/:id', {
templateUrl: 'components/learn/learn.tpl.html',
controller: "learnController"
})

.when("/about", {
controller: "aboutController",
templateUrl: "/components/about/about.html"
})

.when("/forgot/", {
controller: "forgotController",
templateUrl: "/components/forgot/forgot.html"
})
.when("/reset/", {
controller: "resetController",
templateUrl: "/components/reset/reset.html",
reloadOnSearch: false
})

//Project
.when(project, {
controller: "projectController",
templateUrl: "/components/project/list.html"
})
.when(project + "/add", {
controller: "projectEditController",
templateUrl: "/components/project/edit.html"
})
.when(project + "/edit/:id", {
controller: "projectEditController",
templateUrl: "/components/project/edit.html"
})
//Project ###


//Model
.when(project + "/:id/models" , {
controller: "modelController",
templateUrl: "/components/model/list.html"
})
.when(project + "/:id/addmodel", {
controller: "modelEditController",
templateUrl: "/components/model/edit.html"
})
.when(project + "/:id/editmodel/:modelid", {
controller: "modelEditController",
templateUrl: "/components/model/edit.html"
})
//Model ###

//end user list

.otherwise({
redirectTo: "/"
});

});

myApp.constant('appSettings', {
apiServiceBaseUri: 'http://localhost:5001/api/v1'
});

myApp.config(['$httpProvider', '$locationProvider',
function ($httpProvider, $locationProvider) {
$httpProvider.interceptors.push('authInterceptorService');
}]);

myApp.directive('convertToNumber', function () {
return {
require: 'ngModel',
link: function (scope, element, attrs, ngModel) {
ngModel.$parsers.push(function (val) {
return parseInt(val, 10);
});
ngModel.$formatters.push(function (val) {
return '' + val;
});
}
};
});


myApp.run(['authService', '$rootScope', '$location', '$route',
function (authService, $rootScope, $location, $route) {

authService.fillAuth();
$rootScope.AccActivate = true;

$rootScope.$watch(function () {
if (authService.user.isActive == true && authService.user.isLoggedIn == true) $rootScope.AccActivate = true;
else if (authService.user.isActive == false && authService.user.isLoggedIn == true) $rootScope.AccActivate = false;
else $rootScope.AccActivate = true;
});

var original = $location.path;
$location.path = function (path, reload) {
if (reload === false) {
var lastRoute = $route.current;
var un = $rootScope.$on('$locationChangeSuccess', function () {
$route.current = lastRoute;
un();
});
}
return original.apply($location, [path]);
};

$rootScope.url = {
root: root,
feedback: feedback,

project: project,
users: users,
}
}]);

10 changes: 10 additions & 0 deletions admin/app/components/about/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div class="my-container">
<div class="row">
<div class="col-xs-12 col-sm-5 col-md-6">
<h3 id="about-title">Lingwing</h3>
<!--<p>about</p>-->
</div>
<div class="col-xs-12 col-sm-7 col-md-6" id="about-image">
</div>
</div>
</div>
6 changes: 6 additions & 0 deletions admin/app/components/about/aboutController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';
angular.module('myApp').controller('aboutController',
['$scope',
function ($scope) {

}]);
1 change: 1 addition & 0 deletions admin/app/components/footer/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="footer" ng-controller="footerController"></div>
6 changes: 6 additions & 0 deletions admin/app/components/footer/footerController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference path="../../../../typings/angularjs/angular.d.ts"/>

angular.module('myApp').controller('footerController', ['$scope', '$location', '$route', '$cookies',
function ($scope, $location, $route, $cookies) {

}]);
11 changes: 11 additions & 0 deletions admin/app/components/forgot/forgot.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<form role="form" class="login-middle-box">
<h2 class="text-center">პაროლის აღდგენა</h2>
<div class="form-group">
<input name="email" type="email" class="form-control" placeholder="ელ. ფოსტა" required data-ng-model="data.username"
autofocus>
</div>

<button class="btn btn-md btn-info btn-block login-submit" type="submit" data-ng-click="forgot()">აღდგენა</button>
<div data-ng-hide="message == ''" class="alert alert-danger">{{message}}</div>
<div data-ng-hide="info == ''" class="alert alert-info">{{info}}</div>
</form>
28 changes: 28 additions & 0 deletions admin/app/components/forgot/forgotController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/// <reference path="../../../../typings/angularjs/angular.d.ts"/>
'use strict';

angular.module('myApp').controller('forgotController', ['$scope', '$location', 'User',
function ($scope, $location, User) {
$scope.data = {
username: ""
};
$scope.message = "";
$scope.info = "";

$scope.forgot = function () {
$scope.message = "";
$scope.info = "";

User.forgot(this.data, function (response) {
$scope.info = "თქვენს ელ. ფოსტაზე გამოგზავნილია ინსტრუქცია პაროლის აღსადგენად";
}, function (response) {
if (response.status === 404) {
console.log("not found user");
} else if (response.status === 400) {
}

$scope.message = 'მომხმარებელი ასეთი ელ. ფოსტით არ არსებობს!';
});
};

}]);
50 changes: 50 additions & 0 deletions admin/app/components/header/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<nav class="navbar navbar-inverse navbar-fixed-top" ng-controller="headerController">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
aria-expanded="false"
aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Lingwing.com</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">

<li class="dropdown" data-ng-hide="!user.isLoggedIn">
<a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">ადმინისტრაცია
<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#/project">პროექტი</a></li>

</ul>
</li>

</ul>

<ul class="nav navbar-nav navbar-right">


<li data-ng-hide="!user.isLoggedIn">
<a href="#/profile"> {{user.email}}</a>
</li>
<li data-ng-hide="!user.isLoggedIn">
<a href="" data-ng-click="logOut()">გამოსვლა</a>
</li>
<li data-ng-hide="user.isLoggedIn">
<a href="#/login">შესვლა</a>
</li>
<li data-ng-hide="user.isLoggedIn">
<a href="#/signup">რეგისტრაცია</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</nav>
<div class="alert alert-warning text-center" role="alert" ng-hide="AccActivate" ng-controller="headerController">
გთხოვთ გააქტიუროთ ექაუნთი, <a href="" data-ng-click="requestActivate()">აქტივაციის მაილის მიღება.</a>
</div>
Loading

0 comments on commit d53baaa

Please sign in to comment.