Skip to content
This repository has been archived by the owner on Dec 6, 2018. It is now read-only.

Add collection descriptions #16

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ To install (developers):
3. `cd WARClight`
4. `bundle install`
5. `rake db:migrate`
6. `rake db:seed` to seed the database with WALK descriptions.

If you get errors, may need to reset db `rake db:reset`.

To use the bundled Solr index:

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/200/SFU_ngos-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/800/SFU_ngos-800.png
3 changes: 3 additions & 0 deletions app/assets/javascripts/description.coffee
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/
4 changes: 3 additions & 1 deletion app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@import "description";

@import "variables";

@import "bootstrap";

@import "bootswatch";

@import 'blacklight/blacklight'
@import 'blacklight/blacklight'
43 changes: 43 additions & 0 deletions app/assets/stylesheets/description.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Place all the styles related to the Description controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

figure {
float: left;
padding: 2px;
width: 205px;
height: 300px;
margin-right: 5px;
margin-bottom: 20em;
margin-top: 20em;
}

figure :hover {
background-color: yellow
}

figure a img {
width: 200px;
height: 200px;
padding: 5px;
border: 1px dotted gray;
}

figure figcaption {
border: 1px dotted blue;
text-align: center;
margin-bottom: 20em;
}

.row div.nav {
float: right;
}

.nav-pills {

}

.description-notes {
width: 800px;
margin: 10px 10px 10px 20px;
}
5 changes: 5 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ class ApplicationController < ActionController::Base
# Adds a few additional behaviors into the application controller
include Blacklight::Controller
layout 'blacklight'

def layout_name
"description"
end


# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Expand Down
1 change: 0 additions & 1 deletion app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class CatalogController < ApplicationController
include Blacklight::Catalog
include Blacklight::Marc::Catalog


configure_blacklight do |config|
## Class for sending and receiving requests from a search index
# config.repository_class = Blacklight::Solr::Repository
Expand Down
48 changes: 48 additions & 0 deletions app/controllers/description_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
class DescriptionController < ApplicationController
def list
@descriptions = Description.all
@keyword = params[:keyword]
end

def showdescription
@description = Description.find(params[:id])
#@stats = Description.find(params[:id]).stats.split(",").map(&:strip)
end

def new
@description = Description.new
end

def description_params
params.require(:descriptions).permit(:name, :institutional, :walk_desc, :filename, :graphviz, :network, :keywords, :stats, :archive_it_url, :dataverse_url, :summary)
end

def create
@description = Description.new(description_params)

if @description.save
redirect_to :action => 'list'
end
end

def edit
@description = Description.find(params[:id])
end

def description_param
params.require(:description).permit(:name, :institutional, :walk_desc, :filename, :graphviz, :network, :keywords, :stats, :archive_it_url, :dataverse_url, :summary)
end

def update
@description = Description.find(params[:id])

if @description.update_attributes(description_param)
redirect_to :action => 'show', :id => @description
end
end

def delete
Description.find(params[:id]).destroy
redirect_to :action => 'list'
end
end
2 changes: 2 additions & 0 deletions app/helpers/description_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module DescriptionHelper
end
3 changes: 3 additions & 0 deletions app/models/application_record.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
4 changes: 4 additions & 0 deletions app/models/description.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Description < ApplicationRecord
validates_presence_of :name, :filename

end
111 changes: 70 additions & 41 deletions app/views/catalog/_home_text.html.erb
Original file line number Diff line number Diff line change
@@ -1,51 +1,80 @@
<div class="page-header row">
<h1 class="col-md-8 page-heading"><%= t('blacklight.Web Archives for Longitudinal Knowledge') %></h1>
<ul class="nav nav-pills col-md-4">
<li><a href="https://dataverse.scholarsportal.info/dataverse/wahr">Derivative Data</a></li>
<li><a href="http://webarchives.ca/">Old Portal</a></li>
<li><a href="https://github.com/web-archive-group/WALK">GitHub</a></li>
<li><a href="/static_pages/about">About</a></li>
</ul>


<div class="nav nav-pills col-md-4">
<a href="https://dataverse.scholarsportal.info/dataverse/wahr">Data</a> &#9643;
<a href="http://webarchives.ca/">Old Site</a> &#9643;
<a href="https://github.com/web-archive-group/WALK">GitHub</a> &#9643;
<a href="/static_pages/about">About</a>
</div>

