BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
dc857ab1
Unverified
Commit
dc857ab1
authored
May 17, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added editable concern
parent
6dd88474
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
11 deletions
+12
-11
issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-2
application_helper.rb
app/helpers/application_helper.rb
+1
-3
editable_helper.rb
app/helpers/editable_helper.rb
+0
-5
editable.rb
app/models/concerns/editable.rb
+7
-0
issuable.rb
app/models/concerns/issuable.rb
+1
-0
note.rb
app/models/note.rb
+1
-0
show.html.haml
app/views/projects/issues/show.html.haml
+1
-1
No files found.
app/controllers/projects/issues_controller.rb
View file @
dc857ab1
...
...
@@ -5,7 +5,6 @@ class Projects::IssuesController < Projects::ApplicationController
include
ToggleAwardEmoji
include
IssuableCollections
include
SpammableActions
include
EditableHelper
prepend_before_action
:authenticate_user!
,
only:
[
:new
]
...
...
@@ -212,7 +211,7 @@ class Projects::IssuesController < Projects::ApplicationController
issue_number:
@issue
.
iid
,
}
if
is_edited?
(
@issue
)
if
@issue
.
is_edited?
response
[
:updated_at
]
=
@issue
.
updated_at
response
[
:updated_by_name
]
=
@issue
.
last_edited_by
.
name
response
[
:updated_by_path
]
=
user_path
(
@issue
.
last_edited_by
)
...
...
app/helpers/application_helper.rb
View file @
dc857ab1
...
...
@@ -2,8 +2,6 @@ require 'digest/md5'
require
'uri'
module
ApplicationHelper
include
EditableHelper
# Check if a particular controller is the current one
#
# args - One or more controller names to check
...
...
@@ -183,7 +181,7 @@ module ApplicationHelper
end
def
edited_time_ago_with_tooltip
(
object
,
placement:
'top'
,
html_class:
'time_ago'
,
exclude_author:
false
)
return
unless
is_edited?
(
object
)
return
unless
object
.
is_edited?
content_tag
:small
,
class:
'edited-text'
do
output
=
content_tag
(
:span
,
'Edited '
)
...
...
app/helpers/editable_helper.rb
deleted
100644 → 0
View file @
6dd88474
module
EditableHelper
def
is_edited?
(
object
)
!
object
.
last_edited_at
.
blank?
&&
object
.
last_edited_at
!=
object
.
created_at
end
end
app/models/concerns/editable.rb
0 → 100644
View file @
dc857ab1
module
Editable
extend
ActiveSupport
::
Concern
def
is_edited?
last_edited_at
.
present?
&&
last_edited_at
!=
created_at
end
end
app/models/concerns/issuable.rb
View file @
dc857ab1
...
...
@@ -15,6 +15,7 @@ module Issuable
include
Taskable
include
TimeTrackable
include
Importable
include
Editable
# This object is used to gather issuable meta data for displaying
# upvotes, downvotes, notes and closing merge requests count for issues and merge requests
...
...
app/models/note.rb
View file @
dc857ab1
...
...
@@ -13,6 +13,7 @@ class Note < ActiveRecord::Base
include
AfterCommitQueue
include
ResolvableNote
include
IgnorableColumn
include
Editable
ignore_column
:original_discussion_id
...
...
app/views/projects/issues/show.html.haml
View file @
dc857ab1
...
...
@@ -53,7 +53,7 @@
.detail-page-description.content-block
.issue-title-data.hidden
{
"data"
=>
{
"endpoint"
=>
rendered_title_namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
),
"can-update-tasks-class"
=>
can?
(
current_user
,
:update_issue
,
@issue
)
?
'js-task-list-container'
:
''
,
"is-edited"
:
is_edited?
(
@issue
)
,
"is-edited"
:
@issue
.
is_edited?
,
}
}
.issue-title-entrypoint
...
...
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