Skip to content

Commit

Permalink
루머 기능을 지우고, 관련자료 페이지를 추가합니다
Browse files Browse the repository at this point in the history
  • Loading branch information
rest515 committed Apr 24, 2020
1 parent 8a30ade commit 95ddb61
Show file tree
Hide file tree
Showing 16 changed files with 2,296 additions and 56 deletions.
14 changes: 1 addition & 13 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,4 @@
//= require summernote/summernote-bs4.min
//= require summernote-slowalk
//= require turbolinks

$(document).on('ready show.bs closed.bs load page:change turbolinks:load', function () {
$.onmount();
initializeSummernote();

$('[data-toggle="offcanvas"]').on('click', function () {
$('.offcanvas-collapse').toggleClass('open');
})
});

$(document).on('turbolinks:before-cache', function () { $.onmount.teardown() });

$.onmount('.js-tooltip', function () { $(this).tooltip() });
//= require parti
3 changes: 0 additions & 3 deletions app/assets/javascripts/data_sets.coffee

This file was deleted.

3 changes: 0 additions & 3 deletions app/assets/javascripts/pages.coffee

This file was deleted.

20 changes: 20 additions & 0 deletions app/assets/javascripts/parti.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$(document).on('ready show.bs closed.bs load page:change turbolinks:load', function () {
$.onmount();

initializeSummernote();

$('[data-toggle="offcanvas"]').on('click', function () {
$('.offcanvas-collapse').toggleClass('open');
})

$('.infinite-scroll').infiniteScroll({
path: ".pagination a[rel=next]",
append: ".infinite-scroll-item",
prefill: true,
debug: true
});
});

$(document).on('turbolinks:before-cache', function () { $.onmount.teardown() });

$.onmount('.js-tooltip', function () { $(this).tooltip() });
11 changes: 11 additions & 0 deletions app/assets/stylesheets/parti.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ header nav.navbar.fixed-top {
left: 0;
}

.card .card-image {
position: relative;
padding-bottom: 56.2%;
img {
position:absolute;
width: 100%;
height: 100%;
object-fit: cover;
}
}

.card-columns {
@include media-breakpoint-only(sm) {
column-count: 2;
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/links_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class LinksController < ApplicationController
def index
@links = Link.order("id desc").page(params[:page])
end
end
9 changes: 7 additions & 2 deletions app/views/application/_aside.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
= render "search_bar"

%section
%h5.text-muted= t('menu.tags')
.mb-4
Expand All @@ -15,6 +13,13 @@
= link_to data_set, class: "list-group-item list-group-item-action" do
%h6.my-0= data_set.title

%section
%h5.text-muted 최신 관련자료
.mb-4.list-group
- Link.limit(20).each do |link|
= link_to link.data_set, class: "list-group-item list-group-item-action" do
%h6.my-0= link.title

%section
.mb-4
.border.p-3
Expand Down
14 changes: 6 additions & 8 deletions app/views/application/_header.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@
%small.text-light
%i.far.fa-database
%li.nav-item= link_to t("menu.data_sets"), data_sets_path, class: "nav-link"
- if user_signed_in?
%li.nav-item= link_to t("link.new_data_set"), new_data_set_path, class: "nav-link"
%li.nav-item.mt-4
%small.text-light
%i.far.fa-wind
%li.nav-item= link_to t("menu.rumors"), rumors_path, class: "nav-link"
%li.nav-item= link_to t("menu.links"), links_path, class: "nav-link"
%li.nav-item.mt-4
%small.text-light
Expand All @@ -29,4 +23,8 @@
- else
%li.nav-item= link_to t("link.sign_in"), new_user_session_path, class: "nav-link"
= link_to t("site_name"), root_path, class: "navbar-brand"
.mr-auto
= link_to t("site_name"), root_path, class: "navbar-brand"
= form_with url: data_sets_path, method: :get, local: true, class: "form-inline" do |f|
= f.text_field :q, value: params[:q], placeholder: "검색", class: "form-control form-control-sm"
6 changes: 0 additions & 6 deletions app/views/application/_search_bar.html.haml

This file was deleted.

4 changes: 3 additions & 1 deletion app/views/data_sets/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
%h2.pb-2
= t('main.title')
= t('menu.data_sets')
- if params[:q].present?
= "'#{params[:q]}'"
%small
= link_to t('menu.links'), links_path, class: "text-muted"

.row
- @data_sets.each do |data_set|
Expand Down
15 changes: 2 additions & 13 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}
%meta{:charset => "utf-8"}
%meta{:content => "width=device-width, initial-scale=1, shrink-to-fit=no", :name => "viewport"}
%title 데이터퍼블릭
%title 빠띠 데이터퍼블릭
= csrf_meta_tags
= csp_meta_tag
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
Expand All @@ -13,18 +13,7 @@
%body.bg-light
= render "header"

- if current_page?(root_url)
%header
.container
.py-5.text-center
%span.display-3.bg-dark.text-white.rounded.px-3.font-weight-bold D
%h2.mt-4
%span.font-weight-bold 데이터퍼블릭
%small.font-weight-light .kr
%p.p-2.lead.text-muted
사회적으로 이슈가 된 사안들의 원본 데이터들을 출처와 함께 모읍니다.

%main.py-4
%main.py-5
.container
.row
.col-md-8
Expand Down
6 changes: 6 additions & 0 deletions app/views/links/_link.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.list-group-item[link]
%h5.mb-1
= link_to link.url, class: "text-dark" do
= link.title

%p.mb-1= link_to link.data_set.title, link.data_set, class: "text-muted"
10 changes: 10 additions & 0 deletions app/views/links/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%h2.pb-2
= t('menu.links')
%small
= link_to t('menu.data_sets'), data_sets_path, class: "text-muted"

.list-group
= render @links

.d-flex.justify-content-center
= paginate @links
8 changes: 2 additions & 6 deletions config/locales/ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,15 @@ ko:
tags: 태그
links: 관련정보
comments: 댓글
rumor:
title: 제목
body: 내용
comments: 댓글
link:
title: 제목
body: 요약
url: URL

site_name: 데이터퍼블릭.kr
site_name: 빠띠 데이터퍼블릭
menu:
data_sets: 원 데이터
rumors: 루머
links: 관련자료
fact_checks: 팩트체크
tags: 태그
search: 검색
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
devise_for :users

resources :data_sets
resources :rumors
resources :tags
resources :links

root "data_sets#index"
end
Loading

0 comments on commit 95ddb61

Please sign in to comment.