Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
ansaphonehandler
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Cederqvist
ansaphonehandler
Commits
cbb990a2
Commit
cbb990a2
authored
Jul 7, 2006
by
Per Cederqvist
Browse files
Options
Downloads
Patches
Plain Diff
Added ability to give recordings to users.
parent
08c55bdf
Branches
master
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/recordings_controller.rb
+16
-0
16 additions, 0 deletions
app/controllers/recordings_controller.rb
app/views/recordings/_list.rhtml
+26
-1
26 additions, 1 deletion
app/views/recordings/_list.rhtml
with
42 additions
and
1 deletion
app/controllers/recordings_controller.rb
+
16
−
0
View file @
cbb990a2
...
@@ -150,6 +150,22 @@ class RecordingsController < ApplicationController
...
@@ -150,6 +150,22 @@ class RecordingsController < ApplicationController
:page
=>
cookies
[
:recording_page
]
:page
=>
cookies
[
:recording_page
]
end
end
def
give
recording
=
Recording
.
find
(
params
[
:id
])
user
=
User
.
find
(
params
[
:user_id
])
if
user
.
nil?
logger
.
add
(
Logger
::
DEBUG
,
"User to give to not found"
)
return
end
recording
.
user_id
=
user
.
id
recording
.
save!
rec_id
=
recording
[
"when"
].
strftime
(
"%Y-%m-%d %H:%M:%S"
)
flash
[
:notice
]
=
'Recording '
+
rec_id
+
' given to '
+
user
.
username
+
'.'
redirect_to
:action
=>
cookies
[
:recording_goal
],
:page
=>
cookies
[
:recording_page
]
end
def
archive
def
archive
recording
=
Recording
.
find
(
params
[
:id
])
recording
=
Recording
.
find
(
params
[
:id
])
user_id
=
cookies
[
:user_id
]
user_id
=
cookies
[
:user_id
]
...
...
This diff is collapsed.
Click to expand it.
app/views/recordings/_list.rhtml
+
26
−
1
View file @
cbb990a2
...
@@ -9,7 +9,8 @@
...
@@ -9,7 +9,8 @@
<table
border=
"1"
>
<table
border=
"1"
>
<tr>
<tr>
<th
colspan=
"3"
>
</th>
<th
colspan=
"3"
>
Action
</th>
<th>
Give to
</th>
<%
for
column_name
in
sorted_columns
%>
<%
for
column_name
in
sorted_columns
%>
<th>
<%=
Recording
.
columns_hash
[
column_name
].
human_name
%>
</th>
<th>
<%=
Recording
.
columns_hash
[
column_name
].
human_name
%>
</th>
<%
end
%>
<%
end
%>
...
@@ -41,6 +42,24 @@
...
@@ -41,6 +42,24 @@
</form>
</form>
<%
end
%>
<%
end
%>
</td>
</td>
<td>
<%
give_printed
=
false
%>
<%
for
user
in
User
.
find
(
:all
)
%>
<%
if
user
.
id
!=
@owner
.
id
&&
user
.
id
!=
recording
.
user_id
%>
<form
class=
"actionform"
method=
"post"
action=
"
<%=
url_for
:controller
=>
"recordings"
,
:action
=>
"give"
%>
"
>
<input
type=
"hidden"
name=
"id"
value=
"
<%=
recording
.
id
%>
"
/>
<input
type=
"hidden"
name=
"user_id"
value=
"
<%=
user
.
id
%>
"
/>
<input
type=
"submit"
value=
"
<%=
h
user
.
username
%>
"
/>
</form>
<%
give_printed
=
true
%>
<%
end
%>
<%
end
%>
<%
if
!
give_printed
%>
<%
end
%>
</td>
<%
for
column_name
in
sorted_columns
%>
<%
for
column_name
in
sorted_columns
%>
<td>
<td>
...
@@ -49,6 +68,12 @@
...
@@ -49,6 +68,12 @@
<%=
recording
[
"when"
].
strftime
(
"%Y-%m-%d %H:%M:%S"
)
%>
<%=
recording
[
"when"
].
strftime
(
"%Y-%m-%d %H:%M:%S"
)
%>
<%
when
"length"
:
%>
<%
when
"length"
:
%>
<%=
(
10
*
recording
[
"length"
].
to_f
).
round
/
10.0
%>
<%=
(
10
*
recording
[
"length"
].
to_f
).
round
/
10.0
%>
<%
when
"user_id"
:
%>
<%
if
recording
.
user
.
nil?
%>
<%
else
%>
<%=
h
recording
.
user
.
username
%>
<%
end
%>
<%
else
%>
<%
else
%>
<%
if
recording
[
column_name
].
to_s
!=
""
%>
<%
if
recording
[
column_name
].
to_s
!=
""
%>
<%=
h
recording
.
send
(
column_name
)
%>
<%=
h
recording
.
send
(
column_name
)
%>
...
...
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