Skip to content

Commit

Permalink
Deleted condition_details view
Browse files Browse the repository at this point in the history
- Moved contents of deleted conditions_details view into show view
  • Loading branch information
h-kataria committed Feb 4, 2021
1 parent 63715f3 commit c301899
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 92 deletions.
91 changes: 0 additions & 91 deletions app/views/condition/_condition_details.html.haml

This file was deleted.

92 changes: 91 additions & 1 deletion app/views/condition/show.html.haml
Original file line number Diff line number Diff line change
@@ -1 +1,91 @@
= render :partial => 'condition_details'
#condition_details_div
= render :partial => "layouts/flash_msg"
.form-horizontal
-# Don't show basic info box with description only unless in edit mode
%h3= _("Basic Information")
.form-horizontal
.form-group
%label.control-label.col-md-2
= _("Description")
.col-md-8
%p.form-control-static
= h(@condition.description)

.form-horizontal
.form-group
%label.control-label.col-md-2
= _("Applies To")
.col-md-8
= Condition::TOWHAT_APPLIES_TO_CLASSES[@edit ? @edit[:new][:towhat] : @condition.towhat]

%h3= _("Scope")
.form-horizontal
.form-group
%label.control-label.col-md-2
= _("Description")
.col-md-8
- if !@applies_to_exp_table.nil?
- @applies_to_exp_table.each do |token|
- if ! ["AND", "OR", "(", ")"].include?([token].flatten.first)
= h([token].flatten.first)
- else
%font{:color => "black"}
%b
= h([token].flatten.first)
- else
= render :partial => 'layouts/info_msg', :locals => {:message => _("No scope defined, the scope of this condition includes all elements.")}
%hr

%h3= _("Expression")
.form-horizontal
.form-group
%label.control-label.col-md-2
.col-md-8
- if !@expression_table.nil?
- @expression_table.each do |token|
- if ! ["AND", "OR", "(", ")"].include?([token].flatten.first)
= h([token].flatten.first)
- else
%font{:color => "black"}
%b
= h([token].flatten.first)
- else
= render :partial => 'layouts/info_msg', :locals => {:message => _("A condition must contain a valid expression.")}
%hr

-# Notes field
%h3= _("Notes")
.form-horizontal
- if @condition.notes.blank?
= render :partial => 'layouts/info_msg', :locals => {:message => _("No notes have been entered.")}
- else
= text_area_tag("notes", @condition.notes, :readonly => true, :rows => 5)
%hr

%h3= _("Assigned to Policies")
- if @condition_policies.empty?
= render :partial => 'layouts/info_msg', :locals => {:message => _("This Condition is not assigned to any Policies.")}
- else
%table.table.table-striped.table-bordered.table-hover
%tbody
- @condition_policies.each do |p|
- id = "xx-#{p.mode.downcase}_xx-#{p.mode.downcase}-#{p.towhat.camelize(:lower)}_p-#{p.id}"
%tr{:title => _("Click to view Policy")}
%td.table-view-pf-select
%i{:class => p.decorate.fonticon}
%td
= p.description
- if !@edit
%h3= _("Assigned to Policies")
- if @condition_policies.empty?
= render :partial => 'layouts/info_msg', :locals => {:message => _("This Condition is not assigned to any Policies.")}
- else
%table.table.table-striped.table-bordered.table-hover
%tbody
- @condition_policies.each do |p|
- id = "xx-#{p.mode.downcase}_xx-#{p.mode.downcase}-#{p.towhat.camelize(:lower)}_p-#{p.id}"
%tr{:title => _("Click to view Policy")}
%td.table-view-pf-select
%i{:class => p.decorate.fonticon}
%td
= p.description

0 comments on commit c301899

Please sign in to comment.