Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
openproject
Service Pack
Commits
976e8145
Verified
Commit
976e8145
authored
6 years ago
by
Tam Le
Browse files
Options
Download
Email Patches
Plain Diff
Add new view to display assignment on this project
parent
20d7ede7
master
addtional_notification_email
api-fix-time-entry
dont_have_notify
feature/multiple-SP
feature/report-with-filter
fix/1-gitlab
fix/3-gitlab
fix/3bis-gitlab
fix/handle_when_remain_unit_is_zero
fix_run_out_mail_sent_3_times
improvement/rollback_when_logtime_exceed_remain_unit
make_notify_email_send_once_only
v1.0.5
v1.0.4
v1.0.3
v1.0.2
2 merge requests
!6
Master
,
!4
Multiple SPs can be assigned to a project
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/controllers/assigns_controller.rb
+5
-1
app/controllers/assigns_controller.rb
app/views/assigns/_assignment_table.html.erb
+29
-0
app/views/assigns/_assignment_table.html.erb
app/views/assigns/already_assigned.html.erb
+14
-14
app/views/assigns/already_assigned.html.erb
with
48 additions
and
15 deletions
+48
-15
app/controllers/assigns_controller.rb
+
5
-
1
View file @
976e8145
class
AssignsController
<
ApplicationController
#layout 'admin'
# put all feature switches here
FEATURE_SWITCH_ALREADY_ASSIGNED_VIEW
=
1
before_action
:find_project_by_project_id
include
SPAssignmentManager
...
...
@@ -62,7 +66,7 @@ class AssignsController < ApplicationController
@assignables
=
ServicePack
.
availables
if
@assignables
.
exists?
@assignment
=
Assign
.
new
render
-
'not_assigned_yet'
and
return
render
(
defined?
(
FEATURE_SWITCH_ALREADY_ASSIGNED_VIEW
)
?
-
'already_assigned'
:
-
'not_assigned_yet'
)
and
return
end
end
render
-
'unassignable'
...
...
This diff is collapsed.
Click to expand it.
app/views/assigns/_assignment_table.html.erb
0 → 100644
+
29
-
0
View file @
976e8145
<%# service_pack, assign, unassign, rem, total %>
<%# link to report %>
<div
class=
"generic-table--container"
>
<div
class=
"generic-table--results-container"
>
<table
class=
"generic-table"
>
<colgroup>
<col
highlight-col
><col
highlight-col
><col
highlight-col
><col
highlight-col
><col>
</colgroup>
<thead>
<tr>
<%
[
-
'Service Pack'
,
-
'Assign Date'
,
-
'Expiration Date'
,
-
'Units'
].
each
do
|
column_name
|
%>
<th><div
class=
"generic-table--sort-header-outer"
><div
class=
"generic-table--sort-header"
><span>
<%=
column_name
%>
</span></div></div></th>
<%
end
%>
<th><div
class=
"generic-table--empty-header"
></div></th>
</tr>
</thead>
<tbody>
<tr>
<%=
content_tag
:td
,
@assignment
.
service_pack
.
name
%>
<%=
content_tag
:td
,
@assignment
.
assign_date
%>
<%=
content_tag
:td
,
@assignment
.
unassign_date
%>
<%=
content_tag
:td
,
"
#{
@assignment
.
service_pack
.
remained_units
}
/
#{
@assignment
.
service_pack
.
total_units
}
"
%>
<%=
content_tag
:td
,
op_icon
(
-
'icon icon-delete'
)
%>
</tr>
</tbody>
</table>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/views/assigns/already_assigned.html.erb
+
14
-
14
View file @
976e8145
<%=
stylesheet_link_tag
'assigns'
,
plugin: :openproject_service_packs
%>
<div
id=
"sp-display"
>
<h2>
Service Pack
<%=
@service_pack
.
name
%>
already assigned to
<%=
@project
.
name
%>
</h2><hr/>
<strong>
Assignment Date
</strong>
:
<%=
@assignment
.
assign_date
%>
<strong>
Valid Until
</strong>
:
<%=
@assignment
.
unassign_date
%>
<strong>
Remained:
</strong>
<%=
@service_pack
.
remained_units
%>
/
<%=
@service_pack
.
total_units
%>
</div>
<br/>
<%
if
@can_unassign
||=
User
.
current
.
allowed_to?
(
:unassign_service_packs
,
@project
)
%>
<%=
link_to
-
'Unassign'
,
assigns_unassign_path
(
@project
),
method: :post
,
class:
-
'button norm'
,
data:
{
confirm:
-
'Are you sure?'
}
%>
<%
end
%>
<hr/>
<p
class=
'other-formats'
>
Report available in:
<%=
link_to
-
'CSV'
,
{
action: :report
,
format: :csv
}
%>
</p>
\ No newline at end of file
<h2>
Assigned Service Packs
</h2>
<a
class=
"button -alt-highlight float-right"
href=
"#"
>
<i
class=
"button--icon icon-add"
aria-hidden=
"true"
></i><span
class=
"button--text"
>
Assign
</span>
</a>
<%
if
@assignment
.
new_record?
%>
<div
id=
"result-table"
>
<div
class=
"generic-table--no-results-container"
>
<i
class=
"icon-info1"
></i>
<h3
class=
"generic-table--no-results-title"
>
No Service Pack is assigned to this project.
</h3>
</div>
</div>
<%
else
%>
<%=
render
partial:
-
'assignment_table'
%>
<%
end
%>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help