Commit 00028702fc516f799296d10a1d0da960e93a0381
1 parent
ed75afbb
Exists in
master
and in
4 other branches
design tab improved. Themes added
Showing
10 changed files
with
64 additions
and
21 deletions
Show diff stats
app/assets/stylesheets/common.scss
@@ -642,3 +642,12 @@ p.time { | @@ -642,3 +642,12 @@ p.time { | ||
642 | } | 642 | } |
643 | } | 643 | } |
644 | } | 644 | } |
645 | + | ||
646 | +.styled_image { | ||
647 | + -webkit-border-radius: 4px; | ||
648 | + -moz-border-radius: 4px; | ||
649 | + border-radius: 4px; | ||
650 | + -moz-box-shadow: 0 0 5px #888; | ||
651 | + -webkit-box-shadow: 0 0 5px#888; | ||
652 | + box-shadow: 0 0 5px #888; | ||
653 | +} |
app/helpers/application_helper.rb
@@ -113,4 +113,12 @@ module ApplicationHelper | @@ -113,4 +113,12 @@ module ApplicationHelper | ||
113 | def layout | 113 | def layout |
114 | controller.send :_layout | 114 | controller.send :_layout |
115 | end | 115 | end |
116 | + | ||
117 | + def app_theme | ||
118 | + if current_user && current_user.theme_id == 1 | ||
119 | + "ui_basic" | ||
120 | + else | ||
121 | + "ui_mars" | ||
122 | + end | ||
123 | + end | ||
116 | end | 124 | end |
app/models/user.rb
@@ -6,7 +6,7 @@ class User < ActiveRecord::Base | @@ -6,7 +6,7 @@ class User < ActiveRecord::Base | ||
6 | 6 | ||
7 | # Setup accessible (or protected) attributes for your model | 7 | # Setup accessible (or protected) attributes for your model |
8 | attr_accessible :email, :password, :password_confirmation, :remember_me, | 8 | attr_accessible :email, :password, :password_confirmation, :remember_me, |
9 | - :name, :projects_limit, :skype, :linkedin, :twitter, :dark_scheme | 9 | + :name, :projects_limit, :skype, :linkedin, :twitter, :dark_scheme, :theme_id |
10 | 10 | ||
11 | has_many :users_projects, :dependent => :destroy | 11 | has_many :users_projects, :dependent => :destroy |
12 | has_many :projects, :through => :users_projects | 12 | has_many :projects, :through => :users_projects |
app/views/layouts/application.html.haml
1 | !!! 5 | 1 | !!! 5 |
2 | %html{ :lang => "en"} | 2 | %html{ :lang => "en"} |
3 | = render "layouts/head" | 3 | = render "layouts/head" |
4 | - %body.ui_basic.application | 4 | + %body{:class => "#{app_theme} application"} |
5 | = render "layouts/flash" | 5 | = render "layouts/flash" |
6 | = render "layouts/head_panel", :title => "Dashboard" | 6 | = render "layouts/head_panel", :title => "Dashboard" |
7 | .container | 7 | .container |
app/views/layouts/error.html.haml
1 | !!! 5 | 1 | !!! 5 |
2 | %html{ :lang => "en"} | 2 | %html{ :lang => "en"} |
3 | = render "layouts/head" | 3 | = render "layouts/head" |
4 | - %body.ui_basic.application | 4 | + %body{:class => "#{app_theme} application"} |
5 | = render "layouts/flash" | 5 | = render "layouts/flash" |
6 | = render "layouts/head_panel", :title => "" | 6 | = render "layouts/head_panel", :title => "" |
7 | .container | 7 | .container |
app/views/layouts/profile.html.haml
1 | !!! 5 | 1 | !!! 5 |
2 | %html{ :lang => "en"} | 2 | %html{ :lang => "en"} |
3 | = render "layouts/head" | 3 | = render "layouts/head" |
4 | - %body.ui_basic.profile | 4 | + %body{:class => "#{app_theme} profile"} |
5 | = render "layouts/flash" | 5 | = render "layouts/flash" |
6 | = render "layouts/head_panel", :title => "Profile" | 6 | = render "layouts/head_panel", :title => "Profile" |
7 | .container | 7 | .container |
app/views/layouts/project.html.haml
1 | !!! 5 | 1 | !!! 5 |
2 | %html{ :lang => "en"} | 2 | %html{ :lang => "en"} |
3 | = render "layouts/head" | 3 | = render "layouts/head" |
4 | - %body.ui_basic.project | 4 | + %body{:class => "#{app_theme} project"} |
5 | = render "layouts/flash" | 5 | = render "layouts/flash" |
6 | = render "layouts/head_panel", :title => @project.name | 6 | = render "layouts/head_panel", :title => @project.name |
7 | .container | 7 | .container |
app/views/profile/design.html.haml
1 | -%h3 Design | ||
2 | -%hr | ||
3 | -= form_for @user, :url => profile_update_path, :method => :put do |f| | 1 | += form_for @user, :url => profile_update_path, :remote => true, :method => :put do |f| |
2 | + %h3 Application theme | ||
3 | + %hr | ||
4 | + .clearfix | ||
5 | + = label_tag do | ||
6 | + = f.radio_button :theme_id, 1 | ||
7 | + Default | ||
8 | + | ||
9 | + = label_tag do | ||
10 | + = f.radio_button :theme_id, 2 | ||
11 | + Classic | ||
12 | + %br | ||
13 | + %h3 Code review | ||
14 | + %hr | ||
4 | .row | 15 | .row |
5 | %label.span4{:for => "user_dark_scheme_false"} | 16 | %label.span4{:for => "user_dark_scheme_false"} |
6 | - = image_tag "white.png", :width => 210 | ||
7 | %center | 17 | %center |
8 | %h4 | 18 | %h4 |
9 | = f.radio_button :dark_scheme, false | 19 | = f.radio_button :dark_scheme, false |
10 | White code preview | 20 | White code preview |
21 | + = image_tag "white.png", :width => 210, :class => "styled_image" | ||
11 | %label.span4{:for => "user_dark_scheme_true"} | 22 | %label.span4{:for => "user_dark_scheme_true"} |
12 | - = image_tag "dark.png", :width => 210 | ||
13 | %center | 23 | %center |
14 | %h4 | 24 | %h4 |
15 | = f.radio_button :dark_scheme, true | 25 | = f.radio_button :dark_scheme, true |
16 | Dark code preview | 26 | Dark code preview |
17 | - .clearfix | ||
18 | - .actions | ||
19 | - = f.submit 'Save', :class => "btn" | 27 | + = image_tag "dark.png", :width => 210, :class => "styled_image" |
20 | 28 | ||
29 | +:javascript | ||
30 | + $(function(){ | ||
31 | + $(".edit_user input").bind("click", function() { | ||
32 | + $(".edit_user").submit(); | ||
33 | + }); | ||
34 | + }) |
db/schema.rb
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | # | 11 | # |
12 | # It's strongly recommended to check this file into your version control system. | 12 | # It's strongly recommended to check this file into your version control system. |
13 | 13 | ||
14 | -ActiveRecord::Schema.define(:version => 20120228134252) do | 14 | +ActiveRecord::Schema.define(:version => 20120301185805) do |
15 | 15 | ||
16 | create_table "events", :force => true do |t| | 16 | create_table "events", :force => true do |t| |
17 | t.string "target_type" | 17 | t.string "target_type" |
@@ -24,6 +24,18 @@ ActiveRecord::Schema.define(:version => 20120228134252) do | @@ -24,6 +24,18 @@ ActiveRecord::Schema.define(:version => 20120228134252) do | ||
24 | t.integer "action" | 24 | t.integer "action" |
25 | end | 25 | end |
26 | 26 | ||
27 | + create_table "features", :force => true do |t| | ||
28 | + t.string "name" | ||
29 | + t.string "branch_name" | ||
30 | + t.integer "assignee_id" | ||
31 | + t.integer "author_id" | ||
32 | + t.integer "project_id" | ||
33 | + t.datetime "created_at" | ||
34 | + t.datetime "updated_at" | ||
35 | + t.string "version" | ||
36 | + t.integer "status", :default => 0, :null => false | ||
37 | + end | ||
38 | + | ||
27 | create_table "issues", :force => true do |t| | 39 | create_table "issues", :force => true do |t| |
28 | t.string "title" | 40 | t.string "title" |
29 | t.integer "assignee_id" | 41 | t.integer "assignee_id" |
@@ -150,6 +162,7 @@ ActiveRecord::Schema.define(:version => 20120228134252) do | @@ -150,6 +162,7 @@ ActiveRecord::Schema.define(:version => 20120228134252) do | ||
150 | t.string "twitter", :default => "", :null => false | 162 | t.string "twitter", :default => "", :null => false |
151 | t.string "authentication_token" | 163 | t.string "authentication_token" |
152 | t.boolean "dark_scheme", :default => false, :null => false | 164 | t.boolean "dark_scheme", :default => false, :null => false |
165 | + t.integer "theme_id", :default => 1, :null => false | ||
153 | end | 166 | end |
154 | 167 | ||
155 | add_index "users", ["email"], :name => "index_users_on_email", :unique => true | 168 | add_index "users", ["email"], :name => "index_users_on_email", :unique => true |
@@ -163,13 +176,6 @@ ActiveRecord::Schema.define(:version => 20120228134252) do | @@ -163,13 +176,6 @@ ActiveRecord::Schema.define(:version => 20120228134252) do | ||
163 | t.integer "project_access", :default => 0, :null => false | 176 | t.integer "project_access", :default => 0, :null => false |
164 | end | 177 | end |
165 | 178 | ||
166 | - create_table "web_hook_urls", :force => true do |t| | ||
167 | - t.string "url" | ||
168 | - t.integer "project_id" | ||
169 | - t.datetime "created_at" | ||
170 | - t.datetime "updated_at" | ||
171 | - end | ||
172 | - | ||
173 | create_table "web_hooks", :force => true do |t| | 179 | create_table "web_hooks", :force => true do |t| |
174 | t.string "url" | 180 | t.string "url" |
175 | t.integer "project_id" | 181 | t.integer "project_id" |