Skip to content

Commit

Permalink
Merge eee1527 into 91a3cad
Browse files Browse the repository at this point in the history
  • Loading branch information
YOSHIDA Cake committed Aug 24, 2014
2 parents 91a3cad + eee1527 commit 9301111
Show file tree
Hide file tree
Showing 16 changed files with 137 additions and 17 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source 'https://rubygems.org'
source 'https://rails-assets.org'

# Declare your gem's dependencies in poteti.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/poteti/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require bootstrap-sass
//= require_tree .
15 changes: 0 additions & 15 deletions app/assets/stylesheets/poteti/application.css

This file was deleted.

79 changes: 79 additions & 0 deletions app/assets/stylesheets/poteti/application.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
//= require_tree .
//= require_self

@import 'bootstrap-sass';

body {
padding-top: 70px;
}

header {
@extend .navbar;
@extend .navbar-default;
@extend .navbar-fixed-top;

nav {
@extend .container;
display: block;

h1 {
@extend .navbar-header;
margin: 0;

& > a {
@extend .navbar-brand;
}
}

& > ul {
@extend .nav;
@extend .navbar-nav;

li.icon > a {
$font-size: 14px;
$font-size-offset: 3px;
$padding: 15px;

padding-top: $padding - ($font-size-offset * 2);

&:before {
margin-right: 5px;
font-size: $font-size + ($font-size-offset * 2);
top: $font-size-offset + 1px;
position: relative;
}

& > .caret {
margin-left: 5px;
}
}

li.config > a:before {
@extend .glyphicon;
@extend .glyphicon-cog;
}
}

& > .signup {
@extend .nav;
@extend .navbar-nav;
@extend .navbar-right;

& > a {
$border: 1px;
$padding-top-bottom: 6px + $border;
$navber-link-padding: 15px;
margin: ($navber-link-padding - $padding-top-bottom) ($navber-link-padding - $border);
}
}
}
}

.signup > a {
@extend .btn;
@extend .btn-danger;

.jumbotron & {
@extend .btn-lg;
}
}
8 changes: 8 additions & 0 deletions app/controllers/poteti/home_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require_dependency 'poteti/application_controller'

module Poteti
class HomeController < ApplicationController
def index
end
end
end
3 changes: 3 additions & 0 deletions app/helpers/poteti/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module Poteti
module ApplicationHelper
def home?
controller_name.to_sym == :home
end
end
end
4 changes: 4 additions & 0 deletions app/helpers/poteti/home_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Poteti
module HomeHelper
end
end
21 changes: 21 additions & 0 deletions app/views/layouts/poteti/_header.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
header role="navigation"
nav
h1
= link_to 'Poteti', root_path

ul
li
a href="#" Link
- if !user_signed_in? && !home?
.signup
= link_to 'Sign up', new_user_registration_path

ul.navbar-right
- if user_signed_in?
li.dropdown.icon.config
a.dropdown-toggle data-toggle="dropdown" href="#"
span.caret
ul.dropdown-menu role="menu"
li = link_to 'Sign out', destroy_user_session_path, method: :delete
- else
li = link_to 'Sign in', new_user_session_path
4 changes: 3 additions & 1 deletion app/views/layouts/poteti/application.slim
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ html
= javascript_include_tag "poteti/application"
= csrf_meta_tags
body
== yield
= render 'layouts/poteti/header'
.container
== yield
5 changes: 5 additions & 0 deletions app/views/poteti/home/index.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.jumbotron
h1 Poteti
p stands for Portal Of TEchnology TIps. stands for Portal Of TEchnology TIps. stands for Portal Of TEchnology TIps. stands for Portal Of TEchnology TIps. stands for Portal Of TEchnology TIps.
p.signup
= link_to 'Sign up now &raquo;'.html_safe, new_user_registration_path
4 changes: 3 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
# Because ActiveAdmin not supported nested namespace...
# refs: https://github.com/activeadmin/active_admin/issues/615
#
devise_for :users, class_name: 'Poteti::User'
devise_for :users, class_name: 'Poteti::User', module: :devise

resources :users, param: :name do
resources :tips
end

root to: 'home#index'
end
1 change: 1 addition & 0 deletions gemfiles/active_record_40.gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source 'https://rubygems.org'
source 'https://rails-assets.org'

gem 'railties', '~> 4.0.8'
gem 'activerecord', '~> 4.0.8', require: 'active_record'
Expand Down
1 change: 1 addition & 0 deletions gemfiles/active_record_41.gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source 'https://rubygems.org'
source 'https://rails-assets.org'

gem 'railties', '~> 4.1.4'
gem 'activerecord', '~> 4.1.4', require: 'active_record'
Expand Down
1 change: 1 addition & 0 deletions gemfiles/active_record_edge.gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source 'https://rubygems.org'
source 'https://rails-assets.org'

git 'git://github.com/rails/rails.git' do
gem 'railties'
Expand Down
2 changes: 2 additions & 0 deletions lib/poteti/engine.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require 'slim'
require 'devise'
require 'activeadmin'
require 'rails-assets-jquery'
require 'rails-assets-bootstrap-sass'

module Poteti
class Engine < ::Rails::Engine
Expand Down
2 changes: 2 additions & 0 deletions poteti.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Gem::Specification.new do |s|
s.add_dependency 'slim'
s.add_dependency 'devise'
s.add_dependency 'activeadmin'
s.add_dependency 'rails-assets-jquery'
s.add_dependency 'rails-assets-bootstrap-sass'

s.add_development_dependency 'pg'
s.add_development_dependency 'rubocop'
Expand Down

0 comments on commit 9301111

Please sign in to comment.