Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-03-01 23:23:50 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-03-01 23:23:50 +0400
commit00028702fc516f799296d10a1d0da960e93a0381 (patch)
tree21c56e5f03a579bca3345825949b9a1a5cdc27ae
parented75afbb1014920f811a33524ba73cf1a7d78dc9 (diff)
design tab improved. Themes added
-rw-r--r--app/assets/stylesheets/common.scss9
-rw-r--r--app/helpers/application_helper.rb8
-rw-r--r--app/models/user.rb2
-rw-r--r--app/views/layouts/application.html.haml2
-rw-r--r--app/views/layouts/error.html.haml2
-rw-r--r--app/views/layouts/profile.html.haml2
-rw-r--r--app/views/layouts/project.html.haml2
-rw-r--r--app/views/profile/design.html.haml30
-rw-r--r--db/migrate/20120301185805_add_theme_to_user.rb6
-rw-r--r--db/schema.rb22
10 files changed, 64 insertions, 21 deletions
diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss
index 5ea1cffeab1..1d20ce3ba1c 100644
--- a/app/assets/stylesheets/common.scss
+++ b/app/assets/stylesheets/common.scss
@@ -642,3 +642,12 @@ p.time {
}
}
}
+
+.styled_image {
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ -moz-box-shadow: 0 0 5px #888;
+ -webkit-box-shadow: 0 0 5px#888;
+ box-shadow: 0 0 5px #888;
+}
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 12fe333a74a..4d85e39464b 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -113,4 +113,12 @@ module ApplicationHelper
def layout
controller.send :_layout
end
+
+ def app_theme
+ if current_user && current_user.theme_id == 1
+ "ui_basic"
+ else
+ "ui_mars"
+ end
+ end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 942f333702e..660e5a21ad9 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -6,7 +6,7 @@ class User < ActiveRecord::Base
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me,
- :name, :projects_limit, :skype, :linkedin, :twitter, :dark_scheme
+ :name, :projects_limit, :skype, :linkedin, :twitter, :dark_scheme, :theme_id
has_many :users_projects, :dependent => :destroy
has_many :projects, :through => :users_projects
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 8a1739f12a5..0d5d829e00d 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -1,7 +1,7 @@
!!! 5
%html{ :lang => "en"}
= render "layouts/head"
- %body.ui_basic.application
+ %body{:class => "#{app_theme} application"}
= render "layouts/flash"
= render "layouts/head_panel", :title => "Dashboard"
.container
diff --git a/app/views/layouts/error.html.haml b/app/views/layouts/error.html.haml
index 544fdcc7596..52fa56f4c76 100644
--- a/app/views/layouts/error.html.haml
+++ b/app/views/layouts/error.html.haml
@@ -1,7 +1,7 @@
!!! 5
%html{ :lang => "en"}
= render "layouts/head"
- %body.ui_basic.application
+ %body{:class => "#{app_theme} application"}
= render "layouts/flash"
= render "layouts/head_panel", :title => ""
.container
diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml
index 091e85631f6..3e049f4a6c7 100644
--- a/app/views/layouts/profile.html.haml
+++ b/app/views/layouts/profile.html.haml
@@ -1,7 +1,7 @@
!!! 5
%html{ :lang => "en"}
= render "layouts/head"
- %body.ui_basic.profile
+ %body{:class => "#{app_theme} profile"}
= render "layouts/flash"
= render "layouts/head_panel", :title => "Profile"
.container
diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml
index 2bc326df8c4..e79161db0f9 100644
--- a/app/views/layouts/project.html.haml
+++ b/app/views/layouts/project.html.haml
@@ -1,7 +1,7 @@
!!! 5
%html{ :lang => "en"}
= render "layouts/head"
- %body.ui_basic.project
+ %body{:class => "#{app_theme} project"}
= render "layouts/flash"
= render "layouts/head_panel", :title => @project.name
.container
diff --git a/app/views/profile/design.html.haml b/app/views/profile/design.html.haml
index 68746fdc214..11ab73337be 100644
--- a/app/views/profile/design.html.haml
+++ b/app/views/profile/design.html.haml
@@ -1,20 +1,34 @@
-%h3 Design
-%hr
-= form_for @user, :url => profile_update_path, :method => :put do |f|
+= form_for @user, :url => profile_update_path, :remote => true, :method => :put do |f|
+ %h3 Application theme
+ %hr
+ .clearfix
+ = label_tag do
+ = f.radio_button :theme_id, 1
+ Default
+
+ = label_tag do
+ = f.radio_button :theme_id, 2
+ Classic
+ %br
+ %h3 Code review
+ %hr
.row
%label.span4{:for => "user_dark_scheme_false"}
- = image_tag "white.png", :width => 210
%center
%h4
= f.radio_button :dark_scheme, false
White code preview
+ = image_tag "white.png", :width => 210, :class => "styled_image"
%label.span4{:for => "user_dark_scheme_true"}
- = image_tag "dark.png", :width => 210
%center
%h4
= f.radio_button :dark_scheme, true
Dark code preview
- .clearfix
- .actions
- = f.submit 'Save', :class => "btn"
+ = image_tag "dark.png", :width => 210, :class => "styled_image"
+:javascript
+ $(function(){
+ $(".edit_user input").bind("click", function() {
+ $(".edit_user").submit();
+ });
+ })
diff --git a/db/migrate/20120301185805_add_theme_to_user.rb b/db/migrate/20120301185805_add_theme_to_user.rb
new file mode 100644
index 00000000000..7c2e55692b0
--- /dev/null
+++ b/db/migrate/20120301185805_add_theme_to_user.rb
@@ -0,0 +1,6 @@
+class AddThemeToUser < ActiveRecord::Migration
+ def change
+ add_column :users, :theme_id, :integer, :null => false, :default => 1
+
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index c5e14a69542..1bb5f709dcc 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120228134252) do
+ActiveRecord::Schema.define(:version => 20120301185805) do
create_table "events", :force => true do |t|
t.string "target_type"
@@ -24,6 +24,18 @@ ActiveRecord::Schema.define(:version => 20120228134252) do
t.integer "action"
end
+ create_table "features", :force => true do |t|
+ t.string "name"
+ t.string "branch_name"
+ t.integer "assignee_id"
+ t.integer "author_id"
+ t.integer "project_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "version"
+ t.integer "status", :default => 0, :null => false
+ end
+
create_table "issues", :force => true do |t|
t.string "title"
t.integer "assignee_id"
@@ -150,6 +162,7 @@ ActiveRecord::Schema.define(:version => 20120228134252) do
t.string "twitter", :default => "", :null => false
t.string "authentication_token"
t.boolean "dark_scheme", :default => false, :null => false
+ t.integer "theme_id", :default => 1, :null => false
end
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
@@ -163,13 +176,6 @@ ActiveRecord::Schema.define(:version => 20120228134252) do
t.integer "project_access", :default => 0, :null => false
end
- create_table "web_hook_urls", :force => true do |t|
- t.string "url"
- t.integer "project_id"
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
create_table "web_hooks", :force => true do |t|
t.string "url"
t.integer "project_id"