Skip to content

Commit

Permalink
Fix rendering print in patinfo view
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed Aug 23, 2017
1 parent bec93bc commit 0ff3431
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/view/drugs/patinfo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ class PiChapterChooser < HtmlGrid::Composite
COMPONENTS = {
[0,0] => :full_text,
}
COMPONENT_CSS_MAP = {
[0,0,2] => 'chapter-tab',
[2,0] => 'chapter-tab bold',
}
CSS_CLASS = 'composite'
CSS_MAP = {
[0,0,2] => 'chapter-tab',
Expand All @@ -79,20 +75,26 @@ class PiChapterChooser < HtmlGrid::Composite
}
def init
xwidth = self::class::XWIDTH
unless(@model.pointer.skeleton == [:create])
if(@session.state.allowed?)
components.store([2,0], :print_edit)
else
components.store([2,0], :print)
end
end
document = @model.send(@session.language)
next_offset = 1
@css_map = {[0,0,2] => 'chapter-tab'}
@component_css_map = {
[0,0,2] => 'chapter-tab',
[1, 0] => 'chapter-tab',
}
unless(@model.pointer.skeleton == [:create])
document = @model.send(@session.language)
if document.change_log.size > 0
@components.store([next_offset, 0], :change_log)
@css_map.store( [next_offset, 0], 'chapter-tab')
components.store([next_offset, 0], :change_log)
@css_map.store( [next_offset, 0], 'chapter-tab')
next_offset += 1
end
if(@session.state.allowed?)
components.store([next_offset,0], :print_edit)
else
components.store([next_offset,0], :print)
end
colspan_map.store( [next_offset, 0], XWIDTH - next_offset)
@css_map.store( [next_offset, 0], 'chapter-tab bold')
end
names = display_names(document)
xx = 0
Expand Down

0 comments on commit 0ff3431

Please sign in to comment.