diff --git a/app/assets/images/synapse.png b/app/assets/images/synapse.png new file mode 100644 index 00000000..8ae3ca7b Binary files /dev/null and b/app/assets/images/synapse.png differ diff --git a/app/assets/images/synapse2.png b/app/assets/images/synapse2.png new file mode 100644 index 00000000..0adecbac Binary files /dev/null and b/app/assets/images/synapse2.png differ diff --git a/app/assets/javascripts/Jit/analyze.js b/app/assets/javascripts/Jit/analyze.js index 41a69c7f..735ae7b2 100644 --- a/app/assets/javascripts/Jit/analyze.js +++ b/app/assets/javascripts/Jit/analyze.js @@ -1,42 +1,51 @@ -//// -//// -//// -//// Define all the dynamic interactions for the Analyze using Jquery - -$(document).ready(function() { - - // this sets up the initial opening of the organize box - $('#sideOptionAnalyze').bind('click',function(){ - if (!analyzeOpen) openAnalyze(); - }); - - // this sets up the closing of the organize box, and the toggling between open and closed. - $('#closeAnalyze').bind('click',function(){ - if (analyzeOpen) closeAnalyze(); - }); -}); - -function openAnalyze() { - analyzeOpen = true; - if (findOpen) closeFind(); - if (organizeOpen) closeOrganize(); - $('#sideOptionFind').css('z-index','8'); - $('#sideOptionAnalyze, #closeAnalyze').css('z-index','10'); - $('#sideOptionOrganize').css('z-index','8'); - $('#sideOptionAnalyze').animate({ - width: '100px', - height: '76px' - }, 100); - $('#closeAnalyze').css('display','block'); - $('#sideOptionAnalyze').css('cursor','default'); -} - -function closeAnalyze() { - analyzeOpen = false; - $('#closeAnalyze').css('display','none'); - $('#sideOptionAnalyze').css('cursor','pointer'); - $('#sideOptionAnalyze').animate({ - width: '64px', - height: '32px' - }, 100); +//// +//// +//// +//// Define all the dynamic interactions for the Analyze using Jquery + +$(document).ready(function() { + + // this sets up the initial opening of the organize box + $('#sideOptionAnalyze').bind('click',function(){ + if (!analyzeOpen) openAnalyze(); + }); + + // this sets up the closing of the organize box, and the toggling between open and closed. + $('#closeAnalyze').bind('click',function(){ + if (analyzeOpen) closeAnalyze(); + }); +}); + +function openAnalyze() { + analyzeOpen = true; + if (findOpen) closeFind(); + if (organizeOpen) closeOrganize(); + $('#sideOptionFind').css('z-index','8'); + $('#sideOptionAnalyze, #closeAnalyze').css('z-index','10'); + $('#sideOptionOrganize').css('z-index','8'); + $('#sideOptionAnalyze').animate({ + width: '100px', + height: '76px' + }, 100); + $('#closeAnalyze').css('display','block'); + $('#sideOptionAnalyze').css('cursor','default'); + var numT = Object.keys(Mconsole.graph.nodes).length; + var numS = 0; + Mconsole.graph.eachNode(function (n) { + n.eachAdjacency(function () { + numS++; + }); + }); + numS = numS/2; + $('.analysis').html('

' + numT + ' topics

' + numS + ' synapses

