diff --git a/.bowerrc b/.bowerrc
new file mode 100644
index 000000000..8c58c8efc
--- /dev/null
+++ b/.bowerrc
@@ -0,0 +1,3 @@
+{
+ "directory": "app/bower_components"
+}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 763f2e86c..d99cfa427 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,5 +3,10 @@ npm-debug.log
dist
.tmp
.sass-cache
-bower_components
.idea
+typings
+app/bower_components
+app/resource
+app/**/*.js.map
+app/**/*.js
+!app/lib/angular-ui-bootstrap/*.js
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 000000000..169046f06
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,7 @@
+// Place your settings in this file to overwrite default and user settings.
+{
+ "files.exclude": {
+ "**/*.js": { "when": "$(basename).ts"},
+ "**/*.js.map": true
+ }
+}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 000000000..d7e1d18d4
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,19 @@
+{
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
+ // for the documentation about the tasks.json format
+ "version": "0.1.0",
+ "command": "npm",
+ "isShellCommand": true,
+ "showOutput": "always",
+ "suppressTaskName": true,
+ "tasks": [
+ {
+ "taskName": "install",
+ "args": ["install"]
+ },
+ {
+ "taskName": "build",
+ "args": ["run", "serve.dev"]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Gruntfile.js b/Gruntfile.js
deleted file mode 100644
index cf00783b8..000000000
--- a/Gruntfile.js
+++ /dev/null
@@ -1,410 +0,0 @@
-// Generated on 2015-01-21 using generator-angular 0.9.2
-'use strict';
-
-// # Globbing
-// for performance reasons we're only matching one level down:
-// 'test/spec/{,*/}*.js'
-// use this if you want to recursively match all subfolders:
-// 'test/spec/**/*.js'
-
-module.exports = function (grunt) {
-
- // Load grunt tasks automatically
- require('load-grunt-tasks')(grunt);
-
- // Time how long tasks take. Can help when optimizing build times
- require('time-grunt')(grunt);
-
- // Configurable paths for the application
- var appConfig = {
- app: require('./bower.json').appPath || 'app',
- dist: 'dist'
- };
-
- // Define the configuration for all the tasks
- grunt.initConfig({
-
- // Project settings
- yeoman: appConfig,
-
- // Watches files for changes and runs tasks based on the changed files
- watch: {
- bower: {
- files: ['bower.json'],
- tasks: ['wiredep']
- },
- js: {
- files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
- tasks: ['newer:jshint:all'],
- options: {
- livereload: '<%= connect.options.livereload %>'
- }
- },
- jsTest: {
- files: ['test/spec/{,*/}*.js'],
- tasks: ['newer:jshint:test', 'karma']
- },
- styles: {
- files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
- tasks: ['newer:copy:styles', 'autoprefixer']
- },
- gruntfile: {
- files: ['Gruntfile.js']
- },
- livereload: {
- options: {
- livereload: '<%= connect.options.livereload %>'
- },
- files: [
- '<%= yeoman.app %>/{,*/}*.html',
- '.tmp/styles/{,*/}*.css',
- '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
- ]
- }
- },
-
- // The actual grunt server settings
- connect: {
- options: {
- port: 9000,
- // Change this to '0.0.0.0' to access the server from outside.
- hostname: 'localhost',
- livereload: 35729
- },
- livereload: {
- options: {
- open: true,
- middleware: function (connect) {
- return [
- connect.static('.tmp'),
- connect().use(
- '/bower_components',
- connect.static('./bower_components')
- ),
- connect.static(appConfig.app)
- ];
- }
- }
- },
- test: {
- options: {
- port: 9001,
- middleware: function (connect) {
- return [
- connect.static('.tmp'),
- connect.static('test'),
- connect().use(
- '/bower_components',
- connect.static('./bower_components')
- ),
- connect.static(appConfig.app)
- ];
- }
- }
- },
- dist: {
- options: {
- open: true,
- base: '<%= yeoman.dist %>'
- }
- }
- },
-
- // Make sure code styles are up to par and there are no obvious mistakes
- jshint: {
- options: {
- jshintrc: '.jshintrc',
- reporter: require('jshint-stylish')
- },
- all: {
- src: [
- 'Gruntfile.js',
- '<%= yeoman.app %>/scripts/{,*/}*.js'
- ]
- },
- test: {
- options: {
- jshintrc: 'test/.jshintrc'
- },
- src: ['test/spec/{,*/}*.js']
- }
- },
-
- // Empties folders to start fresh
- clean: {
- dist: {
- files: [{
- dot: true,
- src: [
- '.tmp',
- '<%= yeoman.dist %>/{,*/}*',
- '!<%= yeoman.dist %>/.git*'
- ]
- }]
- },
- server: '.tmp'
- },
-
- // Add vendor prefixed styles
- autoprefixer: {
- options: {
- browsers: ['last 1 version']
- },
- dist: {
- files: [{
- expand: true,
- cwd: '.tmp/styles/',
- src: '{,*/}*.css',
- dest: '.tmp/styles/'
- }]
- }
- },
-
- // Automatically inject Bower components into the app
-/* wiredep: {
- options: {
- cwd: '<%= yeoman.app %>'
- },
- app: {
- src: ['<%= yeoman.app %>/index.html'],
- ignorePath: /\.\.\//
- }
- },
-*/
- // Renames files for browser caching purposes
- filerev: {
- dist: {
- src: [
- '<%= yeoman.dist %>/scripts/{,*/}*.js',
- '<%= yeoman.dist %>/styles/{,*/}*.css',
- '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
- '<%= yeoman.dist %>/styles/fonts/*'
- ]
- }
- },
-
- // Reads HTML for usemin blocks to enable smart builds that automatically
- // concat, minify and revision files. Creates configurations in memory so
- // additional tasks can operate on them
- useminPrepare: {
- html: '<%= yeoman.app %>/index.html',
- options: {
- dest: '<%= yeoman.dist %>',
- flow: {
- html: {
- steps: {
- js: ['concat', 'uglifyjs'],
- css: ['cssmin']
- },
- post: {}
- }
- }
- }
- },
-
- // Performs rewrites based on filerev and the useminPrepare configuration
- usemin: {
- html: ['<%= yeoman.dist %>/{,*/}*.html'],
- css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
- options: {
- assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/images']
- }
- },
-
- // The following *-min tasks will produce minified files in the dist folder
- // By default, your `index.html`'s will take care of
- // minification. These next options are pre-configured if you do not wish
- // to use the Usemin blocks.
- cssmin: {
- dist: {
- files: [{
- expand: true,
- cwd: '<%= yeoman.dist %>',
- src: 'styles/*.css',
- dest: '<%= yeoman.dist %>'
- }]
- }
- },
- uglify: {
- build: {
- files: [{
- expand: true,
- src: '**/*.js',
- dest: '<%= yeoman.dist %>/scripts',
- cwd: '<%= yeoman.app %>/scripts'
- }]
- },
- options: {
- mangle:false
- },
- },
- // concat: {
- // dist: {}
- // },
-
- imagemin: {
- dist: {
- files: [{
- expand: true,
- cwd: '<%= yeoman.app %>/images',
- src: '{,*/}*.{png,jpg,jpeg,gif}',
- dest: '<%= yeoman.dist %>/images'
- }]
- }
- },
-
- svgmin: {
- dist: {
- files: [{
- expand: true,
- cwd: '<%= yeoman.app %>/images',
- src: '{,*/}*.svg',
- dest: '<%= yeoman.dist %>/images'
- }]
- }
- },
-
- htmlmin: {
- dist: {
- options: {
- collapseWhitespace: true,
- conservativeCollapse: true,
- collapseBooleanAttributes: true,
- removeCommentsFromCDATA: true,
- removeOptionalTags: true
- },
- files: [{
- expand: true,
- cwd: '<%= yeoman.dist %>',
- src: '**/*.html',
- dest: '<%= yeoman.dist %>'
- }]
- }
- },
-
- // ngAnnotate tries to make the code safe for minification automatically by
- // using the Angular long form for dependency injection. It doesn't work on
- // things like resolve or inject so those have to be done manually.
- ngAnnotate: {
- dist: {
- files: [{
- expand: true,
- cwd: '<%= yeoman.app %>/scripts',
- src: '**/*.js',
- dest: '<%= yeoman.dist %>/scripts',
- }]
- }
- },
-
- // Replace Google CDN references
- cdnify: {
- dist: {
- html: ['<%= yeoman.dist %>/*.html']
- }
- },
-
- // Copies remaining files to places other tasks can use
- copy: {
- dist: {
- files: [{
- expand: true,
- dot: true,
- cwd: '<%= yeoman.app %>',
- dest: '<%= yeoman.dist %>',
- src: [ '**']
- },{
-
- expand:true,
- cwd:'bower_components',
- dest:'<%= yeoman.dist %>/bower_components',
- src:['**']
- } ,
-
- {
- expand: true,
- cwd: '.tmp/images',
- dest: '<%= yeoman.dist %>/images',
- src: ['generated/*']
- }, {
- expand: true,
- cwd: 'bower_components/bootstrap/dist',
- src: 'fonts/*',
- dest: '<%= yeoman.dist %>'
- }]
- },
- styles: {
- expand: true,
- cwd: '<%= yeoman.app %>/styles',
- dest: '.tmp/styles/',
- src: '{,*/}*.css'
- }
- },
-
- // Run some tasks in parallel to speed up the build process
- concurrent: {
- server: [
- 'copy:styles'
- ],
- test: [
- 'copy:styles'
- ],
- dist: [
- 'copy:styles',
- 'imagemin',
- 'svgmin'
- ]
- },
-
- // Test settings
- karma: {
- unit: {
- configFile: 'test/karma.conf.js',
- singleRun: true
- }
- }
- });
-
-
- grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
- if (target === 'dist') {
- return grunt.task.run(['build', 'connect:dist:keepalive']);
- }
-
- grunt.task.run([
- 'clean:server',
- 'concurrent:server',
- 'autoprefixer',
- 'connect:livereload',
- 'watch'
- ]);
- });
-
- grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
- grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
- grunt.task.run(['serve:' + target]);
- });
-
- grunt.registerTask('test', [
- 'clean:server',
- 'concurrent:test',
- 'autoprefixer',
- 'connect:test',
- 'karma'
- ]);
-
- grunt.registerTask('build', [
- 'clean:dist',
- 'concurrent:dist',
- 'copy:dist',
- 'cssmin',
- 'ngAnnotate',
- 'uglify',
- 'htmlmin'
- ]);
-
- grunt.registerTask('default', [
- 'newer:jshint',
- 'test',
- 'build'
- ]);
-};
diff --git a/README.md b/README.md
index 6bb5a7029..840c7c61f 100644
--- a/README.md
+++ b/README.md
@@ -1,62 +1,31 @@
-## SB Admin v2.0 rewritten in AngularJS
-
-[](https://gitter.im/start-angular/sb-admin-angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+## Entrepreneur
+WIP Project. SB Admin based Fast Enterprise Application Framework.
This project is a port of the famous Free Admin Bootstrap Theme [SB Admin v2.0](http://startbootstrap.com/template-overviews/sb-admin-2/) to Angular Theme.
-Find out more [Free Angular Themes at StartAngular.com](http://www.startangular.com/).
-
## Installation
-####1. Clone this project or Download that ZIP file
+#### 1. Clone this project or Download that ZIP file
```sh
-$ git clone https://github.com/start-angular/sb-admin-angular.git
+$ git clone git@github.com:norami/entrepreneur.git
```
-####2. Make sure you have [bower](http://bower.io/), [grunt-cli](https://www.npmjs.com/package/grunt-cli) and [npm](https://www.npmjs.org/) installed globally
-
+#### 2. Make sure you have [node.js]
-```sh
-$ sudo apt-get install npm
-$ sudo npm install -g grunt-cli
-$ sudo npm install -g bower
-```
-####3. On the command prompt run the following commands
+#### 3. On the command prompt run the following commands
```sh
$ cd `project-directory`
```
-- bower install is ran from the postinstall
+- bower install, typescript install are ran from the postinstall
```sh
$ npm install
```
-- a shortcut for `grunt serve`
+- incremental build of typescript
```sh
-$ npm start
+$ npm run watch.dev
```
-- a shortcut for `grunt serve:dist` to minify the files for deployment
+- incremental build and live reload
```sh
-$ npm run dist
-```
-
-
-**Note:**
-If you get this following error,
-```text
-Error: EACCES, permission denied '.config/configstore/insight-bower.yml'
-You don't have access to this file.
-```
-changing ownner .config
-
-```sh
-sudo chown -R [user name] ~/.config
-```
-
-
-## Roadmap
-
-- Add sample AJAX calls and make the directives more modular
-
-### Automation tools
-
-- [Grunt](http://gruntjs.com/)
+$ npm run serve.dev
+```
\ No newline at end of file
diff --git a/app/.buildignore b/app/.buildignore
deleted file mode 100644
index fc98b8eb5..000000000
--- a/app/.buildignore
+++ /dev/null
@@ -1 +0,0 @@
-*.coffee
\ No newline at end of file
diff --git a/app/.htaccess b/app/.htaccess
deleted file mode 100644
index cb84cb918..000000000
--- a/app/.htaccess
+++ /dev/null
@@ -1,543 +0,0 @@
-# Apache Configuration File
-
-# (!) Using `.htaccess` files slows down Apache, therefore, if you have access
-# to the main server config file (usually called `httpd.conf`), you should add
-# this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html.
-
-# ##############################################################################
-# # CROSS-ORIGIN RESOURCE SHARING (CORS) #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | Cross-domain AJAX requests |
-# ------------------------------------------------------------------------------
-
-# Enable cross-origin AJAX requests.
-# http://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
-# http://enable-cors.org/
-
-#
-# Header set Access-Control-Allow-Origin "*"
-#
-
-# ------------------------------------------------------------------------------
-# | CORS-enabled images |
-# ------------------------------------------------------------------------------
-
-# Send the CORS header for images when browsers request it.
-# https://developer.mozilla.org/en/CORS_Enabled_Image
-# http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
-# http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
-
-
-
-
- SetEnvIf Origin ":" IS_CORS
- Header set Access-Control-Allow-Origin "*" env=IS_CORS
-
-
-
-
-# ------------------------------------------------------------------------------
-# | Web fonts access |
-# ------------------------------------------------------------------------------
-
-# Allow access from all domains for web fonts
-
-
-
- Header set Access-Control-Allow-Origin "*"
-
-
-
-
-# ##############################################################################
-# # ERRORS #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | 404 error prevention for non-existing redirected folders |
-# ------------------------------------------------------------------------------
-
-# Prevent Apache from returning a 404 error for a rewrite if a directory
-# with the same name does not exist.
-# http://httpd.apache.org/docs/current/content-negotiation.html#multiviews
-# http://www.webmasterworld.com/apache/3808792.htm
-
-Options -MultiViews
-
-# ------------------------------------------------------------------------------
-# | Custom error messages / pages |
-# ------------------------------------------------------------------------------
-
-# You can customize what Apache returns to the client in case of an error (see
-# http://httpd.apache.org/docs/current/mod/core.html#errordocument), e.g.:
-
-ErrorDocument 404 /404.html
-
-
-# ##############################################################################
-# # INTERNET EXPLORER #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | Better website experience |
-# ------------------------------------------------------------------------------
-
-# Force IE to render pages in the highest available mode in the various
-# cases when it may not: http://hsivonen.iki.fi/doctype/ie-mode.pdf.
-
-
- Header set X-UA-Compatible "IE=edge"
- # `mod_headers` can't match based on the content-type, however, we only
- # want to send this header for HTML pages and not for the other resources
-
- Header unset X-UA-Compatible
-
-
-
-# ------------------------------------------------------------------------------
-# | Cookie setting from iframes |
-# ------------------------------------------------------------------------------
-
-# Allow cookies to be set from iframes in IE.
-
-#
-# Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
-#
-
-# ------------------------------------------------------------------------------
-# | Screen flicker |
-# ------------------------------------------------------------------------------
-
-# Stop screen flicker in IE on CSS rollovers (this only works in
-# combination with the `ExpiresByType` directives for images from below).
-
-# BrowserMatch "MSIE" brokenvary=1
-# BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
-# BrowserMatch "Opera" !brokenvary
-# SetEnvIf brokenvary 1 force-no-vary
-
-
-# ##############################################################################
-# # MIME TYPES AND ENCODING #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | Proper MIME types for all files |
-# ------------------------------------------------------------------------------
-
-
-
- # Audio
- AddType audio/mp4 m4a f4a f4b
- AddType audio/ogg oga ogg
-
- # JavaScript
- # Normalize to standard type (it's sniffed in IE anyways):
- # http://tools.ietf.org/html/rfc4329#section-7.2
- AddType application/javascript js jsonp
- AddType application/json json
-
- # Video
- AddType video/mp4 mp4 m4v f4v f4p
- AddType video/ogg ogv
- AddType video/webm webm
- AddType video/x-flv flv
-
- # Web fonts
- AddType application/font-woff woff
- AddType application/vnd.ms-fontobject eot
-
- # Browsers usually ignore the font MIME types and sniff the content,
- # however, Chrome shows a warning if other MIME types are used for the
- # following fonts.
- AddType application/x-font-ttf ttc ttf
- AddType font/opentype otf
-
- # Make SVGZ fonts work on iPad:
- # https://twitter.com/FontSquirrel/status/14855840545
- AddType image/svg+xml svg svgz
- AddEncoding gzip svgz
-
- # Other
- AddType application/octet-stream safariextz
- AddType application/x-chrome-extension crx
- AddType application/x-opera-extension oex
- AddType application/x-shockwave-flash swf
- AddType application/x-web-app-manifest+json webapp
- AddType application/x-xpinstall xpi
- AddType application/xml atom rdf rss xml
- AddType image/webp webp
- AddType image/x-icon ico
- AddType text/cache-manifest appcache manifest
- AddType text/vtt vtt
- AddType text/x-component htc
- AddType text/x-vcard vcf
-
-
-
-# ------------------------------------------------------------------------------
-# | UTF-8 encoding |
-# ------------------------------------------------------------------------------
-
-# Use UTF-8 encoding for anything served as `text/html` or `text/plain`.
-AddDefaultCharset utf-8
-
-# Force UTF-8 for certain file formats.
-
- AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml
-
-
-
-# ##############################################################################
-# # URL REWRITES #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | Rewrite engine |
-# ------------------------------------------------------------------------------
-
-# Turning on the rewrite engine and enabling the `FollowSymLinks` option is
-# necessary for the following directives to work.
-
-# If your web host doesn't allow the `FollowSymlinks` option, you may need to
-# comment it out and use `Options +SymLinksIfOwnerMatch` but, be aware of the
-# performance impact: http://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks
-
-# Also, some cloud hosting services require `RewriteBase` to be set:
-# http://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-mod-rewrite-not-working-on-my-site
-
-
- Options +FollowSymlinks
- # Options +SymLinksIfOwnerMatch
- RewriteEngine On
- # RewriteBase /
-
-
-# ------------------------------------------------------------------------------
-# | Suppressing / Forcing the "www." at the beginning of URLs |
-# ------------------------------------------------------------------------------
-
-# The same content should never be available under two different URLs especially
-# not with and without "www." at the beginning. This can cause SEO problems
-# (duplicate content), therefore, you should choose one of the alternatives and
-# redirect the other one.
-
-# By default option 1 (no "www.") is activated:
-# http://no-www.org/faq.php?q=class_b
-
-# If you'd prefer to use option 2, just comment out all the lines from option 1
-# and uncomment the ones from option 2.
-
-# IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME!
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-# Option 1: rewrite www.example.com → example.com
-
-
- RewriteCond %{HTTPS} !=on
- RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
- RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
-
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-# Option 2: rewrite example.com → www.example.com
-
-# Be aware that the following might not be a good idea if you use "real"
-# subdomains for certain parts of your website.
-
-#
-# RewriteCond %{HTTPS} !=on
-# RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
-# RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
-#
-
-
-# ##############################################################################
-# # SECURITY #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | Content Security Policy (CSP) |
-# ------------------------------------------------------------------------------
-
-# You can mitigate the risk of cross-site scripting and other content-injection
-# attacks by setting a Content Security Policy which whitelists trusted sources
-# of content for your site.
-
-# The example header below allows ONLY scripts that are loaded from the current
-# site's origin (no inline scripts, no CDN, etc). This almost certainly won't
-# work as-is for your site!
-
-# To get all the details you'll need to craft a reasonable policy for your site,
-# read: http://html5rocks.com/en/tutorials/security/content-security-policy (or
-# see the specification: http://w3.org/TR/CSP).
-
-#
-# Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
-#
-# Header unset Content-Security-Policy
-#
-#
-
-# ------------------------------------------------------------------------------
-# | File access |
-# ------------------------------------------------------------------------------
-
-# Block access to directories without a default document.
-# Usually you should leave this uncommented because you shouldn't allow anyone
-# to surf through every directory on your server (which may includes rather
-# private places like the CMS's directories).
-
-
- Options -Indexes
-
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-# Block access to hidden files and directories.
-# This includes directories used by version control systems such as Git and SVN.
-
-
- RewriteCond %{SCRIPT_FILENAME} -d [OR]
- RewriteCond %{SCRIPT_FILENAME} -f
- RewriteRule "(^|/)\." - [F]
-
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-# Block access to backup and source files.
-# These files may be left by some text editors and can pose a great security
-# danger when anyone has access to them.
-
-
- Order allow,deny
- Deny from all
- Satisfy All
-
-
-# ------------------------------------------------------------------------------
-# | Secure Sockets Layer (SSL) |
-# ------------------------------------------------------------------------------
-
-# Rewrite secure requests properly to prevent SSL certificate warnings, e.g.:
-# prevent `https://www.example.com` when your certificate only allows
-# `https://secure.example.com`.
-
-#
-# RewriteCond %{SERVER_PORT} !^443
-# RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L]
-#
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-# Force client-side SSL redirection.
-
-# If a user types "example.com" in his browser, the above rule will redirect him
-# to the secure version of the site. That still leaves a window of opportunity
-# (the initial HTTP connection) for an attacker to downgrade or redirect the
-# request. The following header ensures that browser will ONLY connect to your
-# server via HTTPS, regardless of what the users type in the address bar.
-# http://www.html5rocks.com/en/tutorials/security/transport-layer-security/
-
-#
-# Header set Strict-Transport-Security max-age=16070400;
-#
-
-# ------------------------------------------------------------------------------
-# | Server software information |
-# ------------------------------------------------------------------------------
-
-# Avoid displaying the exact Apache version number, the description of the
-# generic OS-type and the information about Apache's compiled-in modules.
-
-# ADD THIS DIRECTIVE IN THE `httpd.conf` AS IT WILL NOT WORK IN THE `.htaccess`!
-
-# ServerTokens Prod
-
-
-# ##############################################################################
-# # WEB PERFORMANCE #
-# ##############################################################################
-
-# ------------------------------------------------------------------------------
-# | Compression |
-# ------------------------------------------------------------------------------
-
-
-
- # Force compression for mangled headers.
- # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
-
-
- SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
- RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
-
-
-
- # Compress all output labeled with one of the following MIME-types
- # (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
- # and can remove the `` and ` ` lines
- # as `AddOutputFilterByType` is still in the core directives).
-
- AddOutputFilterByType DEFLATE application/atom+xml \
- application/javascript \
- application/json \
- application/rss+xml \
- application/vnd.ms-fontobject \
- application/x-font-ttf \
- application/x-web-app-manifest+json \
- application/xhtml+xml \
- application/xml \
- font/opentype \
- image/svg+xml \
- image/x-icon \
- text/css \
- text/html \
- text/plain \
- text/x-component \
- text/xml
-
-
-
-
-# ------------------------------------------------------------------------------
-# | Content transformations |
-# ------------------------------------------------------------------------------
-
-# Prevent some of the mobile network providers from modifying the content of
-# your site: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5.
-
-#
-# Header set Cache-Control "no-transform"
-#
-
-# ------------------------------------------------------------------------------
-# | ETag removal |
-# ------------------------------------------------------------------------------
-
-# Since we're sending far-future expires headers (see below), ETags can
-# be removed: http://developer.yahoo.com/performance/rules.html#etags.
-
-# `FileETag None` is not enough for every server.
-
- Header unset ETag
-
-
-FileETag None
-
-# ------------------------------------------------------------------------------
-# | Expires headers (for better cache control) |
-# ------------------------------------------------------------------------------
-
-# The following expires headers are set pretty far in the future. If you don't
-# control versioning with filename-based cache busting, consider lowering the
-# cache time for resources like CSS and JS to something like 1 week.
-
-
-
- ExpiresActive on
- ExpiresDefault "access plus 1 month"
-
- # CSS
- ExpiresByType text/css "access plus 1 year"
-
- # Data interchange
- ExpiresByType application/json "access plus 0 seconds"
- ExpiresByType application/xml "access plus 0 seconds"
- ExpiresByType text/xml "access plus 0 seconds"
-
- # Favicon (cannot be renamed!)
- ExpiresByType image/x-icon "access plus 1 week"
-
- # HTML components (HTCs)
- ExpiresByType text/x-component "access plus 1 month"
-
- # HTML
- ExpiresByType text/html "access plus 0 seconds"
-
- # JavaScript
- ExpiresByType application/javascript "access plus 1 year"
-
- # Manifest files
- ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
- ExpiresByType text/cache-manifest "access plus 0 seconds"
-
- # Media
- ExpiresByType audio/ogg "access plus 1 month"
- ExpiresByType image/gif "access plus 1 month"
- ExpiresByType image/jpeg "access plus 1 month"
- ExpiresByType image/png "access plus 1 month"
- ExpiresByType video/mp4 "access plus 1 month"
- ExpiresByType video/ogg "access plus 1 month"
- ExpiresByType video/webm "access plus 1 month"
-
- # Web feeds
- ExpiresByType application/atom+xml "access plus 1 hour"
- ExpiresByType application/rss+xml "access plus 1 hour"
-
- # Web fonts
- ExpiresByType application/font-woff "access plus 1 month"
- ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
- ExpiresByType application/x-font-ttf "access plus 1 month"
- ExpiresByType font/opentype "access plus 1 month"
- ExpiresByType image/svg+xml "access plus 1 month"
-
-
-
-# ------------------------------------------------------------------------------
-# | Filename-based cache busting |
-# ------------------------------------------------------------------------------
-
-# If you're not using a build process to manage your filename version revving,
-# you might want to consider enabling the following directives to route all
-# requests such as `/css/style.12345.css` to `/css/style.css`.
-
-# To understand why this is important and a better idea than `*.css?v231`, read:
-# http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring
-
-#
-# RewriteCond %{REQUEST_FILENAME} !-f
-# RewriteCond %{REQUEST_FILENAME} !-d
-# RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
-#
-
-# ------------------------------------------------------------------------------
-# | File concatenation |
-# ------------------------------------------------------------------------------
-
-# Allow concatenation from within specific CSS and JS files, e.g.:
-# Inside of `script.combined.js` you could have
-#
-#
-# and they would be included into this single file.
-
-#
-#
-# Options +Includes
-# AddOutputFilterByType INCLUDES application/javascript application/json
-# SetOutputFilter INCLUDES
-#
-#
-# Options +Includes
-# AddOutputFilterByType INCLUDES text/css
-# SetOutputFilter INCLUDES
-#
-#
-
-# ------------------------------------------------------------------------------
-# | Persistent connections |
-# ------------------------------------------------------------------------------
-
-# Allow multiple requests to be sent over the same TCP connection:
-# http://httpd.apache.org/docs/current/en/mod/core.html#keepalive.
-
-# Enable if you serve a lot of static content but, be aware of the
-# possible disadvantages!
-
-#
-# Header set Connection Keep-Alive
-#
diff --git a/app/app.ts b/app/app.ts
new file mode 100644
index 000000000..6b0653728
--- /dev/null
+++ b/app/app.ts
@@ -0,0 +1,92 @@
+'use strict';
+/**
+ * @ngdoc overview
+ * @name sbAdminApp
+ * @description
+ * # sbAdminApp
+ *
+ * Main module of the application.
+ */
+angular
+ .module('sbAdminApp', [
+ 'ngAnimate',
+ 'ngCookies',
+ 'ngResource',
+ 'ngSanitize',
+ 'ngTouch',
+ 'oc.lazyLoad',
+ 'ui.router',
+ 'ui.bootstrap',
+ 'angular-loading-bar',
+ 'localytics.directives',
+ 'datetimepicker',
+ ])
+ .config(['$stateProvider','$urlRouterProvider','$ocLazyLoadProvider',function ($stateProvider,$urlRouterProvider,$ocLazyLoadProvider) {
+ console.log('start');
+ $ocLazyLoadProvider.config({
+ debug:false,
+ events:true,
+ });
+
+ $urlRouterProvider.otherwise('/dashboard');
+
+ $stateProvider
+ .state('login',{
+ url:'/login',
+ template: ' ',
+ resolve: {
+ loadMyDirectives:function($ocLazyLoad){
+ return $ocLazyLoad.load(
+ {
+ name:'sbAdminApp',
+ files:[
+ 'components/login/login.js',
+ ]
+ });
+ }
+ }
+ })
+ .state('dashboard', {
+ url:'/dashboard',
+ template: ' ',
+ resolve: {
+ loadMyDirectives:function($ocLazyLoad){
+ return $ocLazyLoad.load(
+ {
+ name:'sbAdminApp',
+ files:[
+ 'components/main/main.js',
+ 'components/header/header.js',
+ 'components/header/header-notification/header-notification.js',
+ 'components/sidebar/sidebar.js',
+ 'components/sidebar/sidebar-search/sidebar-search.js',
+ 'services/dialog.js',
+ 'services/schema.js',
+ 'components/input-elements/input-element.js',
+ 'components/search-elements/search-element.js',
+ ]
+ });
+ },
+ schema: function(Schema, loadMyDirectives){
+ return Schema.$promise;
+ }
+ }
+ })
+ .state('dashboard.page',{
+ template:' ',
+ url:'/page/:pageId/:recordId',
+ resolve: {
+ loadMyFile:function($ocLazyLoad) {
+ return $ocLazyLoad.load({
+ name:'sbAdminApp',
+ files:[
+ 'components/rootPage/rootPage.js',
+ 'components/page/page.js',
+ ]
+ });
+ }
+ }
+ });
+ }]);
+
+
diff --git a/app/scripts/directives/header/header-notification/header-notification.html b/app/components/header/header-notification/header-notification.html
similarity index 100%
rename from app/scripts/directives/header/header-notification/header-notification.html
rename to app/components/header/header-notification/header-notification.html
diff --git a/app/scripts/directives/header/header.js b/app/components/header/header-notification/header-notification.ts
similarity index 50%
rename from app/scripts/directives/header/header.js
rename to app/components/header/header-notification/header-notification.ts
index 86ecc225d..e6d8fdaf7 100644
--- a/app/scripts/directives/header/header.js
+++ b/app/components/header/header-notification/header-notification.ts
@@ -7,12 +7,12 @@
* # adminPosHeader
*/
angular.module('sbAdminApp')
- .directive('header',function(){
+ .directive('headerNotification', function () {
return {
- templateUrl:'scripts/directives/header/header.html',
- restrict: 'E',
- replace: true,
- }
+ templateUrl: 'components/header/header-notification/header-notification.html',
+ restrict: 'E',
+ replace: true,
+ };
});
diff --git a/app/scripts/directives/header/header.html b/app/components/header/header.html
similarity index 88%
rename from app/scripts/directives/header/header.html
rename to app/components/header/header.html
index 70bba1831..9fefa482f 100644
--- a/app/scripts/directives/header/header.html
+++ b/app/components/header/header.html
@@ -7,7 +7,7 @@
- SB Admin v2.0
+ {{$ctrl.title}}
diff --git a/app/components/header/header.ts b/app/components/header/header.ts
new file mode 100644
index 000000000..8aab4cdee
--- /dev/null
+++ b/app/components/header/header.ts
@@ -0,0 +1,20 @@
+'use strict';
+
+/**
+ * @ngdoc directive
+ * @name izzyposWebApp.directive:adminPosHeader
+ * @description
+ * # adminPosHeader
+ */
+angular.module('sbAdminApp')
+ .component('header',{
+ templateUrl:'components/header/header.html',
+ controller: class Header {
+ title;
+ constructor(Schema) {
+ this.title = Schema.common.title;
+ }
+ }
+ });
+
+
diff --git a/app/components/input-elements/input-element.ts b/app/components/input-elements/input-element.ts
new file mode 100644
index 000000000..d3e7f8c92
--- /dev/null
+++ b/app/components/input-elements/input-element.ts
@@ -0,0 +1,284 @@
+angular.module('sbAdminApp')
+ .directive('inputElement', function ($compile) {
+ return {
+ scope: {
+ value: '=',
+ param: '<',
+ record: '<',
+ type: '<',
+ },
+ link: function (scope:any, element) {
+ let type = scope.param.elementType || scope.param.type;
+ if (!type || scope['param'].error) {
+ type = 'error';
+ }
+ const componentName = 'input-' + camelToSnake(type);
+ const template = `
+ <${componentName} value="value" param="param" record="record">${componentName}>
+ `;
+ const contents: any = angular.element(template);
+ $compile(contents)(scope);
+ element.html(contents);
+ function camelToSnake(p){
+ return p.replace(/([A-Z])/g,
+ function(s) {
+ return '_' + s.charAt(0).toLowerCase();
+ }
+ );
+ };
+ }
+ };
+ })
+ .component('inputError', {
+ template: `
+
+ {{$ctrl.param.error}}
+
+ `,
+ bindings: {
+ value: '<',
+ param: '<',
+ record: '<',
+ }
+ })
+ .component('inputChain', {
+ template: `
+
+ {{$ctrl.param.stringify($ctrl.record)}}
+
+ `,
+ bindings: {
+ value: '<',
+ param: '<',
+ record: '<',
+ }
+ })
+ .component('inputCalc', {
+ template: `
+
+ {{$ctrl.param.stringify($ctrl.record)}}
+
+ `,
+ bindings: {
+ value: '<',
+ param: '<',
+ record: '<',
+ }
+ })
+ .component('inputString', {
+ template: `
+
+ `,
+ bindings: {
+ value: '=',
+ param: '<',
+ }
+ })
+ .component('inputMultiString', {
+ template: `
+
+ `,
+ bindings: {
+ value: '=',
+ param: '<',
+ }
+ })
+ .component('inputId', {
+ template: `
+
+ `,
+ bindings: {
+ value: '=',
+ param: '<',
+ }
+ })
+ .component('inputInteger', {
+ template: `
+
+ `,
+ bindings: {
+ value: '=',
+ param: '<',
+ }
+ })
+ .component('inputDate', {
+ template: `
+
+
+
+
+
+
+
+
+ `,
+ bindings: {
+ value: '=',
+ param: '<',
+ }
+ })
+ .component('inputDatetime', {
+ template: `
+
+
+
+
+
+
+
+
+ `,
+ bindings: {
+ value: '=',
+ param: '<',
+ },
+ controller: class InputDatetime {
+ param: any;
+ value: any;
+ constructor() {
+ //
+ }
+ open($event) {
+ var parent = $($event.currentTarget).closest('.input-group')
+ var element = parent.find('input');
+ var widget = parent.find('.bootstrap-datetimepicker-widget').length;
+ if(!widget) {
+ setTimeout(()=> {
+ element.data('DateTimePicker').show();
+ }, 0);
+ }
+ }
+ }
+ })
+ .component('inputReference', {
+ template: `
+
+
+
+
+
+
+ `,
+ bindings: {
+ value: '=',
+ param: '<',
+ },
+ controller: class InputReference {
+ param: any;
+ value: any;
+ item: any;
+ constructor(public Dialog, public $scope) {
+ $scope.$watch('$ctrl.value', (value) => {
+ this.item = this.param.idToItem(value);
+ });
+ $scope.$watch('$ctrl.item', (item) => {
+ this.value = this.param.itemToId(item);
+ });
+ }
+ stringify(item) {
+ return this.param.referenceTable && this.param.referenceTable.stringify(item);
+ }
+ selectByList() {
+ this.Dialog.openWindow(this.param.referenceTable.listPage.extend({
+ forSelect: true
+ }))
+ .then((result) => {
+ if (result) {
+ this.value = result;
+ }
+ });
+
+ }
+ }
+ })
+ .component('inputOption', {
+ template: `
+
+
+
+ `,
+ bindings: {
+ value: '=',
+ param: '<',
+ },
+ controller: class InputReference {
+ param: any;
+ value: any;
+ item: any;
+ constructor(public Dialog, public $scope) {
+ $scope.$watch('$ctrl.value', (value) => {
+ this.item = this.param.idToItem(value);
+ });
+ $scope.$watch('$ctrl.item', (item) => {
+ this.value = this.param.itemToId(item);
+ });
+ }
+ stringify(item) {
+ return this.param.referenceTable && this.param.referenceTable.stringify(item);
+ }
+ }
+ })
+ .component('inputOptionMulti', {
+ template: `
+
+
+
+ `,
+ bindings: {
+ value: '=',
+ param: '<',
+ },
+ controller: class InputReference {
+ param: any;
+ value: any;
+ item: any;
+ constructor(public Dialog, public $scope) {
+ $scope.$watch('$ctrl.value', (value) => {
+ this.item = this.param.idToItem(value);
+ });
+ $scope.$watch('$ctrl.item', (item) => {
+ this.value = this.param.itemToId(item);
+ });
+ }
+ stringify(item) {
+ return this.param.referenceTable && this.param.referenceTable.stringify(item);
+ }
+ }
+ });
+
diff --git a/app/components/login/login.ts b/app/components/login/login.ts
new file mode 100644
index 000000000..254d57124
--- /dev/null
+++ b/app/components/login/login.ts
@@ -0,0 +1,35 @@
+angular.module('sbAdminApp')
+ .component('login',{
+ template: `
+
+ `
+ });
diff --git a/app/components/main/main.ts b/app/components/main/main.ts
new file mode 100644
index 000000000..b0d673c57
--- /dev/null
+++ b/app/components/main/main.ts
@@ -0,0 +1,11 @@
+angular.module('sbAdminApp')
+ .component('main',{
+ template: `
+
+ `
+ });
diff --git a/app/scripts/directives/notifications/notifications.html b/app/components/notifications/notifications.html
similarity index 100%
rename from app/scripts/directives/notifications/notifications.html
rename to app/components/notifications/notifications.html
diff --git a/app/scripts/directives/chat/chat.js b/app/components/notifications/notifications.ts
similarity index 51%
rename from app/scripts/directives/chat/chat.js
rename to app/components/notifications/notifications.ts
index 50550699d..810cfce9b 100644
--- a/app/scripts/directives/chat/chat.js
+++ b/app/components/notifications/notifications.ts
@@ -7,12 +7,8 @@
* # adminPosHeader
*/
angular.module('sbAdminApp')
- .directive('chat',function(){
- return {
- templateUrl:'scripts/directives/chat/chat.html',
- restrict: 'E',
- replace: true,
- }
+ .component('notifications',{
+ templateUrl:'components/notifications/notifications.html',
});
diff --git a/app/components/page/page-list.html b/app/components/page/page-list.html
new file mode 100644
index 000000000..e07cc87ed
--- /dev/null
+++ b/app/components/page/page-list.html
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+{{action.error ? 'error': action.title}}
+
+
+
+
+
+
+ {{field.title}}
+
+
+
+ Actions
+
+
+
+
+
+
+ {{field.stringify(record)}}
+
+
+ 選択
+ {{action.error ? 'error': action.title}}
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/page/page-record.html b/app/components/page/page-record.html
new file mode 100644
index 000000000..019cdd769
--- /dev/null
+++ b/app/components/page/page-record.html
@@ -0,0 +1,26 @@
+{{action.error ? 'error': action.title}}
+
+
+
+
+
+ {{fieldGroup.title}}
+
+
+
\ No newline at end of file
diff --git a/app/components/page/page.ts b/app/components/page/page.ts
new file mode 100644
index 000000000..476ef76a5
--- /dev/null
+++ b/app/components/page/page.ts
@@ -0,0 +1,212 @@
+class ComponentBase {
+ param: any;
+ value: any;
+}
+
+angular.module('sbAdminApp')
+ .directive('pageElement', function ($compile) {
+ return {
+ scope: {
+ value: '<',
+ param: '<',
+ $onClose: '&onClose',
+ },
+ bindToController: true,
+ controllerAs: '$ctrl',
+ link: function (scope, element) {
+ scope.$watch('$ctrl.param.type', function (type) {
+ var componentName = 'page-' + type;
+ var template = `
+ <${componentName} value="$ctrl.value" param="$ctrl.param" on-close="$ctrl.onClose(result)">${componentName}>
+ `;
+ var contents: any = angular.element(template);
+ $compile(contents)(scope);
+ element.html(contents);
+ });
+ },
+ controller: class PageElement {
+ $onClose(value) {
+ //
+ }
+ constructor(private $scope) { }
+ onClose(result) {
+ this.$onClose({ result: result });
+ }
+ }
+ };
+ })
+ .component('pageList', {
+ templateUrl: 'components/page/page-list.html',
+ bindings: {
+ param: '<',
+ value: '<',
+ $onClose: '&onClose',
+ },
+ controller: class ComponentList extends ComponentBase {
+ public records;
+ public conditions = {};
+ sortField;
+ sortMode;
+ constructor(private Dialog, private $scope) {
+ super();
+ $scope.$watch('$ctrl.value', (value) => {
+ this.updateList();
+ }, true);
+ $scope.$watch('$ctrl.conditions', (value) => {
+ this.updateList();
+ }, true);
+ $scope.$watch('$ctrl.sortField', (value) => {
+ this.updateList();
+ });
+ $scope.$watch('$ctrl.sortMode', (value) => {
+ this.updateList();
+ });
+ }
+ $onClose(value) { }//overwriten by bindings
+ // select modeの時に使われる
+ select(value) {
+ this.$onClose({
+ result: value[this.param.table.primaryKey]
+ });
+ }
+ updateList() {
+ const conditionString = JSON.stringify(Object.assign({}, this.value, this.conditions));
+ this.records = this.param.table.search(conditionString);
+ if(this.sortMode > 0) {
+ this.records.sort((a, b)=> {
+ if(a[this.sortField] > b[this.sortField]) {return 1;}
+ if(a[this.sortField] < b[this.sortField]) {return -1;}
+ return 0;
+ });
+ }else if(this.sortMode < 0) {
+ this.records.sort((a, b)=> {
+ if(a[this.sortField] > b[this.sortField]) {return -1;}
+ if(a[this.sortField] < b[this.sortField]) {return 1;}
+ return 0;
+ });
+ }
+ }
+ action(action, value) {
+ if (action.error) {
+ this.Dialog.openDialog({
+ title: 'error',
+ message: action.error,
+ actions: [
+ { caption: 'ok', color: 'primary', result: 'ok' }
+ ]
+ });
+ } else if (action.type === 'link') {
+ this.Dialog.openWindow(action.page, value && value[this.param.table.primaryKey] && {
+ [this.param.table.primaryKey]: value[this.param.table.primaryKey]
+ } || value)
+ .then(() => {
+ this.updateList();
+ });
+ } else if (action.type === 'previewRecords') {
+ this.Dialog.openPreviewWindow(this.param.table.title, this.param.table.records)
+ .then(() => {
+ //
+ });
+ }
+ }
+ }
+ })
+ .component('pageRecord', {
+ templateUrl: 'components/page/page-record.html',
+ bindings: {
+ param: '<',
+ value: '<',
+ $onClose: '&onClose',
+ },
+ controller: class ComponentRecord extends ComponentBase {
+ model: any;
+ constructor(private Dialog, private $scope) {
+ super();
+ }
+ $postLink() {
+ if (this.value && this.value[this.param.table.primaryKey]) {
+ this.model = angular.copy(this.param.table.get(this.value[this.param.table.primaryKey]));
+ } else {
+ this.model = Object.assign(angular.copy(this.value) || {}, this.param.defaultValue());
+ }
+ }
+ $onClose(value) { }//overwriten by bindings
+ action(action, value) {
+ if (action.type === 'save') {
+ this.Dialog.openDialogWithPreset('save')
+ .then((result) => {
+ if (result === 'ok') {
+ this.param.table.save(this.model);
+ }
+ if (result) {
+ this.$onClose({ result: this.model });
+ }
+ });
+ } else if (action.type === 'link') {
+ this.Dialog.openWindow(action.page, value && value[this.param.table.primaryKey] && {
+ [this.param.table.primaryKey]: value[this.param.table.primaryKey]
+ } || value)
+ .then(() => {
+ // this.updateList();
+ });
+ }
+ }
+ }
+ })
+ .component('pageComplex', {
+ template: `
+
+ `,
+ bindings: {
+ param: '<',
+ value: '<',
+ onClose: '&',
+ },
+ controller: class ComponentComplex extends ComponentBase {
+ }
+ })
+ .component('sortButton', {
+ template: ` `,
+ bindings: {
+ mode: '=',
+ currentField: '<',
+ selectedField: '=',
+ },
+ controller: class SortButton {
+ mode = 0;
+ currentField;
+ selectedField;
+ getClassName() {
+ if (this.selectedField === this.currentField) {
+ if (this.mode > 0) {
+ return 'sort-amount-asc';
+ } else if (this.mode < 0) {
+ return 'sort-amount-desc';
+ }
+ }
+ return 'sort';
+ }
+ toggle() {
+ if(this.selectedField !== this.currentField){
+ this.selectedField = this.currentField;
+ this.mode = 1;
+ }else if (this.mode > 0) {
+ this.mode = -1;
+ } else if (this.mode < 0) {
+ this.selectedField = null;
+ this.mode = 0;
+ } else {
+ this.mode = 1;
+ }
+ }
+ }
+ });
diff --git a/app/components/rootPage/rootPage.ts b/app/components/rootPage/rootPage.ts
new file mode 100644
index 000000000..b15bacfab
--- /dev/null
+++ b/app/components/rootPage/rootPage.ts
@@ -0,0 +1,45 @@
+'use strict';
+
+/**
+ * @ngdoc directive
+ * @name izzyposWebApp.directive:adminPosHeader
+ * @description
+ * # adminPosHeader
+ */
+
+angular.module('sbAdminApp')
+ .component('rootPage', {
+ template: `
+
+
+ `,
+ controller: class RootPage{
+ param:any;
+ value:any;
+ constructor($stateParams, Schema) {
+ this.param = Schema.pages[$stateParams.pageId];
+ if($stateParams.recordId) {
+ const condition = JSON.parse($stateParams.recordId);
+ if(angular.isString(condition) || angular.isNumber(condition)) {
+ if(!this.param.table) {
+ debugger;
+ }
+ this.value = {[this.param.table.primaryKey]: condition};
+ }else {
+ this.value = condition;
+ }
+ }
+ }
+ }
+ }
+ );
+
+
diff --git a/app/components/search-elements/search-element.ts b/app/components/search-elements/search-element.ts
new file mode 100644
index 000000000..826c9adcb
--- /dev/null
+++ b/app/components/search-elements/search-element.ts
@@ -0,0 +1,46 @@
+angular.module('sbAdminApp')
+ .directive('searchElement', function($compile) {
+ return {
+ scope: {
+ value: '=',
+ param: '<',
+ condition: '<',
+ type: '<',
+ },
+ link: function(scope:any, element){
+ scope.$watch('type', function(){
+ if(scope.param.type === 'chain' && scope.param.forceEdittable) {
+ scope.effectiveParam = scope.param.chains.slice(-1)[0].field;
+ }else {
+ scope.effectiveParam = scope.param;
+ }
+ let type = scope.effectiveParam.elementType || scope.effectiveParam.type;
+ if(scope['param'].error) {
+ type = 'error';
+ }
+ const conditionTypesMap = {
+ 'partial': ['._$text._$search'],
+ 'suffix': ['._$suffix._$search'],
+ 'prefix': ['._$prefix._$search'],
+ 'exact': [''],
+ 'multi': ['._$in'],
+ 'range': ['._$gte', '._$lt'],
+ 'default': ['']
+ };
+ const conditionTypes = conditionTypesMap[scope.effectiveParam.searchType] || conditionTypesMap['default'];
+ const componentName = 'input-' + type + (scope.effectiveParam.searchType === 'multi' ? '-multi': '');
+ if(scope.effectiveParam.defaultValue && conditionTypes[0] === '') {
+ scope.condition[scope.effectiveParam.name] = scope.effectiveParam.defaultValue();
+ }
+ const template = conditionTypes.map((conditionType)=> {
+ return `
+ <${componentName} value="condition[effectiveParam.name]${conditionType}" param="effectiveParam">${componentName}>
+ `;
+ }).join('');
+ const contents:any = angular.element(template);
+ $compile(contents)(scope);
+ element.html(contents);
+ });
+ }
+ };
+ });
diff --git a/app/scripts/directives/sidebar/sidebar-search/sidebar-search.html b/app/components/sidebar/sidebar-search/sidebar-search.html
similarity index 100%
rename from app/scripts/directives/sidebar/sidebar-search/sidebar-search.html
rename to app/components/sidebar/sidebar-search/sidebar-search.html
diff --git a/app/components/sidebar/sidebar-search/sidebar-search.ts b/app/components/sidebar/sidebar-search/sidebar-search.ts
new file mode 100644
index 000000000..43d5619bb
--- /dev/null
+++ b/app/components/sidebar/sidebar-search/sidebar-search.ts
@@ -0,0 +1,16 @@
+'use strict';
+
+/**
+ * @ngdoc directive
+ * @name izzyposWebApp.directive:adminPosHeader
+ * @description
+ * # adminPosHeader
+ */
+
+angular.module('sbAdminApp')
+ .component('sidebarSearch',{
+ templateUrl:'components/sidebar/sidebar-search/sidebar-search.html',
+ controller: class SidebarSearch{
+ selectedMenu = 'home';
+ }
+ });
diff --git a/app/components/sidebar/sidebar.html b/app/components/sidebar/sidebar.html
new file mode 100644
index 000000000..ca7821547
--- /dev/null
+++ b/app/components/sidebar/sidebar.html
@@ -0,0 +1,31 @@
+
+
+
+
diff --git a/app/components/sidebar/sidebar.ts b/app/components/sidebar/sidebar.ts
new file mode 100644
index 000000000..7f8f5e33c
--- /dev/null
+++ b/app/components/sidebar/sidebar.ts
@@ -0,0 +1,36 @@
+/**
+ * @ngdoc directive
+ * @name izzyposWebApp.directive:adminPosHeader
+ * @description
+ * # adminPosHeader
+ */
+
+angular.module('sbAdminApp')
+ .component('sidebar',{
+ templateUrl:'components/sidebar/sidebar.html',
+ controller: class Sidebar{
+ menu:any;
+ collapseVar:number = 0;
+ multiCollapseVar:number = 0;
+ srefOption = {inherit: false};
+ debug = '';
+ constructor(Schema) {
+ this.menu = Schema.menu;
+ }
+ check(x) {
+ if(x === this.collapseVar) {
+ this.collapseVar = 0;
+ }else {
+ this.collapseVar = x;
+ }
+ }
+ multiCheck(y) {
+ if(y === this.multiCollapseVar) {
+ this.multiCollapseVar = 0;
+ }else {
+ this.multiCollapseVar = y;
+ }
+ }
+ }
+ });
+
diff --git a/app/index.html b/app/index.html
index 63b938101..11f80a48e 100644
--- a/app/index.html
+++ b/app/index.html
@@ -1,74 +1,78 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+