Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
0f627a65
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 搜索 >>
提交
0f627a65
编写于
12月 30, 2011
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Project tab r1 is finished
上级
c1c903fb
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
128 addition
and
53 deletion
+128
-53
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+3
-2
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+5
-5
app/views/dashboard/_sidebar.html.haml
app/views/dashboard/_sidebar.html.haml
+1
-1
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+1
-1
app/views/projects/_project_head.html.haml
app/views/projects/_project_head.html.haml
+5
-14
app/views/projects/_team.html.haml
app/views/projects/_team.html.haml
+1
-3
app/views/projects/_tile.html.haml
app/views/projects/_tile.html.haml
+1
-1
app/views/projects/activities.html.haml
app/views/projects/activities.html.haml
+0
-13
app/views/projects/edit.html.erb
app/views/projects/edit.html.erb
+0
-1
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+69
-0
app/views/projects/info.html.haml
app/views/projects/info.html.haml
+28
-0
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+11
-4
app/views/projects/update.js.haml
app/views/projects/update.js.haml
+1
-1
app/views/snippets/index.html.haml
app/views/snippets/index.html.haml
+0
-3
config/routes.rb
config/routes.rb
+1
-3
spec/requests/projects_spec.rb
spec/requests/projects_spec.rb
+1
-1
未找到文件。
app/assets/stylesheets/projects.css.scss
浏览文件 @
0f627a65
...
...
@@ -573,7 +573,6 @@ h4.middle-panel {
.tab
{
font-weight
:
bold
;
text-transform
:
uppercase
;
border-right
:
1px
solid
#ddd
;
background
:none
;
padding
:
10px
;
...
...
@@ -600,7 +599,9 @@ h4.middle-panel {
}
}
.activities-tab
span
{
background
:
url("images.png")
no-repeat
-161px
-1px
;
}
.stat-tab
,
.team-tab
,
.snippets-tab
span
{
background
:
url("images.png")
no-repeat
-38px
-77px
;
}
.stat-tab
span
,
.team-tab
span
,
.snippets-tab
span
{
background
:
url("images.png")
no-repeat
-38px
-77px
;
}
.files-tab
span
{
background
:
url("images.png")
no-repeat
-112px
-23px
;
}
.merge-notes-tab
span
{
background
:
url("images.png")
no-repeat
-161px
-1px
;
}
...
...
app/controllers/projects_controller.rb
浏览文件 @
0f627a65
...
...
@@ -57,7 +57,7 @@ class ProjectsController < ApplicationController
def
update
respond_to
do
|
format
|
if
project
.
update_attributes
(
params
[
:project
])
format
.
html
{
redirect_to
project
,
:notice
=>
'Project was successfully updated.'
}
format
.
html
{
redirect_to
info_project_path
(
project
)
,
:notice
=>
'Project was successfully updated.'
}
format
.
js
else
format
.
html
{
render
action:
"edit"
}
...
...
@@ -67,16 +67,16 @@ class ProjectsController < ApplicationController
end
def
show
return
render
"projects/empty"
unless
@project
.
repo_exists?
&&
@project
.
has_commits?
limit
=
(
params
[
:limit
]
||
20
).
to_i
@activities
=
@project
.
cached_updates
(
limit
)
end
def
files
@notes
=
@project
.
notes
.
where
(
"attachment != 'NULL'"
).
order
(
"created_at DESC"
)
end
def
activities
return
render
"projects/empty"
unless
@project
.
repo_exists?
&&
@project
.
has_commits?
limit
=
(
params
[
:limit
]
||
20
).
to_i
@activities
=
@project
.
cached_updates
(
limit
)
def
info
end
#
...
...
app/views/dashboard/_sidebar.html.haml
浏览文件 @
0f627a65
...
...
@@ -6,7 +6,7 @@
%ol
.project-list
-
@projects
.
each
do
|
project
|
%li
%a
{
:href
=>
activities_
project_path
(
project
)}
%a
{
:href
=>
project_path
(
project
)}
%span
.arrow
→
%span
.project-name
=
project
.
name
%span
.time
...
...
app/views/layouts/project.html.haml
浏览文件 @
0f627a65
...
...
@@ -23,7 +23,7 @@
.project-sidebar
.fixed
%aside
=
link_to
"Project"
,
project_path
(
@project
),
:class
=>
(
current_page?
(
:controller
=>
"projects"
,
:action
=>
"
activities
"
,
:id
=>
@project
)
||
controller
.
controller_name
==
"snippets"
||
current_page?
(
:controller
=>
"projects"
,
:action
=>
"team"
,
:id
=>
@project
)
||
controller
.
controller_name
==
"team_members"
||
current_page?
(
project_path
(
@project
)))
?
"current"
:
nil
=
link_to
"Project"
,
project_path
(
@project
),
:class
=>
(
current_page?
(
:controller
=>
"projects"
,
:action
=>
"
show
"
,
:id
=>
@project
)
||
controller
.
controller_name
==
"snippets"
||
current_page?
(
:controller
=>
"projects"
,
:action
=>
"team"
,
:id
=>
@project
)
||
controller
.
controller_name
==
"team_members"
||
current_page?
(
project_path
(
@project
)))
?
"current"
:
nil
=
link_to
"Tree"
,
tree_project_ref_path
(
@project
,
@project
.
root_ref
),
:class
=>
current_page?
(
:controller
=>
"refs"
,
:action
=>
"tree"
,
:project_id
=>
@project
,
:id
=>
@ref
||
@project
.
root_ref
)
?
"current"
:
nil
=
link_to
"Commits"
,
project_commits_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"commits"
,
:action
=>
"index"
,
:project_id
=>
@project
)
?
"current"
:
nil
=
link_to
"Network graph"
,
graph_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"graph"
,
:id
=>
@project
)
?
"current"
:
nil
...
...
app/views/projects/_project_head.html.haml
浏览文件 @
0f627a65
%div
-#- if can? current_user, :admin_project, @project
-#%span.entity-info
-#= link_to edit_project_path(@project) do
-#.entity-button
-#Edit Project
-#%i
-#%h2= @project.name
.merge-tabs
=
link_to
activities_project_path
(
@project
),
:class
=>
"activities-tab tab
#{
'active'
if
current_page?
(
activities_
project_path
(
@project
))
}
"
do
=
link_to
project_path
(
@project
),
:class
=>
"activities-tab tab
#{
'active'
if
current_page?
(
project_path
(
@project
))
}
"
do
%span
Activities
=
link_to
project_path
(
@project
),
:class
=>
"stat-tab tab
"
do
=
link_to
info_project_path
(
@project
),
:class
=>
"stat-tab tab
#{
'active'
if
current_page?
(
info_project_path
(
@project
))
||
current_page?
(
edit_project_path
(
@project
))
}
"
do
%span
Info
=
link_to
team_project_path
(
@project
),
:class
=>
"team-tab tab"
do
=
link_to
team_project_path
(
@project
),
:class
=>
"team-tab tab
#{
'active'
if
current_page?
(
team_project_path
(
@project
))
}
"
do
%span
Team
=
link_to
files_project_path
(
@project
),
:class
=>
"files-tab tab"
do
=
link_to
files_project_path
(
@project
),
:class
=>
"files-tab tab
#{
'active'
if
current_page?
(
files_project_path
(
@project
))
}
"
do
%span
Files
=
link_to
project_snippets_path
(
@project
),
:class
=>
"snippets-tab tab"
do
=
link_to
project_snippets_path
(
@project
),
:class
=>
"snippets-tab tab
#{
'active'
if
current_page?
(
project_snippets_path
(
@project
))
}
"
do
%span
Snippets
...
...
app/views/projects/_team.html.haml
浏览文件 @
0f627a65
%h2
.icon
%span
>
Team
-
if
can?
current_user
,
:admin_team_member
,
@project
%div
#new-member-holder
.right
=
link_to
"Add new"
,
new_project_team_member_path
(
@project
),
:remote
=>
true
,
:class
=>
"grey-button"
.clear
%br
%table
.round-borders
#team-table
%thead
...
...
app/views/projects/_tile.html.haml
浏览文件 @
0f627a65
...
...
@@ -2,7 +2,7 @@
-
projects
.
each_with_index
do
|
project
,
i
|
%div
.grid_1.projects_selector
%div
{
:class
=>
"project-box ui-box ui-box-big"
}
=
link_to
activities_
project_path
(
project
)
do
=
link_to
project_path
(
project
)
do
%h3
=
truncate
(
project
.
name
,
:length
=>
20
)
.data
%p
.title.repository.git_url_wrapper
...
...
app/views/projects/activities.html.haml
已删除
100644 → 0
浏览文件 @
c1c903fb
-
content_for
(
:body_class
,
"project-page dashboard"
)
=
render
"project_head"
#news-feed
.news-feed
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
-
@activities
.
each
do
|
update
|
=
render
"projects/feed"
,
:update
=>
update
,
:project
=>
@project
:javascript
function
updateDashboard
(){
$
(
'
.project-content
'
).
load
(
"
#{
escape_javascript
(
project_path
(
@project
))
}
.project-content>*
"
);
}
setInterval
(
"
updateDashboard()
"
,
300000
);
app/views/projects/edit.html.erb
已删除
100644 → 0
浏览文件 @
c1c903fb
<%=
render
'form'
%>
app/views/projects/edit.html.haml
0 → 100644
浏览文件 @
0f627a65
=
render
"project_head"
=
form_for
(
@project
,
:remote
=>
true
)
do
|
f
|
%div
%span
.entity-info
=
link_to
info_project_path
(
@project
)
do
.entity-button
Info
%i
%h2
=
@project
.
name
%hr
%table
.no-borders
-
if
@project
.
errors
.
any?
%tr
%td
{
:colspan
=>
2
}
#error_explanation
-
@project
.
errors
.
full_messages
.
each
do
|
msg
|
%span
=
msg
%br
%tr
%td
=
f
.
label
:name
%td
=
f
.
text_field
:name
,
:placeholder
=>
"Example Project"
%tr
%td
.left
=
f
.
label
:path
%cite
.right
=
"git@
#{
GIT_HOST
[
"host"
]
}
:"
%td
=
f
.
text_field
:path
,
:placeholder
=>
"example_project"
,
:disabled
=>
!
@project
.
new_record?
%tr
%td
.left
=
f
.
label
:code
%cite
.right
=
"http://
#{
GIT_HOST
[
"host"
]
}
/"
%td
=
f
.
text_field
:code
,
:placeholder
=>
"example"
-
unless
@project
.
new_record?
||
@project
.
heads
.
empty?
%tr
%td
=
f
.
label
:default_branch
,
"Default Branch"
%td
=
f
.
select
(
:default_branch
,
@project
.
heads
.
map
(
&
:name
),
{},
:style
=>
"width:300px;"
)
%tr
%td
=
f
.
label
:description
%td
=
f
.
text_area
:description
,
:placeholder
=>
"project description"
,
:style
=>
"height:50px"
%br
.merge-tabs
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
-
unless
@project
.
new_record?
.right
=
link_to
'Remove'
,
@project
,
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"red-button"
%div
{
:class
=>
"ajax_loader"
,
:style
=>
"display:none;height:200px;"
}
%center
=
image_tag
"ajax-loader.gif"
,
:class
=>
"append-bottom"
%h3
.prepend-top
Updating project
&
repository. Please wait for few minutes
:javascript
$
(
'
.edit_project
'
).
bind
(
'
ajax:before
'
,
function
()
{
$
(
"
.edit_project
"
).
hide
();
$
(
'
.ajax_loader
'
).
show
();
});
:javascript
$
(
function
(){
$
(
'
form #project_default_branch
'
).
chosen
();
})
app/views/projects/info.html.haml
0 → 100644
浏览文件 @
0f627a65
=
render
"project_head"
%div
%span
.entity-info
=
link_to
edit_project_path
(
@project
)
do
.entity-button
Edit
%i
%h2
=
@project
.
name
%hr
%table
.no-borders
%tr
%td
Name
%td
=
@project
.
name
%tr
%td
Slug
%td
=
@project
.
code
%tr
%td
Created
%td
=
@project
.
created_at
.
stamp
(
"Aug 21, 2011"
)
%tr
%td
{
:colspan
=>
2
}=
simple_format
@project
.
description
app/views/projects/show.html.haml
浏览文件 @
0f627a65
=
render
"project_head"
.stats
-
unless
@project
.
description
.
empty?
%h3
=
simple_format
@project
.
description
-
content_for
(
:body_class
,
"project-page dashboard"
)
=
render
"project_head"
#news-feed
.news-feed
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
-
@activities
.
each
do
|
update
|
=
render
"projects/feed"
,
:update
=>
update
,
:project
=>
@project
:javascript
function
updateDashboard
(){
$
(
'
.project-content
'
).
load
(
"
#{
escape_javascript
(
project_path
(
@project
))
}
.project-content>*
"
);
}
setInterval
(
"
updateDashboard()
"
,
300000
);
app/views/projects/update.js.haml
浏览文件 @
0f627a65
-
if
@project
.
valid?
:plain
location.href = "
#{
project_path
(
@project
,
:notice
=>
'Project was successfully updated.'
)
}
";
location.href = "
#{
info_
project_path
(
@project
,
:notice
=>
'Project was successfully updated.'
)
}
";
-
else
:plain
$(".edit_project").replaceWith("
#{
escape_javascript
(
render
(
'form'
))
}
");
app/views/snippets/index.html.haml
浏览文件 @
0f627a65
=
render
"projects/project_head"
%h2
.icon
%span
>
Snippets
-
if
can?
current_user
,
:write_snippet
,
@project
.right
=
link_to
'New Snippet'
,
new_project_snippet_path
(
@project
),
:class
=>
"grey-button append-bottom-10"
...
...
config/routes.rb
浏览文件 @
0f627a65
...
...
@@ -42,9 +42,7 @@ Gitlab::Application.routes.draw do
get
"team"
get
"wall"
get
"graph"
get
"activities"
get
"branches"
get
"tags"
get
"info"
get
"files"
end
...
...
spec/requests/projects_spec.rb
浏览文件 @
0f627a65
...
...
@@ -140,7 +140,7 @@ describe "Projects" do
end
it
"should be correct path"
do
current_path
.
should
==
project_path
(
@project
)
current_path
.
should
==
info_
project_path
(
@project
)
end
it
"should show project"
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录