'); +} + +function closeAnalyze() { + analyzeOpen = false; + $('#closeAnalyze').css('display','none'); + $('#sideOptionAnalyze').css('cursor','pointer'); + $('#sideOptionAnalyze').animate({ + width: '64px', + height: '32px' + }, 100); } \ No newline at end of file diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index ab5c6808..28109315 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -65,8 +65,9 @@ h2 { display:block; text-align:center; font-family: "vinyl",sans-serif; - background: #333; + background: url('black_bg.png'); font-size:24px; + line-height:35px; } a { @@ -82,6 +83,11 @@ a { clear:both; } +.spacer { + display:block; + height:50px; +} + .hidden { display: none; } @@ -89,6 +95,18 @@ a { /* * Layout stuffs */ + +.profile { + overflow-y:scroll; + height:100%; + margin-bottom:50px; +} + +.centeredProfile { + margin:0 auto; + display: block; + width: 845px; +} .new_session, .new_user, @@ -387,7 +405,6 @@ input[type="submit"] { #sideOptionAnalyze { top:35%; width:64px; - display:none; } #sideOptionOrganize { diff --git a/app/assets/stylesheets/maps.css.scss b/app/assets/stylesheets/maps.css.scss index e829b8ae..12eda20b 100644 --- a/app/assets/stylesheets/maps.css.scss +++ b/app/assets/stylesheets/maps.css.scss @@ -2,6 +2,11 @@ // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ +.mapdata { + color: #1A1; + font-style: italic; +} + .saveMapLayout { float:left; } diff --git a/app/assets/stylesheets/synapses.css.scss b/app/assets/stylesheets/synapses.css.scss index 73162259..1b69c220 100644 --- a/app/assets/stylesheets/synapses.css.scss +++ b/app/assets/stylesheets/synapses.css.scss @@ -1,3 +1,66 @@ -// Place all the styles related to the synapses controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ +// Place all the styles related to the synapses controller here. +// They will automatically be included in application.css. +// 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; +} \ No newline at end of file diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 8f08a931..d6fc3079 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -5,6 +5,14 @@ class MainController < ApplicationController 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 end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 73a15553..f603cb31 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -24,9 +24,9 @@ class UsersController < ApplicationController # GET /user def show @user = User.find(params[:id]) - @topics = @user.topics.order("created_at").limit(3) - @synapses = @user.synapses.order("created_at").limit(3) - @maps = @user.maps.order("created_at").limit(3) + @topics = @user.topics.order("created_at DESC").limit(3) + @synapses = @user.synapses.order("created_at DESC").limit(3) + @maps = @user.maps.order("created_at DESC").limit(3) respond_with(@user, @topics, @synapses, @maps) end diff --git a/app/views/main/_analyze.html.erb b/app/views/main/_analyze.html.erb index c9bc412c..c4f92841 100644 --- a/app/views/main/_analyze.html.erb +++ b/app/views/main/_analyze.html.erb @@ -1,4 +1,6 @@ close
Analyze... +
+
\ No newline at end of file diff --git a/app/views/main/home.html.erb b/app/views/main/home.html.erb new file mode 100644 index 00000000..eaacfa60 --- /dev/null +++ b/app/views/main/home.html.erb @@ -0,0 +1,31 @@ +
+ +

Recently Created Topics <%= link_to "see all", topics_url%>

+
+<% @topics.each do |topic| %> + <%= render topic %> +<% end %> +
+
+ +

Recently Created Synapses <%= link_to "see all", synapses_url%>

+
+<% @synapses.each do |synapse| %> + <%= render synapse %> +<% end %> +
+
+ +

Recently Created Maps <%= link_to "see all", maps_url%>

+
+<% @maps.each do |map| %> + <%= render map %> +<% end %> +
+
+ +
+ +

+ Home +

\ No newline at end of file diff --git a/app/views/synapses/_synapse.html.erb b/app/views/synapses/_synapse.html.erb new file mode 100644 index 00000000..b5635949 --- /dev/null +++ b/app/views/synapses/_synapse.html.erb @@ -0,0 +1,11 @@ +<%= div_for synapse do %> +
+

<%= link_to synapse.topic1.name, topic_url(synapse.topic1) %>

+ <%= image_tag synapse.topic1.metacode.icon, :class => 'icon', :size => '50x50' %> +
+
<%= synapse.desc %>
+
+ <%= image_tag synapse.topic2.metacode.icon, :class => 'icon', :size => '50x50' %> +

<%= link_to synapse.topic2.name, topic_url(synapse.topic2) %>

+
+<% end %> \ No newline at end of file diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 8b37c0be..4e18c98b 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -17,17 +17,33 @@
--> -

Recently Created Topics

+
+ +

Recently Created Topics <%= link_to "see all", user_topics_path(@user)%>

+
<% @topics.each do |topic| %> <%= render topic %> <% end %> +
-

Recently Created Maps

+

Recently Created Synapses <%= link_to "see all", user_synapses_path(@user)%>

+
+<% @synapses.each do |synapse| %> + <%= render synapse %> +<% end %> +
+
+ +

Recently Created Maps <%= link_to "see all", user_maps_path(@user)%>

+
<% @maps.each do |map| %> <%= render map %> <% end %> -
+
+
+ +

Viewing Mapper: <%= @user.name %> diff --git a/config/routes.rb b/config/routes.rb index 69255032..173c127c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,6 @@ 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