@ -0,0 +1,105 @@ | |||
.admin-wrapper { | |||
width: 100%; | |||
height: 100%; | |||
position: fixed; | |||
background: #1a1c23; | |||
overflow-y: scroll; | |||
.sidebar { | |||
width: 240px; | |||
position: fixed; | |||
left: 0; | |||
height: 100%; | |||
background: #282c37; | |||
.logo { | |||
display: block; | |||
margin: 40px auto; | |||
width: 100px; | |||
height: 100px; | |||
} | |||
ul { | |||
list-style: none; | |||
a { | |||
display: block; | |||
padding: 15px 25px; | |||
color: rgba(255, 255, 255, 0.7); | |||
text-decoration: none; | |||
transition: all 200ms linear; | |||
i.fa { | |||
margin-right: 5px; | |||
} | |||
&:hover { | |||
color: #fff; | |||
background-color: darken(#282c37, 5%); | |||
transition: all 100ms linear; | |||
} | |||
&.selected { | |||
color: #fff; | |||
background-color: #2b90d9; | |||
&:hover { | |||
background-color: lighten(#2b90d9, 5%); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
.content { | |||
margin-left: 240px; | |||
padding: 15px; | |||
} | |||
} | |||
.filters { | |||
display: flex; | |||
margin-bottom: 20px; | |||
padding-left: 8px; | |||
.filter-subset { | |||
flex: 0 0 auto; | |||
margin-right: 40px; | |||
ul { | |||
margin-top: 5px; | |||
list-style: none; | |||
li { | |||
display: inline-block; | |||
margin-right: 5px; | |||
} | |||
} | |||
strong { | |||
font-weight: 500; | |||
text-transform: uppercase; | |||
font-size: 12px; | |||
} | |||
a { | |||
display: inline-block; | |||
color: rgba(255, 255, 255, 0.7); | |||
text-decoration: none; | |||
text-transform: uppercase; | |||
font-size: 12px; | |||
font-weight: 500; | |||
border-bottom: 2px solid #282c37; | |||
&:hover { | |||
color: #fff; | |||
border-bottom: 2px solid lighten(#282c37, 5%); | |||
} | |||
&.selected { | |||
color: #2b90d9; | |||
border-bottom: 2px solid #2b90d9; | |||
} | |||
} | |||
} | |||
} |
@ -0,0 +1,14 @@ | |||
# frozen_string_literal: true | |||
class Admin::DomainBlocksController < ApplicationController | |||
before_action :require_admin! | |||
layout 'admin' | |||
def index | |||
@blocks = DomainBlock.paginate(page: params[:page], per_page: 40) | |||
end | |||
def create | |||
end | |||
end |
@ -1,2 +1,15 @@ | |||
# frozen_string_literal: true | |||
module Admin::AccountsHelper | |||
def filter_params(more_params) | |||
params.permit(:local, :remote, :by_domain, :silenced, :suspended, :recent).merge(more_params) | |||
end | |||
def filter_link_to(text, more_params) | |||
link_to text, filter_params(more_params), class: params.merge(more_params).compact == params.compact ? 'selected' : '' | |||
end | |||
def table_link_to(icon, text, path) | |||
link_to safe_join([fa_icon(icon), text]), path, class: 'table-action-link' | |||
end | |||
end |
@ -0,0 +1,4 @@ | |||
# frozen_string_literal: true | |||
module Admin::DomainBlocksHelper | |||
end |
@ -1,2 +1,4 @@ | |||
# frozen_string_literal: true | |||
module Admin::PubsubhubbubHelper | |||
end |
@ -0,0 +1,14 @@ | |||
- content_for :page_title do | |||
Domain Blocks | |||
%table.table | |||
%thead | |||
%tr | |||
%th Domain | |||
%tbody | |||
- @blocks.each do |block| | |||
%tr | |||
%td | |||
%samp= block.domain | |||
= will_paginate @blocks, pagination_options |
@ -0,0 +1,11 @@ | |||
- content_for :content do | |||
.admin-wrapper | |||
.sidebar | |||
= link_to root_path do | |||
= image_tag 'logo.png', class: 'logo' | |||
= render_navigation | |||
.content | |||
= yield | |||
= render template: "layouts/application" |
@ -0,0 +1,11 @@ | |||
# frozen_string_literal: true | |||
SimpleNavigation::Configuration.run do |navigation| | |||
navigation.items do |primary| | |||
primary.item :accounts, safe_join([fa_icon('users fw'), 'Accounts']), admin_accounts_url | |||
primary.item :pubsubhubbubs, safe_join([fa_icon('paper-plane-o fw'), 'PubSubHubbub']), admin_pubsubhubbub_index_url | |||
primary.item :domain_blocks, safe_join([fa_icon('lock fw'), 'Domain Blocks']), admin_domain_blocks_url | |||
primary.item :sidekiq, safe_join([fa_icon('diamond fw'), 'Sidekiq']), sidekiq_url | |||
primary.item :pghero, safe_join([fa_icon('database fw'), 'PgHero']), pghero_url | |||
end | |||
end |
@ -0,0 +1,14 @@ | |||
require 'rails_helper' | |||
RSpec.describe Admin::DomainBlocksController, type: :controller do | |||
before do | |||
sign_in Fabricate(:user, admin: true), scope: :user | |||
end | |||
describe 'GET #index' do | |||
it 'returns http success' do | |||
get :index | |||
expect(response).to have_http_status(:success) | |||
end | |||
end | |||
end |
@ -1,15 +1,5 @@ | |||
require 'rails_helper' | |||
# Specs in this file have access to a helper object that includes | |||
# the Admin::AccountsHelper. For example: | |||
# | |||
# describe Admin::AccountsHelper do | |||
# describe "string concat" do | |||
# it "concats two strings with spaces" do | |||
# expect(helper.concat_strings("this","that")).to eq("this that") | |||
# end | |||
# end | |||
# end | |||
RSpec.describe Admin::AccountsHelper, type: :helper do | |||
pending "add some examples to (or delete) #{__FILE__}" | |||
end |
@ -0,0 +1,5 @@ | |||
require 'rails_helper' | |||
RSpec.describe Admin::DomainBlocksHelper, type: :helper do | |||
end |
@ -1,15 +1,5 @@ | |||
require 'rails_helper' | |||
# Specs in this file have access to a helper object that includes | |||
# the Admin::PubsubhubbubHelper. For example: | |||
# | |||
# describe Admin::PubsubhubbubHelper do | |||
# describe "string concat" do | |||
# it "concats two strings with spaces" do | |||
# expect(helper.concat_strings("this","that")).to eq("this that") | |||
# end | |||
# end | |||
# end | |||
RSpec.describe Admin::PubsubhubbubHelper, type: :helper do | |||
pending "add some examples to (or delete) #{__FILE__}" | |||
end |