-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ac4dbb
commit 77207f7
Showing
22 changed files
with
194 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Place all the styles related to the faq controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class FaqController < ApplicationController | ||
def index | ||
PageView.create(url: '/faq' ) | ||
@blog = Blog.cached_find('FAQ') | ||
@user = current_user | ||
end | ||
|
||
def show | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module FaqHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#wrapper | ||
.full-width-top | ||
== render 'shared/navigationbar', page: 'opportunities' | ||
|
||
|
||
#sidebar-wrapper | ||
ul class="sidebar-nav" | ||
== render 'public_opportunities/sidebar', selected: 'opportunities' | ||
|
||
|
||
#page-content-wrapper | ||
.container-fluid | ||
== render 'shared/breadcrumbs', breadcrumbs: { links: { admin: admin_index_path }, current: ''} | ||
.row | ||
.col-sm-5 | ||
|
||
h2 = @blog.title | ||
|
||
/.col-sm-7 | ||
/ .pull-down-10 | ||
/ = simple_form_for [ @blog ], :url => url_for(:action => 'index', \ | ||
/ :controller => 'faq'), \ | ||
/ :method => 'get', | ||
/ turboboost: true do |f| | ||
/ | ||
/ .input-group | ||
/ span class="input-group-addon" | ||
/ i class= 'fa fa-search' | ||
/ = text_field_tag "query", "", :class => 'search-query form-control', \ | ||
/ :placeholder => 'Search topic', \ | ||
/ value: params[:query] | ||
/ .input-group-btn | ||
/ = f.submit 'Search', class: "btn btn-info" | ||
/ ' | ||
/ = link_to 'Clear', faq_path, class: 'btn btn-default' | ||
/ | ||
/ | ||
.pull-down-10 | ||
|
||
/def self.cached_find('FAQ , @blog) | ||
.digi-box | ||
- @blog.blog_posts.each do |blog_post| | ||
h4 = blog_post.title | ||
= simple_format blog_post.body | ||
- if super? | ||
.row | ||
.col-sm-12 | ||
.pull-right | ||
= link_to 'Add question', new_admin_blog_blog_post_path(@blog), class: 'btn btn-info' | ||
|
||
|
||
|
||
== render 'shared/site_footer' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class SecureUserPublishers < ActiveRecord::Migration | ||
def change | ||
Publisher.find_each do |publisher| | ||
UserPublisher.where( | ||
user_id: publisher.user_id, | ||
publisher_id: publisher.id | ||
|
||
) | ||
.first_or_create( | ||
user_id: publisher.user_id, | ||
publisher_id: publisher.id, | ||
email: publisher.email | ||
) | ||
|
||
end | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
db/migrate/20151101141315_remove_foreign_keys_on_user_publishers.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class RemoveForeignKeysOnUserPublishers < ActiveRecord::Migration | ||
def change | ||
remove_foreign_key "user_publishers", "users" | ||
remove_foreign_key "user_publishers", "publishers" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe FaqController, type: :controller do | ||
|
||
describe "GET #index" do | ||
it "returns http success" do | ||
get :index | ||
expect(response).to have_http_status(:success) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'rails_helper' | ||
|
||
# Specs in this file have access to a helper object that includes | ||
# the FaqHelper. For example: | ||
# | ||
# describe FaqHelper 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 FaqHelper, type: :helper do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe "faq/index.html.slim", type: :view do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
end |