From 87e9ccbcdf4f99dd898b0715750092a27fff7e94 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 4 Jul 2014 15:40:54 +0200 Subject: Enable unblocking handles in identities tab There's an identities tab now for admins that will allow unblocking blocked handles. It should be easy to expand for aliases and forwards and other types of actions such as editing. --- app/views/common/_action.html.haml | 2 ++ app/views/common/_navigation_item.html.haml | 3 +++ app/views/common/_table.html.haml | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 app/views/common/_action.html.haml create mode 100644 app/views/common/_navigation_item.html.haml create mode 100644 app/views/common/_table.html.haml (limited to 'app/views/common') 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 + -- cgit v1.2.3 From bdb4b0e275c205b0b44bbe3cc4ec4c162b309b37 Mon Sep 17 00:00:00 2001 From: Azul Date: Sat, 5 Jul 2014 11:41:43 +0200 Subject: make link_to_navigation more generic and reuse it Use link_to_navigation for all important navigation items. It creates a link in a list item for use with bootstrap. It supports an :active flag and an :icon option in the html_options now. It also translates the label. This way it can be used in a lot of places as the generic navigation link. --- app/views/common/_navigation_item.html.haml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'app/views/common') diff --git a/app/views/common/_navigation_item.html.haml b/app/views/common/_navigation_item.html.haml index 02c54c8..39b20d7 100644 --- a/app/views/common/_navigation_item.html.haml +++ b/app/views/common/_navigation_item.html.haml @@ -1,3 +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 -%li{:class => ("active" if controller?(item))} - = link_to t(".#{item}", cascade: true), polymorphic_url(item) += link_to_navigation ".#{item}", polymorphic_url(item), + active: controller?(item) -- cgit v1.2.3 From 0cc11ebb609de225fbeacbf80788b992b88b6ce6 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 9 Jul 2014 12:51:16 +0200 Subject: list identities based on search only --- app/views/common/_search.html.haml | 8 ++++++++ app/views/common/_table.html.haml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 app/views/common/_search.html.haml (limited to 'app/views/common') 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 index 3c6bf2e..44762da 100644 --- a/app/views/common/_table.html.haml +++ b/app/views/common/_table.html.haml @@ -10,7 +10,7 @@ - headers.each do |header| %th= header %tbody - - if content.any? + - if content.present? = render content.all - else %tr -- cgit v1.2.3