#369: remove layouts/application.html.haml

This commit is contained in:
Vokhmin Alexey V 2014-11-14 00:41:07 +03:00
parent 09a1ab377f
commit 362477fadd
26 changed files with 38 additions and 129 deletions

View File

@ -1,6 +1,4 @@
class AdvisoriesController < ApplicationController
layout 'bootstrap'
before_filter :authenticate_user!
skip_before_filter :authenticate_user! if APP_CONFIG['anonymous_access']
load_resource find_by: :advisory_id

View File

@ -1,6 +1,4 @@
class Groups::BaseController < ApplicationController
layout 'bootstrap'
before_filter :authenticate_user!
before_filter :find_group

View File

@ -1,5 +1,4 @@
class HomeController < ApplicationController
layout 'bootstrap'
before_filter :authenticate_user!, only: [:activity, :issues, :pull_requests]
def root

View File

@ -1,6 +1,5 @@
class Platforms::ContentsController < Platforms::BaseController
include PaginateHelper
layout 'bootstrap'
before_filter :authenticate_user!
skip_before_filter :authenticate_user!, only: :index if APP_CONFIG['anonymous_access']

View File

@ -1,6 +1,4 @@
class Platforms::KeyPairsController < Platforms::BaseController
layout 'bootstrap'
before_filter :authenticate_user!
load_and_authorize_resource :platform

View File

@ -1,6 +1,4 @@
class Platforms::MaintainersController < ApplicationController
layout 'bootstrap'
before_filter :authenticate_user!
skip_before_filter :authenticate_user!, only: [:index] if APP_CONFIG['anonymous_access']
load_and_authorize_resource :platform

View File

@ -1,6 +1,5 @@
class Platforms::MassBuildsController < Platforms::BaseController
include DatatableHelper
layout 'bootstrap'
before_filter :authenticate_user!
skip_before_filter :authenticate_user!, only: [:index, :get_list] if APP_CONFIG['anonymous_access']

View File

@ -1,6 +1,5 @@
class Platforms::PlatformsController < Platforms::BaseController
include FileStoreHelper
layout 'bootstrap'
before_filter :authenticate_user!
skip_before_filter :authenticate_user!, only: [:advisories, :members, :show] if APP_CONFIG['anonymous_access']

View File

@ -1,6 +1,5 @@
class Platforms::ProductBuildListsController < Platforms::BaseController
include FileStoreHelper
layout 'bootstrap'
before_filter :authenticate_user!
skip_before_filter :authenticate_user!, only: [:index, :show, :log] if APP_CONFIG['anonymous_access']

View File

@ -1,6 +1,5 @@
class Platforms::ProductsController < Platforms::BaseController
include GitHelper
layout 'bootstrap'
before_filter :authenticate_user!
skip_before_filter :authenticate_user!, only: [:index, :show] if APP_CONFIG['anonymous_access']

View File

@ -4,8 +4,6 @@ class Platforms::RepositoriesController < Platforms::BaseController
include RepositoriesHelper
include PaginateHelper
layout 'bootstrap'
before_filter :authenticate_user!
skip_before_filter :authenticate_user!, only: [:index, :show, :projects_list] if APP_CONFIG['anonymous_access']

View File

@ -1,6 +1,4 @@
class Platforms::TokensController < Platforms::BaseController
layout 'bootstrap'
before_filter :authenticate_user!
load_resource :platform

View File

@ -2,8 +2,6 @@ class Projects::BuildListsController < Projects::BaseController
include FileStoreHelper
include BuildListsHelper
layout 'bootstrap'
NESTED_ACTIONS = [:index, :new, :create]
before_filter :authenticate_user!

View File

@ -1,6 +1,4 @@
class Projects::Git::BlobsController < Projects::Git::BaseController
layout 'bootstrap', only: [:show]
before_filter :set_blob
before_filter -> {authorize! :write, @project}, only: [:edit, :update]

View File

@ -1,5 +1,4 @@
class Projects::Git::CommitsController < Projects::Git::BaseController
layout 'bootstrap', only: [:index]
def index
if @path.present?

View File

