aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb2
-rw-r--r--app/helpers/newapplication_helper.rb (renamed from app/helpers/newfront_helper.rb)39
2 files changed, 39 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 8e476a958..5edb8c3bf 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1,6 +1,6 @@
module ApplicationHelper
- include NewfrontHelper
+ include NewapplicationHelper
def font_awesome_classic_tag(name)
name = "fa-file-text-o" if name == "fa-file-csv-o"
diff --git a/app/helpers/newfront_helper.rb b/app/helpers/newapplication_helper.rb
index 7bedbeea9..2e5a716a6 100644
--- a/app/helpers/newfront_helper.rb
+++ b/app/helpers/newapplication_helper.rb
@@ -1,4 +1,4 @@
-module NewfrontHelper
+module NewapplicationHelper
# Table Builder
def table_builder collection, columns, actions, cls = nil
@@ -115,4 +115,41 @@ module NewfrontHelper
end
end
+ # PageHeader builder
+ def pageheader pageicon, pagetitle, desc, meta, mainaction = nil, &block
+
+ firstRow = content_tag :div, '', class: 'row' do
+ # Left part with pageicon & pagetitle & desc
+ left = content_tag :div, '', class: 'col-lg-9 col-md-8 col-sm-8 col-xs-7' do
+ picon = content_tag :div, '', class: 'page-icon' do
+ content_tag :span, '', class: "fa fa-lg fa-#{pageicon}"
+ end
+ ptitle = content_tag :div, '', class: 'page-title' do
+ info = content_tag :span, '', class: 'small fa fa-info-circle', title: desc
+
+ content_tag :h1, pagetitle.concat(info).html_safe
+ end
+
+ picon + ptitle
+ end
+ # Right part with meta & mainaction
+ right = content_tag :div, '', class: 'col-lg-3 col-md-4 col-sm-4 col-xs-5 text-right' do
+ content_tag :div, '', class: 'page-action' do
+ a = content_tag :div, meta.html_safe, class: 'small'
+ b = mainaction.try(:html_safe)
+
+ a + b
+ end
+ end
+
+ left + right
+ end
+
+ content_tag :div, '', class: 'page_header' do
+ content_tag :div, '', class: 'container-fluid' do
+ firstRow + capture(&block)
+ end
+ end
+ end
+
end