<div id="getting-started">
<img src="/cpppig-visualization-small.png" alt="Political Link Graph" class="img-responsive" align="right">
<p>Big Data is reshaping the historical profession and society in ways we are only now beginning to grasp. Tremendous new opportunities are opening up for social and cultural historians. Large web archives contain billions of webpages, from personal homepages to professional or academic websites, offering the ability to reconstruct large-scale aspects of the recent past. Yet the sheer size of these primary sources presents significant challenges: if the norm until the digital era was to have human information vanish, “now expectations have inverted. Everything may be recorded and preserved, at least potentially” (as James Gleick noted in his 2012 <em>The Information: A History, a Theory, a Flood</em>).</p>
<p>Welcome to the <strong>Web Archives for Longitudinal Knowledge (WALK) Project</strong>. Spearheaded by the <a href="https://uwaterloo.ca/">University of Waterloo</a>, <a href="http://yorku.ca/">York University</a>, and the <a href="https://ualberta.ca/">University of Alberta</a>, we are bringing together Canadian partners to provide access to their collections.</p>
<h2 class='section-heading'>Browse Our Collection Descriptions</h2>
<p>WebArch is a searchable database of web archives collected by a growing number of Canadian Universities.</p>
</div>
<div id="partners">
<h2>Our partners</h2>
<p>Our project provides access to the holdings of six partners across Canada. For each collection, click on the logo below to be brought to collections information, datasets, and search portals. Or dig in above to search them all!</p>
<img src="/ualib-logo-500w.png" class="img-responsive" alt="Unviersity of Alberta Libraries" align="center" />
<img src="/dalhousie.png" class="img-responsive" alt="Dalhousie University logo" align="center" />
<img src="/sfu-logo@2x.png" class="img-responsive" alt="Simon Fraser University logo" align="center" />
<a href="http://localhost:3000/static_pages/toronto"><img src="/UTL-logo-blue-500w.png" class="img-responsive" alt="Unviersity of Toronto Libraries" align="center" /></a>
<img src="/UVIC_Logo.jpg" class="img-responsive" alt="Unviersity of Victoria Libraries" align="center" />
<img src="/UW_horiz_rgb-black.png" class="img-responsive" alt="University of Winnipeg logo" align="center" />

<div id=id="carousel1">
<h2 class='category-heading'> <%= link_to "Historical Events", description_list_path(:keyword => "event") %> </h2>
<%= link_to image_tag('200/TORONTO_snowden_archive-200.png', style: "float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em"), description_showdescription_path(:id => 18) %>

<%= link_to image_tag('200/ALBERTA_ottawa_shooting_october_2014-200.png', style: "float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em"), description_showdescription_path(:id => 22) %>

<%= link_to image_tag('200/TORONTO_toronto_2015_pan_am_american_games-200.png', style: "float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em"), description_showdescription_path(:id => 7) %>

<p style="clear: both;">

<div class="network_text" id="CATEGORY1" style="float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em;"/> Edward Snowden Archive </div>
<div class="network_text" id="CATEGORY1" style="float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em;"/> Ottawa Shooting October 2014 </div>
<div class="network_text" id="CATEGORY1" style="float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em;"/ > Toronto Pan Am Games </div>


<p style="clear: both;">
</div>
<div id="carousel2">
<h2 class='category-heading'> <%= link_to "Culture and Ethnicity", description_list_path(:keyword => "culture") %> </h2>


<%= link_to image_tag('200/WINNIPEG_truth_reconciliation-200.png', style: "float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em"), description_showdescription_path(:id => 15) %>
<%= link_to image_tag('200/ALBERTA_heritage_community_foundation-200.png', style: "float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em"), description_showdescription_path(:id => 1) %>
<%= link_to image_tag('200/ALBERTA_western_canadian_film-200.png', style: "float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em"), description_showdescription_path(:id => 3) %>



<p style="clear: both;">

<div class="network_text" id="CATEGORY1" style="float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em;"/> Truth and Reconcilliation </div>
<div class="network_text" id="CATEGORY1" style="float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em;"/> Community Heritage Foundation </div>
<div class="network_text" id="CATEGORY1" style="float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em;"/ > Western Canadian Film </div>
</div>
<p style="clear: both;">

<div id="carousel3">

<h2 class='category-heading'> <%= link_to "Science, Technology and the Environment", description_list_path(:keyword => "science") %> </h2>

<%= link_to image_tag('200/ALBERTA_health_sciences_grey_literature-200.png', style: "float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em"), description_showdescription_path(:id => 2) %>

<div id="acknowlgements">
<h2>Acknowlegements</h2>
<p>This research was supported by <a href="https://www.computecanada.ca/">Compute Canada</a> and the <a href="http://www.sshrc-crsh.gc.ca/home-accueil-eng.aspx">Social Sciences and Humanities Research Council of Canada</a>. Additional support was forthcoming from the <a href="https://www.ontario.ca/page/early-researcher-awards">Ontario Ministry of Research and Innovation's Early Researcher Award</a>.</p>
<a href="http://www.sshrc-crsh.gc.ca/home-accueil-eng.aspx"><img src="/sshrc_fip_wordmark_eng.jpg" alt="Social Sciences and Humanities Research Council wordmark and logo" class="img-responsive" align="left"></a>
<a href="https://www.computecanada.ca/"><img src="/biligual-cc-web-logo-flat-white.png" alt="Compute Canada wordmark and logo" class="img-responsive" align="left"></a>
<a href="https://www.ontario.ca/page/early-researcher-awards"><img src="/ontario-logo.png" alt="Ontario logo" class="img-responsive" align="right"></a>
<%= link_to image_tag('200/DALHOUSIE_Ransom_Myers-200.png', style: "float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em"), description_showdescription_path(:id => 4) %>

<p style="clear: both;">

<div class="network_text" id="CATEGORY1" style="float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em;"/> Alberta Health Sciences Grey Literature </div>
<div class="network_text" id="CATEGORY1" style="float: left; width: 22%; margin-right: 1%; margin-bottom: 0.5em;"/> Ransom Myers Web Archive </div>
>
<p style="clear: both;">
</div>

<script>
$(function() {
$('#about a').on('click', function(e) {
e.preventDefault();

if ($('#about-content').html() == "") {
$('#about-content').load($(this).attr("href"), function() {
$('#about-content').show();
});
} else {
$('#about-content').toggle();
}
});
});
</script>
$(function() {
$('#about a').on('click', function(e) {
e.preventDefault();
if ($('#about-content').html() == "") {
$('#about-content').load($(this).attr("href"), function() {
$('#about-content').show();
});
} else {
$('#about-content').toggle();
}
});
});
</script>


13 changes: 8 additions & 5 deletions app/views/catalog/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<div id="sidebar" class="<%= sidebar_classes %>">
<%= render 'search_sidebar' %>
</div>

<div id="content" class="<%= main_content_classes %>">


<% unless has_search_parameters? %>
<%# if there are no input/search related params, display the "home" partial -%>
<%= render 'home' %>
<% else %>

<div id="sidebar" class="<%= sidebar_classes %>">
<%= render 'search_sidebar' %>
</div>
<div id="content" class="<%= main_content_classes %>">
<%= render 'search_results' %>
</div>
<% end %>
</div>
22 changes: 22 additions & 0 deletions app/views/description/list.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

<% if @descriptions.blank? %>
<p>There are not any web archives tagged <i>"<% @keyword %>"</i>..</p>
<% else %>
<p>These are the current collections for the keyword <i><%= @keyword.inspect %></i>.</p>

<ul id = "descriptions">
<% @descriptions.each do |c| %>

<% if c.keywords.split(",").map(&:strip).include?(@keyword) %>
<figure>
<%= link_to image_tag('200/' + c.filename + '-200.png' ), {:action => 'showdescription', :id => c.id} -%>
<figcaption> <%= link_to c.name, description_showdescription_path(:id => c.id) -%><br />
<%= c.summary %>
</figcaption>
</figure>
<% end %>
<% end %>

</ul>

<% end %>
39 changes: 39 additions & 0 deletions app/views/description/showdescription.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@


<div class="description-notes">
<h1><%= @description.name %></h1>



<%= link_to image_tag("800/" + @description.filename + "-800.png", size: "800x200"), @description.archive_it_url %>

<p>
<%= link_to "Archive page", @description.archive_it_url %><br />
<%= link_to "Graphml", @description.dataverse_url %><br />
<%= link_to "Time-series visualization of crawls", "https://web-archive-group.github.io/WALK-CrawlVis/crawl-sites/" + @description.filename + "-all.html" %><br /><br />
</p>



<p>
<%= @description.institutional %><br /><br />
<%= @description.walk_desc %><br /><br />
<strong>Crawl notes:</strong> <%= @description.graphviz %><br /><br />



<strong>Network notes: </strong><%= @description.network %><br /><br />
<strong> Keywords: </strong> <% @description.keywords.split(",").map(&:strip).each do |c| %>
<%= link_to c + " ", description_list_path(:keyword => c) %>
<% end %>
<br /><br />
<strong>Network notes: </strong><%= @description.network %><br />
<strong> Total nodes: </strong> <%= @description.stats.split(",")[0] %>
<strong> Total edges: </strong><%= @description.stats.split(",")[1] %>
<strong> Average degree: </strong><%= @description.stats.split(",")[2] %><br /><br />

<p>
</div>

<hr />

2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<title>BlacklightWALK</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= stylesheet_link_tag 'description', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
Expand Down
26 changes: 26 additions & 0 deletions app/views/layouts/description.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Place all the styles related to the Description controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

figure {
border: 1px dotted gray;
}
figure a img {
float: left;
width: "22%";
margin-right: "1%";
margin-bottom: 0.5em
}

figure figcaption {
border: 1px dotted blue;
text-align: center;
float:left;
}

div.nav nav-pills col-md-4 {
float: right;
font-size: large;
text-align: center;
background-color: yellow;
}
Loading