@ -1,5 +1,4 @@
class Projects::Git::TreesController < Projects::Git::BaseController
layout 'bootstrap', only: [:show, :branches, :tags]
before_filter -> {redirect_to @project if params[:treeish] == @project.default_branch and params[:path].blank?}, only: :show
skip_before_filter :set_branch_and_tree, :set_treeish_and_path, only: :archive

View File

@ -3,8 +3,6 @@ class Projects::HooksController < Projects::BaseController
load_and_authorize_resource :project
load_and_authorize_resource :hook, through: :project
layout 'bootstrap'
def index
authorize! :edit, @project
@name = params[:name]

View File

@ -1,7 +1,7 @@
class Projects::ProjectsController < Projects::BaseController
include DatatableHelper
include ProjectsHelper
layout 'bootstrap', only: [:index, :new, :create, :edit, :update, :sections]
before_filter :authenticate_user!
load_and_authorize_resource id_param: :name_with_owner # to force member actions load
before_filter :who_owns, only: [:new, :create, :mass_import, :run_mass_import]

View File

@ -1,6 +1,4 @@
class StatisticsController < ApplicationController
layout 'bootstrap'
RANGES = [
RANGE_TWENTY_FOUR_HOURS = 'twenty_four_hours',
RANGE_LAST_7_DAYS = 'last_7_days',

View File

@ -1,6 +1,4 @@
class Users::BaseController < ApplicationController
layout 'bootstrap'
before_filter :authenticate_user!
before_filter :find_user

View File

@ -1,6 +1,6 @@
class Users::SettingsController < Users::BaseController
include AvatarHelper
layout 'bootstrap'
before_filter :set_current_user
def profile

View File

@ -1,5 +1,4 @@
class Users::SshKeysController < Users::BaseController
layout 'bootstrap'
before_filter :set_current_user
def index

View File

@ -12,7 +12,7 @@ class Ability
@user = user
# Shared rights between guests and registered users
can [:show, :archive], Project, visibility: 'open'
can [:show, :archive, :read], Project, visibility: 'open'
can :get_id, Project, visibility: 'open' # api
can(:refs_list, Project) {|project| can? :show, project}
can :read, Issue, project: { visibility: 'open' }

View File

@ -1,61 +0,0 @@
!!!
%html
%head
%meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
= stylesheet_link_tag 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/base/jquery-ui.css', media: 'screen, projection'
= stylesheet_link_tag "application"
/[if lt IE 9]
= javascript_include_tag 'https://html5shiv.googlecode.com/svn/trunk/html5.js'
= javascript_include_tag 'application'
= javascript_include_tag 'moment/ru.js' if I18n.locale == :ru
= csrf_meta_tag
= display_meta_tags site: APP_CONFIG['project_name'], reverse: true, separator: '-'
- if user_signed_in?
= auto_discovery_link_tag :atom, atom_activity_feeds_path(format: 'atom', token: current_user.authentication_token), title: t("layout.atom_link_tag_title", nickname: current_user.uname, app_name: APP_CONFIG['project_name'])
%body{'ng-app' => 'RosaABF', 'ng-controller' => 'RosaABFController', 'ng-init' => "init('#{I18n.locale}', #{!!current_user.try(:sound_notifications)})"}
.wrap{class: content_for?(:sidebar) ? 'columns' : ''}
%header
.left
.middle
%menu
.logo= link_to image_tag('logo-mini.png', alt: 'logo'), root_path
= render 'layouts/menu/top', which_menu: 'top_menu'
.information
= render 'search/form'
- if current_user
.user
.avatar= image_tag avatar_url(current_user), alt: 'avatar', height: "30"
.profile
%a{href: "#"}
= current_user.uname
= image_tag 'expand-white.png', alt: 'ex'
.both
.both
.droplist-wrap
#droplist.droplist
.a= link_to current_user.uname, current_user
.a= link_to t('layout.settings.label'), profile_settings_path
.a= link_to t('layout.logout'), destroy_user_session_path, method: :delete
- else
.user
.profile= link_to t("layout.devise.shared_links.sign_up"), new_register_request_path
.profile= link_to t("layout.devise.shared_links.sign_in"), new_user_session_path
.right
.both
- if content_for?(:submenu)
.sub-menu= yield :submenu
- if content_for?(:feed_tabs)
= yield :feed_tabs
.both
= render 'layouts/noscript'
= render "layouts/flashes"
= render "layouts/notifies"
%article
- if content_for?(:sidebar)
%aside= yield :sidebar
%div{class: layout_class}= yield
.both
%footer= render "layouts/menu/bottom"
= render 'layouts/counters' if !current_user.try(:admin?) && Rails.env.production?

View File

@ -0,0 +1,35 @@
doctype html
html
head
meta name="viewport" content="width=device-width, initial-scale=1.0"
meta content="text/html; charset=utf-8" http-equiv="Content-Type"
== csrf_meta_tag
= display_meta_tags site: APP_CONFIG['project_name'], reverse: true, separator: '-'
- if user_signed_in?
= auto_discovery_link_tag :atom, atom_activity_feeds_path(format: 'atom', token: current_user.authentication_token), title: t("layout.atom_link_tag_title", nickname: current_user.uname, app_name: APP_CONFIG['project_name'])
== stylesheet_link_tag 'new_application'
body[ ng-app='RosaABF' ng-controller='RosaABFController'
ng-init="init('#{I18n.locale}', #{!!current_user.try(:sound_notifications)})" ]
== render 'layouts/menu/new_top'
== yield :submenu if content_for?(:submenu)
- if current_user || APP_CONFIG['anonymous_access']
- if (flash_notify = FlashNotify.published.first) && flash_notify.should_show?(cookies[:flash_notify_hash])
javascript:
var FLASH_HASH_ID = "#{flash_notify.hash_id}";
.notify.alert.alert-dismissable.text-center class=alert_class(flash_notify.status)
button.close type='button' data-dismiss='alert' aria-hidden=true
= flash_notify.body(I18n.locale).html_safe
== render 'layouts/noscript'
== render "layouts/flashes"
article.container-fluid.offset20
== yield
== render 'layouts/menu/new_bottom'
== javascript_include_tag 'new_application'
- if I18n.locale == :ru
== javascript_include_tag 'moment/ru.js'
== javascript_include_tag 'angular-locale_ru-ru'
== yield :additional_scripts if content_for?(:additional_scripts)

View File

@ -1,34 +0,0 @@
!!!
%html
%head
%meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
= csrf_meta_tag
= display_meta_tags site: APP_CONFIG['project_name'], reverse: true, separator: '-'
- if user_signed_in?
= auto_discovery_link_tag :atom, atom_activity_feeds_path(format: 'atom', token: current_user.authentication_token), title: t("layout.atom_link_tag_title", nickname: current_user.uname, app_name: APP_CONFIG['project_name'])
= stylesheet_link_tag 'new_application'
%body{ 'ng-app' => 'RosaABF', 'ng-controller' => 'RosaABFController',
'ng-init' => "init('#{I18n.locale}', #{!!current_user.try(:sound_notifications)})" }
= render 'layouts/menu/new_top'
= yield :submenu if content_for?(:submenu)
- if current_user || APP_CONFIG['anonymous_access']
- if (flash_notify = FlashNotify.published.first) && flash_notify.should_show?(cookies[:flash_notify_hash])
:javascript
var FLASH_HASH_ID = "#{flash_notify.hash_id}";
.notify.alert.alert-dismissable.text-center{ class: alert_class(flash_notify.status) }
%button.close{ type: 'button', 'data-dismiss' => 'alert', 'aria-hidden' => true } &times;
= flash_notify.body(I18n.locale).html_safe
= render 'layouts/noscript'
= render "layouts/flashes"
%article.container-fluid.offset20
= yield
= render 'layouts/menu/new_bottom'
= javascript_include_tag 'new_application'
- if I18n.locale == :ru
= javascript_include_tag 'moment/ru.js'
= javascript_include_tag 'angular-locale_ru-ru'
= yield :additional_scripts if content_for?(:additional_scripts)