summaryrefslogtreecommitdiff
path: root/app/views/common
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/common')
-rw-r--r--app/views/common/_action.html.haml2
-rw-r--r--app/views/common/_navigation_item.html.haml9
-rw-r--r--app/views/common/_search.html.haml8
-rw-r--r--app/views/common/_table.html.haml18
4 files changed, 37 insertions, 0 deletions
diff --git a/app/views/common/_action.html.haml b/app/views/common/_action.html.haml
new file mode 100644
index 0000000..71ffd96
--- /dev/null
+++ b/app/views/common/_action.html.haml
@@ -0,0 +1,2 @@
+%li.action{class: action.class}
+ =link_to action.label, action.url, action.html_options
diff --git a/app/views/common/_navigation_item.html.haml b/app/views/common/_navigation_item.html.haml
new file mode 100644
index 0000000..39b20d7
--- /dev/null
+++ b/app/views/common/_navigation_item.html.haml
@@ -0,0 +1,9 @@
+-#
+-# A very simple navigation link. It takes a symbol, uses it for the
+-# translation, path and determining if the link is active.
+-#
+-# For something more complex use link_to_navigation directly instead.
+-#
+- item = navigation_item.to_s
+= link_to_navigation ".#{item}", polymorphic_url(item),
+ active: controller?(item)
diff --git a/app/views/common/_search.html.haml b/app/views/common/_search.html.haml
new file mode 100644
index 0000000..9f14903
--- /dev/null
+++ b/app/views/common/_search.html.haml
@@ -0,0 +1,8 @@
+= form_tag path, :method => :get, :class => "form-search" do
+ .input-append
+ = text_field_tag :query, params[:query],
+ id: "#{id}-typeahead",
+ class: "search-query",
+ autocomplete: :off
+ %button.btn{:type => :submit}= submit_label
+
diff --git a/app/views/common/_table.html.haml b/app/views/common/_table.html.haml
new file mode 100644
index 0000000..44762da
--- /dev/null
+++ b/app/views/common/_table.html.haml
@@ -0,0 +1,18 @@
+-#
+-# A simple table with headers, content and a message if there is no
+-# content.
+-# You can use the table helper method to translate the headers and
+-# error message.
+-#
+%table.table.table-striped.table-bordered
+ %thead
+ %tr
+ - headers.each do |header|
+ %th= header
+ %tbody
+ - if content.present?
+ = render content.all
+ - else
+ %tr
+ %td{:colspan=>headers.count}= none
+