From 4f9e7be4622a73c12582d6770700eb3f9d089a1c Mon Sep 17 00:00:00 2001 From: Moises Deniz Aleman Date: Thu, 9 Mar 2017 10:15:21 +0100 Subject: [PATCH] [webui] Replace ERB templates with HAML for webui/notifications controller --- .../views/webui/notifications/_roles.html.erb | 14 ----------- .../webui/notifications/_roles.html.haml | 8 +++++++ .../views/webui/notifications/index.html.erb | 15 ------------ .../views/webui/notifications/index.html.haml | 9 ++++++++ .../bento/layouts/webui/_header.html.erb | 23 ------------------- .../bento/layouts/webui/_header.html.haml | 17 ++++++++++++++ .../webui/package/_extra_actions.html.erb | 5 ---- .../webui/package/_extra_actions.html.haml | 4 ++++ src/api/app/views/webui/timeout.html.erb | 4 ---- src/api/app/views/webui/timeout.html.haml | 4 ++++ 10 files changed, 42 insertions(+), 61 deletions(-) delete mode 100644 src/api/app/views/webui/notifications/_roles.html.erb create mode 100644 src/api/app/views/webui/notifications/_roles.html.haml delete mode 100644 src/api/app/views/webui/notifications/index.html.erb create mode 100644 src/api/app/views/webui/notifications/index.html.haml delete mode 100644 src/api/app/views/webui/theme/bento/layouts/webui/_header.html.erb create mode 100644 src/api/app/views/webui/theme/bento/layouts/webui/_header.html.haml delete mode 100644 src/api/app/views/webui/theme/bento/webui/package/_extra_actions.html.erb create mode 100644 src/api/app/views/webui/theme/bento/webui/package/_extra_actions.html.haml delete mode 100644 src/api/app/views/webui/timeout.html.erb create mode 100644 src/api/app/views/webui/timeout.html.haml diff --git a/src/api/app/views/webui/notifications/_roles.html.erb b/src/api/app/views/webui/notifications/_roles.html.erb deleted file mode 100644 index 0bfff0cb781..00000000000 --- a/src/api/app/views/webui/notifications/_roles.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -

Events to get email for ...

- -<% @notifications.each do |type| %> - <%= field_set_tag type.description do %> - - <% end %> -<% end %> diff --git a/src/api/app/views/webui/notifications/_roles.html.haml b/src/api/app/views/webui/notifications/_roles.html.haml new file mode 100644 index 00000000000..8ce1defd568 --- /dev/null +++ b/src/api/app/views/webui/notifications/_roles.html.haml @@ -0,0 +1,8 @@ +%h3 Events to get email for ... +- @notifications.each do |type| + = field_set_tag type.description do + %ul.horizontal-list + - type.receiver_roles.each do |role| + %li + = check_box_tag "#{type}[#{role}]", '1', EventSubscription.subscription_value(type.to_s, role, @user) + = label_tag "#{type}[#{role}]", role diff --git a/src/api/app/views/webui/notifications/index.html.erb b/src/api/app/views/webui/notifications/index.html.erb deleted file mode 100644 index 377f7fad14f..00000000000 --- a/src/api/app/views/webui/notifications/index.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<% @pagetitle = 'Global Notification Settings' %> -<% @crumb_list = [@pagetitle] %> -<% @layouttype = 'custom' %> - -
- <%= render :partial => 'webui/configuration/tabs' %> - -

<%= @pagetitle %>

- - <%= form_tag(bulk_update_notifications_path, { method: :patch, id: 'notification_form'}) do %> - <%= render partial: 'roles' %> -

<%= submit_tag 'Update' %>

- <% end %> - -
diff --git a/src/api/app/views/webui/notifications/index.html.haml b/src/api/app/views/webui/notifications/index.html.haml new file mode 100644 index 00000000000..fc0247513b6 --- /dev/null +++ b/src/api/app/views/webui/notifications/index.html.haml @@ -0,0 +1,9 @@ +- @pagetitle = 'Global Notification Settings' +- @crumb_list = [ @pagetitle ] +- @layouttype = 'custom' +.grid_16.alpha.omega.box.box-shadow + = render partial: 'webui/configuration/tabs' + %p= @pagetitle + = form_tag(bulk_update_notifications_path, { method: :patch, id: 'notification_form'}) do + = render partial: 'roles' + %p= submit_tag 'Update' diff --git a/src/api/app/views/webui/theme/bento/layouts/webui/_header.html.erb b/src/api/app/views/webui/theme/bento/layouts/webui/_header.html.erb deleted file mode 100644 index cd435d6ab6d..00000000000 --- a/src/api/app/views/webui/theme/bento/layouts/webui/_header.html.erb +++ /dev/null @@ -1,23 +0,0 @@ - - - - diff --git a/src/api/app/views/webui/theme/bento/layouts/webui/_header.html.haml b/src/api/app/views/webui/theme/bento/layouts/webui/_header.html.haml new file mode 100644 index 00000000000..aae40f0b23e --- /dev/null +++ b/src/api/app/views/webui/theme/bento/layouts/webui/_header.html.haml @@ -0,0 +1,17 @@ +/ Start: Header +#header + #header-content.container_12 + = link_to sprite_tag( "header-logo" ), root_path, { id: "header-logo" } + %ul#global-navigation + %li#item-downloads + %a{href: "http://en.opensuse.org/openSUSE:Browse#Downloads" } Downloads + %li#item-support + %a{ href: "http://en.opensuse.org/openSUSE:Browse#Support" } Support + %li#item-community + %a{ href: "http://en.opensuse.org/openSUSE:Browse#Community" } Community + %li#item-development + %a{ href: "http://en.opensuse.org/openSUSE:Browse#Development" } Development + - unless User.current.is_nobody? + %li#item-favorites{ style: "float: right;" } + %a{ href: "#{user_show_url(User.current)}" } Watchlist + = render partial: "layouts/webui/watch_and_search" diff --git a/src/api/app/views/webui/theme/bento/webui/package/_extra_actions.html.erb b/src/api/app/views/webui/theme/bento/webui/package/_extra_actions.html.erb deleted file mode 100644 index 3fb436f829d..00000000000 --- a/src/api/app/views/webui/theme/bento/webui/package/_extra_actions.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<% if CONFIG['software_opensuse_url'] %> -
  • - <%= sprite_tag 'application_get' %> Download package -
  • -<% end %> diff --git a/src/api/app/views/webui/theme/bento/webui/package/_extra_actions.html.haml b/src/api/app/views/webui/theme/bento/webui/package/_extra_actions.html.haml new file mode 100644 index 00000000000..4579e72faef --- /dev/null +++ b/src/api/app/views/webui/theme/bento/webui/package/_extra_actions.html.haml @@ -0,0 +1,4 @@ +- if CONFIG['software_opensuse_url'] + %li + = sprite_tag 'application_get' + %a{ href: "#{CONFIG['software_opensuse_url']}/download.html?project=#{u @project.name}&package=#{u @package.name}" } Download package diff --git a/src/api/app/views/webui/timeout.html.erb b/src/api/app/views/webui/timeout.html.erb deleted file mode 100644 index b5698901726..00000000000 --- a/src/api/app/views/webui/timeout.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -

    Timeout occurred

    - -

    We're sorry but the system is currently not able to handle your request -in a reasonable time. Please try again later.

    diff --git a/src/api/app/views/webui/timeout.html.haml b/src/api/app/views/webui/timeout.html.haml new file mode 100644 index 00000000000..da26d2dd098 --- /dev/null +++ b/src/api/app/views/webui/timeout.html.haml @@ -0,0 +1,4 @@ +%h1 Timeout occurred +%p + We're sorry but the system is currently not able to handle your request + in a reasonable time. Please try again later.