Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
9a2a8612
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9a2a8612
编写于
12月 20, 2011
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Design tab for profile. Colorscheme as db value
上级
2f7b6716
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
100 addition
and
66 deletion
+100
-66
app/assets/images/dark.png
app/assets/images/dark.png
+0
-0
app/assets/images/white.png
app/assets/images/white.png
+0
-0
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+12
-0
app/controllers/profile_controller.rb
app/controllers/profile_controller.rb
+6
-2
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+2
-2
app/models/tree.rb
app/models/tree.rb
+2
-0
app/models/user.rb
app/models/user.rb
+1
-1
app/views/layouts/profile.html.haml
app/views/layouts/profile.html.haml
+1
-0
app/views/layouts/user.html.haml
app/views/layouts/user.html.haml
+0
-31
app/views/profile/design.html.haml
app/views/profile/design.html.haml
+22
-0
app/views/profile/show.html.haml
app/views/profile/show.html.haml
+31
-26
app/views/refs/_tree_file.html.haml
app/views/refs/_tree_file.html.haml
+2
-2
config/routes.rb
config/routes.rb
+2
-1
db/migrate/20111220190817_add_coloscheme_option_to_user.rb
db/migrate/20111220190817_add_coloscheme_option_to_user.rb
+5
-0
db/schema.rb
db/schema.rb
+14
-1
未找到文件。
app/assets/images/dark.png
0 → 100644
浏览文件 @
9a2a8612
16.5 KB
app/assets/images/white.png
0 → 100644
浏览文件 @
9a2a8612
16.8 KB
app/assets/stylesheets/projects.css.scss
浏览文件 @
9a2a8612
...
@@ -654,3 +654,15 @@ body.project-page h2.icon.loading {
...
@@ -654,3 +654,15 @@ body.project-page h2.icon.loading {
background
:
url("ajax-loader-tree.gif")
no-repeat
;
background
:
url("ajax-loader-tree.gif")
no-repeat
;
}
}
}
}
.dark_scheme_box
{
padding
:
20px
0
;
label
{
float
:left
;
box-shadow
:
0
0px
5px
rgba
(
0
,
0
,
0
,.
3
);
img
{
}
}
}
app/controllers/profile_controller.rb
浏览文件 @
9a2a8612
...
@@ -4,10 +4,14 @@ class ProfileController < ApplicationController
...
@@ -4,10 +4,14 @@ class ProfileController < ApplicationController
@user
=
current_user
@user
=
current_user
end
end
def
social_update
def
design
@user
=
current_user
end
def
update
@user
=
current_user
@user
=
current_user
@user
.
update_attributes
(
params
[
:user
])
@user
.
update_attributes
(
params
[
:user
])
redirect_to
[
:profile
]
redirect_to
:back
end
end
def
password
def
password
...
...
app/helpers/application_helper.rb
浏览文件 @
9a2a8612
...
@@ -2,9 +2,9 @@ require 'digest/md5'
...
@@ -2,9 +2,9 @@ require 'digest/md5'
module
ApplicationHelper
module
ApplicationHelper
include
Utils
::
CharEncode
include
Utils
::
CharEncode
def
gravatar_icon
(
user_email
)
def
gravatar_icon
(
user_email
,
size
=
40
)
gravatar_host
=
request
.
ssl?
?
"https://secure.gravatar.com"
:
"http://www.gravatar.com"
gravatar_host
=
request
.
ssl?
?
"https://secure.gravatar.com"
:
"http://www.gravatar.com"
"
#{
gravatar_host
}
/avatar/
#{
Digest
::
MD5
.
hexdigest
(
user_email
)
}
?s=
40
&d=identicon"
"
#{
gravatar_host
}
/avatar/
#{
Digest
::
MD5
.
hexdigest
(
user_email
)
}
?s=
#{
size
}
&d=identicon"
end
end
def
fixed_mode?
def
fixed_mode?
...
...
app/models/tree.rb
浏览文件 @
9a2a8612
...
@@ -7,6 +7,8 @@ class Tree
...
@@ -7,6 +7,8 @@ class Tree
:name
,
:name
,
:data
,
:data
,
:mime_type
,
:mime_type
,
:mode
,
:size
,
:text?
,
:text?
,
:colorize
,
:colorize
,
:to
=>
:tree
:to
=>
:tree
...
...
app/models/user.rb
浏览文件 @
9a2a8612
...
@@ -6,7 +6,7 @@ class User < ActiveRecord::Base
...
@@ -6,7 +6,7 @@ class User < ActiveRecord::Base
# Setup accessible (or protected) attributes for your model
# Setup accessible (or protected) attributes for your model
attr_accessible
:email
,
:password
,
:password_confirmation
,
:remember_me
,
attr_accessible
:email
,
:password
,
:password_confirmation
,
:remember_me
,
:name
,
:projects_limit
,
:skype
,
:linkedin
,
:twitter
:name
,
:projects_limit
,
:skype
,
:linkedin
,
:twitter
,
:dark_scheme
has_many
:users_projects
,
:dependent
=>
:destroy
has_many
:users_projects
,
:dependent
=>
:destroy
has_many
:projects
,
:through
=>
:users_projects
has_many
:projects
,
:through
=>
:users_projects
...
...
app/views/layouts/profile.html.haml
浏览文件 @
9a2a8612
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
%aside
%aside
=
link_to
"Profile"
,
profile_path
,
:class
=>
current_page?
(
:controller
=>
"profile"
,
:action
=>
:show
)
?
"current"
:
nil
=
link_to
"Profile"
,
profile_path
,
:class
=>
current_page?
(
:controller
=>
"profile"
,
:action
=>
:show
)
?
"current"
:
nil
=
link_to
"Password & token"
,
profile_password_path
,
:class
=>
current_page?
(
:controller
=>
"profile"
,
:action
=>
:password
)
?
"current"
:
nil
=
link_to
"Password & token"
,
profile_password_path
,
:class
=>
current_page?
(
:controller
=>
"profile"
,
:action
=>
:password
)
?
"current"
:
nil
=
link_to
"Design"
,
profile_design_path
,
:class
=>
current_page?
(
:controller
=>
"profile"
,
:action
=>
:design
)
?
"current"
:
nil
=
link_to
keys_path
,
:class
=>
controller
.
controller_name
==
"keys"
?
"current"
:
nil
do
=
link_to
keys_path
,
:class
=>
controller
.
controller_name
==
"keys"
?
"current"
:
nil
do
Keys
Keys
-
unless
current_user
.
keys
.
empty?
-
unless
current_user
.
keys
.
empty?
...
...
app/views/layouts/user.html.haml
已删除
100644 → 0
浏览文件 @
2f7b6716
!!!
%html
%head
%title
GitLab
#{
" - #{current_user.name}"
}
=
stylesheet_link_tag
"application"
=
javascript_include_tag
"application"
=
csrf_meta_tags
=
javascript_tag
do
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
REQ_REFFER = "
#{
request
.
env
[
"HTTP_REFERER"
]
}
";
%body
{
:class
=>
body_class
(
'project-page'
),
:id
=>
yield
(
:boyd_id
)}
=
render
:partial
=>
"layouts/flash"
#container
=
render
:partial
=>
"layouts/head_panel"
.project-container
.project-sidebar
.fixed
%aside
=
link_to
issues_path
,
:class
=>
current_page?
(
issues_path
)
?
"current"
:
nil
do
Issues
-
unless
current_user
.
assigned_issues
.
empty?
%span
{
:class
=>
"number"
}=
current_user
.
assigned_issues
.
count
=
link_to
merge_requests_path
,
:class
=>
current_page?
(
merge_requests_path
)
?
"current"
:
nil
do
Merge Requests
-
unless
current_user
.
assigned_merge_requests
.
empty?
%span
{
:class
=>
"number"
}=
current_user
.
assigned_merge_requests
.
count
.project-content
=
yield
app/views/profile/design.html.haml
0 → 100644
浏览文件 @
9a2a8612
.ui-box.width-100p
%h3
Design
=
form_for
@user
,
:url
=>
profile_update_path
,
:method
=>
:put
do
|
f
|
.data
.left.dark_scheme_box
%label
{
:for
=>
"user_dark_scheme_false"
}
=
image_tag
"white.png"
,
:width
=>
310
,
:height
=>
212
%center
%h4
=
f
.
radio_button
:dark_scheme
,
false
White code preview
.right.dark_scheme_box
%label
{
:for
=>
"user_dark_scheme_true"
}
=
image_tag
"dark.png"
,
:width
=>
310
,
:height
=>
212
%center
%h4
=
f
.
radio_button
:dark_scheme
,
true
Dark code preview
.clear
.buttons
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
app/views/profile/show.html.haml
浏览文件 @
9a2a8612
.ui-box.width-100p
.ui-box.width-100p
%h3
=
@user
.
name
%h3
=
@user
.
name
=
form_for
@user
,
:url
=>
profile_
edit
_path
,
:method
=>
:put
do
|
f
|
=
form_for
@user
,
:url
=>
profile_
update
_path
,
:method
=>
:put
do
|
f
|
.data
.data
-
if
@user
.
errors
.
any?
.left
#error_explanation
-
if
@user
.
errors
.
any?
%ul
#error_explanation
-
@user
.
errors
.
full_messages
.
each
do
|
msg
|
%ul
%li
=
msg
-
@user
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
.form-row
.form-row
=
f
.
label
:name
=
f
.
label
:name
%br
%br
=
f
.
text_field
:name
=
f
.
text_field
:name
.form-row
.form-row
=
f
.
label
:email
=
f
.
label
:email
%br
%br
=
f
.
text_field
:email
=
f
.
text_field
:email
.form-row
.form-row
=
f
.
label
:skype
=
f
.
label
:skype
%br
%br
=
f
.
text_field
:skype
=
f
.
text_field
:skype
.form-row
.form-row
=
f
.
label
:linkedin
=
f
.
label
:linkedin
%br
%br
=
f
.
text_field
:linkedin
=
f
.
text_field
:linkedin
.form-row
.form-row
=
f
.
label
:twitter
=
f
.
label
:twitter
%br
%br
=
f
.
text_field
:twitter
=
f
.
text_field
:twitter
.right
=
image_tag
gravatar_icon
(
current_user
.
email
,
64
),
:width
=>
64
,
:style
=>
"margin:5px; border:5px solid #eee;"
.clear
.buttons
.buttons
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
app/views/refs/_tree_file.html.haml
浏览文件 @
9a2a8612
...
@@ -5,12 +5,12 @@
...
@@ -5,12 +5,12 @@
=
name
=
name
=
link_to
"raw"
,
blob_project_ref_path
(
@project
,
@ref
,
:path
=>
params
[
:path
]
),
:class
=>
"right"
,
:target
=>
"_blank"
=
link_to
"raw"
,
blob_project_ref_path
(
@project
,
@ref
,
:path
=>
params
[
:path
]
),
:class
=>
"right"
,
:target
=>
"_blank"
=
link_to
"history"
,
project_commits_path
(
@project
,
:path
=>
params
[
:path
],
:ref
=>
@ref
),
:class
=>
"right"
,
:style
=>
"margin-right:10px;"
=
link_to
"history"
,
project_commits_path
(
@project
,
:path
=>
params
[
:path
],
:ref
=>
@ref
),
:class
=>
"right"
,
:style
=>
"margin-right:10px;"
=
switch_colorscheme_link
(
:class
=>
"right"
,
:style
=>
"margin-right:10px;color:orange"
)
-#
= switch_colorscheme_link(:class => "right", :style => "margin-right:10px;color:orange")
%br
/
%br
/
-
if
file
.
text?
-
if
file
.
text?
.view_file_content
.view_file_content
-
unless
file
.
empty?
-
unless
file
.
empty?
%div
{
:class
=>
c
ookies
[
:colorschema
]
}
%div
{
:class
=>
c
urrent_user
.
dark_scheme
?
"black"
:
""
}
:erb
:erb
<%=
raw
file
.
colorize
%>
<%=
raw
file
.
colorize
%>
-
else
-
else
...
...
config/routes.rb
浏览文件 @
9a2a8612
...
@@ -19,8 +19,9 @@ Gitlab::Application.routes.draw do
...
@@ -19,8 +19,9 @@ Gitlab::Application.routes.draw do
get
"profile/password"
,
:to
=>
"profile#password"
get
"profile/password"
,
:to
=>
"profile#password"
put
"profile/password"
,
:to
=>
"profile#password_update"
put
"profile/password"
,
:to
=>
"profile#password_update"
put
"profile/reset_private_token"
,
:to
=>
"profile#reset_private_token"
put
"profile/reset_private_token"
,
:to
=>
"profile#reset_private_token"
put
"profile/edit"
,
:to
=>
"profile#social_update"
get
"profile"
,
:to
=>
"profile#show"
get
"profile"
,
:to
=>
"profile#show"
get
"profile/design"
,
:to
=>
"profile#design"
put
"profile/update"
,
:to
=>
"profile#update"
get
"dashboard"
,
:to
=>
"dashboard#index"
get
"dashboard"
,
:to
=>
"dashboard#index"
get
"dashboard/issues"
,
:to
=>
"dashboard#issues"
get
"dashboard/issues"
,
:to
=>
"dashboard#issues"
...
...
db/migrate/20111220190817_add_coloscheme_option_to_user.rb
0 → 100644
浏览文件 @
9a2a8612
class
AddColoschemeOptionToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:dark_scheme
,
:boolean
,
:default
=>
false
,
:null
=>
false
end
end
db/schema.rb
浏览文件 @
9a2a8612
...
@@ -11,7 +11,19 @@
...
@@ -11,7 +11,19 @@
#
#
# It's strongly recommended to check this file into your version control system.
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
20111207211728
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
20111220190817
)
do
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
|
create_table
"issues"
,
:force
=>
true
do
|
t
|
t
.
string
"title"
t
.
string
"title"
...
@@ -118,6 +130,7 @@ ActiveRecord::Schema.define(:version => 20111207211728) do
...
@@ -118,6 +130,7 @@ ActiveRecord::Schema.define(:version => 20111207211728) do
t
.
string
"linkedin"
,
:default
=>
""
,
:null
=>
false
t
.
string
"linkedin"
,
:default
=>
""
,
:null
=>
false
t
.
string
"twitter"
,
:default
=>
""
,
:null
=>
false
t
.
string
"twitter"
,
:default
=>
""
,
:null
=>
false
t
.
string
"authentication_token"
t
.
string
"authentication_token"
t
.
boolean
"dark_scheme"
,
:default
=>
false
,
:null
=>
false
end
end
add_index
"users"
,
[
"email"
],
:name
=>
"index_users_on_email"
,
:unique
=>
true
add_index
"users"
,
[
"email"
],
:name
=>
"index_users_on_email"
,
:unique
=>
true
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录