diff --git a/public/index.html b/public/index.html index 814a07c..7741ca1 100644 --- a/public/index.html +++ b/public/index.html @@ -5,10 +5,13 @@ Pepyatka - - + + diff --git a/public/js/app/controllers/SettingsGenericController.js b/public/js/app/controllers/SettingsGenericController.js index e161eaa..8419d8e 100644 --- a/public/js/app/controllers/SettingsGenericController.js +++ b/public/js/app/controllers/SettingsGenericController.js @@ -34,6 +34,10 @@ define(["config", actions: { previewProfilePicture: function (newFile) { this.set('newProfilePicture', newFile) + }, + + themeSelect: function(theme) { + Ember.$('link#theme-css').attr("href", "/css/themes/" + theme + "/app.css"); } } }) diff --git a/public/js/app/fields/ThemeSelectorView.js b/public/js/app/fields/ThemeSelectorView.js new file mode 100644 index 0000000..cf63171 --- /dev/null +++ b/public/js/app/fields/ThemeSelectorView.js @@ -0,0 +1,12 @@ +define(["app/app"], function(App) { + "use strict"; + + App.ThemeSelectorView = Ember.Select.extend({ + content: ["helvetica", "fresh"], + classNames: ['form-control theme-selector'], + + change: function(event) { + this.get('controller').send('themeSelect', event.target.value); + } + }) +}) diff --git a/public/js/app/main.js b/public/js/app/main.js index d3e380e..8c60fdd 100644 --- a/public/js/app/main.js +++ b/public/js/app/main.js @@ -57,6 +57,7 @@ define([ "fields/CreateCommentView", "fields/EditCommentView", "fields/UpdateProfilePictureView", + "fields/ThemeSelectorView", "routes/ForgotPasswordRoute", "routes/GroupsHomeRoute", diff --git a/public/js/app/templates/settingsIndexTemplate.handlebars b/public/js/app/templates/settingsIndexTemplate.handlebars index 5de5beb..25480f3 100644 --- a/public/js/app/templates/settingsIndexTemplate.handlebars +++ b/public/js/app/templates/settingsIndexTemplate.handlebars @@ -83,3 +83,8 @@ {{profilePicErrors}} {{/if}} + +
+ + {{view 'theme-selector'}} +