Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
ce95488d
Commit
ce95488d
authored
9 years ago
by
Mateus Rambo Strey
Browse files
Options
Downloads
Patches
Plain Diff
build bookmarks with bookmark class
parent
d599b350
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/builders/collection_builder.rb
+3
-2
3 additions, 2 deletions
app/builders/collection_builder.rb
app/views/collections/show.html.erb
+1
-1
1 addition, 1 deletion
app/views/collections/show.html.erb
with
4 additions
and
3 deletions
app/builders/collection_builder.rb
+
3
−
2
View file @
ce95488d
...
...
@@ -20,12 +20,13 @@ class CollectionBuilder
unless
args
.
nil?
# cache object when build
lo
=
Rails
.
cache
.
fetch
(
cache_key
(
args
[
'@rid'
],
args
[
'last_modified'
]),
expires_in:
12
.
hours
)
do
obj
=
Collection
.
new
(
type
=
(
args
[
'name'
]
==
'Bookmarks'
)
?
Bookmarks
:
Collection
obj
=
type
.
new
(
learning_objects:
LearningObjectBuilder
.
build
(
map_rid_to_object
(
args
[
'learning_objects'
])
||
[]),
privacy:
args
[
'privacy'
],
name:
args
[
'name'
],
id:
args
[
'@rid'
]
)
obj
.
name
=
args
[
'name'
]
unless
type
==
Bookmarks
obj
.
owner
=
collection_repository
.
owner
(
args
[
'@rid'
])
obj
.
created_at
=
DateTime
.
strptime
(
args
[
'created_at'
],
"%Y-%m-%d %H:%M:%S"
)
unless
args
[
'created_at'
].
nil?
obj
.
last_modified
=
DateTime
.
strptime
(
args
[
'last_modified'
],
"%Y-%m-%d %H:%M:%S"
)
unless
args
[
'last_modified'
].
nil?
...
...
This diff is collapsed.
Click to expand it.
app/views/collections/show.html.erb
+
1
−
1
View file @
ce95488d
<nav
class=
"navigation navbar-default "
><br/>
<div
class=
"container-fluid"
>
<%
if
@own
%>
<%
if
@own
&&
@collection
.
class
!=
Bookmarks
%>
<div
class=
"navbar-right"
style=
"text-align:right"
>
<%=
link_to
'#'
do
%>
<%=
link_to
'APAGAR'
,
collection_path
(
@collection
.
id
),
method: :delete
,
class:
'btn btn-danger btn-remove'
,
style
:'margin-right: 30px'
,
data:
{
confirm:
'Não será possível recuperá-la, você tem certeza?'
}
%>
</span>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment