added home page with recent info, and personal profiles with recent indo
This commit is contained in:
parent
bf957617da
commit
1b44175c31
13 changed files with 215 additions and 53 deletions
BIN
app/assets/images/synapse.png
Normal file
BIN
app/assets/images/synapse.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
BIN
app/assets/images/synapse2.png
Normal file
BIN
app/assets/images/synapse2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
|
@ -1,42 +1,51 @@
|
||||||
////
|
////
|
||||||
////
|
////
|
||||||
////
|
////
|
||||||
//// Define all the dynamic interactions for the Analyze using Jquery
|
//// Define all the dynamic interactions for the Analyze using Jquery
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
// this sets up the initial opening of the organize box
|
// this sets up the initial opening of the organize box
|
||||||
$('#sideOptionAnalyze').bind('click',function(){
|
$('#sideOptionAnalyze').bind('click',function(){
|
||||||
if (!analyzeOpen) openAnalyze();
|
if (!analyzeOpen) openAnalyze();
|
||||||
});
|
});
|
||||||
|
|
||||||
// this sets up the closing of the organize box, and the toggling between open and closed.
|
// this sets up the closing of the organize box, and the toggling between open and closed.
|
||||||
$('#closeAnalyze').bind('click',function(){
|
$('#closeAnalyze').bind('click',function(){
|
||||||
if (analyzeOpen) closeAnalyze();
|
if (analyzeOpen) closeAnalyze();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function openAnalyze() {
|
function openAnalyze() {
|
||||||
analyzeOpen = true;
|
analyzeOpen = true;
|
||||||
if (findOpen) closeFind();
|
if (findOpen) closeFind();
|
||||||
if (organizeOpen) closeOrganize();
|
if (organizeOpen) closeOrganize();
|
||||||
$('#sideOptionFind').css('z-index','8');
|
$('#sideOptionFind').css('z-index','8');
|
||||||
$('#sideOptionAnalyze, #closeAnalyze').css('z-index','10');
|
$('#sideOptionAnalyze, #closeAnalyze').css('z-index','10');
|
||||||
$('#sideOptionOrganize').css('z-index','8');
|
$('#sideOptionOrganize').css('z-index','8');
|
||||||
$('#sideOptionAnalyze').animate({
|
$('#sideOptionAnalyze').animate({
|
||||||
width: '100px',
|
width: '100px',
|
||||||
height: '76px'
|
height: '76px'
|
||||||
}, 100);
|
}, 100);
|
||||||
$('#closeAnalyze').css('display','block');
|
$('#closeAnalyze').css('display','block');
|
||||||
$('#sideOptionAnalyze').css('cursor','default');
|
$('#sideOptionAnalyze').css('cursor','default');
|
||||||
}
|
var numT = Object.keys(Mconsole.graph.nodes).length;
|
||||||
|
var numS = 0;
|
||||||
function closeAnalyze() {
|
Mconsole.graph.eachNode(function (n) {
|
||||||
analyzeOpen = false;
|
n.eachAdjacency(function () {
|
||||||
$('#closeAnalyze').css('display','none');
|
numS++;
|
||||||
$('#sideOptionAnalyze').css('cursor','pointer');
|
});
|
||||||
$('#sideOptionAnalyze').animate({
|
});
|
||||||
width: '64px',
|
numS = numS/2;
|
||||||
height: '32px'
|
$('.analysis').html('<p>' + numT + ' topics</p><p>' + numS + ' synapses</p>');
|
||||||
}, 100);
|
}
|
||||||
|
|
||||||
|
function closeAnalyze() {
|
||||||
|
analyzeOpen = false;
|
||||||
|
$('#closeAnalyze').css('display','none');
|
||||||
|
$('#sideOptionAnalyze').css('cursor','pointer');
|
||||||
|
$('#sideOptionAnalyze').animate({
|
||||||
|
width: '64px',
|
||||||
|
height: '32px'
|
||||||
|
}, 100);
|
||||||
}
|
}
|
|
@ -65,8 +65,9 @@ h2 {
|
||||||
display:block;
|
display:block;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
font-family: "vinyl",sans-serif;
|
font-family: "vinyl",sans-serif;
|
||||||
background: #333;
|
background: url('black_bg.png');
|
||||||
font-size:24px;
|
font-size:24px;
|
||||||
|
line-height:35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
@ -82,6 +83,11 @@ a {
|
||||||
clear:both;
|
clear:both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.spacer {
|
||||||
|
display:block;
|
||||||
|
height:50px;
|
||||||
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -89,6 +95,18 @@ a {
|
||||||
/*
|
/*
|
||||||
* Layout stuffs
|
* Layout stuffs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
.profile {
|
||||||
|
overflow-y:scroll;
|
||||||
|
height:100%;
|
||||||
|
margin-bottom:50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.centeredProfile {
|
||||||
|
margin:0 auto;
|
||||||
|
display: block;
|
||||||
|
width: 845px;
|
||||||
|
}
|
||||||
|
|
||||||
.new_session,
|
.new_session,
|
||||||
.new_user,
|
.new_user,
|
||||||
|
@ -387,7 +405,6 @@ input[type="submit"] {
|
||||||
#sideOptionAnalyze {
|
#sideOptionAnalyze {
|
||||||
top:35%;
|
top:35%;
|
||||||
width:64px;
|
width:64px;
|
||||||
display:none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#sideOptionOrganize {
|
#sideOptionOrganize {
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
// They will automatically be included in application.css.
|
// They will automatically be included in application.css.
|
||||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||||
|
|
||||||
|
.mapdata {
|
||||||
|
color: #1A1;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
.saveMapLayout {
|
.saveMapLayout {
|
||||||
float:left;
|
float:left;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,66 @@
|
||||||
// Place all the styles related to the synapses controller here.
|
// Place all the styles related to the synapses controller here.
|
||||||
// They will automatically be included in application.css.
|
// They will automatically be included in application.css.
|
||||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||||
|
|
||||||
|
|
||||||
|
.synapse {
|
||||||
|
display:block;
|
||||||
|
position:relative;
|
||||||
|
width:215px;
|
||||||
|
height:320px;
|
||||||
|
float:left;
|
||||||
|
margin: 30px 0 30px 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.synapseTopic1 {
|
||||||
|
position:absolute;
|
||||||
|
top:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topic1desc {
|
||||||
|
display: block;
|
||||||
|
width: 190px;
|
||||||
|
background: url("bg.png") repeat;
|
||||||
|
position: relative;
|
||||||
|
margin-left: 25px;
|
||||||
|
border-radius: 15px;
|
||||||
|
padding: 10px 5px 10px 28px;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.synapseTopic1 img {
|
||||||
|
position:absolute;
|
||||||
|
top: 15px;
|
||||||
|
z-index: 30;
|
||||||
|
}
|
||||||
|
|
||||||
|
.synapseDesc {
|
||||||
|
position:absolute;
|
||||||
|
top:22px;
|
||||||
|
left:8px;
|
||||||
|
height:30px;
|
||||||
|
padding:125px 0 125px 35px;
|
||||||
|
background: url('synapse2.png') no-repeat 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.synapseTopic2 {
|
||||||
|
position:absolute;
|
||||||
|
bottom:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.synapseTopic2 img {
|
||||||
|
position:absolute;
|
||||||
|
top:-24px;
|
||||||
|
z-index:30;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topic2desc {
|
||||||
|
display: block;
|
||||||
|
width: 190px;
|
||||||
|
background: url("bg.png") repeat;
|
||||||
|
position: relative;
|
||||||
|
margin-left: 25px;
|
||||||
|
border-radius: 15px;
|
||||||
|
padding: 10px 5px 10px 28px;
|
||||||
|
color: #000;
|
||||||
|
}
|
|
@ -5,6 +5,14 @@ class MainController < ApplicationController
|
||||||
|
|
||||||
respond_to :html, :js, :json
|
respond_to :html, :js, :json
|
||||||
|
|
||||||
|
def home
|
||||||
|
@topics = Topic.order("created_at DESC").limit(3).visibleToUser(@current, nil)
|
||||||
|
@synapses = Synapse.order("created_at DESC").limit(3).visibleToUser(@current, nil)
|
||||||
|
@maps = Map.order("created_at DESC").limit(3).visibleToUser(@current, nil)
|
||||||
|
|
||||||
|
respond_with(@topics, @synapses, @maps)
|
||||||
|
end
|
||||||
|
|
||||||
def console
|
def console
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,9 +24,9 @@ class UsersController < ApplicationController
|
||||||
# GET /user
|
# GET /user
|
||||||
def show
|
def show
|
||||||
@user = User.find(params[:id])
|
@user = User.find(params[:id])
|
||||||
@topics = @user.topics.order("created_at").limit(3)
|
@topics = @user.topics.order("created_at DESC").limit(3)
|
||||||
@synapses = @user.synapses.order("created_at").limit(3)
|
@synapses = @user.synapses.order("created_at DESC").limit(3)
|
||||||
@maps = @user.maps.order("created_at").limit(3)
|
@maps = @user.maps.order("created_at DESC").limit(3)
|
||||||
|
|
||||||
respond_with(@user, @topics, @synapses, @maps)
|
respond_with(@user, @topics, @synapses, @maps)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<span id="closeAnalyze" class="closeSideOption">close</span>
|
<span id="closeAnalyze" class="closeSideOption">close</span>
|
||||||
<div class="sideOption" id="sideOptionAnalyze">
|
<div class="sideOption" id="sideOptionAnalyze">
|
||||||
<span class="find_key">Analyze...</span>
|
<span class="find_key">Analyze...</span>
|
||||||
|
<div class="clearfloat"></div>
|
||||||
|
<div class="analysis"></div>
|
||||||
</div>
|
</div>
|
31
app/views/main/home.html.erb
Normal file
31
app/views/main/home.html.erb
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
<div class="profile">
|
||||||
|
|
||||||
|
<h2>Recently Created Topics <%= link_to "see all", topics_url%></h2>
|
||||||
|
<div class="centeredProfile">
|
||||||
|
<% @topics.each do |topic| %>
|
||||||
|
<%= render topic %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="clearfloat"></div>
|
||||||
|
|
||||||
|
<h2>Recently Created Synapses <%= link_to "see all", synapses_url%></h2>
|
||||||
|
<div class="centeredProfile">
|
||||||
|
<% @synapses.each do |synapse| %>
|
||||||
|
<%= render synapse %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="clearfloat"></div>
|
||||||
|
|
||||||
|
<h2>Recently Created Maps <%= link_to "see all", maps_url%></h2>
|
||||||
|
<div class="centeredProfile">
|
||||||
|
<% @maps.each do |map| %>
|
||||||
|
<%= render map %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="clearfloat spacer"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h1 class="index">
|
||||||
|
Home
|
||||||
|
</h1>
|
11
app/views/synapses/_synapse.html.erb
Normal file
11
app/views/synapses/_synapse.html.erb
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<%= div_for synapse do %>
|
||||||
|
<div class="synapseTopic1">
|
||||||
|
<p class="topic1desc"><%= link_to synapse.topic1.name, topic_url(synapse.topic1) %></p>
|
||||||
|
<%= image_tag synapse.topic1.metacode.icon, :class => 'icon', :size => '50x50' %>
|
||||||
|
</div>
|
||||||
|
<div class="synapseDesc"><%= synapse.desc %></div>
|
||||||
|
<div class="synapseTopic2">
|
||||||
|
<%= image_tag synapse.topic2.metacode.icon, :class => 'icon', :size => '50x50' %>
|
||||||
|
<p class="topic2desc"><%= link_to synapse.topic2.name, topic_url(synapse.topic2) %></p>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
|
@ -17,17 +17,33 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfloat nodemargin"></div>-->
|
<div class="clearfloat nodemargin"></div>-->
|
||||||
|
|
||||||
<h2>Recently Created Topics</h2>
|
<div class="profile">
|
||||||
|
|
||||||
|
<h2>Recently Created Topics <%= link_to "see all", user_topics_path(@user)%></h2>
|
||||||
|
<div class="centeredProfile">
|
||||||
<% @topics.each do |topic| %>
|
<% @topics.each do |topic| %>
|
||||||
<%= render topic %>
|
<%= render topic %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
||||||
<div class="clearfloat"></div>
|
<div class="clearfloat"></div>
|
||||||
|
|
||||||
<h2>Recently Created Maps</h2>
|
<h2>Recently Created Synapses <%= link_to "see all", user_synapses_path(@user)%></h2>
|
||||||
|
<div class="centeredProfile">
|
||||||
|
<% @synapses.each do |synapse| %>
|
||||||
|
<%= render synapse %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="clearfloat"></div>
|
||||||
|
|
||||||
|
<h2>Recently Created Maps <%= link_to "see all", user_maps_path(@user)%></h2>
|
||||||
|
<div class="centeredProfile">
|
||||||
<% @maps.each do |map| %>
|
<% @maps.each do |map| %>
|
||||||
<%= render map %>
|
<%= render map %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="clearfloat"></div>
|
</div>
|
||||||
|
<div class="clearfloat spacer"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<h1 class="index">
|
<h1 class="index">
|
||||||
Viewing Mapper: <%= @user.name %>
|
Viewing Mapper: <%= @user.name %>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
ISSAD::Application.routes.draw do
|
ISSAD::Application.routes.draw do
|
||||||
|
|
||||||
root to: 'main#console', via: :get
|
root to: 'main#home', via: :get
|
||||||
|
|
||||||
match 'console', to: 'main#console', via: :get, as: :console
|
match 'console', to: 'main#console', via: :get, as: :console
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue