Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
7da5ad2b1f79
Commit
7da5ad2b
authored
Oct 21, 2011
by
Dmitriy Zaporozhets
Browse files
1.1pre1
parent
e85a2138557c
Changes
83
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
7da5ad2b
v 1.1.0
- project dashboard
- wall redesigned
- feature: code snippets
- fixed horizontal scroll on file preview
- fixed app crash if commit message has invalid chars
- bugfix & code cleaning
v 1.0.2
- fixed bug with empty project
- added adv validation for project path & code
- feature: issues can be sortable
- bugfix
- username dispalyed on top panel
v 1.0.1
- fixed: with invalid source code for commit
- fixed: lose branch/tag selection when use tree navigateion
- when history clicked - display path
- bug fix & code cleaning
...
...
@@ -1,8 +16,9 @@
v 1.0.1
- fixed: with invalid source code for commit
- fixed: lose branch/tag selection when use tree navigateion
- when history clicked - display path
- bug fix & code cleaning
v 1.0.0
- bug fix
- projects preview mode
...
...
@@ -6,6 +22,7 @@
v 1.0.0
- bug fix
- projects preview mode
v 0.9.6
- css fix
- new repo empty tree until restart server - fixed
...
...
@@ -9,6 +26,7 @@
v 0.9.6
- css fix
- new repo empty tree until restart server - fixed
v 0.9.4
- security improved
- authorization improved
...
...
@@ -24,6 +42,7 @@
- updated app name
- issue redesigned
- issue can be edit
v 0.8.0
- sytax highlight for main file types
- redesign
...
...
Gemfile
View file @
7da5ad2b
...
...
@@ -15,7 +15,7 @@
gem
'
faker
'
gem
'
seed-fu
'
,
:git
=>
'git://github.com/mbleigh/seed-fu.git'
gem
"
inifile
"
gem
"
albino
"
,
:git
=>
"git://github.com/gitlabhq/albino.git
"
gem
"
pygments.rb
"
,
"0.2.3
"
gem
"
kaminari
"
gem
"
thin
"
gem
"
git
"
...
...
Gemfile.lock
View file @
7da5ad2b
...
...
@@ -5,13 +5,6 @@
annotate (2.4.1.beta1)
GIT
remote: git://github.com/gitlabhq/albino.git
revision: 118380924969f3a856659f86ea1f40c1ba7bfcb1
specs:
albino (1.3.3)
posix-spawn (>= 0.3.6)
GIT
remote: git://github.com/gitlabhq/grit.git
revision: ff015074ef35bd94cba943f9c0f98e161ab5851c
specs:
...
...
@@ -72,6 +65,7 @@
ZenTest (= 4.5)
awesome_print (0.4.0)
bcrypt-ruby (3.0.1)
blankslate (2.1.2.4)
builder (3.0.0)
capybara (1.0.1)
mime-types (>= 1.16)
...
...
@@ -138,6 +132,8 @@
orm_adapter (0.0.5)
polyglot (0.3.2)
posix-spawn (0.3.6)
pygments.rb (0.2.3)
rubypython (>= 0.5.1)
rack (1.3.2)
rack-cache (1.0.3)
rack (>= 0.4)
...
...
@@ -189,6 +185,9 @@
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
rubypython (0.5.1)
blankslate (>= 2.1.2.3)
ffi (~> 1.0.7)
rubyzip (0.9.4)
sass (3.1.7)
sass-rails (3.1.1)
...
...
@@ -242,7 +241,6 @@
DEPENDENCIES
acts_as_list
albino!
annotate!
autotest
autotest-rails
...
...
@@ -260,6 +258,7 @@
jquery-rails
kaminari
launchy
pygments.rb (= 0.2.3)
rails (= 3.1.0)
rails-footnotes (>= 3.7.5.rc4)
rspec-rails
...
...
VERSION
View file @
7da5ad2b
1.
0.1
1.
1.0
app/assets/images/home.png
0 → 100644
View file @
7da5ad2b
271 Bytes
app/assets/javascripts/application.js
View file @
7da5ad2b
...
...
@@ -16,3 +16,7 @@
$
(
'
select#branch
'
).
selectmenu
({
style
:
'
popup
'
,
width
:
200
});
$
(
'
select#tag
'
).
selectmenu
({
style
:
'
popup
'
,
width
:
200
});
});
function
updatePage
(){
$
.
ajax
({
type
:
"
GET
"
,
url
:
location
.
href
,
dataType
:
"
script
"
});
}
app/assets/javascripts/snippets.js
0 → 100644
View file @
7da5ad2b
$
(
document
).
ready
(
function
(){
$
(
"
#snippets-table .snippet
"
).
live
(
'
click
'
,
function
(
e
){
if
(
e
.
target
.
nodeName
!=
"
A
"
&&
e
.
target
.
nodeName
!=
"
INPUT
"
)
{
location
.
href
=
$
(
this
).
attr
(
"
url
"
);
e
.
stopPropagation
();
return
false
;
}
});
});
app/assets/stylesheets/highlight.css.scss
View file @
7da5ad2b
...
...
@@ -22,8 +22,8 @@
.highlight
{
background
:none
;
padding
:
10px
0px
0px
0
;
margin-left
:
1
0px
;
padding
:
10px
0px
0px
10px
;
margin-left
:
0px
;
}
.highlight
pre
{
}
...
...
@@ -43,7 +43,7 @@
}
td
.code
.highlight
{
overflow
-x
:
scroll
;
overflow
:
auto
;
}
table
.highlighttable
pre
{
padding
:
0
;
...
...
app/assets/stylesheets/projects.css.scss
View file @
7da5ad2b
...
...
@@ -310,6 +310,7 @@
}
#projects-list
.project
,
#snippets-table
.snippet
,
#issues-table
.issue
{
cursor
:pointer
;
...
...
@@ -360,6 +361,8 @@
.user_new
,
.edit_user
,
.new_project
,
.new_snippet
,
.edit_snippet
,
.edit_project
{
input
[
type
=
'text'
],
input
[
type
=
'email'
],
...
...
@@ -488,8 +491,14 @@
background
:
white
;
}
p
{
margin-bottom
:
3px
;
font-size
:
12px
;
margin-bottom
:
4px
;
font-size
:
13px
;
color
:
#111
;
}
}
cite
{
&
.ago
{
color
:
#666
;
}
}
}
...
...
@@ -512,7 +521,7 @@
}
.note_content
{
float
:left
;
width
:
7
50px
;
width
:
6
50px
;
}
.issue_notes
{
...
...
@@ -549,3 +558,83 @@
height
:
12px
;
padding
:
10px
;
}
.recent_message_parent
{
img
{
padding-right
:
10px
;
}
float
:
left
;
margin
:
0
20px
20px
0px
;
padding
:
5px
0px
;;
width
:
420px
;
&
.dash_wall
{
border-bottom
:
2px
solid
orange
;
span
{
background
:
orange
;
color
:black
;
}
}
&
.dash_issue
{
border-bottom
:
2px
solid
#ffbbbb
;
span
{
background
:
#ffbbbb
;
}
}
&
.dash_commit
{
border-bottom
:
2px
solid
#bbbbff
;
span
{
background
:
#bbbbff
;
}
}
&
.dash_snippet
{
border-bottom
:
2px
solid
#bbffbb
;
span
{
background
:
#bbffbb
;
}
}
span
{
border
:
1px
solid
#aaa
;
color
:black
;
padding
:
1px
4px
;
}
h4
{
margin-bottom
:
3px
;
}
}
.commit
,
.message
,
#notes-list
{
.author
{
background
:
#eaeaea
;
color
:
#333
;
border
:
1px
solid
#aaa
;
padding
:
1px
2px
;
margin-right
:
5px
;
}
}
/* Note textare */
#note_note
{
height
:
100px
;
width
:
97%
;
font-size
:
14px
;
}
.wall_page
{
#note_note
{
height
:
25px
;
}
.attach_holder
{
display
:none
;
}
}
app/assets/stylesheets/snippets.css.scss
0 → 100644
View file @
7da5ad2b
// Place all the styles related to the Snippets controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
app/controllers/application_controller.rb
View file @
7da5ad2b
...
...
@@ -27,7 +27,7 @@
end
def
authenticate_admin!
return
re
direct_to
(
new_user_session_path
)
unless
current_user
.
is_admin?
return
re
nder_404
unless
current_user
.
is_admin?
end
def
authorize_project!
(
action
)
...
...
@@ -31,7 +31,11 @@
end
def
authorize_project!
(
action
)
return
redirect_to
(
new_user_session_path
)
unless
can?
(
current_user
,
action
,
project
)
return
render_404
unless
can?
(
current_user
,
action
,
project
)
end
def
access_denied!
render_404
end
def
method_missing
(
method_sym
,
*
arguments
,
&
block
)
...
...
app/controllers/issues_controller.rb
View file @
7da5ad2b
class
IssuesController
<
ApplicationController
before_filter
:authenticate_user!
before_filter
:project
before_filter
:issue
,
:only
=>
[
:edit
,
:update
,
:destroy
,
:show
]
# Authorize
before_filter
:add_project_abilities
before_filter
:authorize_read_issue!
before_filter
:authorize_write_issue!
,
:only
=>
[
:new
,
:create
,
:close
,
:edit
,
:update
,
:sort
]
...
...
@@ -4,9 +5,8 @@
# Authorize
before_filter
:add_project_abilities
before_filter
:authorize_read_issue!
before_filter
:authorize_write_issue!
,
:only
=>
[
:new
,
:create
,
:close
,
:edit
,
:update
,
:sort
]
before_filter
:authorize_admin_issue!
,
:only
=>
[
:destroy
]
respond_to
:js
...
...
@@ -30,8 +30,7 @@
end
def
edit
@issue
=
@project
.
issues
.
find
(
params
[
:id
])
respond_with
(
@issue
)
end
def
show
...
...
@@ -34,8 +33,7 @@
respond_with
(
@issue
)
end
def
show
@issue
=
@project
.
issues
.
find
(
params
[
:id
])
@notes
=
@issue
.
notes
@note
=
@project
.
notes
.
new
(
:noteable
=>
@issue
)
end
...
...
@@ -51,7 +49,6 @@
end
def
update
@issue
=
@project
.
issues
.
find
(
params
[
:id
])
@issue
.
update_attributes
(
params
[
:issue
])
respond_to
do
|
format
|
...
...
@@ -62,7 +59,8 @@
def
destroy
@issue
=
@project
.
issues
.
find
(
params
[
:id
])
return
access_denied!
unless
can?
(
current_user
,
:admin_issue
,
@issue
)
@issue
.
destroy
respond_to
do
|
format
|
...
...
@@ -79,4 +77,10 @@
render
:nothing
=>
true
end
protected
def
issue
@issue
||=
@project
.
issues
.
find
(
params
[
:id
])
end
end
app/controllers/notes_controller.rb
View file @
7da5ad2b
...
...
@@ -4,7 +4,6 @@
# Authorize
before_filter
:add_project_abilities
before_filter
:authorize_write_note!
,
:only
=>
[
:create
]
before_filter
:authorize_admin_note!
,
:only
=>
[
:destroy
]
respond_to
:js
...
...
@@ -25,6 +24,9 @@
def
destroy
@note
=
@project
.
notes
.
find
(
params
[
:id
])
return
access_denied!
unless
can?
(
current_user
,
:admin_note
,
@note
)
@note
.
destroy
respond_to
do
|
format
|
...
...
@@ -41,6 +43,8 @@
Notify
.
note_commit_email
(
u
,
@note
).
deliver
when
"Issue"
then
Notify
.
note_issue_email
(
u
,
@note
).
deliver
when
"Snippet"
true
else
Notify
.
note_wall_email
(
u
,
@note
).
deliver
end
...
...
app/controllers/profile_controller.rb
View file @
7da5ad2b
...
...
@@ -3,6 +3,12 @@
@user
=
current_user
end
def
social_update
@user
=
current_user
@user
.
update_attributes
(
params
[
:user
])
redirect_to
[
:profile
]
end
def
password
@user
=
current_user
end
...
...
app/controllers/projects_controller.rb
View file @
7da5ad2b
...
...
@@ -60,8 +60,10 @@
end
def
show
@repo
=
project
.
repo
@commit
=
@repo
.
commits
.
first
@tree
=
@commit
.
tree
@tree
=
@tree
/
params
[
:path
]
if
params
[
:path
]
return
render
"projects/empty"
unless
@project
.
repo_exists?
@date
=
case
params
[
:view
]
when
"week"
then
Date
.
today
-
7
.
days
when
"day"
then
Date
.
today
else
nil
end
...
...
@@ -67,7 +69,12 @@
rescue
Grit
::
NoSuchPathError
=>
ex
respond_to
do
|
format
|
format
.
html
{
render
"projects/empty"
}
if
@date
@date
=
@date
.
at_beginning_of_day
@commits
=
@project
.
commits_since
(
@date
)
@messages
=
project
.
notes
.
since
(
@date
).
order
(
"created_at DESC"
)
else
@commits
=
@project
.
fresh_commits
@messages
=
project
.
notes
.
fresh
.
limit
(
10
)
end
end
...
...
@@ -76,5 +83,4 @@
#
def
wall
@notes
=
@project
.
common_notes
@note
=
Note
.
new
...
...
@@ -80,4 +86,12 @@
@note
=
Note
.
new
@notes
=
@project
.
common_notes
.
order
(
"created_at DESC"
)
@notes
=
case
params
[
:view
]
when
"week"
then
@notes
.
since
((
Date
.
today
-
7
.
days
).
at_beginning_of_day
)
when
"all"
then
@notes
.
all
when
"day"
then
@notes
.
since
(
Date
.
today
.
at_beginning_of_day
)
else
@notes
.
fresh
.
limit
(
10
)
end
end
#
...
...
app/controllers/snippets_controller.rb
0 → 100644
View file @
7da5ad2b
class
SnippetsController
<
ApplicationController
before_filter
:authenticate_user!
before_filter
:project
# Authorize
before_filter
:add_project_abilities
before_filter
:authorize_read_snippet!
before_filter
:authorize_write_snippet!
,
:only
=>
[
:new
,
:create
,
:close
,
:edit
,
:update
,
:sort
]
respond_to
:html
def
index
@snippets
=
@project
.
snippets
end
def
new
@snippet
=
@project
.
snippets
.
new
end
def
create
@snippet
=
@project
.
snippets
.
new
(
params
[
:snippet
])
@snippet
.
author
=
current_user
@snippet
.
save
if
@snippet
.
valid?
redirect_to
[
@project
,
@snippet
]
else
respond_with
(
@snippet
)
end
end
def
edit
@snippet
=
@project
.
snippets
.
find
(
params
[
:id
])
end
def
update
@snippet
=
@project
.
snippets
.
find
(
params
[
:id
])
@snippet
.
update_attributes
(
params
[
:snippet
])
if
@snippet
.
valid?
redirect_to
[
@project
,
@snippet
]
else
respond_with
(
@snippet
)
end
end
def
show
@snippet
=
@project
.
snippets
.
find
(
params
[
:id
])
@notes
=
@snippet
.
notes
@note
=
@project
.
notes
.
new
(
:noteable
=>
@snippet
)
end
def
destroy
@snippet
=
@project
.
snippets
.
find
(
params
[
:id
])
return
access_denied!
unless
can?
(
current_user
,
:admin_snippet
,
@snippet
)
@snippet
.
destroy
redirect_to
project_snippets_path
(
@project
)
end
end
app/controllers/team_members_controller.rb
View file @
7da5ad2b
...
...
@@ -3,8 +3,8 @@
# Authorize
before_filter
:add_project_abilities
before_filter
:authorize_read_
team_member
!
before_filter
:authorize_admin_
team_member
!
,
:only
=>
[
:new
,
:create
,
:destroy
,
:update
]
before_filter
:authorize_read_
project
!
before_filter
:authorize_admin_
project
!
,
:only
=>
[
:new
,
:create
,
:destroy
,
:update
]
def
show
@team_member
=
project
.
users_projects
.
find
(
params
[
:id
])
...
...
app/helpers/application_helper.rb
View file @
7da5ad2b
...
...
@@ -53,25 +53,4 @@
[
projects
,
default_nav
,
project_nav
].
flatten
.
to_json
end
def
handle_file_type
(
file_name
,
mime_type
)
if
file_name
=~
/(\.rb|\.ru|\.rake|Rakefile|\.gemspec|\.rbx|Gemfile)$/
:ruby
elsif
file_name
=~
/\.py$/
:python
elsif
file_name
=~
/(\.pl|\.scala|\.c|\.cpp|\.java|\.haml|\.html|\.sass|\.scss|\.xml|\.php|\.erb)$/
$1
[
1
..-
1
].
to_sym
elsif
file_name
=~
/\.js$/
:javascript
elsif
file_name
=~
/\.sh$/
:bash
elsif
file_name
=~
/\.coffee$/
:coffeescript
elsif
file_name
=~
/\.yml$/
:yaml
elsif
file_name
=~
/\.md$/
:minid
else
:text
end
end
end
app/helpers/commits_helper.rb
View file @
7da5ad2b
...
...
@@ -21,4 +21,13 @@
link_to
"More"
,
project_commits_path
(
@project
,
:offset
=>
offset
.
to_i
+
limit
.
to_i
,
:limit
=>
limit
),
:remote
=>
true
,
:class
=>
"lite_button vm"
,
:style
=>
"text-align:center; width:930px; "
,
:id
=>
"more-commits-link"
end
# Cause some errors with trucate & encoding use this method
def
truncate_commit_message
(
commit
,
size
=
60
)
message
=
commit
.
message
message
.
length
>
size
?
(
message
[
0
..
(
size
-
1
)]
+
"..."
)
:
message
# if special characters occurs
rescue
commit
.
message
end
end
app/helpers/projects_helper.rb
View file @
7da5ad2b
...
...
@@ -3,4 +3,16 @@
cookies
[
"project_view"
]
||=
"tile"
cookies
[
"project_view"
]
==
type
?
nil
:
"display:none"
end
def
load_note_parent
(
id
,
type
,
project
)
case
type
when
"Issue"
then
@project
.
issues
.
find
(
id
)
when
"Commit"
then
@project
.
repo
.
commits
(
id
).
first
when
"Snippet"
then
@project
.
snippets
.
find
(
id
)
else
true
end
rescue
nil
end
end
Prev
1
2
3
4
5
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment