Skip to content

Commit

Permalink
Replace Bento views by Bootstrap views for Webui::MainController
Browse files Browse the repository at this point in the history
`Webui::StatusMessagesController` doesn't have views, except for
partials which are then used by `Webui::MainController`. This explains
why we tackle them together.
  • Loading branch information
dmarcoux committed Sep 4, 2019
1 parent 8d8a068 commit d14afe8
Show file tree
Hide file tree
Showing 21 changed files with 54 additions and 190 deletions.
18 changes: 0 additions & 18 deletions src/api/app/views/webui/main/_latest_updates.haml

This file was deleted.

14 changes: 8 additions & 6 deletions src/api/app/views/webui/main/_sponsors.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
- unless CONFIG['sponsors'].nil? or CONFIG['sponsors'].empty?
- if CONFIG['sponsors'].present?
- sponsor = CONFIG['sponsors'].sample
.box.box-shadow.centered
%h2.box-header Sponsor
= link_to(sprite_tag(sponsor['icon']), sponsor['url'], { title: sponsor['name'] })
%p
%em= sponsor['description']
.card.mb-3
%h5.card-header Sponsor
.card-body.text-center
%figure.figure.mb-0
= link_to(sprite_tag(sponsor['icon'], class: 'figure-img img-fluid'), sponsor['url'], title: sponsor['name'])
%figcaption.figure-caption
= sponsor['description']
43 changes: 15 additions & 28 deletions src/api/app/views/webui/main/_status_messages.html.haml
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
- if @status_messages.present? || User.admin_session?
.box.box-shadow#messages
%h2.box-header
Announcements
\#{link_to('', news_feed_path(format: 'rss'), { class: 'alignright icons-feeds', title: 'RSS Feed' })}
- @status_messages.each do |msg|
.grid_4.news-sender
= user_with_realname_and_icon msg.user, short: true
wrote #{time_ago_in_words(msg.created_at)} ago
.clear
.grid_4.box.news-message
- if User.admin_session?
= link_to(sprite_tag('comment_delete', title: 'Remove status message'),
{ controller: 'status_messages', action: 'destroy_status_message_dialog', id: msg.id },
{ remote: true, class: 'delete-message' })
- case msg.severity.to_i
- when 3
= sprite_tag('exclamation', alt: 'Red')
- when 2
= sprite_tag('error', alt: 'Yellow')
- when 1
= sprite_tag('accept', alt: 'Green')
- else
= sprite_tag('information', alt: 'Information')
= render_as_markdown(msg.message)
.clear
.card.mb-3
.card-header.d-flex.justify-content-between
%h5
News
.float-right
= link_to(news_feed_path(format: 'rss'), title: 'RSS Feed') do
%i.fa.fa-rss
.list-group
- @status_messages.each do |message|
= render partial: 'status_message', locals: { message: message }
- if User.admin_session?
%p
= link_to(sprite_tag('comment_add') + content_tag(:span, 'Add new status message', id: "add-new-message"), { controller: 'status_messages', action: 'create_status_message_dialog' }, { remote: true })
.card-footer
= link_to('#', 'data-toggle': 'modal', 'data-target': '#status-message-modal') do
%i.fas.fa-plus-circle.text-primary
Add status message
= render partial: 'add_status_message_modal'
23 changes: 0 additions & 23 deletions src/api/app/views/webui/main/_systemstatus.html.haml

This file was deleted.

6 changes: 3 additions & 3 deletions src/api/app/views/webui/main/about.html.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
- @pagetitle = "About"
%h2 About
- @pagetitle = 'About'
%h2= @pagetitle
%p
This is the web interface for the #{@configuration['title']}.
%p
Check the
%a{ href: "http://openbuildservice.org" } Open Build Service project page
%a{ href: 'http://openbuildservice.org' } Open Build Service project page
for details about the software behind it.
57 changes: 28 additions & 29 deletions src/api/app/views/webui/main/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
- @pagetitle = 'Welcome'
- @layouttype = 'custom'
.grid_11.alpha
.box.box-shadow
%h1.mainhead
Welcome to #{@configuration['title']}
= raw @configuration['description']
%br/
%ul#proceed-list
- if User.admin_session?
= proceed_link 'configure', 'Configuration', controller: 'configuration', action: 'index'
= proceed_link 'list', 'All Projects', controller: 'project'
= proceed_link 'system-search', 'Search', controller: 'search', action: 'index'
- else
= proceed_link 'start-here', 'Your Home', user_show_path(User.session!) if User.session
= proceed_link 'list', 'All Projects', controller: 'project'
= proceed_link 'system-search', 'Search', controller: 'search', action: 'index'
= proceed_link "document-new", 'New Project', controller: 'project', action: 'new', ns: User.session!.home_project_name if User.session
- unless @spider_bot
= proceed_link 'utilities-system-monitor', 'Status Monitor', controller: 'monitor', action: 'index'
= proceed_link 'drive-optical-32', 'New Image', image_templates_path
= render partial: 'systemstatus'
.grid_5.omega
- if !User.session and can_register
.box.box-shadow
%h2.box-header New here? Sign up!
= render partial: 'shared/sign_up'
= render partial: 'sponsors'
= render partial: 'status_messages'
= render partial: 'latest_updates' if (@latest_updates and ::Configuration.anonymous)

.row
.col-md-8.col-lg-7
.card.mb-3
.card-body
%h2
Welcome to #{@configuration['title']}
-# rubocop:disable Rails/OutputSafety
= raw @configuration['description']
-# rubocop:enable Rails/OutputSafety
.row.no-gutters.text-center#proceed-list
= render partial: 'proceed-list'
= render(partial: 'system_status', locals: { busy: @busy,
building_workers: @building_workers,
overall_workers: @overall_workers,
waiting_packages: @waiting_packages,
host_title: @configuration['title'],
system_stats: @system_stats })
.col-md-4.col-lg-5
- if !User.session && can_register
.card.mb-3
%h5.card-header New here? Sign up!
.card-body
= render partial: 'webui2/shared/sign_up', locals: { submit_btn_text: 'Sign Up' }
= render partial: 'sponsors'
- if @status_messages.present? || User.admin_session?
= render partial: 'status_messages'
= render(partial: 'latest_updates') if @latest_updates && ::Configuration.anonymous

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions src/api/app/views/webui2/webui/main/_sponsors.html.haml

This file was deleted.

16 changes: 0 additions & 16 deletions src/api/app/views/webui2/webui/main/_status_messages.html.haml

This file was deleted.

8 changes: 0 additions & 8 deletions src/api/app/views/webui2/webui/main/about.html.haml

This file was deleted.

29 changes: 0 additions & 29 deletions src/api/app/views/webui2/webui/main/index.html.haml

This file was deleted.

0 comments on commit d14afe8

Please sign in to comment.