├── .gitignore ├── LICENSE.md ├── README.md ├── VisualStudio.gitignore ├── docs └── ResourceMetadata- release notes.docx └── source └── ResourceMetadata ├── ResourceMetadata.API ├── App_Start │ ├── Bootstrapper.cs │ ├── FilterConfig.cs │ ├── Startup.Auth.cs │ └── WebApiConfig.cs ├── Controllers │ ├── AccountController.cs │ ├── LocationsController.cs │ ├── ResourceActivitiesController.cs │ └── ResourcesController.cs ├── Enums │ └── Enum.cs ├── Global.asax ├── Global.asax.cs ├── Mappers │ ├── AutoMapperConfiguration.cs │ ├── DomainToViewModelMappingProfile.cs │ └── ViewModelToDomainMappingProfile.cs ├── Project_Readme.html ├── Properties │ └── AssemblyInfo.cs ├── Providers │ └── ApplicationOAuthProvider.cs ├── ResourceMetadata.API.csproj ├── Results │ └── ChallengeResult.cs ├── Startup.cs ├── ViewModels │ ├── LocationViewModel.cs │ ├── LoginViewModel.cs │ ├── PagedCollectionViewModel.cs │ ├── RegisterViewModel.cs │ ├── ResourceActivityViewModel.cs │ ├── ResourceViewModel.cs │ └── UserProfileViewModel.cs ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── favicon.ico └── packages.config ├── ResourceMetadata.Data ├── App.config ├── Configurations │ ├── IdentityUserLoginConfiguration.cs │ ├── IdentityUserRoleConfiguration.cs │ ├── LocationConfiguration.cs │ ├── ResourceActivityConfiguration.cs │ └── ResourceConfiguration.cs ├── Infrastructure │ ├── DatabaseFactory.cs │ ├── Disposable.cs │ ├── IDatabaseFactory.cs │ ├── IRepository.cs │ ├── IUnitOfWork.cs │ ├── RepositoryBase.cs │ └── UnitOfWork.cs ├── Properties │ └── AssemblyInfo.cs ├── Repositories │ ├── LocationRepository.cs │ ├── ResourceActivityRepository.cs │ ├── ResourceRepository.cs │ └── UserRepository.cs ├── ResourceManagerContext.cs ├── ResourceMetadata.Data.csproj └── packages.config ├── ResourceMetadata.Model ├── Location.cs ├── Properties │ └── AssemblyInfo.cs ├── Resource.cs ├── ResourceActivity.cs ├── ResourceMetadata.Model.csproj └── User.cs ├── ResourceMetadata.Service ├── LocationService.cs ├── Properties │ └── AssemblyInfo.cs ├── ResourceActivityService.cs ├── ResourceMetadata.Service.csproj ├── ResourceService.cs ├── UserService.cs └── app.config ├── ResourceMetadata.Web ├── Content │ ├── fonts │ │ ├── basic.icons.eot │ │ ├── basic.icons.svg │ │ ├── basic.icons.ttf │ │ ├── basic.icons.woff │ │ ├── icons.eot │ │ ├── icons.otf │ │ ├── icons.svg │ │ ├── icons.ttf │ │ └── icons.woff │ └── themes │ │ ├── Site.css │ │ ├── base │ │ └── minified │ │ │ ├── images │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ ├── ui-icons_454545_256x240.png │ │ │ ├── ui-icons_888888_256x240.png │ │ │ └── ui-icons_cd0a0a_256x240.png │ │ │ ├── jquery-ui.min.css │ │ │ ├── jquery.ui.accordion.min.css │ │ │ ├── jquery.ui.autocomplete.min.css │ │ │ ├── jquery.ui.button.min.css │ │ │ ├── jquery.ui.core.min.css │ │ │ ├── jquery.ui.datepicker.min.css │ │ │ ├── jquery.ui.dialog.min.css │ │ │ ├── jquery.ui.progressbar.min.css │ │ │ ├── jquery.ui.resizable.min.css │ │ │ ├── jquery.ui.selectable.min.css │ │ │ ├── jquery.ui.slider.min.css │ │ │ ├── jquery.ui.tabs.min.css │ │ │ └── jquery.ui.theme.min.css │ │ ├── fonts │ │ ├── basic.icons.eot │ │ ├── basic.icons.svg │ │ ├── basic.icons.ttf │ │ ├── basic.icons.woff │ │ ├── icons.eot │ │ ├── icons.otf │ │ ├── icons.svg │ │ ├── icons.ttf │ │ └── icons.woff │ │ ├── images │ │ ├── loader-large-inverted.gif │ │ ├── loader-large.gif │ │ ├── loader-medium-inverted.gif │ │ ├── loader-medium.gif │ │ ├── loader-mini-inverted.gif │ │ ├── loader-mini.gif │ │ ├── loader-small-inverted.gif │ │ └── loader-small.gif │ │ ├── jasmine-2.0.0 │ │ ├── jasmine.css │ │ └── jasmine.min.css │ │ ├── ng-table │ │ ├── ng-table.css │ │ └── ng-table.min.css │ │ ├── select2 │ │ ├── select2-spinner.gif │ │ ├── select2.css │ │ └── select2.png │ │ ├── semantic │ │ └── semantic.css │ │ └── smoothness │ │ ├── images │ │ ├── loading.gif │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ ├── ui-icons_222222_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_454545_256x240.png │ │ ├── ui-icons_888888_256x240.png │ │ └── ui-icons_cd0a0a_256x240.png │ │ └── jquery-ui.min.css ├── Index.html ├── Properties │ └── AssemblyInfo.cs ├── ResourceMetadata.Web.csproj ├── Scripts │ ├── app │ │ ├── app.js │ │ ├── controllers │ │ │ ├── activities │ │ │ │ ├── activitiescontroller.js │ │ │ │ └── activityaddcontroller.js │ │ │ ├── home │ │ │ │ └── homecontroller.js │ │ │ ├── locations │ │ │ │ ├── locationcontroller.js │ │ │ │ └── locationscontroller.js │ │ │ ├── resources │ │ │ │ ├── resourcecontroller.js │ │ │ │ ├── resourceeditcontroller.js │ │ │ │ └── resourcescontroller.js │ │ │ └── shared │ │ │ │ └── resourcemngrcontroller.js │ │ ├── directives │ │ │ ├── activities │ │ │ │ ├── ResourceActivityList.html │ │ │ │ └── resourceactivitylist.js │ │ │ └── shared │ │ │ │ ├── confirmmodal.js │ │ │ │ ├── datepicker.js │ │ │ │ ├── externalurl.js │ │ │ │ ├── itemdelete.js │ │ │ │ ├── loadingoverlay.js │ │ │ │ ├── modal.js │ │ │ │ └── topmenu.js │ │ ├── helpers │ │ │ └── authorizationinterceptor.js │ │ ├── partials │ │ │ ├── Loader.html │ │ │ ├── TopMenu.html │ │ │ └── confirm-modal.html │ │ ├── services │ │ │ ├── activities │ │ │ │ └── activityservice.js │ │ │ ├── locations │ │ │ │ └── locationservice.js │ │ │ ├── resources │ │ │ │ └── resourceservice.js │ │ │ └── shared │ │ │ │ ├── resourcemngrservice.js │ │ │ │ └── servicehelper.js │ │ └── views │ │ │ ├── about │ │ │ └── About.html │ │ │ ├── activities │ │ │ └── Add.html │ │ │ ├── home │ │ │ └── Home.html │ │ │ ├── locations │ │ │ ├── Add.html │ │ │ ├── Edit.html │ │ │ └── Locations.html │ │ │ ├── resources │ │ │ ├── Add.html │ │ │ ├── Details.html │ │ │ ├── Edit.html │ │ │ ├── Resources-ng-table.html │ │ │ └── Resources.html │ │ │ └── shared │ │ │ ├── Error.html │ │ │ ├── Login.html │ │ │ └── Register.html │ ├── config.js │ ├── libs │ │ ├── angular-1.2.16.js │ │ ├── angular-animate-1.2.16.js │ │ ├── angular-mocks-1.2.16.js │ │ ├── angular-resource-1.2.16.js │ │ ├── angular-route-1.2.16.js │ │ ├── angular-ui │ │ │ └── select2.js │ │ ├── jasmine-2.0.0 │ │ │ ├── boot.js │ │ │ ├── boot.min.js │ │ │ ├── console.js │ │ │ ├── console.min.js │ │ │ ├── jasmine-html.js │ │ │ ├── jasmine-html.min.js │ │ │ ├── jasmine.js │ │ │ └── jasmine.min.js │ │ ├── jquery-1.9.1.js │ │ ├── jquery-ui-1.10.3.min.js │ │ ├── ng-table │ │ │ └── ng-table.js │ │ ├── select2 │ │ │ └── select2.js │ │ └── semantic │ │ │ └── semantic.js │ └── test │ │ └── spec │ │ ├── activitiescontrollerspec.js │ │ ├── activityservicespec.js │ │ ├── locationcontrollerspec.js │ │ ├── locationscontrollerspec.js │ │ ├── locationservicespec.js │ │ ├── resourcecontrollerspec.js │ │ ├── resourceeditcontrollerspec.js │ │ ├── resourcemngrcontrollerspec.js │ │ ├── resourcemngrservicespec.js │ │ ├── resourcescontrollerspec.js │ │ ├── resourceservicespec.js │ │ └── spechelper.js ├── SpecRunner.html ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── gulpfile.js └── package.json └── ResourceMetadata.sln /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Marlabs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | WebApi-AngularJS-Spa v1.2.0 2 | ==================== 3 | 4 | [![alt text](http://www.marlabs.com/sites/default/files/logo.png "Marlabs")](http://www.marlabs.com) 5 | 6 | A reference app for building single page apps (SPA) with ASP.NET Web API 2 and AngularJS, developed by [Marlabs](http://www.marlabs.com) 7 | 8 | Technologies 9 | ============ 10 | 11 | Server-Side 12 | ----------- 13 | 14 | * ASP.NET Web API 2 15 | * EF 6 Code First 16 | * AutoMapper 17 | * Autofac 18 | 19 | Client-Side 20 | ----------- 21 | 22 | * AngularJS 23 | * Semantic UI 24 | * Gulp.js 25 | * Jasmine 26 | 27 | Building the application 28 | ============ 29 | 30 | Visual Studio 31 | ----------- 32 | 33 | 1. Build the solution to install Nuget packages.(This will automatically restore Nuget packages. Please ensure you have Nuget version 2.7 or higher) 34 | 2. The Project ResourceMetada.API is configured to run using IIS Express. 35 | 3. Before starting the Client Application (ResourceMetadata.Web), please ensure that the API project is running in IIS or IIS express. 36 | 37 | Client-Side 38 | ----------- 39 | 40 | 1. Config.js file at ***[source/ResourceMetadata/ResourceMetadata.Web/Scripts/config.js](https://github.com/MarlabsInc/webapi-angularjs-spa/tree/master/source/ResourceMetadata/ResourceMetadata.Web/Scripts/config.js)*** holds the api url used by the Client application. Update this file to change the api url appropriately. 41 | 2. If you haven't installed Node.js, download and install it from http://nodejs.org/ 42 | 3. Navigate to the directory of ResourceMetadata.Web project ***[source/ResourceMetadata/ResourceMetadata.Web/](https://github.com/MarlabsInc/webapi-angularjs-spa/tree/master/source/ResourceMetadata/ResourceMetadata.Web/)*** in command prompt. 43 | 4. Run command **npm install** 44 | 5. Execute gulp tasks 45 | 1. Run command **gulp build**. 46 | 2. In order to clean the destination files created by build task, run **gulp cleanbuild**. 47 | 3. To run unit tests, run the command **gulp tests** 48 | 49 | 50 | Migrating from Previous Versions 51 | ------------------------------- 52 | If you are already using the previous versions of the App, please drop the database ResourceMetadata from your SQL server before running the Application. 53 | 54 | # Changes in v1.2.0 55 | 56 | * Added unit tests for client-side JavaScript with Jasmine. 57 | * Added paging with ng-Table. 58 | * Role based security for both server-side and client-side. 59 | 60 | # Role Based Security 61 | 62 | Role based security has been implemented on both client-side and server-side. Write operations on the "Location" entity is restricted with admin role. There is a pre-defined admin user with credentials admin@marlabs.com/Marlabs 63 | 64 | # Current Features 65 | 66 | * REST API with ASP.NET Web API 2. 67 | * Server-Side security with ASP.NET Identity. 68 | * Single Page Application(SPA) with AngularJS. 69 | * AngularJS factory $resource for interacting with RESTful server-side data sources. 70 | * AngularJS $http interceptors. 71 | * AngularJS directives. 72 | * Task automation with Gulp.js 73 | * Unit tests for client-side JavaScript with Jasmine. 74 | * Paging using ng-Table. 75 | * Role based security. 76 | 77 | 78 | # Roadmap Targets 79 | 80 | * Leverage Browserify 81 | * Performance optimizations and best prarctices for SPA. 82 | * Enhanced security model for SPA. 83 | * Next-generation hybrid mobile apps with HTML5 and AngularJS. 84 | 85 | # Team 86 | 87 | * [Shiju Varghese](http://weblogs.asp.net/shijuvarghese/) - Architect 88 | * [Dileep C.D.](https://github.com/DileepCD) - Lead Developer 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /docs/ResourceMetadata- release notes.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/docs/ResourceMetadata- release notes.docx -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/App_Start/Bootstrapper.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using Microsoft.AspNet.Identity; 3 | using ResourceMetadata.API.Mappers; 4 | using ResourceMetadata.Data.Infrastructure; 5 | using ResourceMetadata.Data.Repositories; 6 | using ResourceMetadata.Model; 7 | using ResourceMetadata.Service; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Web; 12 | using System.Web.Http; 13 | using Autofac.Integration.WebApi; 14 | using Microsoft.AspNet.Identity.EntityFramework; 15 | using ResourceMetadata.Data; 16 | 17 | namespace ResourceMetadata.API.App_Start 18 | { 19 | public static class Bootstrapper 20 | { 21 | public static void Configure() 22 | { 23 | ConfigureAutofacContainer(); 24 | AutoMapperConfiguration.Configure(); 25 | } 26 | 27 | public static void ConfigureAutofacContainer() 28 | { 29 | 30 | var webApiContainerBuilder = new ContainerBuilder(); 31 | ConfigureWebApiContainer(webApiContainerBuilder); 32 | } 33 | 34 | public static void ConfigureWebApiContainer(ContainerBuilder containerBuilder) 35 | { 36 | containerBuilder.RegisterType().As().AsImplementedInterfaces().InstancePerApiRequest(); 37 | containerBuilder.RegisterType().As().AsImplementedInterfaces().InstancePerApiRequest(); 38 | containerBuilder.RegisterType().As().AsImplementedInterfaces().InstancePerApiRequest(); 39 | containerBuilder.RegisterType().As().InstancePerApiRequest(); 40 | containerBuilder.RegisterType().As().InstancePerApiRequest(); 41 | containerBuilder.RegisterType().As().InstancePerApiRequest(); 42 | containerBuilder.RegisterType().As().InstancePerApiRequest(); 43 | containerBuilder.RegisterType().As().InstancePerApiRequest(); 44 | containerBuilder.RegisterType().As().InstancePerApiRequest(); 45 | containerBuilder.RegisterType().As().InstancePerApiRequest(); 46 | 47 | containerBuilder.Register(c => new UserManager(new UserStore(new ResourceManagerEntities()) 48 | { 49 | /*Avoids UserStore invoking SaveChanges on every actions.*/ 50 | //AutoSaveChanges = false 51 | })).As>().InstancePerApiRequest(); 52 | 53 | containerBuilder.RegisterApiControllers(System.Reflection.Assembly.GetExecutingAssembly()); 54 | IContainer container = containerBuilder.Build(); 55 | GlobalConfiguration.Configuration.DependencyResolver = new AutofacWebApiDependencyResolver(container); 56 | } 57 | 58 | } 59 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace ResourceMetadata.API 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/App_Start/Startup.Auth.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Microsoft.AspNet.Identity; 5 | using Microsoft.AspNet.Identity.EntityFramework; 6 | using Microsoft.Owin; 7 | using Microsoft.Owin.Security.Cookies; 8 | using Microsoft.Owin.Security.OAuth; 9 | using Owin; 10 | using ResourceMetadata.API.Providers; 11 | using ResourceMetadata.Data; 12 | 13 | namespace ResourceMetadata.API 14 | { 15 | public partial class Startup 16 | { 17 | static Startup() 18 | { 19 | PublicClientId = "self"; 20 | 21 | UserManagerFactory = () => new UserManager(new UserStore(new ResourceManagerEntities())); 22 | 23 | OAuthOptions = new OAuthAuthorizationServerOptions 24 | { 25 | TokenEndpointPath = new PathString("/Token"), 26 | Provider = new ApplicationOAuthProvider(PublicClientId, UserManagerFactory), 27 | AuthorizeEndpointPath = new PathString("/api/Account/ExternalLogin"), 28 | AccessTokenExpireTimeSpan = TimeSpan.FromDays(14), 29 | AllowInsecureHttp = true 30 | }; 31 | } 32 | 33 | public static OAuthAuthorizationServerOptions OAuthOptions { get; private set; } 34 | 35 | public static Func> UserManagerFactory { get; set; } 36 | 37 | public static string PublicClientId { get; private set; } 38 | 39 | // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864 40 | public void ConfigureAuth(IAppBuilder app) 41 | { 42 | 43 | app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); 44 | 45 | // Enable the application to use a cookie to store information for the signed in user 46 | // and to use a cookie to temporarily store information about a user logging in with a third party login provider 47 | //app.UseCookieAuthentication(new CookieAuthenticationOptions()); 48 | //app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); 49 | 50 | // Enable the application to use bearer tokens to authenticate users 51 | app.UseOAuthBearerTokens(OAuthOptions); 52 | 53 | // Uncomment the following lines to enable logging in with third party login providers 54 | //app.UseMicrosoftAccountAuthentication( 55 | // clientId: "", 56 | // clientSecret: ""); 57 | 58 | //app.UseTwitterAuthentication( 59 | // consumerKey: "", 60 | // consumerSecret: ""); 61 | 62 | //app.UseFacebookAuthentication( 63 | // appId: "", 64 | // appSecret: ""); 65 | 66 | //app.UseGoogleAuthentication(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Http; 5 | using System.Web.Http; 6 | using Microsoft.Owin.Security.OAuth; 7 | using Newtonsoft.Json.Serialization; 8 | 9 | 10 | namespace ResourceMetadata.API 11 | { 12 | public static class WebApiConfig 13 | { 14 | public static void Register(HttpConfiguration config) 15 | { 16 | 17 | config.EnableCors(); 18 | // Web API configuration and services 19 | // Configure Web API to use only bearer token authentication. 20 | config.SuppressDefaultHostAuthentication(); 21 | config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType)); 22 | config.Filters.Add(new AuthorizeAttribute()); 23 | // Web API routes 24 | config.MapHttpAttributeRoutes(); 25 | 26 | config.Routes.MapHttpRoute( 27 | name: "DefaultApi", 28 | routeTemplate: "api/{controller}/{id}", 29 | defaults: new { id = RouteParameter.Optional } 30 | ); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Controllers/AccountController.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Microsoft.AspNet.Identity; 3 | using Microsoft.AspNet.Identity.EntityFramework; 4 | using Microsoft.Owin.Security; 5 | using ResourceMetadata.Model; 6 | using ResourceMetadata.Service; 7 | using ResourceMetadata.API.ViewModels; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Threading.Tasks; 12 | using System.Web; 13 | using System.Web.Http; 14 | 15 | namespace ResourceMetadata.API.Controllers 16 | { 17 | public class AccountController : ApiController 18 | { 19 | 20 | private readonly IUserService userService; 21 | 22 | private readonly UserManager userManager; 23 | private IAuthenticationManager AuthenticationManager 24 | { 25 | get 26 | { 27 | return HttpContext.Current.GetOwinContext().Authentication; 28 | } 29 | } 30 | 31 | public AccountController(IUserService userService, UserManager userManager) 32 | { 33 | this.userService = userService; 34 | this.userManager = userManager; 35 | 36 | //Todo: This needs to be moved from here. 37 | this.userManager.UserValidator = new UserValidator(userManager) 38 | { 39 | AllowOnlyAlphanumericUserNames = false 40 | }; 41 | } 42 | 43 | [HttpPost] 44 | [OverrideAuthorization] 45 | public async Task Post(RegisterViewModel viewModel) 46 | { 47 | if (ModelState.IsValid) 48 | { 49 | try 50 | { 51 | ApplicationUser user = new ApplicationUser(); 52 | Mapper.Map(viewModel, user); 53 | 54 | var identityResult = await userManager.CreateAsync(user, viewModel.Password); 55 | 56 | if (identityResult.Succeeded) 57 | { 58 | userManager.AddToRole(user.Id, "Member"); 59 | return Ok(); 60 | } 61 | else 62 | { 63 | foreach (var error in identityResult.Errors) 64 | { 65 | ModelState.AddModelError(error,error); 66 | } 67 | 68 | return BadRequest(ModelState); 69 | } 70 | } 71 | catch (Exception ex) 72 | { 73 | 74 | throw ex; 75 | } 76 | } 77 | else 78 | { 79 | return BadRequest(ModelState); 80 | } 81 | 82 | } 83 | 84 | #region Private methods 85 | #region SignInAsync 86 | private async Task SignInAsync(ApplicationUser user, bool isPersistent) 87 | { 88 | try 89 | { 90 | AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie); 91 | var identity = await userManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie); 92 | AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity); 93 | } 94 | catch (Exception ex) 95 | { 96 | 97 | throw ex; 98 | } 99 | 100 | } 101 | 102 | #endregion SignInAsync 103 | #endregion SignInAsync 104 | } 105 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Controllers/LocationsController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Net.Http; 6 | using System.Web.Http; 7 | using ResourceMetadata.API.ViewModels; 8 | using ResourceMetadata.Model; 9 | using ResourceMetadata.Service; 10 | using AutoMapper; 11 | using System.Threading; 12 | using Microsoft.AspNet.Identity; 13 | 14 | namespace ResourceMetadata.API.Controllers 15 | { 16 | 17 | public class LocationsController : ApiController 18 | { 19 | private readonly ILocationService locationService; 20 | private readonly UserManager userManager; 21 | 22 | public LocationsController(ILocationService locationService, UserManager userManager) 23 | { 24 | 25 | this.locationService = locationService; 26 | this.userManager = userManager; 27 | } 28 | 29 | public IHttpActionResult Get() 30 | { 31 | var locations = locationService.GetLocations(); 32 | var locationViewModels = new List(); 33 | Mapper.Map(locations, locationViewModels); 34 | return Ok(locationViewModels); 35 | } 36 | 37 | public IHttpActionResult Get(int id) 38 | { 39 | var location = locationService.GetLocationById(id); 40 | var viewModel = new LocationViewModel(); 41 | Mapper.Map(location, viewModel); 42 | return Ok(viewModel); 43 | } 44 | 45 | 46 | [Authorize(Roles = "Admin")] 47 | public IHttpActionResult Post(LocationViewModel location) 48 | { 49 | Location entity = new Location(); 50 | Mapper.Map(location, entity); 51 | entity.CreatedOn = DateTime.UtcNow; 52 | locationService.AddLocation(entity); 53 | Mapper.Map(entity, location); 54 | return Created(Url.Link("DefaultApi", new { controller = "Locations", id = location.Id }), location); 55 | } 56 | 57 | [Authorize(Roles = "Admin")] 58 | public IHttpActionResult Put(int id, LocationViewModel locationViewModel) 59 | { 60 | locationViewModel.Id = id; 61 | var location = locationService.GetLocationById(id); 62 | Mapper.Map(locationViewModel, location); 63 | locationService.UpdateLoaction(location); 64 | return Ok(locationViewModel); 65 | } 66 | 67 | [Authorize(Roles = "Admin")] 68 | public IHttpActionResult Delete(int id) 69 | { 70 | locationService.DeleteLocation(id); 71 | return Ok(); 72 | } 73 | 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Controllers/ResourceActivitiesController.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using ResourceMetadata.Model; 3 | using ResourceMetadata.Service; 4 | using ResourceMetadata.API.ViewModels; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Net; 9 | using System.Net.Http; 10 | using System.Web.Http; 11 | 12 | namespace ResourceMetadata.API.Controllers 13 | { 14 | public class ResourceActivitiesController : ApiController 15 | { 16 | private readonly IResourceActivityService activityService; 17 | 18 | public ResourceActivitiesController(IResourceActivityService activityService) 19 | { 20 | this.activityService = activityService; 21 | } 22 | 23 | [Route("api/Resources/{resourceId}/Activities")] 24 | public IHttpActionResult Get(int resourceId) 25 | { 26 | var activities = activityService.GetActivitiesByResourceId(resourceId); 27 | IList activityViewModel = new List(); 28 | Mapper.Map(activities, activityViewModel); 29 | return Ok(activityViewModel); 30 | } 31 | 32 | [Route("api/Resources/{resourceId}/Activities")] 33 | public IHttpActionResult Post(int resourceId, ResourceActivityViewModel activity) 34 | { 35 | var entity = new ResourceActivity(); 36 | Mapper.Map(activity, entity); 37 | activityService.AddResourceActivity(entity); 38 | activity.Id = entity.Id; 39 | return Created(Url.Link("DefaultApi", new { controller = "ResourceActivities", id = activity.Id }), activity); 40 | } 41 | 42 | [Route("api/Resources/{resourceId}/Activities/{id}")] 43 | public IHttpActionResult Delete(int id) 44 | { 45 | activityService.DeleteActivity(id); 46 | return Ok(); 47 | } 48 | 49 | } 50 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Enums/Enum.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace ResourceMetadata.API.Enums 7 | { 8 | public enum LoginActions 9 | { 10 | Login, 11 | Register, 12 | LogOff 13 | 14 | } 15 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ResourceMetadata.API.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using ResourceMetadata.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Data.Entity; 5 | using System.Linq; 6 | using System.Web; 7 | using System.Web.Http; 8 | using System.Web.Routing; 9 | using System.Web.Mvc; 10 | using System.Web.Optimization; 11 | using ResourceMetadata.API.App_Start; 12 | 13 | namespace ResourceMetadata.API 14 | { 15 | // Note: For instructions on enabling IIS7 classic mode, 16 | // visit http://go.microsoft.com/fwlink/?LinkId=301868 17 | public class WebApiApplication : System.Web.HttpApplication 18 | { 19 | protected void Application_Start() 20 | { 21 | //WebApiConfig.Register(GlobalConfiguration.Configuration); 22 | GlobalConfiguration.Configure(WebApiConfig.Register); 23 | Bootstrapper.Configure(); 24 | Database.SetInitializer(new ResourceManagerDbInitializer()); 25 | AreaRegistration.RegisterAllAreas(); 26 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Mappers/AutoMapperConfiguration.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace ResourceMetadata.API.Mappers 8 | { 9 | public class AutoMapperConfiguration 10 | { 11 | public static void Configure() 12 | { 13 | Mapper.Initialize(mapper => 14 | { 15 | mapper.AddProfile() ; 16 | mapper.AddProfile(); 17 | }); 18 | 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Mappers/DomainToViewModelMappingProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using ResourceMetadata.Model; 3 | using ResourceMetadata.API.ViewModels; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Web; 8 | 9 | namespace ResourceMetadata.API.Mappers 10 | { 11 | public class DomainToViewModelMappingProfile : Profile 12 | { 13 | public override string ProfileName 14 | { 15 | get 16 | { 17 | return "DomainToViewModelMappingProfile"; 18 | } 19 | } 20 | 21 | 22 | protected override void Configure() 23 | { 24 | Mapper.CreateMap(); 25 | Mapper.CreateMap(); 26 | Mapper.CreateMap() 27 | .ForMember(vm => vm.ActivityDateString, dm=> dm.MapFrom(dModel => dModel.ActivityDate.ToLongDateString())); 28 | Mapper.CreateMap(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Mappers/ViewModelToDomainMappingProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using ResourceMetadata.Model; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Web; 7 | using ResourceMetadata.API.ViewModels; 8 | 9 | namespace ResourceMetadata.API.Mappers 10 | { 11 | public class ViewModelToDomainMappingProfile : Profile 12 | { 13 | public override string ProfileName 14 | { 15 | get 16 | { 17 | return "ViewModelToDomainMappingProfile"; 18 | } 19 | } 20 | 21 | protected override void Configure() 22 | { 23 | Mapper.CreateMap() 24 | .ForMember(resource => resource.Activities, vm => vm.Ignore()) 25 | .ForMember(resource => resource.UserId, vm => vm.Ignore()); 26 | 27 | Mapper.CreateMap(); 28 | Mapper.CreateMap(); 29 | Mapper.CreateMap(); 30 | Mapper.CreateMap().ForMember(user => user.UserName, vm => vm.MapFrom(rm => rm.Email)); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ResourceMetadata.API")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ResourceMetadata.API")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0f21fd4c-a219-467c-b6f6-3ca9ebeb9a6e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Results/ChallengeResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Net.Http; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | using System.Web.Http; 9 | 10 | namespace ResourceMetadata.API.Results 11 | { 12 | public class ChallengeResult : IHttpActionResult 13 | { 14 | public ChallengeResult(string loginProvider, ApiController controller) 15 | { 16 | LoginProvider = loginProvider; 17 | Request = controller.Request; 18 | } 19 | 20 | public string LoginProvider { get; set; } 21 | public HttpRequestMessage Request { get; set; } 22 | 23 | public Task ExecuteAsync(CancellationToken cancellationToken) 24 | { 25 | Request.GetOwinContext().Authentication.Challenge(LoginProvider); 26 | 27 | HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.Unauthorized); 28 | response.RequestMessage = Request; 29 | return Task.FromResult(response); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Microsoft.Owin; 5 | using Owin; 6 | 7 | [assembly: OwinStartup(typeof(ResourceMetadata.API.Startup))] 8 | 9 | namespace ResourceMetadata.API 10 | { 11 | public partial class Startup 12 | { 13 | public void Configuration(IAppBuilder app) 14 | { 15 | ConfigureAuth(app); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/ViewModels/LocationViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace ResourceMetadata.API.ViewModels 7 | { 8 | public class LocationViewModel 9 | { 10 | public int Id { get; set; } 11 | public string Name { get; set; } 12 | public string Description { get; set; } 13 | public DateTime CreatedOn { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/ViewModels/LoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using ResourceMetadata.API.Enums; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace ResourceMetadata.API.ViewModels 9 | { 10 | public class LoginViewModel 11 | { 12 | [Required(ErrorMessage="Required")] 13 | public string Email { get; set; } 14 | 15 | [Required(ErrorMessage = "Required")] 16 | public string Password { get; set; } 17 | public LoginActions Action { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/ViewModels/PagedCollectionViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace ResourceMetadata.API.ViewModels 7 | { 8 | public class PagedCollectionViewModel 9 | { 10 | public IEnumerable Data { get; set; } 11 | public int TotalCount { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/ViewModels/RegisterViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using ResourceMetadata.API.Enums; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace ResourceMetadata.API.ViewModels 9 | { 10 | public class RegisterViewModel 11 | { 12 | [Required] 13 | public string FirstName { get; set; } 14 | 15 | [Required] 16 | public string LastName { get; set; } 17 | [Required] 18 | public string Email { get; set; } 19 | [Required] 20 | [MinLength(6, ErrorMessage = "Password should contain at least 6 characters")] 21 | public string Password { get; set; } 22 | 23 | [Compare("Password", ErrorMessage = "Password and confirm password should match")] 24 | 25 | public string ConfirmPassword { get; set; } 26 | public LoginActions Action { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/ViewModels/ResourceActivityViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace ResourceMetadata.API.ViewModels 7 | { 8 | public class ResourceActivityViewModel 9 | { 10 | public int Id { get; set; } 11 | public int ResourceId { get; set; } 12 | public string Title { get; set; } 13 | public string Notes { get; set; } 14 | public DateTime ActivityDate { get; set; } 15 | public string ActivityDateString { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/ViewModels/ResourceViewModel.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | 8 | namespace ResourceMetadata.API.ViewModels 9 | { 10 | public class ResourceViewModel 11 | { 12 | public int Id { get; set; } 13 | public string Name { get; set; } 14 | public string Description { get; set; } 15 | public bool IsShared { get; set; } 16 | public int LocationId { get; set; } 17 | public string LocationName { get; set; } 18 | public string Path { get; set; } 19 | public int Priority { get; set; } 20 | 21 | public IEnumerable Activities { get; set; } 22 | 23 | } 24 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/ViewModels/UserProfileViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace ResourceMetadata.API.ViewModels 7 | { 8 | public class UserProfileViewModel 9 | { 10 | public string Email { get; set; } 11 | public string Role { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.API/favicon.ico -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.API/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Configurations/IdentityUserLoginConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNet.Identity.EntityFramework; 7 | using System.Data.Entity.ModelConfiguration; 8 | 9 | namespace ResourceMetadata.Data.Configurations 10 | { 11 | public class IdentityUserLoginConfiguration : EntityTypeConfiguration 12 | { 13 | public IdentityUserLoginConfiguration() 14 | { 15 | HasKey(login => new { login.UserId, login.LoginProvider, login.ProviderKey }); 16 | //HasRequired(login => login.UserId).WithMany().HasForeignKey(login => login.UserId); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Configurations/IdentityUserRoleConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNet.Identity.EntityFramework; 7 | using System.Data.Entity.ModelConfiguration; 8 | 9 | namespace ResourceMetadata.Data.Configurations 10 | { 11 | public class IdentityUserRoleConfiguration : EntityTypeConfiguration 12 | { 13 | public IdentityUserRoleConfiguration() 14 | { 15 | HasKey(role => new { role.RoleId, role.UserId }); 16 | //HasRequired(role => role.User).WithMany().HasForeignKey(role => role.UserId); 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Configurations/LocationConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Data.Entity.ModelConfiguration; 7 | using System.Data.Entity; 8 | using ResourceMetadata.Model; 9 | 10 | namespace ResourceMetadata.Data.Configurations 11 | { 12 | internal class LocationConfiguration : EntityTypeConfiguration 13 | { 14 | public LocationConfiguration() 15 | { 16 | //HasRequired(l => l.User).WithMany().HasForeignKey(l => l.UserId).WillCascadeOnDelete(true); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Configurations/ResourceActivityConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Data.Entity.ModelConfiguration; 7 | using ResourceMetadata.Model; 8 | 9 | namespace ResourceMetadata.Data.Configurations 10 | { 11 | internal class ResourceActivityConfiguration : EntityTypeConfiguration 12 | { 13 | public ResourceActivityConfiguration() 14 | { 15 | HasRequired(a => a.Resource).WithMany(r => r.Activities).HasForeignKey(a => a.ResourceId).WillCascadeOnDelete(true); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Configurations/ResourceConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Data.Entity.ModelConfiguration; 7 | using System.Data.Entity; 8 | using ResourceMetadata.Model; 9 | 10 | namespace ResourceMetadata.Data.Configurations 11 | { 12 | internal class ResourceConfiguration : EntityTypeConfiguration 13 | { 14 | public ResourceConfiguration() 15 | { 16 | HasRequired(r => r.Location).WithMany().HasForeignKey(r => r.LocationId).WillCascadeOnDelete(true); 17 | HasRequired(r => r.User).WithMany().HasForeignKey(r => r.UserId).WillCascadeOnDelete(true); 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Infrastructure/DatabaseFactory.cs: -------------------------------------------------------------------------------- 1 | using ResourceMetadata.Data; 2 | using ResourceMetadata.Model; 3 | 4 | namespace ResourceMetadata.Data.Infrastructure 5 | { 6 | public class DatabaseFactory : Disposable, IDatabaseFactory 7 | { 8 | private ResourceManagerEntities dataContext; 9 | public ResourceManagerEntities Get() 10 | { 11 | return dataContext ?? (dataContext = new ResourceManagerEntities()); 12 | } 13 | protected override void DisposeCore() 14 | { 15 | if (dataContext != null) 16 | dataContext.Dispose(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Infrastructure/Disposable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ResourceMetadata.Data.Infrastructure 4 | { 5 | public class Disposable : IDisposable 6 | { 7 | private bool isDisposed; 8 | 9 | ~Disposable() 10 | { 11 | Dispose(false); 12 | } 13 | 14 | public void Dispose() 15 | { 16 | Dispose(true); 17 | GC.SuppressFinalize(this); 18 | } 19 | private void Dispose(bool disposing) 20 | { 21 | if (!isDisposed && disposing) 22 | { 23 | DisposeCore(); 24 | } 25 | 26 | isDisposed = true; 27 | } 28 | 29 | protected virtual void DisposeCore() 30 | { 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Infrastructure/IDatabaseFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ResourceMetadata.Data; 3 | 4 | namespace ResourceMetadata.Data.Infrastructure 5 | { 6 | public interface IDatabaseFactory : IDisposable 7 | { 8 | ResourceManagerEntities Get(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Infrastructure/IRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data.Entity; 4 | using System.Linq; 5 | using System.Linq.Expressions; 6 | using System.Text; 7 | 8 | namespace ResourceMetadata.Data.Infrastructure 9 | { 10 | public interface IRepository where T : class 11 | { 12 | T GetById(int id); 13 | IEnumerable GetAll(); 14 | IEnumerable GetMany(Expression> where); 15 | T Add(T entity); 16 | 17 | void Update(T entity); 18 | 19 | void Delete(T entity); 20 | 21 | IQueryable Query(Expression> where); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Infrastructure/IUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ResourceMetadata.Data.Infrastructure 8 | { 9 | public interface IUnitOfWork 10 | { 11 | void SaveChanges(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Infrastructure/RepositoryBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Data.Entity; 7 | using System.Data; 8 | using System.Linq.Expressions; 9 | 10 | namespace ResourceMetadata.Data.Infrastructure 11 | { 12 | public abstract class RepositoryBase where T : class, new() 13 | { 14 | private ResourceManagerEntities dataContext; 15 | private readonly IDbSet dbset; 16 | protected RepositoryBase(IDatabaseFactory databaseFactory) 17 | { 18 | DatabaseFactory = databaseFactory; 19 | dbset = DataContext.Set(); 20 | } 21 | 22 | protected IDatabaseFactory DatabaseFactory 23 | { 24 | get; 25 | private set; 26 | } 27 | 28 | protected ResourceManagerEntities DataContext 29 | { 30 | get { return dataContext ?? (dataContext = DatabaseFactory.Get()); } 31 | } 32 | public virtual T Add(T entity) 33 | { 34 | dbset.Add(entity); 35 | return entity; 36 | } 37 | public virtual void Update(T entity) 38 | { 39 | dbset.Attach(entity); 40 | dataContext.Entry(entity).State = EntityState.Modified; 41 | } 42 | public virtual void Delete(T entity) 43 | { 44 | dbset.Remove(entity); 45 | } 46 | public virtual void Delete(Expression> where) 47 | { 48 | IEnumerable objects = dbset.Where(where).AsEnumerable(); 49 | foreach (T obj in objects) 50 | dbset.Remove(obj); 51 | } 52 | public virtual T GetById(int id) 53 | { 54 | return dbset.Find(id); 55 | } 56 | 57 | public virtual IEnumerable GetAll() 58 | { 59 | return dbset.ToList(); 60 | } 61 | public virtual IEnumerable GetMany(Expression> where) 62 | { 63 | return dbset.Where(where).ToList(); 64 | } 65 | 66 | public virtual IQueryable Query(Expression> where) 67 | { 68 | return dbset.Where(where); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Infrastructure/UnitOfWork.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ResourceMetadata.Data.Infrastructure 8 | { 9 | public class UnitOfWork : IUnitOfWork 10 | { 11 | private ResourceManagerEntities dbContext; 12 | private readonly IDatabaseFactory dbFactory; 13 | protected ResourceManagerEntities DbContext 14 | { 15 | get 16 | { 17 | return dbContext ?? dbFactory.Get(); 18 | } 19 | } 20 | 21 | public UnitOfWork(IDatabaseFactory dbFactory) 22 | { 23 | this.dbFactory = dbFactory; 24 | } 25 | 26 | public void SaveChanges() 27 | { 28 | DbContext.SaveChanges(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ResourceMetadata.Data")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ResourceMetadata.Data")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("11f65705-81f2-4032-9495-9ce87aae00db")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Repositories/LocationRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ResourceMetadata.Data.Infrastructure; 7 | using ResourceMetadata.Model; 8 | 9 | namespace ResourceMetadata.Data.Repositories 10 | { 11 | public class LocationRepository : RepositoryBase, ILocationRepository 12 | { 13 | public LocationRepository(IDatabaseFactory dbFactory): base(dbFactory) 14 | { 15 | 16 | } 17 | } 18 | 19 | public interface ILocationRepository : IRepository 20 | { 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Repositories/ResourceActivityRepository.cs: -------------------------------------------------------------------------------- 1 | using ResourceMetadata.Data.Infrastructure; 2 | using ResourceMetadata.Model; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Data.Entity; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace ResourceMetadata.Data.Repositories 11 | { 12 | public class ResourceActivityRepository : RepositoryBase, IResourceActivityRepository 13 | { 14 | public ResourceActivityRepository(IDatabaseFactory databaseFactory) 15 | : base(databaseFactory) 16 | { 17 | 18 | } 19 | 20 | 21 | } 22 | 23 | public interface IResourceActivityRepository : IRepository 24 | { 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Repositories/ResourceRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ResourceMetadata.Model; 7 | using ResourceMetadata.Data.Infrastructure; 8 | 9 | namespace ResourceMetadata.Data.Repositories 10 | { 11 | public class ResourceRepository : RepositoryBase, IResourceRepository 12 | { 13 | public ResourceRepository(IDatabaseFactory databaseFactory) 14 | : base(databaseFactory) 15 | { 16 | 17 | } 18 | } 19 | 20 | public interface IResourceRepository : IRepository 21 | { 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/Repositories/UserRepository.cs: -------------------------------------------------------------------------------- 1 | using ResourceMetadata.Data.Infrastructure; 2 | using ResourceMetadata.Model; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace ResourceMetadata.Data.Repositories 10 | { 11 | public class UserRepository : RepositoryBase, IUserRepository 12 | { 13 | 14 | public UserRepository(IDatabaseFactory dbFactory): base(dbFactory) 15 | { 16 | 17 | } 18 | } 19 | 20 | 21 | public interface IUserRepository : IRepository 22 | { 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/ResourceManagerContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ResourceMetadata.Model; 7 | using ResourceMetadata.Data.Configurations; 8 | using Microsoft.AspNet.Identity.EntityFramework; 9 | using System.Data.Entity.ModelConfiguration.Conventions; 10 | using System.Data.Entity; 11 | using Microsoft.AspNet.Identity; 12 | 13 | namespace ResourceMetadata.Data 14 | { 15 | public class ResourceManagerEntities : IdentityDbContext 16 | { 17 | public ResourceManagerEntities() 18 | : base("ResourceManagerEntities") 19 | { 20 | 21 | } 22 | 23 | public DbSet Resources { get; set; } 24 | public DbSet Activities { get; set; } 25 | public DbSet Locations { get; set; } 26 | 27 | //public DbSet Users { get; set; } 28 | 29 | protected override void OnModelCreating(DbModelBuilder modelBuilder) 30 | { 31 | modelBuilder.Configurations.Add(new LocationConfiguration()); 32 | modelBuilder.Configurations.Add(new ResourceConfiguration()); 33 | modelBuilder.Configurations.Add(new ResourceActivityConfiguration()); 34 | 35 | //Configurations Auto generated tables for IdentityDbContext. 36 | modelBuilder.Configurations.Add(new IdentityUserRoleConfiguration()); 37 | modelBuilder.Configurations.Add(new IdentityUserLoginConfiguration()); 38 | } 39 | } 40 | 41 | public class ResourceManagerDbInitializer : DropCreateDatabaseIfModelChanges 42 | { 43 | protected override void Seed(ResourceManagerEntities context) 44 | { 45 | try 46 | { 47 | var userManager = new UserManager(new UserStore(context)); 48 | userManager.UserValidator = new UserValidator(userManager) 49 | { 50 | AllowOnlyAlphanumericUserNames = false 51 | }; 52 | var roleManager = new RoleManager(new RoleStore(context)); 53 | 54 | if (!roleManager.RoleExists("Admin")) 55 | { 56 | roleManager.Create(new IdentityRole("Admin")); 57 | } 58 | 59 | if (!roleManager.RoleExists("Member")) 60 | { 61 | roleManager.Create(new IdentityRole("Member")); 62 | } 63 | 64 | var user = new ApplicationUser(); 65 | user.FirstName = "Admin"; 66 | user.LastName = "Marlabs"; 67 | user.Email = "admin@marlabs.com"; 68 | user.UserName = "admin@marlabs.com"; 69 | 70 | var userResult = userManager.Create(user, "Marlabs"); 71 | 72 | if (userResult.Succeeded) 73 | { 74 | //var user = userManager.FindByName("admin@marlabs.com"); 75 | userManager.AddToRole(user.Id, "Admin"); 76 | } 77 | } 78 | catch (Exception ex) 79 | { 80 | 81 | throw ex; 82 | } 83 | 84 | //context.Users.Add(new ApplicationUser { Email = "abc@yahoo.com", Password = "Marlabs" }); 85 | //context.SaveChanges(); 86 | } 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Data/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Model/Location.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ResourceMetadata.Model 8 | { 9 | public class Location 10 | { 11 | public int Id { get; set; } 12 | public string Name { get; set; } 13 | 14 | public string Description { get; set; } 15 | 16 | public DateTime CreatedOn { get; set; } 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Model/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ResourceMetadata.Model")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ResourceMetadata.Model")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c9586cd4-cada-4622-8678-a90ef8cb2b27")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Model/Resource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ResourceMetadata.Model 8 | { 9 | public class Resource 10 | { 11 | public Resource() 12 | { 13 | this.Activities = new HashSet(); 14 | } 15 | 16 | public int Id { get; set; } 17 | public string Name { get; set; } 18 | public string Description { get; set; } 19 | 20 | public int LocationId { get; set; } 21 | public virtual Location Location { get; set; } 22 | 23 | public string Path { get; set; } 24 | public int Priority { get; set; } 25 | public DateTime CreatedOn { get; set; } 26 | public bool IsShared { get; set; } 27 | public virtual ICollection Activities { get; set; } 28 | 29 | public string UserId { get; set; } 30 | public ApplicationUser User { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Model/ResourceActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ResourceMetadata.Model 8 | { 9 | public class ResourceActivity 10 | { 11 | public int Id { get; set; } 12 | public string Title { get; set; } 13 | public int ResourceId { get; set; } 14 | public virtual Resource Resource { get; set; } 15 | public string Notes { get; set; } 16 | public DateTime ActivityDate { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Model/ResourceMetadata.Model.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {673CF0EE-E1DB-4FB5-934B-80830B50B3A0} 8 | Library 9 | Properties 10 | ResourceMetadata.Model 11 | ResourceMetadata.Model 12 | v4.5.1 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | False 35 | ..\packages\Microsoft.AspNet.Identity.Core.1.0.0\lib\net45\Microsoft.AspNet.Identity.Core.dll 36 | 37 | 38 | False 39 | ..\packages\Microsoft.AspNet.Identity.EntityFramework.1.0.0\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 64 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Model/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNet.Identity; 7 | using Microsoft.AspNet.Identity.EntityFramework; 8 | 9 | namespace ResourceMetadata.Model 10 | { 11 | public class ApplicationUser : IdentityUser 12 | { 13 | public string FirstName { get; set; } 14 | public string LastName { get; set; } 15 | public string Email { get; set; } 16 | //public string Password { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Service/LocationService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ResourceMetadata.Data.Infrastructure; 7 | using ResourceMetadata.Model; 8 | using ResourceMetadata.Data.Repositories; 9 | 10 | namespace ResourceMetadata.Service 11 | { 12 | public class LocationService : ILocationService 13 | { 14 | private ILocationRepository repository; 15 | private IResourceRepository resourceRepository; 16 | private IUnitOfWork unitOfWork; 17 | 18 | public LocationService(ILocationRepository repository, IResourceRepository resourceRepository, IUnitOfWork unitOfWork) 19 | { 20 | this.repository = repository; 21 | this.resourceRepository = resourceRepository; 22 | this.unitOfWork = unitOfWork; 23 | } 24 | 25 | public IEnumerable GetLocations() 26 | { 27 | return repository.GetAll(); 28 | } 29 | 30 | public Location AddLocation(Location location) 31 | { 32 | repository.Add(location); 33 | SaveChanges(); 34 | return location; 35 | } 36 | 37 | public Location GetLocationById(int id) 38 | { 39 | return repository.GetById(id); 40 | } 41 | 42 | public Location UpdateLoaction(Location location) 43 | { 44 | repository.Update(location); 45 | SaveChanges(); 46 | return location; 47 | } 48 | 49 | public void DeleteLocation(int id) 50 | { 51 | var location = repository.GetById(id); 52 | var resources = resourceRepository.GetMany(r => r.LocationId == id); 53 | 54 | foreach (var item in resources) 55 | { 56 | resourceRepository.Delete(item); 57 | } 58 | repository.Delete(location); 59 | SaveChanges(); 60 | } 61 | 62 | public void SaveChanges() 63 | { 64 | unitOfWork.SaveChanges(); 65 | } 66 | } 67 | 68 | public interface ILocationService 69 | { 70 | IEnumerable GetLocations(); 71 | Location AddLocation(Location location); 72 | Location GetLocationById(int id); 73 | Location UpdateLoaction(Location location); 74 | void DeleteLocation(int locationId); 75 | 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Service/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ResourceMetadata.Service")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ResourceMetadata.Service")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f865a22b-9e20-4156-861d-7ebd7c338f08")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Service/ResourceActivityService.cs: -------------------------------------------------------------------------------- 1 | using ResourceMetadata.Data.Infrastructure; 2 | using ResourceMetadata.Data.Repositories; 3 | using ResourceMetadata.Model; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace ResourceMetadata.Service 11 | { 12 | public class ResourceActivityService : IResourceActivityService 13 | { 14 | private readonly IUnitOfWork unitOfWork; 15 | private readonly IResourceActivityRepository activityRepository; 16 | public ResourceActivityService(IUnitOfWork unitOfWork, IResourceActivityRepository activityRepository) 17 | { 18 | this.unitOfWork = unitOfWork; 19 | this.activityRepository = activityRepository; 20 | } 21 | 22 | public ResourceActivity AddResourceActivity(ResourceActivity activity) 23 | { 24 | activityRepository.Add(activity); 25 | SaveChanges(); 26 | return activity; 27 | } 28 | 29 | public void DeleteActivity(int id) 30 | { 31 | var activity = activityRepository.GetById(id); 32 | activityRepository.Delete(activity); 33 | SaveChanges(); 34 | } 35 | public IEnumerable GetActivitiesByResourceId(int resourceId) 36 | { 37 | var activities = activityRepository.GetMany(act => act.ResourceId == resourceId); 38 | return activities; 39 | } 40 | public void SaveChanges() 41 | { 42 | unitOfWork.SaveChanges(); 43 | } 44 | } 45 | 46 | public interface IResourceActivityService 47 | { 48 | ResourceActivity AddResourceActivity(ResourceActivity activity); 49 | void DeleteActivity(int id); 50 | IEnumerable GetActivitiesByResourceId(int resourceId); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Service/UserService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ResourceMetadata.Data.Repositories; 7 | using ResourceMetadata.Data.Infrastructure; 8 | using ResourceMetadata.Model; 9 | 10 | namespace ResourceMetadata.Service 11 | { 12 | public class UserService : IUserService 13 | { 14 | private readonly IUserRepository userRepository; 15 | private readonly IUnitOfWork unitOfWork; 16 | public UserService(IUserRepository userRepository,IUnitOfWork unitOfWork) 17 | { 18 | this.userRepository = userRepository; 19 | this.unitOfWork = unitOfWork; 20 | } 21 | 22 | 23 | public ApplicationUser RegisterUser(ApplicationUser user) 24 | { 25 | user =userRepository.Add(user); 26 | SaveChanges(); 27 | return user; 28 | } 29 | 30 | public ApplicationUser GetUserByEmail(string email) 31 | { 32 | var user = userRepository.GetMany(u => u.Email == email).FirstOrDefault(); 33 | return user; 34 | } 35 | 36 | public void SaveChanges() 37 | { 38 | unitOfWork.SaveChanges(); 39 | } 40 | 41 | } 42 | 43 | public interface IUserService 44 | { 45 | ApplicationUser GetUserByEmail(string email); 46 | ApplicationUser RegisterUser(ApplicationUser user); 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Service/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/basic.icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/basic.icons.eot -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/basic.icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/basic.icons.ttf -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/basic.icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/basic.icons.woff -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.eot -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.otf -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.ttf -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.woff -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/jquery.ui.accordion.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.8.20 - 2012-04-30 2 | * https://github.com/jquery/jquery-ui 3 | * Includes: jquery.ui.accordion.css 4 | * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */ 5 | .ui-accordion{width:100%}.ui-accordion .ui-accordion-header{cursor:pointer;position:relative;margin-top:1px;zoom:1}.ui-accordion .ui-accordion-li-fix{display:inline}.ui-accordion .ui-accordion-header-active{border-bottom:0!important}.ui-accordion .ui-accordion-header a{display:block;font-size:1em;padding:.5em .5em .5em .7em}.ui-accordion-icons .ui-accordion-header a{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;margin-top:-2px;position:relative;top:1px;margin-bottom:2px;overflow:auto;display:none;zoom:1}.ui-accordion .ui-accordion-content-active{display:block} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/jquery.ui.autocomplete.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.8.20 - 2012-04-30 2 | * https://github.com/jquery/jquery-ui 3 | * Includes: jquery.ui.autocomplete.css 4 | * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */ 5 | .ui-autocomplete{position:absolute;cursor:default}* html .ui-autocomplete{width:1px}.ui-menu{list-style:none;padding:2px;margin:0;display:block;float:left}.ui-menu .ui-menu{margin-top:-3px}.ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;float:left;clear:left;width:100%}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:.2em .4em;line-height:1.5;zoom:1}.ui-menu .ui-menu-item a.ui-state-hover,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/jquery.ui.button.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.8.20 - 2012-04-30 2 | * https://github.com/jquery/jquery-ui 3 | * Includes: jquery.ui.button.css 4 | * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */ 5 | .ui-button{display:inline-block;position:relative;padding:0;margin-right:.1em;text-decoration:none!important;cursor:pointer;text-align:center;zoom:1;overflow:visible}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:1.4}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}button.ui-button::-moz-focus-inner{border:0;padding:0} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/jquery.ui.core.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.8.20 - 2012-04-30 2 | * https://github.com/jquery/jquery-ui 3 | * Includes: jquery.ui.core.css 4 | * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */ 5 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px);clip:rect(1px,1px,1px,1px)}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{zoom:1}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/jquery.ui.datepicker.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.8.20 - 2012-04-30 2 | * https://github.com/jquery/jquery-ui 3 | * Includes: jquery.ui.datepicker.css 4 | * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */ 5 | .ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0em}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:right}.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-cover{display:none;display position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/jquery.ui.dialog.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.8.20 - 2012-04-30 2 | * https://github.com/jquery/jquery-ui 3 | * Includes: jquery.ui.dialog.css 4 | * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */ 5 | .ui-dialog{position:absolute;padding:.2em;width:300px;overflow:hidden}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 16px .1em 0}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:19px;margin:-10px 0 0 0;padding:1px;height:18px}.ui-dialog .ui-dialog-titlebar-close span{display:block;margin:1px}.ui-dialog .ui-dialog-titlebar-close:hover,.ui-dialog .ui-dialog-titlebar-close:focus{padding:0}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto;zoom:1}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin:.5em 0 0 0;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px}.ui-draggable .ui-dialog-titlebar{cursor:move} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/jquery.ui.progressbar.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.8.20 - 2012-04-30 2 | * https://github.com/jquery/jquery-ui 3 | * Includes: jquery.ui.progressbar.css 4 | * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */ 5 | .ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/jquery.ui.resizable.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.8.20 - 2012-04-30 2 | * https://github.com/jquery/jquery-ui 3 | * Includes: jquery.ui.resizable.css 4 | * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */ 5 | .ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/jquery.ui.selectable.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.8.20 - 2012-04-30 2 | * https://github.com/jquery/jquery-ui 3 | * Includes: jquery.ui.selectable.css 4 | * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */ 5 | .ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/jquery.ui.slider.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.8.20 - 2012-04-30 2 | * https://github.com/jquery/jquery-ui 3 | * Includes: jquery.ui.slider.css 4 | * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */ 5 | .ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/base/minified/jquery.ui.tabs.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.8.20 - 2012-04-30 2 | * https://github.com/jquery/jquery-ui 3 | * Includes: jquery.ui.tabs.css 4 | * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */ 5 | .ui-tabs{position:relative;padding:.2em;zoom:1}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:1px;margin:0 .2em 1px 0;border-bottom:0!important;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-selected{margin-bottom:0;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-selected a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-state-processing a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tabs .ui-tabs-hide{display:none!important} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/basic.icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/basic.icons.eot -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/basic.icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/basic.icons.ttf -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/basic.icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/basic.icons.woff -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/icons.eot -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/icons.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/icons.otf -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/icons.ttf -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/fonts/icons.woff -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-large-inverted.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-large-inverted.gif -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-large.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-large.gif -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-medium-inverted.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-medium-inverted.gif -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-medium.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-medium.gif -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-mini-inverted.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-mini-inverted.gif -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-mini.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-mini.gif -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-small-inverted.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-small-inverted.gif -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/images/loader-small.gif -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/jasmine-2.0.0/jasmine.min.css: -------------------------------------------------------------------------------- 1 | body{background-color:#eee;padding:0;margin:5px;overflow-y:scroll}.html-reporter{font-size:11px;font-family:Monaco,"Lucida Console",monospace;line-height:14px;color:#333}.html-reporter a{text-decoration:none}.html-reporter a:hover{text-decoration:underline}.html-reporter h1,.html-reporter h2,.html-reporter h3,.html-reporter h4,.html-reporter h5,.html-reporter h6,.html-reporter p{margin:0;line-height:14px}.html-reporter .alert .bar,.html-reporter .banner,.html-reporter .result-message,.html-reporter .spec .description,.html-reporter .spec-detail .description,.html-reporter .stack-trace,.html-reporter .summary,.html-reporter .symbol-summary{padding-left:9px;padding-right:9px}.html-reporter .banner .version{margin-left:14px}.html-reporter #jasmine_content{position:fixed;right:100%}.html-reporter .version{color:#aaa}.html-reporter .banner{margin-top:14px}.html-reporter .duration{color:#aaa;float:right}.html-reporter .symbol-summary{overflow:hidden;*zoom:1;margin:14px 0}.html-reporter .symbol-summary li{display:inline-block;height:8px;width:14px;font-size:16px}.html-reporter .symbol-summary li.passed{font-size:14px}.html-reporter .symbol-summary li.passed:before{color:#5e7d00;content:"\02022"}.html-reporter .symbol-summary li.failed{line-height:9px}.html-reporter .symbol-summary li.failed:before{color:#b03911;content:"x";font-weight:700;margin-left:-1px}.html-reporter .symbol-summary li.disabled{font-size:14px}.html-reporter .symbol-summary li.disabled:before{color:#bababa;content:"\02022"}.html-reporter .symbol-summary li.pending{line-height:17px}.html-reporter .symbol-summary li.pending:before{color:#ba9d37;content:"*"}.html-reporter .exceptions{color:#fff;float:right;margin-top:5px;margin-right:5px}.html-reporter .bar{line-height:28px;font-size:14px;display:block;color:#eee}.html-reporter .bar.failed{background-color:#b03911}.html-reporter .bar.passed{background-color:#a6b779}.html-reporter .bar.skipped{background-color:#bababa}.html-reporter .bar.menu{background-color:#fff;color:#aaa}.html-reporter .bar.menu a{color:#333}.html-reporter .bar a{color:#fff}.html-reporter.failure-list .bar.menu.spec-list,.html-reporter.failure-list .summary,.html-reporter.spec-list .bar.menu.failure-list,.html-reporter.spec-list .results .failures{display:none}.html-reporter .running-alert{background-color:#666}.html-reporter .results{margin-top:14px}.html-reporter.showDetails .summaryMenuItem{font-weight:400;text-decoration:inherit}.html-reporter.showDetails .summaryMenuItem:hover{text-decoration:underline}.html-reporter.showDetails .detailsMenuItem{font-weight:700;text-decoration:underline}.html-reporter.showDetails .summary{display:none}.html-reporter.showDetails #details{display:block}.html-reporter .summaryMenuItem{font-weight:700;text-decoration:underline}.html-reporter .summary{margin-top:14px}.html-reporter .summary ul{list-style-type:none;margin-left:14px;padding-top:0;padding-left:0}.html-reporter .summary ul.suite{margin-top:7px;margin-bottom:7px}.html-reporter .summary li.passed a{color:#5e7d00}.html-reporter .summary li.failed a{color:#b03911}.html-reporter .summary li.pending a{color:#ba9d37}.html-reporter .description+.suite{margin-top:0}.html-reporter .suite{margin-top:14px}.html-reporter .suite a{color:#333}.html-reporter .failures .spec-detail{margin-bottom:28px}.html-reporter .failures .spec-detail .description{background-color:#b03911}.html-reporter .failures .spec-detail .description a{color:#fff}.html-reporter .result-message{padding-top:14px;color:#333;white-space:pre}.html-reporter .result-message span.result{display:block}.html-reporter .stack-trace{margin:5px 0 0;max-height:224px;overflow:auto;line-height:18px;color:#666;border:1px solid #ddd;background:#fff;white-space:pre} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/ng-table/ng-table.css: -------------------------------------------------------------------------------- 1 | .ng-table th { 2 | text-align: center; 3 | -webkit-touch-callout: none; 4 | -webkit-user-select: none; 5 | -khtml-user-select: none; 6 | -moz-user-select: none; 7 | -ms-user-select: none; 8 | user-select: none; 9 | } 10 | .ng-table th.sortable { 11 | cursor: pointer; 12 | } 13 | .ng-table th.sortable div { 14 | padding-right: 18px; 15 | position: relative; 16 | } 17 | .ng-table th.sortable div:after, 18 | .ng-table th.sortable div:before { 19 | content: ""; 20 | border-width: 0 4px 4px; 21 | border-style: solid; 22 | border-color: #000 transparent; 23 | visibility: visible; 24 | right: 8px; 25 | top: 50%; 26 | position: absolute; 27 | opacity: .3; 28 | margin-top: -4px; 29 | } 30 | .ng-table th.sortable div:before { 31 | margin-top: 2px; 32 | border-bottom: none; 33 | border-left: 4px solid transparent; 34 | border-right: 4px solid transparent; 35 | border-top: 4px solid #000; 36 | } 37 | .ng-table th.sortable div:hover:after, 38 | .ng-table th.sortable div:hover:before { 39 | opacity: 1; 40 | visibility: visible; 41 | } 42 | .ng-table th.sortable.sort-desc, 43 | .ng-table th.sortable.sort-asc { 44 | background-color: rgba(141, 192, 219, 0.25); 45 | text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); 46 | } 47 | .ng-table th.sortable.sort-desc div:after, 48 | .ng-table th.sortable.sort-asc div:after { 49 | margin-top: -2px; 50 | } 51 | .ng-table th.sortable.sort-desc div:before, 52 | .ng-table th.sortable.sort-asc div:before { 53 | visibility: hidden; 54 | } 55 | .ng-table th.sortable.sort-asc div:after, 56 | .ng-table th.sortable.sort-asc div:hover:after { 57 | visibility: visible; 58 | filter: alpha(opacity=60); 59 | -khtml-opacity: 0.6; 60 | -moz-opacity: 0.6; 61 | opacity: 0.6; 62 | } 63 | .ng-table th.sortable.sort-desc div:after { 64 | border-bottom: none; 65 | border-left: 4px solid transparent; 66 | border-right: 4px solid transparent; 67 | border-top: 4px solid #000; 68 | visibility: visible; 69 | -webkit-box-shadow: none; 70 | -moz-box-shadow: none; 71 | box-shadow: none; 72 | filter: alpha(opacity=60); 73 | -khtml-opacity: 0.6; 74 | -moz-opacity: 0.6; 75 | opacity: 0.6; 76 | } 77 | .ng-table th.filter .input-filter { 78 | margin: 0; 79 | display: block; 80 | width: 100%; 81 | min-height: 30px; 82 | -webkit-box-sizing: border-box; 83 | -moz-box-sizing: border-box; 84 | box-sizing: border-box; 85 | } 86 | .ng-table + .pagination { 87 | margin-top: 0; 88 | } 89 | @media only screen and (max-width: 800px) { 90 | .ng-table-responsive { 91 | border-bottom: 1px solid #999999; 92 | } 93 | .ng-table-responsive tr { 94 | border-top: 1px solid #999999; 95 | border-left: 1px solid #999999; 96 | border-right: 1px solid #999999; 97 | } 98 | .ng-table-responsive td:before { 99 | position: absolute; 100 | padding: 8px; 101 | left: 0; 102 | top: 0; 103 | width: 50%; 104 | white-space: nowrap; 105 | text-align: left; 106 | font-weight: bold; 107 | } 108 | .ng-table-responsive thead tr th { 109 | text-align: left; 110 | } 111 | .ng-table-responsive thead tr.ng-table-filters th { 112 | padding: 0; 113 | } 114 | .ng-table-responsive thead tr.ng-table-filters th form > div { 115 | padding: 8px; 116 | } 117 | .ng-table-responsive td { 118 | border: none; 119 | border-bottom: 1px solid #eeeeee; 120 | position: relative; 121 | padding-left: 50%; 122 | white-space: normal; 123 | text-align: left; 124 | } 125 | .ng-table-responsive td:before { 126 | content: attr(data-title-text); 127 | } 128 | .ng-table-responsive, 129 | .ng-table-responsive thead, 130 | .ng-table-responsive tbody, 131 | .ng-table-responsive th, 132 | .ng-table-responsive td, 133 | .ng-table-responsive tr { 134 | display: block; 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/ng-table/ng-table.min.css: -------------------------------------------------------------------------------- 1 | .ng-table th{text-align:center;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ng-table th.sortable{cursor:pointer}.ng-table th.sortable div{padding-right:18px;position:relative}.ng-table th.sortable div:after,.ng-table th.sortable div:before{content:"";border-width:0 4px 4px;border-style:solid;border-color:#000 transparent;visibility:visible;right:8px;top:50%;position:absolute;opacity:.3;margin-top:-4px}.ng-table th.sortable div:before{margin-top:2px;border-bottom:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000}.ng-table th.sortable div:hover:after,.ng-table th.sortable div:hover:before{opacity:1;visibility:visible}.ng-table th.sortable.sort-asc,.ng-table th.sortable.sort-desc{background-color:rgba(141,192,219,.25);text-shadow:0 1px 1px rgba(255,255,255,.75)}.ng-table th.sortable.sort-asc div:after,.ng-table th.sortable.sort-desc div:after{margin-top:-2px}.ng-table th.sortable.sort-asc div:before,.ng-table th.sortable.sort-desc div:before{visibility:hidden}.ng-table th.sortable.sort-asc div:after,.ng-table th.sortable.sort-asc div:hover:after{visibility:visible;filter:alpha(opacity=60);-khtml-opacity:.6;-moz-opacity:.6;opacity:.6}.ng-table th.sortable.sort-desc div:after{border-bottom:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000;visibility:visible;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:alpha(opacity=60);-khtml-opacity:.6;-moz-opacity:.6;opacity:.6}.ng-table th.filter .input-filter{margin:0;display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-table+.pagination{margin-top:0}@media only screen and (max-width:800px){.ng-table-responsive{border-bottom:1px solid #999}.ng-table-responsive tr{border-top:1px solid #999;border-left:1px solid #999;border-right:1px solid #999}.ng-table-responsive td:before{position:absolute;padding:8px;left:0;top:0;width:50%;white-space:nowrap;text-align:left;font-weight:700}.ng-table-responsive thead tr th{text-align:left}.ng-table-responsive thead tr.ng-table-filters th{padding:0}.ng-table-responsive thead tr.ng-table-filters th form>div{padding:8px}.ng-table-responsive td{border:0;border-bottom:1px solid #eee;position:relative;padding-left:50%;white-space:normal;text-align:left}.ng-table-responsive td:before{content:attr(data-title-text)}.ng-table-responsive,.ng-table-responsive tbody,.ng-table-responsive td,.ng-table-responsive th,.ng-table-responsive thead,.ng-table-responsive tr{display:block}} -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/select2/select2-spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/select2/select2-spinner.gif -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/select2/select2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/select2/select2.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/loading.gif -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarlabsInc/webapi-angularjs-spa/28bea19b3267aeed1768920b0d77be329b0278a5/source/ResourceMetadata/ResourceMetadata.Web/Content/themes/smoothness/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Resource Manager 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 |
17 |
18 |
19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ResourceMetadata.Web")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ResourceMetadata.Web")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("303e17b1-cb9e-4a63-97f9-d0411cbdf931")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.2.0.0")] 35 | [assembly: AssemblyFileVersion("1.2.0.0")] 36 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/app.js: -------------------------------------------------------------------------------- 1 | window.app = angular.module('resourceManagerApp', ['ui.select2', 'ngTable', 'ngRoute', 'ngResource', 'ngAnimate', 'custom-utilities']); 2 | app.config(['$routeProvider', '$locationProvider', '$httpProvider', '$provide', function ($routeProvider, $locationProvider, $httpProvider, $provide) { 3 | $httpProvider.defaults.useXDomain = true; 4 | delete $httpProvider.defaults.headers.common['X-Requested-With']; 5 | $httpProvider.defaults.useXDomain = true; 6 | $locationProvider.html5Mode(true); 7 | $routeProvider 8 | .when('/Login', { templateUrl: '/Scripts/app/views/shared/Login.html' }) 9 | .when('/Register', { templateUrl: '/Scripts/app/views/shared/Register.html' }) 10 | .when('/Locations', { templateUrl: '/Scripts/app/views/locations/Locations.html', controller: 'LocationsCtrl' }) 11 | .when('/About', { templateUrl: '/Scripts/app/views/about/About.html' }) 12 | .when('/Locations/Add', { templateUrl: '/Scripts/app/views/locations/Add.html', controller: 'LocationCtrl' }) 13 | .when('/Locations/Edit/:locationId', { templateUrl: '/Scripts/app/views/locations/Edit.html', controller: 'LocationCtrl' }) 14 | .when('/Resources', { templateUrl: '/Scripts/app/views/resources/Resources-ng-table.html', controller: 'ResourcesCtrl' }) 15 | .when('/Resources/Add', { templateUrl: '/Scripts/app/views/resources/Add.html', controller: 'ResourceCtrl' }) 16 | .when('/Resources/Edit/:resourceId', { templateUrl: '/Scripts/app/views/resources/Edit.html', controller: 'ResourceEditCtrl' }) 17 | .when('/Resources/:resourceId', { templateUrl: '/Scripts/app/views/resources/Details.html', controller: 'ResourceCtrl' }) 18 | .when('/Activities/Add', { templateUrl: '/Scripts/app/views/activities/Add.html', controller: 'ActivityAddCtrl' }) 19 | .when('/Home', { templateUrl: '/Scripts/app/views/home/Home.html', controller: 'HomeCtrl' }) 20 | .when('/Error', { templateUrl: '/Scripts/app/views/shared/Error.html' }) 21 | .otherwise({ 22 | redirectTo: '/Login' 23 | }); 24 | 25 | $httpProvider.interceptors.push('authorizationInterceptor'); 26 | $httpProvider.interceptors.push('httpInterceptor'); 27 | }]).factory("userProfileSvc", function () { 28 | return {}; 29 | }); 30 | 31 | window.utilities = angular.module("custom-utilities", []); 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/controllers/activities/activitiescontroller.js: -------------------------------------------------------------------------------- 1 | app.controller('ActivitiesCtrl', ['$scope', '$location', 'activitySvc', function ($scope, $location, activitySvc) { 2 | $scope.deleteActivity = function (activity) { 3 | activitySvc.deleteActivity(activity) 4 | .then(function (data) { 5 | $scope.activities = activitySvc.getActivites(activity.ResourceId); 6 | }); 7 | }; 8 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/controllers/activities/activityaddcontroller.js: -------------------------------------------------------------------------------- 1 | app.controller('ActivityAddCtrl', ['$scope', '$location', '$routeParams', 'activitySvc', function ($scope, $location, $routeParams, activitySvc) { 2 | $scope.activity = { ResourceId: $routeParams.resourceId }; 3 | $scope.addActivity = function (activity, date) { 4 | activitySvc.addActivity(activity) 5 | .then(function (addedActivity) { 6 | $location.url('/Resources/' + addedActivity.ResourceId); 7 | }); 8 | }; 9 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/controllers/home/homecontroller.js: -------------------------------------------------------------------------------- 1 | app.controller('HomeCtrl', ['$scope', 'resourceSvc', function ($scope, resourceSvc) { 2 | init(); 3 | function init() { 4 | loadResources(); 5 | } 6 | function loadResources() { 7 | $scope.resources = resourceSvc.getTopFiveResources(); 8 | } 9 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/controllers/locations/locationcontroller.js: -------------------------------------------------------------------------------- 1 | app.controller('LocationCtrl', ['$scope', '$location', '$routeParams', 'locationSvc', 2 | function ($scope, $location, $routeParams, locationSvc) { 3 | $scope.addLocation = function (location) { 4 | locationSvc.addLocation(location).$promise 5 | .then(function (data) { 6 | $location.url('/Locations'); 7 | }); 8 | }; 9 | $scope.editLocation = function (location) { 10 | locationSvc.editLocation(location).$promise.then(function (data) { 11 | $location.url('/Locations'); 12 | }); 13 | }; 14 | 15 | init(); 16 | function init() { 17 | if ($routeParams.locationId > 0) { 18 | $scope.location = locationSvc.getLocation($routeParams.locationId); 19 | } 20 | } 21 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/controllers/locations/locationscontroller.js: -------------------------------------------------------------------------------- 1 |  2 | app.controller('LocationsCtrl', ['$scope', 'ngTableParams', 'locationSvc', 3 | function ($scope, ngTableParams, locationSvc) { 4 | $scope.tableParams = new ngTableParams({ 5 | total: 1, 6 | page: 1 7 | }, { 8 | counts: [], 9 | getData: function ($defer, params) { 10 | locationSvc.getLocations().$promise.then(function (locations) { 11 | $defer.resolve(locations); 12 | }); 13 | } 14 | }); 15 | 16 | $scope.deleteLocation = function (locationId) { 17 | locationSvc.deleteLocation(locationId).$promise 18 | .then(function (data, responseHeaders) { 19 | $scope.tableParams.reload(); 20 | }); 21 | }; 22 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/controllers/resources/resourcecontroller.js: -------------------------------------------------------------------------------- 1 | app.controller('ResourceCtrl', ['$scope', '$routeParams', '$location', 'resourceSvc','locationSvc', function ($scope, $routeParams, $location, resourceSvc, locationSvc) { 2 | $scope.resource = { hasActivites: false }; 3 | 4 | $scope.addResource = function (resource) { 5 | resourceSvc.addResource(resource).$promise 6 | .then(function (data) { 7 | $location.url('/Resources'); 8 | }); 9 | }; 10 | 11 | init(); 12 | 13 | function init() { 14 | if ($routeParams.resourceId > 0) { 15 | $scope.resource = resourceSvc.getResource($routeParams.resourceId); 16 | } 17 | else { 18 | $scope.locations = locationSvc.getLocations(); 19 | } 20 | } 21 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/controllers/resources/resourceeditcontroller.js: -------------------------------------------------------------------------------- 1 | app.controller('ResourceEditCtrl', ['$scope', '$location', '$routeParams', 'resourceSvc', 2 | function ($scope, $location, $routeParams, resourceSvc) { 3 | init(); 4 | $scope.editResource = function (resource) { 5 | resourceSvc.editResource(resource).$promise.then(function (data) { 6 | $location.url('/Resources'); 7 | }); 8 | }; 9 | 10 | function priorityValues() { 11 | var priorities = []; 12 | for (var i = 1; i <= 10; i++) { 13 | priorities.push({ priority: i }); 14 | } 15 | 16 | return priorities; 17 | } 18 | 19 | function init() { 20 | resourceSvc.createResourceEditFormModel($routeParams.resourceId) 21 | .then(function (data) { 22 | $scope.resource = data[0]; 23 | $scope.locations = data[1]; 24 | //hack for issue with select2 hard coded values pre-selection. 25 | $scope.priorities = priorityValues(); 26 | }); 27 | } 28 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/controllers/resources/resourcescontroller.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | app.controller('ResourcesCtrl', ['$scope', 'resourceSvc', 'ngTableParams', function ($scope, resourceSvc, ngTableParams) { 3 | var fetchPagedStruct = function (pagedStruct) { 4 | var sorting = pagedStruct.sorting(); 5 | var sortField; 6 | var sortOrder; 7 | if (sorting) { 8 | for (var prop in sorting) { 9 | sortField = prop; 10 | sortOrder = sorting[prop]; 11 | break; 12 | } 13 | } 14 | 15 | return { 16 | page: pagedStruct.page(), 17 | count: pagedStruct.count(), 18 | sortField: sortField, 19 | sortOrder: sortOrder 20 | } 21 | }; 22 | 23 | $scope.tableParams = new ngTableParams({ 24 | page: 1, // show first page 25 | count: 10, 26 | sorting: { 27 | Name: 'asc' 28 | } 29 | }, { 30 | counts: [], 31 | total: 0, 32 | getData: function ($defer, params) { 33 | resourceSvc.getPagedResources(fetchPagedStruct(params)) 34 | .$promise.then(function (data) { 35 | params.total(data.TotalCount);// update table params 36 | $defer.resolve(data.Data);// set new data 37 | }).catch(function (error) { 38 | console.log(error); 39 | }); 40 | } 41 | }); 42 | 43 | $scope.deleteResource = function (resourceId) { 44 | resourceSvc.deleteResource(resourceId).$promise 45 | .then(function (data) { 46 | if ($scope.tableParams.page() !== 1 && $scope.tableParams.data.length === 1) { 47 | $scope.tableParams.page(1); 48 | } 49 | $scope.tableParams.reload(); 50 | }); 51 | }; 52 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/controllers/shared/resourcemngrcontroller.js: -------------------------------------------------------------------------------- 1 | app.controller('ResourceMngrCtrl', ['$scope', '$location', 'resourceMngrSvc', function ($scope, $location, resourceMngrSvc) { 2 | $scope.login = function (userLogin) { 3 | $scope.errorMessage = ''; 4 | resourceMngrSvc.login(userLogin).$promise 5 | .then(function (data) { 6 | $scope.$emit('logOn'); 7 | $location.url('/Home'); 8 | }).catch(function (errorResponse) { 9 | if (errorResponse.status == 404) { 10 | $scope.errorMessage = errorResponse.data; 11 | } 12 | if (errorResponse.status === 400) { 13 | $scope.errorMessage = "Invalid Email/Password"; 14 | } 15 | else { 16 | $scope.errorMessage = "An error occured while performing this action. Please try after some time."; 17 | } 18 | }); 19 | }; 20 | 21 | $scope.register = function (userRegistration) { 22 | if (userRegistration.password !== userRegistration.confirmPassword) { 23 | $scope.errorMessage = "Passwords do not match"; 24 | return; 25 | } 26 | 27 | $scope.errorMessage = ''; 28 | 29 | resourceMngrSvc.registerUser(userRegistration).$promise 30 | .then(function (data) { 31 | return resourceMngrSvc.login({ Email: userRegistration.email, Password: userRegistration.password }).$promise.then(function (data) { 32 | $scope.$emit('logOn'); 33 | $location.url('/Home'); 34 | }); 35 | }).catch(function (error) { 36 | if (error.status === 400) { 37 | $scope.errorMessage = "Email already exists."; 38 | } 39 | else { 40 | $scope.errorMessage = "An error occured while performing this action. Please try after some time."; 41 | } 42 | }); 43 | }; 44 | 45 | $scope.logOff = function () { 46 | resourceMngrSvc.logOffUser(); 47 | $scope.$emit('logOff'); 48 | $location.url('/Login'); 49 | }; 50 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/directives/activities/ResourceActivityList.html: -------------------------------------------------------------------------------- 1 | 
2 |
Activities
3 |
4 |
5 | You had an activity 6 | {{activity.Title}} 7 | against this Resource on {{activity.ActivityDateString}} 8 |
9 |
10 |
11 | 14 | 15 | 24 |
25 |
26 |
27 | You don't have any activity against this resource 28 |
29 |
30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/directives/activities/resourceactivitylist.js: -------------------------------------------------------------------------------- 1 | app.directive('resourceActivityList', function () { 2 | return { 3 | restrict: 'E', 4 | templateUrl: '/Scripts/app/directives/activities/ResourceActivityList.html', 5 | scope: { 6 | activities: "=activities" 7 | } 8 | }; 9 | 10 | }); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/directives/shared/confirmmodal.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | utilities.directive("cstConfirmModal", [function () { 3 | return { 4 | restrict: "A", 5 | scope: { 6 | approve: '&onApprove', 7 | deny: '&onDeny', 8 | closable: '=closable', 9 | id: '@modalId', 10 | title: '@title', 11 | message: '@message' 12 | }, 13 | templateUrl: "/Scripts/app/partials/confirm-modal.html", 14 | link: function (scope, element, attrs, ngModelCtrl) { 15 | 16 | scope.closeModal = function () { 17 | angular.element('#' + scope.id).modal('hide'); 18 | }; 19 | 20 | element.on('click', function (e) { 21 | angular.element('#' + scope.id).modal('show'); 22 | }); 23 | } 24 | }; 25 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/directives/shared/datepicker.js: -------------------------------------------------------------------------------- 1 | utilities.directive('cstDatepicker', function () { 2 | return { 3 | restrict: "A", 4 | require: 'ngModel', 5 | replace: true, 6 | link: function (scope, element, attrs, ngModelCtrl) { 7 | var dPicker = element.datepicker({ 8 | maxDate:0, 9 | onSelect: function (d) { 10 | ngModelCtrl.$setViewValue(d); 11 | scope.$apply(); 12 | ngModelCtrl.$setValidity('invalid', false); 13 | } 14 | }); 15 | element.on('keypress', function (e) { 16 | return false; 17 | }); 18 | } 19 | 20 | }; 21 | }); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/directives/shared/externalurl.js: -------------------------------------------------------------------------------- 1 |  2 | "use strict"; 3 | utilities.directive("cstExternalUrl", function ($window) { 4 | var webUrlPattern = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; 5 | 6 | return { 7 | link: function (scope, element, attributes) { 8 | var url = attributes.cstExternalUrl; 9 | 10 | if (url && webUrlPattern.test(url)) { 11 | scope.isWebUrl = true; 12 | element.css("text-decoration", "underline"); 13 | element.css("cursor", "pointer"); 14 | } 15 | 16 | element.on("click", function () { 17 | if (scope.isWebUrl) { 18 | $window.open(url); 19 | } 20 | }); 21 | } 22 | }; 23 | 24 | }); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/directives/shared/itemdelete.js: -------------------------------------------------------------------------------- 1 | app.directive('cstDelete', function () { 2 | return { 3 | replace: true, 4 | 5 | link: function ($scope, element, attrs, controller) { 6 | console.log(element); 7 | element.on('click', function (ev) { 8 | return confirm('Delete item?'); 9 | }); 10 | } 11 | }; 12 | }); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/directives/shared/loadingoverlay.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | utilities.directive('cstLoadingOverlay', ['$timeout', '$q', 'httpInterceptor', 'templateSvc', function ($timeout, $q, httpInterceptor, templateSvc) { 3 | var IS_HTML_PAGE = /\.html$|\.html\?/i; 4 | var modifiedTemplates = {}; 5 | 6 | return { 7 | restrict: 'E', 8 | templateUrl: '/Scripts/app/partials/Loader.html', 9 | link: function (scope, element, attribute) { 10 | var requestQueue = []; 11 | httpInterceptor.request = function (config) { 12 | console.log('request: ' + config.url); 13 | requestQueue.push({}); 14 | if (requestQueue.length == 1) { 15 | showOverlay(element); 16 | } 17 | return config || $q.when(config); 18 | }; 19 | httpInterceptor.response = function (response) { 20 | if (IS_HTML_PAGE.test(response.config.url)) { 21 | if (!modifiedTemplates[response.config.url]) { 22 | response.data = templateSvc.processTemplate(response); 23 | modifiedTemplates[response.config.url] = true; 24 | } 25 | } 26 | 27 | console.log('response: ' + response.config.url); 28 | requestQueue.pop(); 29 | if (requestQueue.length === 0) { 30 | $timeout(function () { 31 | if (requestQueue.length === 0) { 32 | hideOverlay(element); 33 | } 34 | }, 500); 35 | } 36 | return response || $q.when(response); 37 | }; 38 | httpInterceptor.responseError = function (response) { 39 | requestQueue.pop(); 40 | if (requestQueue.length === 0) { 41 | $timeout(function () { 42 | if (requestQueue.length === 0) { 43 | hideOverlay(element); 44 | } 45 | }, 500); 46 | } 47 | return $q.reject(response); 48 | }; 49 | } 50 | }; 51 | 52 | function showOverlay(overlayDiv) { 53 | overlayDiv.removeClass('hide'); 54 | overlayDiv.addClass('show'); 55 | } 56 | 57 | function hideOverlay(overlayDiv) { 58 | overlayDiv.removeClass('show'); 59 | overlayDiv.addClass('hide'); 60 | } 61 | 62 | }]); 63 | 64 | utilities.factory('httpInterceptor', function () { 65 | return {}; 66 | }); 67 | 68 | 69 | 70 | utilities.service('templateSvc', ['$templateCache', 'userProfileSvc', function ($templateCache, userProfileSvc) { 71 | var HAS_FLAGS_EXP = /data-(keep|omit)/; 72 | return { 73 | processTemplate: function (response) { 74 | var content = response.data; 75 | var element = $('
').append(content); 76 | if (HAS_FLAGS_EXP.test(content)) { 77 | element.find('[data-omit="' + userProfileSvc.role + '"]').each(function () { 78 | var subElem = $(this); 79 | subElem.remove(); 80 | }); 81 | } 82 | content = element.html(); 83 | $templateCache.put(response.config.url, content); 84 | return content; 85 | } 86 | }; 87 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/directives/shared/modal.js: -------------------------------------------------------------------------------- 1 | utilities.directive('cstModal', function () { 2 | return { 3 | required: 'ngModel', 4 | restrict: 'A', 5 | link: function (scope, element, attrs, ngModelCtrl) { 6 | element.on('click', function (e) { 7 | var modalId = '#' + attrs.cstModal; 8 | $(modalId).modal('show'); 9 | }); 10 | } 11 | }; 12 | }); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/directives/shared/topmenu.js: -------------------------------------------------------------------------------- 1 | app.directive('cstTopMenu', function () { 2 | return { 3 | restrict: 'E', 4 | replace: true, 5 | templateUrl: '/Scripts/app/partials/TopMenu.html', 6 | link: function (scope, element, attrs) { 7 | var menuItems = element.find("a"); 8 | menuItems.on('click', function () { 9 | menuItems.removeClass('active'); 10 | $(this).addClass('active'); 11 | }); 12 | 13 | scope.$on('logOff', function () { 14 | scope.isAuthenticated = false; 15 | }); 16 | 17 | scope.$on('logOn', function () { 18 | scope.isAuthenticated = true; 19 | }); 20 | } 21 | }; 22 | }); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/helpers/authorizationinterceptor.js: -------------------------------------------------------------------------------- 1 | app.factory('authorizationInterceptor', ['$rootScope', '$q', '$location', function ($rootScope, $q, $location) { 2 | return { 3 | responseError: function (rejection) { 4 | switch (rejection.status) { 5 | case 401: { 6 | $rootScope.$broadcast('logOff'); 7 | $location.url('/Login'); 8 | break; 9 | } 10 | case 403: { 11 | $location.url('/Login'); 12 | break; 13 | } 14 | default: { 15 | break; 16 | } 17 | } 18 | 19 | return $q.reject(rejection); 20 | } 21 | }; 22 | }]); 23 | 24 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/partials/Loader.html: -------------------------------------------------------------------------------- 1 | 
2 |
Loading..
3 |
4 | 5 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/partials/TopMenu.html: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/partials/confirm-modal.html: -------------------------------------------------------------------------------- 1 |  17 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/services/activities/activityservice.js: -------------------------------------------------------------------------------- 1 | app.service('activitySvc', ['$resource', 'serviceHelperSvc', function ($resource, serviceHelper) { 2 | var Activity = serviceHelper.ResourceActivity; 3 | var addActivity = function (activity) { 4 | return Activity.save({ resourceId: activity.ResourceId }, activity).$promise; 5 | }; 6 | var deleteActivity = function (activity) { 7 | return Activity.delete({ resourceId: activity.ResourceId, activityId: activity.Id }).$promise; 8 | }; 9 | var getActivites = function (resourceId) { 10 | return Activity.query({ resourceId: resourceId }); 11 | }; 12 | 13 | return { 14 | addActivity: addActivity, 15 | deleteActivity: deleteActivity, 16 | getActivites: getActivites 17 | }; 18 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/services/locations/locationservice.js: -------------------------------------------------------------------------------- 1 | app.factory('locationSvc', ['$resource', 'serviceHelperSvc', function ($resource, serviceHelper) { 2 | var Location = serviceHelper.Location; 3 | var addLocation = function (location) { 4 | //$resource.save will immediately return an object which will have $promise property. 5 | //This property will get resolved with values, once the Server returns response 6 | return Location.save(location); 7 | }; 8 | var editLocation = function (location) { 9 | var updation = Location.update(location); 10 | return updation; 11 | }; 12 | var getLocation = function (id) { 13 | return Location.get({ locationId: id }); 14 | }; 15 | var getLocations = function () { 16 | return Location.query(); 17 | }; 18 | var deleteLocation = function (locationId) { 19 | return Location.delete({ locationId: locationId }); 20 | }; 21 | 22 | return { 23 | addLocation: addLocation, 24 | editLocation: editLocation, 25 | getLocation: getLocation, 26 | getLocations: getLocations, 27 | deleteLocation: deleteLocation 28 | }; 29 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/services/resources/resourceservice.js: -------------------------------------------------------------------------------- 1 | app.factory('resourceSvc', ['$resource', '$q', 'locationSvc', 'serviceHelperSvc', function ($resource, $q, locationSvc, serviceHelper) { 2 | var Resource = serviceHelper.Resource; 3 | 4 | var getTopFiveResources = function () { 5 | return Resource.query({ count: 5 }); 6 | }; 7 | var getResources = function () { 8 | return Resource.query(); 9 | }; 10 | var deleteResource = function (resourceId) { 11 | return Resource.delete({ resourceId: resourceId }); 12 | }; 13 | var addResource = function (resource) { 14 | return Resource.save(resource); 15 | }; 16 | var editResource = function (resource) { 17 | return Resource.update(resource); 18 | }; 19 | var getResource = function (id) { 20 | return Resource.get({ resourceId: id }); 21 | }; 22 | 23 | var createResourceEditFormModel = function (resourceId) { 24 | var sample = $q.all([this.getResource(resourceId).$promise, locationSvc.getLocations().$promise]); 25 | return sample; 26 | }; 27 | 28 | var getPagedResources = function (params) { 29 | return Resource.getPagedItems(params); 30 | }; 31 | 32 | return { 33 | getTopFiveResources: getTopFiveResources, 34 | getResources: getResources, 35 | deleteResource: deleteResource, 36 | addResource: addResource, 37 | editResource: editResource, 38 | getResource: getResource, 39 | createResourceEditFormModel: createResourceEditFormModel, 40 | getPagedResources: getPagedResources 41 | }; 42 | 43 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/services/shared/resourcemngrservice.js: -------------------------------------------------------------------------------- 1 | app.factory('resourceMngrSvc', ['$http', 'serviceHelperSvc', 'userProfileSvc', function ($http, serviceHelper, userProfileSvc) { 2 | 3 | var Token = serviceHelper.AuthorizationToken; 4 | var Account = serviceHelper.Account; 5 | 6 | var buildFormData = function (formData) { 7 | var dataString = ''; 8 | for (var prop in formData) { 9 | if (formData.hasOwnProperty(prop)) { 10 | dataString += (prop + '=' + formData[prop] + '&'); 11 | } 12 | } 13 | return dataString.slice(0, dataString.length - 1); 14 | }; 15 | 16 | return { 17 | login: function (userLogin) { 18 | var formData = { username: userLogin.Email, password: userLogin.Password, grant_type: 'password' }; 19 | return Token.requestToken(buildFormData(formData), function (data) { 20 | $http.defaults.headers.common.Authorization = "Bearer " + data.access_token; 21 | userProfileSvc.role = data.role; 22 | }); 23 | }, 24 | registerUser: function (userRegistration) { 25 | var registration = Account.register(userRegistration); 26 | return registration; 27 | }, 28 | logOffUser: function () { 29 | $http.defaults.headers.common.Authorization = null; 30 | } 31 | }; 32 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/services/shared/servicehelper.js: -------------------------------------------------------------------------------- 1 | app.factory('serviceHelperSvc', ['$http', '$resource', function ($http, $resource) { 2 | var baseUrl = config.apiurl; 3 | var buildUrl = function (resourceUrl) { 4 | return baseUrl + resourceUrl; 5 | }; 6 | 7 | var addRequestHeader = function (key, value) { 8 | 9 | }; 10 | return { 11 | AuthorizationToken: $resource(buildUrl("Token"), null, 12 | { 13 | requestToken: { method: 'POST', headers: { "Content-Type": "application/x-www-form-urlencoded" } } 14 | }), 15 | Account: $resource(buildUrl('api/Account/'), null, 16 | { 17 | register: { method: 'post' }, 18 | logOff: { method: 'put' } 19 | }), 20 | Resource: $resource(buildUrl('api/Resources/:resourceId'), 21 | { resourceId: '@Id' }, 22 | { 23 | 'update': { method: 'PUT' }, 24 | getPagedItems: { url: buildUrl("api/Resources?count=:count&page=:page&sortField=:sortField&sortOrder=:sortOrder"), method: 'GET', params: { count: '@count', page: '@page', sortField: '@sortField', sortOrder: '@sortOrder' } } 25 | }), 26 | Location: $resource(buildUrl('api/Locations/:locationId'), { locationId: '@Id' }, { 'update': { method: 'PUT' } }), 27 | 28 | ResourceActivity: $resource(buildUrl('api/Resources/:resourceId/Activities/:activityId'), 29 | { resourceId: '@ResourceId', activityId: '@Id' }) 30 | }; 31 | }]); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/about/About.html: -------------------------------------------------------------------------------- 1 | 
2 |
About
3 |
4 |

5 | This is an angular js application 6 |

7 |
8 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/activities/Add.html: -------------------------------------------------------------------------------- 1 | 
Add Activity
2 |
3 | 4 |
5 |
6 | Add Activity 7 |
8 |
9 | 12 | 13 |
14 |
15 | 18 | 19 |
20 |
21 | 24 | 25 |
26 |
27 | 31 | Cancel 32 |
33 |
34 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/home/Home.html: -------------------------------------------------------------------------------- 1 |  2 |
Home
3 |
4 |

5 | Welcome to the Resource Manager application. Here is your top 5 resources below with the Priority assigned. 6 |

7 |
8 | 9 | 10 | 11 | 14 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 31 | 34 | 35 | 36 | 37 | 40 | 41 | 42 |
12 | Priority 13 | 15 | Name 16 | 18 | Description 19 |
26 | {{resource.Priority}} 27 | 29 | {{resource.Name}} 30 | 32 | {{resource.Description}} 33 |
38 | There are no resources 39 |
43 |
44 | 45 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/locations/Add.html: -------------------------------------------------------------------------------- 1 |  2 |
Add Location
3 |
4 |
5 |
Add Location
6 |
7 |
8 | 9 | 10 |
11 |
12 |
13 | 16 | 17 |
18 |
19 |
20 | 23 | Cancel 24 | 25 |
26 |
27 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/locations/Edit.html: -------------------------------------------------------------------------------- 1 |  2 | 3 |
Edit Location
4 |
5 |
6 |
Edit Location
7 |
8 |
9 | 10 | 11 |
12 |
13 |
14 | 17 | 18 |
19 |
20 | 23 | Cancel 24 |
25 |
26 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/locations/Locations.html: -------------------------------------------------------------------------------- 1 | 
Locations
2 |
3 |
4 | 5 | 6 | 7 | 10 | 13 | 16 | 21 | 22 | 23 | 24 | 25 |
8 | {{location.Name}} 9 | 11 | {{location.Description}} 12 | 14 | 15 | 17 | 20 |
There are no locations
26 |
27 | Create new 28 |
29 |
30 | 31 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/resources/Add.html: -------------------------------------------------------------------------------- 1 | 
Add Resource
2 |
3 | 4 | 5 |
6 |
Add Resource
7 |
8 |
9 | 12 | 13 |
14 |
15 | 18 | 19 |
20 |
21 | 24 | 25 | 29 | 30 |
31 |
32 | 35 | 36 |
37 |
38 | 41 | 54 |
55 |
56 | 60 | Cancel 61 |
62 |
63 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/resources/Details.html: -------------------------------------------------------------------------------- 1 | 
2 |
Resource Details
3 |
4 |
5 |
6 | {{resource.Name}}
7 |

{{resource.Description}}

8 | 9 |
10 | 11 |
12 | Priority: {{resource.Priority}} 13 |
14 | 15 |
16 | 17 | Path: {{resource.Path}} 18 | 19 | 20 |
21 | 22 | Location: {{resource.LocationName}} 23 | 24 | 25 |
26 |
27 |
28 |
29 | 30 |
31 | New Activity 32 |


33 | 34 | 35 |
36 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/resources/Edit.html: -------------------------------------------------------------------------------- 1 | 
Edit Resource
2 |
3 |
4 |
Edit Resource
5 |
6 |
7 | 10 | 11 |
12 |
13 | 16 | 17 |
18 |
19 | 22 | 26 |
27 |
28 | 31 | 32 |
33 |
34 | 37 | 41 |
42 |
43 | 46 | Cancel 47 |
48 |
49 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/resources/Resources-ng-table.html: -------------------------------------------------------------------------------- 1 | 
Resources
2 |
3 |
4 | 5 | 6 | 9 | 12 | 15 | 20 | 21 | 22 | 23 | 24 |
7 | {{resource.Name}} 8 | 10 | {{resource.Description}} 11 | 13 | 14 | 16 | 19 |
There are no resources
25 | 26 |
27 | Create new 28 |
29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/resources/Resources.html: -------------------------------------------------------------------------------- 1 | 
Resources
2 |
3 |
4 | 5 | 6 | 7 | 10 | 13 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | 30 | 33 | 36 | 41 | 42 | 43 |
8 | Name 9 | 11 | Description 12 | 14 | 16 |
23 | There are no resources 24 |
28 | {{resource.Name}} 29 | 31 | {{resource.Description}} 32 | 34 | 35 | 37 | 40 |
44 |
45 | Create new 46 |
47 |
48 | 49 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/shared/Error.html: -------------------------------------------------------------------------------- 1 | 
2 |

Oops! An error occured while processing your request.

3 |
-------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/shared/Login.html: -------------------------------------------------------------------------------- 1 | 
2 |
3 |
4 |
Login
5 |
6 |
7 |
8 | {{errorMessage}} 9 |
10 |
11 |
12 |
13 | 16 | 17 |
18 |
19 | 22 | 23 |
24 |
25 | 29 | Register 30 |
31 |
32 |
33 | 34 | 35 | 36 | 37 |
-------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/app/views/shared/Register.html: -------------------------------------------------------------------------------- 1 | 
2 |
3 |
Register
4 |
5 |
6 |
7 | {{errorMessage}} 8 |
9 |
10 |
11 |
12 | 15 | 16 |
17 |
18 | 21 | 22 |
23 |
24 | 27 | 28 | Invalid email 29 |
30 |
31 | 34 | 35 | Password should contain at least 6 characaters 36 |
37 | 38 |
39 | 42 | 43 |
44 | 45 | 46 |
47 | 51 | Back to Login 52 |
53 |
54 |
-------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/config.js: -------------------------------------------------------------------------------- 1 | var config = { 2 | "apiurl": "http://localhost:7818/", 3 | "weburl" : "http://localhost:9043/" 4 | } 5 | //http://localhost:3602/ -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/libs/jasmine-2.0.0/boot.min.js: -------------------------------------------------------------------------------- 1 | !function(){function e(e,n){for(var t in n)e[t]=n[t];return e}window.jasmine=jasmineRequire.core(jasmineRequire),jasmineRequire.html(jasmine);var n=jasmine.getEnv(),t={describe:function(e,t){return n.describe(e,t)},xdescribe:function(e,t){return n.xdescribe(e,t)},it:function(e,t){return n.it(e,t)},xit:function(e,t){return n.xit(e,t)},beforeEach:function(e){return n.beforeEach(e)},afterEach:function(e){return n.afterEach(e)},expect:function(e){return n.expect(e)},pending:function(){return n.pending()},spyOn:function(e,t){return n.spyOn(e,t)},jsApiReporter:new jasmine.JsApiReporter({timer:new jasmine.Timer})};"undefined"==typeof window&&"object"==typeof exports?e(exports,t):e(window,t),jasmine.addCustomEqualityTester=function(e){n.addCustomEqualityTester(e)},jasmine.addMatchers=function(e){return n.addMatchers(e)},jasmine.clock=function(){return n.clock};var r=new jasmine.QueryString({getWindowLocation:function(){return window.location}}),i=r.getParam("catch");n.catchExceptions("undefined"==typeof i?!0:i);var o=new jasmine.HtmlReporter({env:n,onRaiseExceptionsClick:function(){r.setParam("catch",!n.catchingExceptions())},getContainer:function(){return document.body},createElement:function(){return document.createElement.apply(document,arguments)},createTextNode:function(){return document.createTextNode.apply(document,arguments)},timer:new jasmine.Timer});n.addReporter(t.jsApiReporter),n.addReporter(o);var a=new jasmine.HtmlSpecFilter({filterString:function(){return r.getParam("spec")}});n.specFilter=function(e){return a.matches(e.getFullName())},window.setTimeout=window.setTimeout,window.setInterval=window.setInterval,window.clearTimeout=window.clearTimeout,window.clearInterval=window.clearInterval;var c=window.onload;window.onload=function(){c&&c(),o.initialize(),n.execute()}}(); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Scripts/libs/jasmine-2.0.0/console.min.js: -------------------------------------------------------------------------------- 1 | function getJasmineRequireObj(){return"undefined"!=typeof module&&module.exports?exports:(window.jasmineRequire=window.jasmineRequire||{},window.jasmineRequire)}getJasmineRequireObj().console=function(e,n){n.ConsoleReporter=e.ConsoleReporter()},getJasmineRequireObj().ConsoleReporter=function(){function e(e){function t(){d("\n")}function o(e,n){return l?v[e]+n+v.none:n}function i(e,n){return 1==n?e:e+"s"}function r(e,n){for(var t=[],o=0;n>o;o++)t.push(e);return t}function s(e,n){for(var t=(e||"").split("\n"),o=[],i=0;i 2 | 3 | 4 | 5 | Jasmine Spec Runner v2.0.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/gulpfile.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by shijuvar on 16/2/14. 3 | */ 4 | 5 | 6 | var gulp = require('gulp'), 7 | gutil = require('gulp-util'), 8 | uglify = require('gulp-uglify'), 9 | jshint = require('gulp-jshint'), 10 | concat = require('gulp-concat'), 11 | jshintreporter = require('jshint-stylish'), 12 | minifycss = require('gulp-minify-css'), 13 | size = require('gulp-size'), 14 | clean = require('gulp-clean'), 15 | rename = require('gulp-rename'), 16 | open = require('gulp-open'), 17 | connect = require('gulp-connect'); 18 | 19 | var filePath = { 20 | appjsminify: { src: './Scripts/app/**/*.js', dest: './Scripts/app' }, 21 | libsjsminify: { src: ['./Scripts/libs/**/*.js', '!*.min.js', '!/**/*.min.js'], dest: './Scripts/libs/' }, 22 | jshint: { src: './Scripts/app/**/*.js' }, 23 | minifycss: { src: ['./Content/themes/**/*.css', '!*.min.css', '!/**/*.min.css'], dest: './Content/themes/' } 24 | }; 25 | 26 | 27 | 28 | gulp.task('app-js-minify', function () { 29 | gulp.src(filePath.appjsminify.src) 30 | .pipe(uglify()) 31 | .pipe(concat('ngscripts.js')) 32 | .pipe(size()) 33 | .pipe(gulp.dest(filePath.appjsminify.dest)); 34 | }); 35 | 36 | gulp.task('libs-js-minify', function () { 37 | /*Excludes already minified files.*/ 38 | gulp.src(filePath.libsjsminify.src) 39 | .pipe(uglify()) 40 | .pipe(rename({ suffix: '.min' })) 41 | .pipe(gulp.dest(filePath.libsjsminify.dest)); 42 | }); 43 | 44 | 45 | gulp.task('jshint', function () { 46 | gulp.src(filePath.jshint.src) 47 | .pipe(jshint()) 48 | .pipe(jshint.reporter(jshintreporter)); 49 | }); 50 | 51 | 52 | gulp.task('minify-css', function () { 53 | /*Excludes already minified files.*/ 54 | gulp.src(filePath.minifycss.src) 55 | .pipe(minifycss()) 56 | .pipe(rename({ suffix: '.min' })) 57 | .pipe(gulp.dest(filePath.minifycss.dest)); 58 | }); 59 | 60 | gulp.task('clean', function () { 61 | gulp.src( 62 | [ 63 | 'Scripts/app/ngscripts.js', 64 | 'Scripts/libs/angular-ui/select2.min.js', 65 | 'Scripts/libs/select2/select2.min.js', 66 | 'Scripts/libs/semantic/semantic.min.js', 67 | 'Scripts/libs/**/*.min.js', 68 | 'Scripts/libs/jquery-1.9.1.min.js', 69 | '!Scripts/libs/jquery-ui-1.10.3.min.js', 70 | './Content/themes/semantic/semantic.min.css', 71 | './Content/themes/Site.min.css', 72 | './Content/themes/select2/select2.min.css' 73 | ], { read: false }) 74 | .pipe(clean({ force: true })); 75 | }); 76 | gulp.task('build', ['app-js-minify', 'libs-js-minify', 'minify-css']); 77 | gulp.task('cleanbuild', ['clean']); 78 | 79 | gulp.task('tests', function () { 80 | connect.server({ 81 | port:8000 82 | }); 83 | var testUrl = "http://localhost:8000/SpecRunner.html"; 84 | gulp.src("./SpecRunner.html") 85 | .pipe(open("", { url: testUrl })); 86 | }); 87 | 88 | //gulp.watch('./app/**/*.js', ['js']); -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.Web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webapi-angularjs-spa", 3 | "description": "SPA Demo app with AngularJS", 4 | "author": "Shiju Varghese", 5 | "version": "0.5.0", 6 | "repository": "https://github.com/MarlabsInc/webapi-angularjs-spa", 7 | "dependencies": {}, 8 | "devDependencies": { 9 | "gulp-util": "~2.2.14", 10 | "gulp": "~3.5.2", 11 | "gulp-concat": "~2.1.7", 12 | "gulp-uglify": "~0.2.1", 13 | "jshint": "~2.4.3", 14 | "gulp-jshint": "~1.4.2", 15 | "jshint-stylish": "~0.1.5", 16 | "gulp-minify-css": "~0.3.0", 17 | "gulp-rename": "~1.1.0", 18 | "gulp-size": "~0.1.3", 19 | "gulp-clean": "~0.2.4", 20 | "gulp-open": "~0.2.8", 21 | "gulp-connect": "~2.0.5" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /source/ResourceMetadata/ResourceMetadata.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceMetadata.Model", "ResourceMetadata.Model\ResourceMetadata.Model.csproj", "{673CF0EE-E1DB-4FB5-934B-80830B50B3A0}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceMetadata.Data", "ResourceMetadata.Data\ResourceMetadata.Data.csproj", "{D6DCCEC1-4B37-4D54-BA9E-9C53948DC285}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceMetadata.Service", "ResourceMetadata.Service\ResourceMetadata.Service.csproj", "{2DE79BEB-2A40-42AB-8065-E9416C9076E3}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceMetadata.API", "ResourceMetadata.API\ResourceMetadata.API.csproj", "{96093264-9F83-4489-ADBE-9A25FC0D40F2}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceMetadata.Web", "ResourceMetadata.Web\ResourceMetadata.Web.csproj", "{69F1397A-AAF3-4D8F-9D2E-E2FDC190BBC5}" 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Release|Any CPU = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {673CF0EE-E1DB-4FB5-934B-80830B50B3A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {673CF0EE-E1DB-4FB5-934B-80830B50B3A0}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {673CF0EE-E1DB-4FB5-934B-80830B50B3A0}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {673CF0EE-E1DB-4FB5-934B-80830B50B3A0}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {D6DCCEC1-4B37-4D54-BA9E-9C53948DC285}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {D6DCCEC1-4B37-4D54-BA9E-9C53948DC285}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {D6DCCEC1-4B37-4D54-BA9E-9C53948DC285}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {D6DCCEC1-4B37-4D54-BA9E-9C53948DC285}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {2DE79BEB-2A40-42AB-8065-E9416C9076E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {2DE79BEB-2A40-42AB-8065-E9416C9076E3}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {2DE79BEB-2A40-42AB-8065-E9416C9076E3}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {2DE79BEB-2A40-42AB-8065-E9416C9076E3}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {96093264-9F83-4489-ADBE-9A25FC0D40F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {96093264-9F83-4489-ADBE-9A25FC0D40F2}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {96093264-9F83-4489-ADBE-9A25FC0D40F2}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {96093264-9F83-4489-ADBE-9A25FC0D40F2}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {69F1397A-AAF3-4D8F-9D2E-E2FDC190BBC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {69F1397A-AAF3-4D8F-9D2E-E2FDC190BBC5}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {69F1397A-AAF3-4D8F-9D2E-E2FDC190BBC5}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {69F1397A-AAF3-4D8F-9D2E-E2FDC190BBC5}.Release|Any CPU.Build.0 = Release|Any CPU 42 | EndGlobalSection 43 | GlobalSection(SolutionProperties) = preSolution 44 | HideSolutionNode = FALSE 45 | EndGlobalSection 46 | EndGlobal 47 | --------------------------------------------------------------------------------