├── .gitignore ├── LICENSE ├── README.md └── 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 ├── app.config └── packages.config ├── ResourceMetadata.Service ├── LocationService.cs ├── Properties │ └── AssemblyInfo.cs ├── ResourceActivityService.cs ├── ResourceMetadata.Service.csproj ├── ResourceService.cs ├── UserService.cs ├── app.config └── packages.config ├── ResourceMetadata.Web ├── Content │ ├── 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 │ ├── select2 │ │ ├── select2-spinner.gif │ │ ├── select2.css │ │ ├── select2.min.css │ │ └── select2.png │ ├── semantic │ │ ├── semantic.css │ │ └── semantic.min.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 │ └── themes │ │ ├── Site.css │ │ └── Site.min.css ├── Index.html ├── Properties │ └── AssemblyInfo.cs ├── ResourceMetadata.Web.csproj ├── Scripts │ ├── _references.js │ └── semantic.js ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── app │ ├── actions │ │ ├── AccountActions.js │ │ ├── ActivityActions.js │ │ ├── LocationActions.js │ │ └── ResourceActions.js │ ├── components │ │ ├── ActivitiesPage.js │ │ ├── ActivityAddPage.js │ │ ├── ActivityGridItem.js │ │ ├── ActivityItem.js │ │ ├── AppContainer.js │ │ ├── ConfirmationModal.js │ │ ├── ContentRouter.js │ │ ├── DatePicker.js │ │ ├── DeleteIcon.js │ │ ├── EditIconLink.js │ │ ├── Footer.js │ │ ├── Header.js │ │ ├── HomePage.js │ │ ├── InformationModal.js │ │ ├── LoadingIndicator.js │ │ ├── LocationAddPage.js │ │ ├── LocationEditPage.js │ │ ├── LocationForm.js │ │ ├── LocationTableRow.js │ │ ├── LocationsPage.js │ │ ├── LoginPage.js │ │ ├── NavLink.js │ │ ├── NavigationRouter.js │ │ ├── NotFoundPage.js │ │ ├── RegistrationPage.js │ │ ├── RequiredEmail.js │ │ ├── RequiredPassword.js │ │ ├── RequiredTextArea.js │ │ ├── RequiredTextbox.js │ │ ├── ResourceAddPage.js │ │ ├── ResourceDetailsPage.js │ │ ├── ResourceEditPage.js │ │ ├── ResourceForm.js │ │ ├── ResourceTableRow.js │ │ ├── ResourcesPage.js │ │ ├── Select2.js │ │ └── app.js │ ├── constants │ │ └── AppConstants.js │ ├── dispatchers │ │ └── AppDispatcher.js │ └── stores │ │ ├── AccountStore.js │ │ ├── ActivityStore.js │ │ ├── ApplicationStore.js │ │ ├── LocationStore.js │ │ └── ResourceStore.js ├── config.js ├── gulpfile.js └── package.json └── ResourceMetadata.sln /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | [Dd]ebug/ 11 | [Dd]ebugPublic/ 12 | [Rr]elease/ 13 | x64/ 14 | build/ 15 | bld/ 16 | [Bb]in/ 17 | [Oo]bj/ 18 | 19 | # MSTest test Results 20 | [Tt]est[Rr]esult*/ 21 | [Bb]uild[Ll]og.* 22 | 23 | #NUNIT 24 | *.VisualState.xml 25 | TestResult.xml 26 | 27 | # Build Results of an ATL Project 28 | [Dd]ebugPS/ 29 | [Rr]eleasePS/ 30 | dlldata.c 31 | 32 | *_i.c 33 | *_p.c 34 | *_i.h 35 | *.ilk 36 | *.meta 37 | *.obj 38 | *.pch 39 | *.pdb 40 | *.pgc 41 | *.pgd 42 | *.rsp 43 | *.sbr 44 | *.tlb 45 | *.tli 46 | *.tlh 47 | *.tmp 48 | *.tmp_proj 49 | *.log 50 | *.vspscc 51 | *.vssscc 52 | .builds 53 | *.pidb 54 | *.svclog 55 | *.scc 56 | 57 | # Chutzpah Test files 58 | _Chutzpah* 59 | 60 | # Visual C++ cache files 61 | ipch/ 62 | *.aps 63 | *.ncb 64 | *.opensdf 65 | *.sdf 66 | *.cachefile 67 | 68 | # Visual Studio profiler 69 | *.psess 70 | *.vsp 71 | *.vspx 72 | 73 | # TFS 2012 Local Workspace 74 | $tf/ 75 | 76 | # Guidance Automation Toolkit 77 | *.gpState 78 | 79 | # ReSharper is a .NET coding add-in 80 | _ReSharper*/ 81 | *.[Rr]e[Ss]harper 82 | *.DotSettings.user 83 | 84 | # JustCode is a .NET coding addin-in 85 | .JustCode 86 | 87 | # TeamCity is a build add-in 88 | _TeamCity* 89 | 90 | # DotCover is a Code Coverage Tool 91 | *.dotCover 92 | 93 | # NCrunch 94 | *.ncrunch* 95 | _NCrunch_* 96 | .*crunch*.local.xml 97 | 98 | # MightyMoose 99 | *.mm.* 100 | AutoTest.Net/ 101 | 102 | # Web workbench (sass) 103 | .sass-cache/ 104 | 105 | # Installshield output folder 106 | [Ee]xpress/ 107 | 108 | # DocProject is a documentation generator add-in 109 | DocProject/buildhelp/ 110 | DocProject/Help/*.HxT 111 | DocProject/Help/*.HxC 112 | DocProject/Help/*.hhc 113 | DocProject/Help/*.hhk 114 | DocProject/Help/*.hhp 115 | DocProject/Help/Html2 116 | DocProject/Help/html 117 | 118 | # Click-Once directory 119 | publish/ 120 | 121 | # Publish Web Output 122 | *.[Pp]ublish.xml 123 | *.azurePubxml 124 | 125 | # NuGet Packages Directory 126 | packages/ 127 | ## TODO: If the tool you use requires repositories.config uncomment the next line 128 | #!packages/repositories.config 129 | 130 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 131 | # This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) 132 | !packages/build/ 133 | 134 | # Windows Azure Build Output 135 | csx/ 136 | *.build.csdef 137 | 138 | # Windows Store app package directory 139 | AppPackages/ 140 | 141 | # Others 142 | sql/ 143 | *.Cache 144 | ClientBin/ 145 | [Ss]tyle[Cc]op.* 146 | ~$* 147 | *~ 148 | *.dbmdl 149 | *.dbproj.schemaview 150 | *.pfx 151 | *.publishsettings 152 | node_modules/ 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | *.mdf 166 | *.ldf 167 | 168 | # Business Intelligence projects 169 | *.rdl.data 170 | *.bim.layout 171 | *.bim_*.settings 172 | 173 | # Microsoft Fakes 174 | FakesAssemblies/ 175 | 176 | ResourceMetadata/ResourceMetadata.Web/app/prod/*.js 177 | bundle.js 178 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Shiju Varghese 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. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #react-aspnet v0.5.0 2 | 3 | Demo app built with React and ASP.NET Web API. 4 | A minimalist implmentation of Flux architetcure is included in this version. An enhanced version of Flux is coming. 5 | 6 | ## Technologies 7 | 8 | * ASP.NET Web API 9 | * ReactJS 10 | 11 | ## Building the App 12 | 13 | 14 | 1. To build the Web API project, open the solution in Visual Studio 2013, and build the solution to install Nuget packages. This will automatically restore Nuget packages. 15 | 2. To change the API url in the Web app (Client app built with React), modify the config.js file at /ResourceMetadata.Web/Scripts/config.js. 16 | 3. If you haven't installed Node.js, download and install it from http://nodejs.org/ 17 | 4. Navigate to the directory of ResourceMetadata.Web project in command prompt and run command **npm install** 18 | 5. As a workaround to conflict between jquery-ui-browserify and jquery-browserify, update the statement 19 | **$ = require('jquery')** in file ResourceMetadata.Web/node-modules/jquery-ui-browserify/index.js 20 | to **$=require('jquery-browserify')**. 21 | 5. Execute gulp tasks 22 | 1. Run commands **gulp build**. 23 | 2. In order to clean the destination files created by build task, run **gulp clean**. 24 | 25 | 26 | 27 | ## About the Sample App 28 | 29 | The ReactJS app named "ResourceMetadata.Web" lets the users store metadata of the resources (articles, github repositories, files on the local computer etc.) with a priority. Based on the priority, users can follow the resources and add activities against the resources. 30 | 31 | The following are the functionalities of the ResourceMetadata: 32 | 33 | 1. Register user to the application 34 | 2. Create locations (eg: github, MyComputer, Artciles ect) for adding resources 35 | 3. Add resources against a location 36 | 4. Add activities against resources. 37 | 38 | 39 | ## Team 40 | * [Shiju Varghese](https://github.com/shijuvar) - Architect 41 | * [Dileep C.D.](https://github.com/DileepCD) - Lead Developer and Core Committer 42 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | using ResourceMetadata.Model; 13 | 14 | namespace ResourceMetadata.API 15 | { 16 | public partial class Startup 17 | { 18 | static Startup() 19 | { 20 | PublicClientId = "self"; 21 | 22 | UserManagerFactory = () => new UserManager(new UserStore(new ResourceManagerEntities())); 23 | 24 | RoleManager = new RoleManager(new RoleStore(new ResourceManagerEntities())); 25 | 26 | OAuthOptions = new OAuthAuthorizationServerOptions 27 | { 28 | TokenEndpointPath = new PathString("/Token"), 29 | Provider = new ApplicationOAuthProvider(PublicClientId, UserManagerFactory, RoleManager), 30 | AuthorizeEndpointPath = new PathString("/api/Account/ExternalLogin"), 31 | AccessTokenExpireTimeSpan = TimeSpan.FromDays(14), 32 | AllowInsecureHttp = true 33 | }; 34 | } 35 | 36 | public static OAuthAuthorizationServerOptions OAuthOptions { get; private set; } 37 | 38 | public static Func> UserManagerFactory { get; set; } 39 | 40 | public static RoleManager RoleManager { get; set; } 41 | 42 | 43 | public static string PublicClientId { get; private set; } 44 | 45 | // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864 46 | public void ConfigureAuth(IAppBuilder app) 47 | { 48 | try 49 | { 50 | app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); 51 | 52 | // Enable the application to use a cookie to store information for the signed in user 53 | // and to use a cookie to temporarily store information about a user logging in with a third party login provider 54 | //app.UseCookieAuthentication(new CookieAuthenticationOptions()); 55 | //app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); 56 | 57 | // Enable the application to use bearer tokens to authenticate users 58 | app.UseOAuthBearerTokens(OAuthOptions); 59 | 60 | // Uncomment the following lines to enable logging in with third party login providers 61 | //app.UseMicrosoftAccountAuthentication( 62 | // clientId: "", 63 | // clientSecret: ""); 64 | 65 | //app.UseTwitterAuthentication( 66 | // consumerKey: "", 67 | // consumerSecret: ""); 68 | 69 | //app.UseFacebookAuthentication( 70 | // appId: "", 71 | // appSecret: ""); 72 | 73 | //app.UseGoogleAuthentication(); 74 | } 75 | catch (Exception ex) 76 | { 77 | 78 | throw ex; 79 | } 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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(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/Activities/{id}")] 43 | public IHttpActionResult Delete(int id) 44 | { 45 | activityService.DeleteActivity(id); 46 | return Ok(); 47 | } 48 | 49 | } 50 | } -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.API/Controllers/ResourcesController.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 | using System.Web.Http.Filters; 14 | 15 | namespace ResourceMetadata.API.Controllers 16 | { 17 | public class ResourcesController : ApiController 18 | { 19 | private readonly IResourceService resourceService; 20 | private readonly UserManager userManager; 21 | 22 | public ResourcesController(IResourceService resourceService, UserManager userManager) 23 | { 24 | this.resourceService = resourceService; 25 | this.userManager = userManager; 26 | } 27 | 28 | public IHttpActionResult Get() 29 | { 30 | string userEmail = RequestContext.Principal.Identity.Name; 31 | var user = userManager.FindByName(userEmail); 32 | var resources = resourceService.GetAllResourcesByUserId(user.Id).ToList(); 33 | IList viewModel = new List(); 34 | Mapper.Map(resources, viewModel); 35 | return Ok(viewModel); 36 | } 37 | 38 | public IHttpActionResult Get(int count, int page, string sortField, string sortOrder) 39 | { 40 | string userEmail = RequestContext.Principal.Identity.Name; 41 | var user = userManager.FindByName(userEmail); 42 | 43 | int totalCount = 0; 44 | var resources = resourceService.GetPagedResourcesByUserId(user.Id, count, page, sortField, sortOrder, ref totalCount).ToList(); 45 | IEnumerable resourceViewModels = new List(); 46 | Mapper.Map(resources, resourceViewModels); 47 | PagedCollectionViewModel viewModel = new PagedCollectionViewModel { Data = resourceViewModels, TotalCount = totalCount }; 48 | 49 | return Ok(viewModel); 50 | 51 | } 52 | 53 | public IHttpActionResult GetTopFiveResources(int count) 54 | { 55 | string userEmail = RequestContext.Principal.Identity.Name; 56 | var user = userManager.FindByName(userEmail); 57 | 58 | IList viewModel = new List(); 59 | var resources = resourceService.GetTopFiveResourcesByUserId(user.Id); 60 | Mapper.Map(resources, viewModel); 61 | return Ok(viewModel); 62 | } 63 | 64 | public IHttpActionResult GetResourceById(int id) 65 | { 66 | Resource resource = resourceService.GetResourceById(id); 67 | var viewModel = new ResourceViewModel(); 68 | Mapper.Map(resource, viewModel); 69 | return Ok(viewModel); 70 | 71 | } 72 | 73 | public IHttpActionResult PostResource(ResourceViewModel resourceViewModel) 74 | { 75 | try 76 | { 77 | Resource resource = new Resource(); 78 | Mapper.Map(resourceViewModel, resource); 79 | resource.CreatedOn = DateTime.Now; 80 | resource.UserId = userManager.FindByName(RequestContext.Principal.Identity.Name).Id; 81 | 82 | resource = resourceService.AddResource(resource); 83 | resourceViewModel.Id = resource.Id; 84 | return Created(Url.Link("DefaultApi", new { controller = "Resources", id = resourceViewModel.Id }), resourceViewModel); 85 | 86 | } 87 | catch (Exception ex) 88 | { 89 | throw ex; 90 | } 91 | } 92 | 93 | public IHttpActionResult PutResource(int id, ResourceViewModel resourceViewModel) 94 | { 95 | resourceViewModel.Id = id; 96 | var resource = resourceService.GetResourceById(id); 97 | Mapper.Map(resourceViewModel, resource); 98 | resourceService.UpdateResource(resource); 99 | return Ok(resourceViewModel); 100 | } 101 | 102 | public IHttpActionResult DeleteResource(int id) 103 | { 104 | resourceService.DeleteResource(id); 105 | return Ok(); 106 | } 107 | 108 | } 109 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.API/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ResourceMetadata.API.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.API/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.API/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.API/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 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 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.API/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.API/favicon.ico -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 = "Shiju"; 67 | user.Email = "admin@shijuvar.com"; 68 | user.UserName = "admin@shijuvar.com"; 69 | 70 | var userResult = userManager.Create(user, "Shijuvar"); 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 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Data/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | ..\packages\EntityFramework.6.1.0\lib\net45\EntityFramework.dll 35 | 36 | 37 | ..\packages\EntityFramework.6.1.0\lib\net45\EntityFramework.SqlServer.dll 38 | 39 | 40 | False 41 | ..\packages\Microsoft.AspNet.Identity.Core.2.0.1\lib\net45\Microsoft.AspNet.Identity.Core.dll 42 | 43 | 44 | False 45 | ..\packages\Microsoft.AspNet.Identity.EntityFramework.2.0.1\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 75 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Model/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Model/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Service/ResourceMetadata.Service.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {2DE79BEB-2A40-42AB-8065-E9416C9076E3} 8 | Library 9 | Properties 10 | ResourceMetadata.Service 11 | ResourceMetadata.Service 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\EntityFramework.6.1.0\lib\net45\EntityFramework.dll 36 | 37 | 38 | ..\packages\EntityFramework.6.1.0\lib\net45\EntityFramework.SqlServer.dll 39 | 40 | 41 | False 42 | ..\packages\Microsoft.AspNet.Identity.Core.2.0.1\lib\net45\Microsoft.AspNet.Identity.Core.dll 43 | 44 | 45 | False 46 | ..\packages\Microsoft.AspNet.Identity.EntityFramework.2.0.1\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | {d6dccec1-4b37-4d54-ba9e-9c53948dc285} 67 | ResourceMetadata.Data 68 | 69 | 70 | {673cf0ee-e1db-4fb5-934b-80830b50b3a0} 71 | ResourceMetadata.Model 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 86 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Service/ResourceService.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 ResourceService : IResourceService 13 | { 14 | private IResourceRepository repository; 15 | private IResourceActivityRepository activityRepository; 16 | private readonly IUnitOfWork unitOfWork; 17 | public ResourceService(IResourceRepository repository, IResourceActivityRepository activityRepository, IUnitOfWork unitOfWork) 18 | { 19 | this.repository = repository; 20 | this.activityRepository = activityRepository; 21 | this.unitOfWork = unitOfWork; 22 | } 23 | 24 | public IEnumerable GetAllResourcesByUserId(string userId) 25 | { 26 | return repository.GetMany(res => res.UserId == userId); 27 | } 28 | 29 | 30 | public IEnumerable GetAllResources() 31 | { 32 | return repository.GetAll(); 33 | } 34 | public Resource AddResource(Resource resource) 35 | { 36 | repository.Add(resource); 37 | unitOfWork.SaveChanges(); 38 | return resource; 39 | } 40 | 41 | public void SaveChanges() 42 | { 43 | unitOfWork.SaveChanges(); 44 | } 45 | 46 | public Resource GetResourceById(int id) 47 | { 48 | return repository.GetById(id); 49 | } 50 | 51 | public Resource UpdateResource(Resource resource) 52 | { 53 | try 54 | { 55 | repository.Update(resource); 56 | SaveChanges(); 57 | return resource; 58 | } 59 | catch (Exception ex) 60 | { 61 | throw ex; 62 | } 63 | 64 | } 65 | 66 | public void DeleteResource(int id) 67 | { 68 | var resource = repository.GetById(id); 69 | repository.Delete(resource); 70 | SaveChanges(); 71 | } 72 | 73 | public Resource GetResourceByPriority(int priority) 74 | { 75 | var resource = repository.GetMany(res => res.Priority == priority).FirstOrDefault(); 76 | return resource; 77 | } 78 | 79 | public IEnumerable GetTopFiveResourcesByUserId(string userId) 80 | { 81 | var resources = repository.Query(res => res.UserId == userId).OrderBy(res => res.Priority).Take(5); 82 | return resources; 83 | } 84 | 85 | public IEnumerable GetPagedResourcesByUserId(string userId, int count, int page, string sortField, string sortOrder, ref int totalCount) 86 | { 87 | var query = repository.Query(res => res.UserId == userId); 88 | 89 | switch (sortField) 90 | { 91 | case "Description": 92 | { 93 | query = sortOrder.ToLower() == "asc" ? query.OrderBy(res => res.Description) : query.OrderByDescending(res => res.Description); 94 | break; 95 | } 96 | default: 97 | { 98 | query = sortOrder.ToLower() == "asc" ? query.OrderBy(res => res.Name) : query.OrderByDescending(res => res.Name); 99 | break; 100 | } 101 | } 102 | 103 | totalCount = query.Count(); 104 | var resources = query.Skip((page - 1) * count).Take(count); 105 | return resources; 106 | } 107 | } 108 | 109 | 110 | 111 | public interface IResourceService 112 | { 113 | Resource AddResource(Resource resource); 114 | IEnumerable GetAllResources(); 115 | 116 | Resource GetResourceById(int id); 117 | 118 | Resource UpdateResource(Resource resource); 119 | 120 | void DeleteResource(int id); 121 | 122 | Resource GetResourceByPriority(int priority); 123 | 124 | IEnumerable GetAllResourcesByUserId(string userId); 125 | 126 | IEnumerable GetTopFiveResourcesByUserId(string userId); 127 | 128 | IEnumerable GetPagedResourcesByUserId(string userId, int count, int page, string sortField, string sortOrder, ref int totalCount); 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Service/app.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 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Service/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/base/minified/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/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} -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/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} -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/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} -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/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%} -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/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} -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/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} -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/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%} -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/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} -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/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} -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/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} -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/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} -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/fonts/basic.icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/fonts/basic.icons.eot -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/fonts/basic.icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/fonts/basic.icons.ttf -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/fonts/basic.icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/fonts/basic.icons.woff -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.eot -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.otf -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.ttf -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/fonts/icons.woff -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/images/loader-large-inverted.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/images/loader-large-inverted.gif -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/images/loader-large.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/images/loader-large.gif -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/images/loader-medium-inverted.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/images/loader-medium-inverted.gif -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/images/loader-medium.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/images/loader-medium.gif -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/images/loader-mini-inverted.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/images/loader-mini-inverted.gif -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/images/loader-mini.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/images/loader-mini.gif -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/images/loader-small-inverted.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/images/loader-small-inverted.gif -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/images/loader-small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/images/loader-small.gif -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/select2/select2-spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/select2/select2-spinner.gif -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/select2/select2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/select2/select2.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/loading.gif -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shijuvar/react-aspnet/7ba9a2634c1a3b1e8fc58cdf0cf526c32688ca97/ResourceMetadata/ResourceMetadata.Web/Content/smoothness/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Content/themes/Site.min.css: -------------------------------------------------------------------------------- 1 | @media screen and (min-width:800px) and (max-width:1200px){.ui.form{margin-left:10px;width:100%}}@media (max-width:800px){.ui.form{width:100%}}@media screen and (min-width:1200px){.ui.form{margin:0 auto!important;align-content:center;width:50%}.ui.form .field{width:55%!important}}body{font-family:"Segoe UI",Verdana,Helvetica,Sans-Serif}a{color:#333;outline:0;padding-left:3px;padding-right:3px;text-decoration:underline}.ui.small.table.segment th,tr{font-size:small}.menu-container{margin-bottom:1rem}.error-message{color:#e80c4d;padding:5px;font-size:1em}input.ng-invalid-required,select.ng-invalid-required{border-left:5px solid #e80c4d!important}input.ng-valid-required{border-left:5px solid #6ECFF5!important}input.ng-invalid-email,input.ng-invalid-email:focus,input.ng-invalid-minlength,input.ng-invalid-minlength:focus{border-left:5px solid #e80c4d!important}textarea.ng-valid-required{border-left:5px solid #6ECFF5!important}input:focus{border-left:5px solid #6ECFF5!important;box-shadow:none!important;border-bottom-left-radius:.325em!important;border-top-left-radius:.325em!important}input.ng-invalid-required:focus,textarea.ng-invalid-required{border-left:5px solid #e80c4d!important;box-shadow:none!important;border-bottom-left-radius:.325em!important;border-top-left-radius:.325em!important}textarea.ng-invalid-required:focus{border-left:5px solid #e80c4d!important}textarea:focus{border-left:5px solid #6ECFF5!important;box-shadow:none!important;border-bottom-left-radius:.325em!important;border-top-left-radius:.325em!important}textarea{font-family:"Segoe UI",Verdana,Helvetica,Sans-Serif}.show{display:block}.hide{display:none}.validation-summary-errors>ul{list-style-type:none!important;color:red}.field-validation-error{color:red}.input-validation-error,.input-validation-error:focus{border-left:5px solid #e80c4d!important}.field-error{color:#e80c4d}.ui.modal{width:58%;margin-left:-29%}.ui.modal>.header{border-bottom:1px solid rgba(0,0,0,.1);margin:0;padding:1em;font-size:1em;font-weight:700;-webkit-border-radius:.325em .325em 0 0;-moz-border-radius:.325em .325em 0 0;border-radius:.325em .325em 0 0}.ui.modal>.content{font-size:.9em;display:table;width:100%;position:relative;padding:1em;background-color:#F4F4F4;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.428571429;text-decoration:none;background-color:#fff;border:1px solid #ddd;color:#428bca}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span{color:#999;cursor:not-allowed;background-color:#fff;border-color:#ddd} -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /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("9dde4d23-45d6-4249-91c4-264d4c9430af")] 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 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Scripts/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/actions/AccountActions.js: -------------------------------------------------------------------------------- 1 |  2 | var AppDispatcher = require('app/dispatchers/AppDispatcher'); 3 | var AppConstants = require('app/constants/AppConstants'); 4 | 5 | var loginAction = function (payload) { 6 | AppDispatcher.dispatch(AppConstants.USER_LOGIN, payload); 7 | }; 8 | 9 | var logOutAction = function (payload) { 10 | AppDispatcher.dispatch(AppConstants.USER_LOGOUT, payload); 11 | }; 12 | 13 | var registerAction = function (payload) { 14 | AppDispatcher.dispatch(AppConstants.USER_REGISTER, payload); 15 | } 16 | 17 | var AccountActions = { 18 | login: loginAction, 19 | logOut: logOutAction, 20 | register: registerAction 21 | }; 22 | module.exports = AccountActions; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/actions/ActivityActions.js: -------------------------------------------------------------------------------- 1 | var AppDispatcher = require('app/dispatchers/AppDispatcher'); 2 | var AppConstants = require('app/constants/AppConstants'); 3 | 4 | function addActivity(payload) { 5 | AppDispatcher.dispatch(AppConstants.ACTIVITY_ADD, payload); 6 | } 7 | 8 | function deleteActivity(id) { 9 | AppDispatcher.dispatch( AppConstants.ACTIVITY_DELETE,id); 10 | } 11 | 12 | var ActivityActions = { 13 | addActivity: addActivity, 14 | deleteActivity: deleteActivity 15 | }; 16 | 17 | module.exports = ActivityActions; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/actions/LocationActions.js: -------------------------------------------------------------------------------- 1 |  2 | 3 | var AppDispatcher = require('app/dispatchers/AppDispatcher'); 4 | var AppConstants = require('app/constants/AppConstants'); 5 | 6 | 7 | var LocationActions = { 8 | addLocation: function (payload) { 9 | AppDispatcher.dispatch(AppConstants.LOCATION_ADD, payload); 10 | }, 11 | updateLocation: function (payload) { 12 | AppDispatcher.dispatch(AppConstants.LOCATION_EDIT, payload); 13 | }, 14 | deleteLocation: function (payload) { 15 | AppDispatcher.dispatch(AppConstants.LOCATION_DELETE, payload); 16 | }, 17 | listLocations: function (payload) { 18 | AppDispatcher.dispatch(AppConstants.LOCATION_LIST, payload); 19 | }, 20 | locationById: function (payload) { 21 | AppDispatcher.dispatch(AppConstants.LOCATION_BY_ID, payload); 22 | } 23 | } 24 | 25 | module.exports = LocationActions; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/actions/ResourceActions.js: -------------------------------------------------------------------------------- 1 |  2 | 3 | var AppDispatcher = require('app/dispatchers/AppDispatcher'); 4 | var AppConstants = require('app/constants/AppConstants'); 5 | 6 | 7 | var ResourceActions = { 8 | addResource: function (payload) { 9 | AppDispatcher.dispatch(AppConstants.RESOURCE_ADD, payload); 10 | }, 11 | updateResource: function (payload) { 12 | AppDispatcher.dispatch(AppConstants.RESOURCE_EDIT, payload); 13 | }, 14 | deleteResource: function (payload) { 15 | AppDispatcher.dispatch(AppConstants.RESOURCE_DELETE, payload); 16 | }, 17 | listResources: function (payload) { 18 | AppDispatcher.dispatch(AppConstants.RESOURCE_LIST, payload); 19 | }, 20 | resourceById: function (payload) { 21 | AppDispatcher.dispatch(AppConstants.RESOURCE_BY_ID, payload); 22 | }, 23 | topFiveResources: function (payload) { 24 | AppDispatcher.dispatch(AppConstants.RESOURCES_TOP_FIVE, payload); 25 | } 26 | } 27 | 28 | module.exports = ResourceActions; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/ActivitiesPage.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | 3 | var React = require('react'); 4 | 5 | var ActivitiesPage = React.createClass({ 6 | render: function () { 7 | return ( 8 |
Activities page
9 | ); 10 | } 11 | }); 12 | 13 | module.exports = ActivitiesPage; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/ActivityAddPage.js: -------------------------------------------------------------------------------- 1 | /**@jsx React.DOM*/ 2 | 3 | var React = require('react'); 4 | var Router = require('react-router-component'); 5 | var RequiredTextbox = require('app/components/RequiredTextbox'); 6 | var RequiredTextArea = require('app/components/RequiredTextArea'); 7 | var DatePicker = require('app/components/DatePicker'); 8 | 9 | var ActivityActions = require("app/actions/ActivityActions"); 10 | var ActivityStore = require("app/stores/ActivityStore"); 11 | 12 | var ActivityAddPage = React.createClass({ 13 | mixins:[Router.NavigatableMixin], 14 | 15 | getInitialState: function(){ 16 | return {ErrorMessage: null}; 17 | }, 18 | componentDidMount: function(){ 19 | ActivityStore.addSuccessListner(this.onActivityAdd); 20 | ActivityStore.addFailureListner(this.onFailure); 21 | }, 22 | componentWillUnmount:function(){ 23 | ActivityStore.removeSuccessListner(this.onActivityAdd); 24 | ActivityStore.removeFailureListner(this.onFailure); 25 | }, 26 | onActivityAdd: function(){ 27 | var id = this.props.resourceId; 28 | this.navigate("/Resources/Details/"+ id); 29 | }, 30 | onFailure: function(){ 31 | var error = ActivityStore.getErrorState(); 32 | this.setState({ErrorMessage: error.Message}); 33 | }, 34 | onActivitySubmit: function(){ 35 | 36 | var title = this.refs.Title.getDOMNode().value; 37 | var notes = this.refs.notes.getDOMNode().value; 38 | var date = this.refs.activityDate.getDOMNode().value; 39 | var resourceId = this.props.resourceId; 40 | ActivityActions.addActivity({Title: title, Notes: notes,ActivityDate: date, ResourceId: resourceId}); 41 | 42 | 43 | return false; 44 | }, 45 | render: function () { 46 | 47 | var Link = Router.Link; 48 | 49 | var requiredSpanStyle = { 50 | color:"red" 51 | }; 52 | 53 | var marginStyle ={ 54 | marginBottom:10 55 | }; 56 | 57 | var errorMessage = function(component){ 58 | if (component.state.ErrorMessage) { 59 | return
component.state.ErrorMessage
; 60 | } 61 | return; 62 | }(this); 63 | 64 | var resourceId = this.props.resourceId; 65 | 66 | return
67 |
Add Activity
68 |
69 | {errorMessage} 70 |
71 |
72 | Add Activity 73 |
74 |
75 | 78 | 79 |
80 |
81 | 84 | 85 |
86 |
87 | 90 | 91 |
92 |
93 | 97 | Cancel 98 |
99 |
100 |
101 | } 102 | }); 103 | 104 | module.exports = ActivityAddPage; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/ActivityGridItem.js: -------------------------------------------------------------------------------- 1 | /**@jsx React.DOM*/ 2 | 3 | var React = require('react'); 4 | var ActivityItem = require('app/components/ActivityItem'); 5 | var DeleteIcon = require('app/components/DeleteIcon'); 6 | 7 | var ActivityGridItem = React.createClass({ 8 | handleDelete: function(){ 9 | var a = this.props.activity; 10 | this.props.onItemDelete(a); 11 | }, 12 | render: function(){ 13 | 14 | var gridColumnStyle ={ 15 | width:"80%" 16 | }; 17 | 18 | var activity = this.props.activity; 19 | return
; 20 | } 21 | }); 22 | 23 | 24 | module.exports = ActivityGridItem; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/ActivityItem.js: -------------------------------------------------------------------------------- 1 | /**@jsx React.DOM*/ 2 | 3 | var React = require('react'); 4 | var Router = require('react-router-component'); 5 | 6 | var ActivityItem = React.createClass({ 7 | showNoteModal: function(e){ 8 | this.setState({Modal: true}); 9 | }, 10 | 11 | render: function () { 12 | 13 | var contentStyle ={ 14 | width:"95%" 15 | }; 16 | 17 | var notesModalStyle ={ 18 | color:"#00BAFF", 19 | textDecoration:"none" 20 | }; 21 | 22 | var activity = this.props.activity; 23 | 24 | return
25 | You had an activity 26 | {activity.Title} 27 | against this Resource on {activity.ActivityDateString}
; 28 | } 29 | 30 | }); 31 | 32 | 33 | module.exports = ActivityItem; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/AppContainer.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM*/ 2 | 3 | var React = require('react'); 4 | var Router = require('react-router-component'); 5 | var Header = require('app/components/Header'); 6 | var Footer = require('app/components/Footer'); 7 | var ContentRouter = require('app/components/ContentRouter'); 8 | var AppContainer = React.createClass({ 9 | 10 | routeHandler:function(){ 11 | console.log(this.getPath()); 12 | }, 13 | render: function () { 14 | return ( 15 |
16 |
17 | 18 |
19 | ); 20 | } 21 | }); 22 | 23 | module.exports = AppContainer; 24 | 25 | 26 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/ConfirmationModal.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM*/ 2 | 3 | var React = require("react"); 4 | var $ = require('jquery-browserify'); 5 | 6 | var ConfirmationModal = React.createClass({ 7 | 8 | showModal:function(){ 9 | $('#' + scope.id).modal('show'); 10 | }, 11 | hideModal:function(){ 12 | $('#' + scope.id).modal('hide'); 13 | }, 14 | render:function(){ 15 | var mainCss ={ 16 | marginTop:-110 17 | }; 18 | 19 | return ( 20 |
21 |
22 | Confirm 23 |
24 |
25 | Do you want to proceed? 26 |
27 |
28 |
29 | No 30 |
31 |
32 | Yes 33 |
34 |
35 |
36 | ); 37 | } 38 | }); 39 | 40 | 41 | module.exports = ConfirmationModal; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/ContentRouter.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | 3 | var React = require('react'); 4 | var Router = require('react-router-component'); 5 | var HomePage = require('app/components/HomePage'); 6 | var ResourcesPage = require('app/components/ResourcesPage'); 7 | var ResourceAddPage = require('app/components/ResourceAddPage'); 8 | var ResourceEditPage = require('app/components/ResourceEditPage'); 9 | var LocationsPage = require('app/components/LocationsPage'); 10 | var LocationAddPage = require('app/components/LocationAddPage'); 11 | var LocationEditPage = require('app/components/LocationEditPage'); 12 | var ActivitiesPage = require('app/components/ActivitiesPage'); 13 | var ResourceDetailsPage = require('app/components/ResourceDetailsPage'); 14 | var ActivityAddPage = require('app/components/ActivityAddPage'); 15 | var NotFoundPage = require('app/components/NotFoundPage'); 16 | var Locations = Router.Locations; 17 | var Location =Router.Location; 18 | var NotFound = Router.NotFound; 19 | 20 | var ContentRouter = React.createClass({ 21 | render: function () { 22 | return ( 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | ) 39 | } 40 | 41 | }); 42 | 43 | module.exports = ContentRouter; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/DatePicker.js: -------------------------------------------------------------------------------- 1 | /**@jsx React.DOM*/ 2 | 3 | var React = require('react'); 4 | var Router = require('react-router-component'); 5 | var Addons = require('react-addons'); 6 | var jquery = require('jquery-browserify'); 7 | var jqueryui = require('jquery-ui-browserify'); 8 | 9 | var DatePicker = React.createClass({ 10 | componentDidMount: function(){ 11 | var element = this.getDOMNode(); 12 | var dPicker = $(element).datepicker({ 13 | maxDate:this.props.maxDate , 14 | onSelect: function(d){ 15 | this.setState({value:d , valid:d.length }); 16 | }.bind(this) 17 | }); 18 | }, 19 | getInitialState: function(){ 20 | return {value : this.props.value , valid : !this.props.required || this.props.required && this.props.value}; 21 | }, 22 | onChange: function(e){ 23 | this.setState({ value: e.target.value, valid:e.target.value.length}); 24 | }, 25 | render: function () { 26 | 27 | var controlClass = Addons.classSet({ 28 | "ng-invalid-required":!this.state.valid, 29 | "ng-valid-required":this.state.valid 30 | }); 31 | 32 | return this.transferPropsTo(); 33 | } 34 | }); 35 | 36 | module.exports = DatePicker; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/DeleteIcon.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | var React = require('react'); 3 | 4 | var DeleteIcon = React.createClass({ 5 | propTypes:{ 6 | onClick : React.PropTypes.func 7 | }, 8 | render: function () { 9 | var spanStyle={ 10 | cursor:"pointer", 11 | border: "none", 12 | margin: "0 0", 13 | backgroundColor: "transparent", 14 | color: "black" 15 | }; 16 | 17 | //return(); 18 | return this.transferPropsTo(); 19 | } 20 | }); 21 | // 22 | module.exports = DeleteIcon; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/EditIconLink.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | var React = require('react'); 3 | var Router = require('react-router-component'); 4 | 5 | var EditIconLink = React.createClass({ 6 | propTypes:{ 7 | href: React.PropTypes.string.isRequired 8 | }, 9 | render: function () { 10 | var Link = Router.Link; 11 | return(this.transferPropsTo()); 12 | } 13 | }); 14 | 15 | module.exports = EditIconLink; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/Footer.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM*/ 2 | 3 | var React = require('react'); 4 | 5 | var Footer = React.createClass({ 6 | render: function () { 7 | return (
); 8 | } 9 | 10 | }); 11 | 12 | module.exports = Footer; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/Header.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM*/ 2 | 3 | var React = require('react'); 4 | var Router = require('react-router-component'); 5 | var NavLink =require('app/components/NavLink'); 6 | var AccountStore = require("app/stores/AccountStore"); 7 | var AccountActions = require('app/actions/AccountActions'); 8 | 9 | var Header = React.createClass({ 10 | mixins:[Router.NavigatableMixin], 11 | 12 | handleLogout:function(){ 13 | AccountActions.logOut(); 14 | }, 15 | onChange:function(){ 16 | var accountState = AccountStore.getState(); 17 | if (!accountState.Error) { 18 | this.navigate("/Login"); 19 | return; 20 | } 21 | }, 22 | componentDidMount:function(){ 23 | AccountStore.addChangeListner(this.onChange); 24 | }, 25 | componentWillUnmount:function(){ 26 | AccountStore.removeChangeListner(this.onChange); 27 | }, 28 | render: function () { 29 | 30 | var cursorStyle ={ 31 | cursor:"pointer" 32 | }; 33 | 34 | return (
35 | 36 | 37 | 38 | 39 |
40 | Logout 41 |
42 |
); 43 | } 44 | }); 45 | 46 | module.exports = Header; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/HomePage.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM*/ 2 | 3 | var React = require('react'); 4 | var Router = require('react-router-component'); 5 | var ResourceStore = require('app/stores/ResourceStore'); 6 | var $ = require('jquery-browserify'); 7 | var LoadingIndicator = require('app/components/LoadingIndicator'); 8 | var ResourceActions = require('app/actions/ResourceActions'); 9 | 10 | 11 | var HomePage = React.createClass({ 12 | getInitialState: function(){ 13 | return {Resources: null, ErrorMessage:null, Loading: true}; 14 | }, 15 | componentWillMount: function(){ 16 | ResourceActions.topFiveResources(); 17 | }, 18 | componentDidMount: function(){ 19 | ResourceStore.addSuccessListner(this.onSuccess); 20 | ResourceStore.addFailureListner(this.onSuccess); 21 | }, 22 | componentWillUnmount: function(){ 23 | ResourceStore.removeFailureListner(this.onSuccess); 24 | ResourceStore.removeSuccessListner(this.onSuccess); 25 | }, 26 | onSuccess:function(){ 27 | var resourceState = ResourceStore.getResourcesState(); 28 | this.setState({Resources: resourceState.Resources,Loading: false}); 29 | }, 30 | onFailure: function(){ 31 | var errorState = ResourceStore.getErrorState(); 32 | this.setState({Loading: false, ErrorMessage : erroState.Message}); 33 | }, 34 | render: function () { 35 | 36 | var Link = Router.Link; 37 | 38 | var loading = function(component){ 39 | if (component.state.Loading) { 40 | return ; 41 | } 42 | return; 43 | }(this); 44 | 45 | var error = function(component){ 46 | if (component.state.ErrorMessage) { 47 | return
{component.state.ErrorMessage}
; 48 | } 49 | return; 50 | }(this); 51 | 52 | var resourcesTable = function(component){ 53 | 54 | if (component.state.Resources) { 55 | 56 | var resourceItems = function(){ 57 | 58 | if (!component.state.Resources.length) { 59 | return There are no resources; 60 | } 61 | 62 | return component.state.Resources.map(function(r){ 63 | return {r.Priority}{r.Name} 64 | {r.Description}; 65 | }); 66 | }(); 67 | 68 | return 69 | 70 | 71 | 74 | 77 | 80 | 81 | 82 | 83 | {resourceItems} 84 | 85 |
72 | Priority 73 | 75 | Name 76 | 78 | Description 79 |
; 86 | 87 | } 88 | return ; 89 | 90 | }(this); 91 | 92 | return (
93 |
Home
94 |
95 | {error} {resourcesTable}{loading}
); 96 | } 97 | }); 98 | 99 | module.exports = HomePage; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/InformationModal.js: -------------------------------------------------------------------------------- 1 | /**@jsx React.DOM*/ 2 | 3 | var React = require('react'); 4 | 5 | var InformationModal = React.createClass({ 6 | 7 | getDefaultProps: function(){ 8 | return {header:'Modal header', content: 'Modal content'}; 9 | }, 10 | componentDidMount: function(){ 11 | //var element =this.getDOMNode(); 12 | //$(element).modal("show"); 13 | }, 14 | componentWillUnmount: function(){ 15 | console.log("componentWillUnmount"); 16 | }, 17 | handleBackDropClick: function(e){ 18 | console.log('handleBackDropClick'); 19 | }, 20 | render: function () { 21 | var headerStyle ={ 22 | fontSize:"1em !important" 23 | }; 24 | 25 | return
26 | 27 |
28 | {this.props.header} 29 |
30 |
31 | {this.props.content} 32 |
33 |
; 34 | } 35 | }); 36 | 37 | 38 | module.exports = InformationModal; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/LoadingIndicator.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | 3 | var React = require('react'); 4 | 5 | var LoadingIndicator = React.createClass({ 6 | render: function () { 7 | return (
8 |
Loading..
9 |
); 10 | } 11 | }); 12 | 13 | module.exports = LoadingIndicator; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/LocationAddPage.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | 3 | var React = require('react'); 4 | var Router = require('react-router-component'); 5 | var LocationForm = require('app/components/LocationForm'); 6 | var LoadingIndicator = require('app/components/LoadingIndicator'); 7 | var LocationStore = require('app/stores/LocationStore'); 8 | var LocationActions = require('app/actions/LocationActions'); 9 | 10 | var LocationAddPage = React.createClass({ 11 | mixins: [Router.NavigatableMixin], 12 | 13 | submitForm:function(location){ 14 | this.setState({Loading:true}); 15 | LocationActions.addLocation(location); 16 | return false; 17 | }, 18 | getInitialState:function(){ 19 | return {Location:null,ResponseError:null}; 20 | }, 21 | componentDidMount:function(){ 22 | LocationStore.addSuccessListner(this.onSuccess); 23 | LocationStore.addFailureListner(this.onFailure); 24 | }, 25 | componentWillUnmount:function(){ 26 | LocationStore.removeSuccessListner(this.onSuccess); 27 | LocationStore.removeFailureListner(this.onFailure); 28 | }, 29 | onSuccess:function(){ 30 | this.navigate("/Locations"); 31 | }, 32 | onFailure:function(){ 33 | var error = LocationStore.getErrorState(); 34 | this.setState({ ResponseError: error.Message, Loading: false }); 35 | }, 36 | render: function () { 37 | if (this.state.ResponseError) { 38 | var errorMessage =
{this.state.ResponseError}
; 39 | } 40 | 41 | if (this.state.Loading) { 42 | var loading = ; 43 | } 44 | 45 | return( 46 |
47 |
Add Location
48 |
49 | {errorMessage} 50 | 51 | {loading} 52 |
53 | ); 54 | } 55 | }); 56 | 57 | module.exports = LocationAddPage; 58 | 59 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/LocationEditPage.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM*/ 2 | 3 | var React = require('react'); 4 | var Router = require('react-router-component'); 5 | var AppConstants = require("app/constants/AppConstants"); 6 | var LocationForm = require("app/components/LocationForm"); 7 | var LoadingIndicator = require("app/components/LoadingIndicator"); 8 | var LocationStore = require('app/stores/LocationStore'); 9 | var LocationActions = require('app/actions/LocationActions'); 10 | 11 | var LocationEditPage = React.createClass({ 12 | mixins: [Router.NavigatableMixin], 13 | 14 | getInitialState:function(){ 15 | return {Loading:true,Location:null,ResponseError:null}; 16 | }, 17 | componentDidMount:function(){ 18 | LocationStore.addSuccessListner(this.onSuccess); 19 | LocationStore.addFailureListner(this.onFailure); 20 | }, 21 | componentWillMount:function(){ 22 | var id = this.props.locationId; 23 | LocationActions.locationById(id); 24 | }, 25 | componentWillUnmount:function(){ 26 | LocationStore.removeSuccessListner(this.onSuccess); 27 | LocationStore.removeFailureListner(this.onFailure); 28 | }, 29 | submitForm:function(location){ 30 | location.Id = this.state.Location.Id; 31 | location.CreatedOn = this.state.Location.CreatedOn; 32 | LocationActions.updateLocation(location); 33 | return false; 34 | }, 35 | onSuccess:function(){ 36 | var state = LocationStore.getLocationState(); 37 | if (state.Status === AppConstants.RETRIEVED) { 38 | this.setState({Location: state.Location, Loading: false}); 39 | } 40 | else { 41 | this.navigate("/Locations"); 42 | } 43 | 44 | }, 45 | onFailure:function(){ 46 | var error = LocationStore.getErrorState(); 47 | this.setState({ResponseError: error, Loading: false}); 48 | }, 49 | render: function () { 50 | 51 | if (this.state.Loading) { 52 | return ; 53 | } 54 | 55 | if (this.state.ResponseError) { 56 | var errorMessage =
{this.state.ResponseError.Message}
; 57 | } 58 | 59 | return( 60 |
61 |
Edit Location
62 |
63 | {errorMessage} 64 | 65 |
66 | ); 67 | } 68 | }); 69 | 70 | 71 | module.exports = LocationEditPage; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/LocationForm.js: -------------------------------------------------------------------------------- 1 | /**@jsx React.DOM */ 2 | 3 | var React = require('react'); 4 | var Router = require('react-router-component'); 5 | var RequiredTextbox = require('app/components/RequiredTextbox'); 6 | var RequiredTextArea = require('app/components/RequiredTextArea'); 7 | 8 | var LocationForm = React.createClass({ 9 | 10 | _onSubmit:function(){ 11 | var name = this.refs.Name.getDOMNode().value; 12 | var description = this.refs.Description.getDOMNode().value; 13 | 14 | if (!name || !description) { 15 | return false; 16 | } 17 | 18 | this.props.handleSubmit({ Name: name,Description:description}); 19 | return false; 20 | }, 21 | getDefaultProps:function(){ 22 | return ({location:null}); 23 | }, 24 | render: function () { 25 | 26 | var requiredSpanStyle ={ 27 | "color":"Red" 28 | }; 29 | 30 | var Link = Router.Link; 31 | 32 | var name = this.props.location && this.props.location.Name; 33 | var description = this.props.location && this.props.location.Description; 34 | 35 | return
36 |
37 | 38 | 39 |
40 |
41 |
42 | 45 | 46 |
47 |
48 |
49 | 52 | Cancel 53 |
54 |
; 55 | } 56 | 57 | }); 58 | 59 | module.exports = LocationForm; 60 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/LocationTableRow.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | 3 | var React = require("react"); 4 | var EditIconLink = require('app/components/EditIconLink'); 5 | var DeleteIcon = require('app/components/DeleteIcon'); 6 | 7 | var LocationTableRow = React.createClass({ 8 | handleDelete:function(){ 9 | var id= this.props.location.Id; 10 | this.props.onDelete(id); 11 | }, 12 | render: function () { 13 | 14 | var iconStyle ={ 15 | width:'4%' 16 | }; 17 | 18 | var location = this.props.location; 19 | return ({location.Name}{location.Description}); 20 | } 21 | }); 22 | 23 | 24 | module.exports = LocationTableRow; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/LocationsPage.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM*/ 2 | 3 | var React = require('react'); 4 | var Router = require('react-router-component'); 5 | var LocationStore = require('app/stores/LocationStore'); 6 | var $ = require('jquery-browserify'); 7 | var LoadingIndicator = require('app/components/LoadingIndicator'); 8 | var LocationTableRow = require('app/components/LocationTableRow'); 9 | var ConfirmationModal = require('app/components/ConfirmationModal'); 10 | var LocationActions = require('app/actions/LocationActions'); 11 | 12 | 13 | var LocationsPage = React.createClass({ 14 | 15 | getInitialState:function(){ 16 | return {locations:null, loading:true}; 17 | }, 18 | componentWillMount:function(){ 19 | LocationActions.listLocations(); 20 | }, 21 | componentDidMount:function(){ 22 | LocationStore.addSuccessListner(this.onSuccess); 23 | LocationStore.addFailureListner(this.onFailure); 24 | }, 25 | componentWillUnmount:function(){ 26 | LocationStore.removeSuccessListner(this.onSuccess); 27 | LocationStore.removeFailureListner(this.onFailure); 28 | }, 29 | onSuccess:function(){ 30 | var entity = LocationStore.getLocationsState(); 31 | this.setState({ locations:entity.Locations, loading:false }); 32 | }, 33 | onFailure:function(){ 34 | var error = LocationStore.getErrorState(); 35 | this.setState({Error : error.Message, loading: false}); 36 | }, 37 | handleDelete:function(id){ 38 | if (confirm("Do you want to delete this location?")) { 39 | LocationActions.deleteLocation(id); 40 | this.setState({loading:true}); 41 | } 42 | }, 43 | render: function () { 44 | var Link = Router.Link; 45 | 46 | var btnStyle ={ 47 | float:'right', 48 | "padding-top":10 49 | } 50 | 51 | 52 | 53 | var loading = function(component){ 54 | if (component.state.loading) { 55 | return ; 56 | } 57 | return ; 58 | }(this); 59 | 60 | var error = function(component){ 61 | if (component.state.Error) { 62 | return
63 | {component.state.Error} 64 |
; 65 | } 66 | return; 67 | }(this); 68 | 69 | var confirmModal = 70 | 71 | 72 | var data = function(component){ 73 | if (!component.state.locations) { 74 | return; 75 | } 76 | 77 | if (!component.state.locations.length) { 78 | return There are no locations in the system; 79 | } 80 | 81 | return component.state.locations.map(function (location) { 82 | return ( 83 | 84 | ); 85 | }.bind(component)); 86 | }(this); 87 | 88 | 89 | return
90 |
Locations
91 |
92 | {error} 93 |
94 | {confirmModal} 95 | 96 | 97 | 98 | 101 | 104 | 105 | 106 | 107 | 108 | 109 | {data} 110 | 111 |
99 | Name 100 | 102 | Description 103 |
{loading} 112 |
113 | Create new 114 |
115 |
116 |
117 | } 118 | }); 119 | 120 | 121 | module.exports = LocationsPage; 122 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/LoginPage.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM*/ 2 | 3 | var React = require('react'); 4 | var Router= require('react-router-component'); 5 | var RequiredEmail = require('app/components/RequiredEmail'); 6 | var RequiredTextbox = require('app/components/RequiredTextbox'); 7 | var LoadingIndicator = require('app/components/LoadingIndicator'); 8 | var AccountActions = require('app/actions/AccountActions'); 9 | var AccountStore = require('app/stores/AccountStore'); 10 | 11 | var LoginPage = React.createClass({ 12 | mixins:[Router.NavigatableMixin], 13 | 14 | getInitialState:function(){ 15 | return {ErrorMessage:null, Loading:false}; 16 | }, 17 | componentDidMount:function(){ 18 | AccountStore.addSuccessListner(this.onSuccess); 19 | AccountStore.addFailureListner(this.onError); 20 | }, 21 | componentWillUnmount:function(){ 22 | AccountStore.removeSuccessListner(this.onSuccess); 23 | AccountStore.removeFailureListner(this.onError); 24 | }, 25 | onSuccess:function(){ 26 | this.navigate("/Home"); 27 | }, 28 | onError: function(){ 29 | var error = AccountStore.getErrorState(); 30 | this.setState({ErrorMessage: error.Message, Loading: false}); 31 | }, 32 | _onSubmit:function(){ 33 | 34 | var email = this.refs.Email.getDOMNode().value; 35 | var password = this.refs.Password.getDOMNode().value 36 | 37 | if (!email || !password) { 38 | return false; 39 | } 40 | 41 | AccountActions.login({ username: email, password: password, grant_type:"password" }); 42 | 43 | this.setState({Loading:true}); 44 | return false; 45 | 46 | }, 47 | render: function () { 48 | 49 | var Link = Router.Link; 50 | 51 | var containerStyle ={ 52 | "marginTop":"75px" 53 | } 54 | 55 | var requiredSpanStyle ={ 56 | "color":"red" 57 | } 58 | 59 | var error = function(component){ 60 | if (component.state.ErrorMessage) { 61 | return
62 | {component.state.ErrorMessage} 63 |
64 |
65 |
; 66 | } 67 | return ; 68 | }(this); 69 | 70 | var loading = function(component){ 71 | if (component.state.Loading) { 72 | return ; 73 | } 74 | return; 75 | }(this); 76 | 77 | return ( 78 |
79 |
80 |
Login
81 |
82 | {error} 83 |
84 | 87 | 88 |
89 |
90 | 93 | 94 |
95 |
96 | 97 | Register 98 |
99 |
100 | {loading} 101 |
102 | ); 103 | } 104 | 105 | }); 106 | 107 | module.exports =LoginPage; 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/NavLink.js: -------------------------------------------------------------------------------- 1 | /**@jsx React.DOM */ 2 | 3 | var React = require('react'); 4 | var Addons = require('react-addons'); 5 | var Router = require('react-router-component'); 6 | 7 | var NavLink = React.createClass({ 8 | mixins:[Router.NavigatableMixin], 9 | 10 | render: function () { 11 | var currentPath = this.getPath(); 12 | var isCurrentItem = currentPath.lastIndexOf(this.props.value) > -1; 13 | 14 | var cx = Addons.classSet; 15 | var navClass = cx({ 16 | "item":true, 17 | "active": isCurrentItem 18 | }); 19 | 20 | var Link = Router.Link; 21 | return this.transferPropsTo({this.props.value}); 22 | } 23 | }); 24 | 25 | 26 | module.exports = NavLink; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/NavigationRouter.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM */ 2 | 3 | var React = require('react'); 4 | var Router = require('react-router-component'); 5 | var Header =require('app/components/Header'); 6 | var AppContainer = require('app/components/AppContainer'); 7 | var LoginPage = require('app/components/LoginPage'); 8 | var RegistrationPage = require('app/components/RegistrationPage'); 9 | var NotFound = Router.NotFound; 10 | 11 | var Locations = Router.Locations; 12 | var Location =Router.Location; 13 | 14 | var NavigationRouter = React.createClass({ 15 | render: function () { 16 | 17 | return ( 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | ); 26 | } 27 | 28 | }); 29 | 30 | module.exports = NavigationRouter; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/NotFoundPage.js: -------------------------------------------------------------------------------- 1 | /** @jsx React.DOM*/ 2 | var React = require('react'); 3 | 4 | var NotFoundPage = React.createClass({ 5 | render: function () { 6 | return ( 7 |
Page not found
8 | ); 9 | } 10 | }); 11 | 12 | module.exports = NotFoundPage; -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/RequiredEmail.js: -------------------------------------------------------------------------------- 1 | /**@jsx React.DOM */ 2 | 3 | var React = require('react'); 4 | var Addons = require('react-addons'); 5 | 6 | var RequiredEmail = React.createClass({ 7 | 8 | getInitialState: function(){ 9 | return {value :''}; 10 | }, 11 | _onChange:function(e){ 12 | var exp = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 13 | var validEmail = e.target.value && exp.test(e.target.value); 14 | this.setState({value:e.target.value, valid:validEmail}); 15 | }, 16 | render: function () { 17 | 18 | var controlClass = Addons.classSet({ 19 | "ng-invalid-required":!this.state.valid, 20 | "ng-valid-required":this.state.valid 21 | }); 22 | 23 | return this.transferPropsTo(); 24 | } 25 | 26 | }); 27 | 28 | 29 | module.exports = RequiredEmail; 30 | 31 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/RequiredPassword.js: -------------------------------------------------------------------------------- 1 | /**@jsx React.DOM */ 2 | 3 | var React = require('react'); 4 | var Addons = require('react-addons'); 5 | 6 | var RequiredTextbox = React.createClass({ 7 | 8 | getInitialState: function(){ 9 | return {value : this.props.value ,valid: this.props.value && this.props.value.length}; 10 | }, 11 | getDefaultProps:function(){ 12 | return {type:"text", pattern:null}; 13 | }, 14 | onChange:function(e){ 15 | this.setState({value:e.target.value, valid:e.target.value.length}); 16 | }, 17 | render: function () { 18 | 19 | var controlClass = Addons.classSet({ 20 | "ng-invalid-required":!this.state.valid, 21 | "ng-valid-required":this.state.valid 22 | }); 23 | 24 | return this.transferPropsTo(); 25 | } 26 | 27 | }); 28 | 29 | 30 | module.exports = RequiredTextbox; 31 | 32 | -------------------------------------------------------------------------------- /ResourceMetadata/ResourceMetadata.Web/app/components/RequiredTextArea.js: -------------------------------------------------------------------------------- 1 | /**@jsx React.DOM */ 2 | 3 | var React = require('react'); 4 | var Addons = require('react-addons'); 5 | 6 | var RequiredTextArea = React.createClass({ 7 | 8 | getInitialState: function(){ 9 | return {value :this.props && this.props.value , valid : this.props && this.props.value && this.props.value.length}; 10 | }, 11 | _onChange:function(e){ 12 | this.setState({value:e.target.value, valid:e.target.value.length}); 13 | }, 14 | render: function () { 15 | 16 | var controlClass = Addons.classSet({ 17 | "ng-invalid-required":!this.state.valid, 18 | "ng-valid-required":this.state.valid 19 | }); 20 | 21 | return this.transferPropsTo(