summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/common/_action.html.haml2
-rw-r--r--app/views/common/_navigation_item.html.haml3
-rw-r--r--app/views/common/_table.html.haml18
-rw-r--r--app/views/identities/_identity.html.haml7
-rw-r--r--app/views/identities/index.html.haml4
-rw-r--r--app/views/layouts/_admin_navigation_item.html.haml3
-rw-r--r--app/views/layouts/_header.html.haml6
7 files changed, 38 insertions, 5 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..02c54c8
--- /dev/null
+++ b/app/views/common/_navigation_item.html.haml
@@ -0,0 +1,3 @@
+- item = navigation_item.to_s
+%li{:class => ("active" if controller?(item))}
+ = link_to t(".#{item}", cascade: true), polymorphic_url(item)
diff --git a/app/views/common/_table.html.haml b/app/views/common/_table.html.haml
new file mode 100644
index 0000000..3c6bf2e
--- /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.any?
+ = render content.all
+ - else
+ %tr
+ %td{:colspan=>headers.count}= none
+
diff --git a/app/views/identities/_identity.html.haml b/app/views/identities/_identity.html.haml
new file mode 100644
index 0000000..7c4aeda
--- /dev/null
+++ b/app/views/identities/_identity.html.haml
@@ -0,0 +1,7 @@
+%tr[identity]{class: identity.status}
+ %td
+ %span.label= t(".#{identity.status}", cascading: true)
+ %td= identity.login
+ %td= identity.destination
+ %td
+ %ul.list-inline= render actions(identity)
diff --git a/app/views/identities/index.html.haml b/app/views/identities/index.html.haml
new file mode 100644
index 0000000..cabcccd
--- /dev/null
+++ b/app/views/identities/index.html.haml
@@ -0,0 +1,4 @@
+-@show_navigation = false
+
+= table @identities, %w(type username destination actions)
+-# = paginate @identities
diff --git a/app/views/layouts/_admin_navigation_item.html.haml b/app/views/layouts/_admin_navigation_item.html.haml
new file mode 100644
index 0000000..8dd8a39
--- /dev/null
+++ b/app/views/layouts/_admin_navigation_item.html.haml
@@ -0,0 +1,3 @@
+- item = admin_navigation_item.to_s
+%li{:class => ("active" if controller?(item))}
+ = link_to t(".#{item}", cascade: true), path_for(item)
diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml
index e827f60..ff14af9 100644
--- a/app/views/layouts/_header.html.haml
+++ b/app/views/layouts/_header.html.haml
@@ -1,10 +1,6 @@
- if admin?
%ul.nav.nav-tabs
- = # this navigation isn't quite right. also, we will want to active for an identity controller once it is added.
- %li{:class => ("active" if controller?('users', 'overviews') || params[:user_id])}
- = link_to t(".users"), users_path
- %li{:class => ("active" if controller?('tickets') && !params[:user_id])}
- = link_to t(".tickets", cascade: true), tickets_path
+ = render partial: 'common/navigation_item', collection: [:users, :identities, :tickets]
%li
= link_to t(:logout), logout_path, :method => :delete
- if @user && @show_navigation