Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
325b8454
Commit
325b8454
authored
Oct 27, 2011
by
Nihad Abbasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't count expired snippets
parent
000c0324
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
app/models/snippet.rb
app/models/snippet.rb
+1
-0
app/views/projects/_top_menu.html.haml
app/views/projects/_top_menu.html.haml
+1
-1
No files found.
app/models/snippet.rb
View file @
325b8454
...
...
@@ -23,6 +23,7 @@ class Snippet < ActiveRecord::Base
:length
=>
{
:within
=>
0
..
10000
}
scope
:fresh
,
order
(
"created_at DESC"
)
scope
:non_expired
,
where
([
"expires_at IS NULL OR expires_at > ?"
,
Time
.
current
])
def
self
.
content_types
[
...
...
app/views/projects/_top_menu.html.haml
View file @
325b8454
...
...
@@ -23,7 +23,7 @@
=
link_to
project_snippets_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"snippets"
)
?
"current"
:
nil
do
Snippets
-
if
@project
.
snippets
.
count
>
0
%span
{
:class
=>
"top_menu_count"
}=
@project
.
snippets
.
count
%span
{
:class
=>
"top_menu_count"
}=
@project
.
snippets
.
non_expired
.
count
-
if
@commit
%span
=
link_to
truncate
(
commit_name
(
@project
,
@commit
),
:length
=>
15
),
project_commit_path
(
@project
,
:id
=>
@commit
.
id
),
:class
=>
current_page?
(
:controller
=>
"commits"
,
:action
=>
"show"
,
:project_id
=>
@project
,
:id
=>
@commit
.
id
)
?
"current"
:
nil
...
...
Write
Preview
Markdown
is supported
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