merge changes on user settings page

This commit is contained in:
Connor Turland 2014-05-30 09:25:29 -04:00
commit f121661858
11 changed files with 25 additions and 202 deletions

View file

@ -14,7 +14,7 @@ gem 'formtastic'
gem 'json'
gem 'rails3-jquery-autocomplete'
gem 'best_in_place'
#gem 'therubyracer' #optional
gem 'therubyracer' #optional
#gem 'rb-readline'
# Gems used only for assets and not required

View file

@ -64,6 +64,7 @@ GEM
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
json (1.8.1)
libv8 (3.16.14.3)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
@ -111,6 +112,9 @@ GEM
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
therubyracer (0.12.1)
libv8 (~> 3.16.14.0)
ref
thor (0.19.1)
thread_safe (0.3.3)
tilt (1.4.1)
@ -143,4 +147,5 @@ DEPENDENCIES
rails3-jquery-autocomplete
redis
sass-rails
therubyracer
uglifier (>= 1.0.3)

View file

@ -1,47 +0,0 @@
source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'devise'
gem 'redis'
gem 'pg'
gem 'cancan'
gem 'formula'
gem 'formtastic'
gem 'json'
gem 'rails3-jquery-autocomplete'
gem 'best_in_place'
#gem 'therubyracer' #optional
#gem 'rb-readline'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails', '2.1.2'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
gem 'jbuilder', '0.8.2'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

View file

@ -455,7 +455,7 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null,
//$(".scroll").mCustomScrollbar();
// initialize scroll bar for filter by metacode, then hide it and position it correctly again
$("#filter_by_metacode").mCustomScrollbar();
$("#filter_by_metacode").mCustomScrollbar({advanced: { updateOnContentResize: true }});
$('.sidebarFilterBox').hide().css({
position:'absolute',
top: '35px',

File diff suppressed because one or more lines are too long

View file

@ -252,12 +252,11 @@ button.button:hover, a.button:hover, input[type="submit"]:hover {
.edit_user{
display: block;
width: 800px;
width: 225px;
position:absolute;
left:50%;
top:0;
left:70%;
top:25%;
margin:50px 0 0 -420px;
background: url('bg.png');
padding: 20px;
border-radius: 15px;
color: #000;

View file

@ -16,11 +16,13 @@ class UsersController < ApplicationController
@user = current_user
@user.attributes = params[:user]
@m = params[:metacodes][:value]
@user.settings.metacodes=@m.split(',')
#@m = params[:metacodes][:value]
#@user.settings.metacodes=@m.split(',')
@user.save
sign_in(@user, :bypass => true)
respond_with(@user, location: session[:previous_url]) do |format|
end
end

View file

@ -28,6 +28,13 @@
<p class="answer off">First and foremost, metamaps bring people together into a shared knowledge environment. Topics and maps "in the commons" invite collaborative editing and shared insight. As new content and connections are made throughout the system, all users benefit from collective intelligence. Other distinguishing factors on the platform include a focus on real-time collaboration, a flexible visual categorization system via metacode icons, no built-in structural biases, and an intuitive search tool to find content. As the project evolves, we will be building in powerful network and graph analysis techniques which are not currently offered in other mind mapping apps.</p>
<div class="question">Is this an open source project? <div class="switch"></div></div>
<p class="answer off">One of the core principles of our work is the enhancement of the pool of commons resources such as open source technology and shared knowledge. Our basic application framework is licensed as GPL open source on <a href="https://github.com/Connoropolous/metamaps_gen002" target="_blank">Github</a> for anyone to build on, and this public platform is freely accessible online.</p>
<div class="question">How can I find out more about the project? <div class="switch"></div></div>
<p class="answer off">Reading here is a great first step. We also suggest browsing our <a href="http://blog.metamaps.cc/" target="_blank">blog</a>, visiting the <a href="https://plus.google.com/u/0/communities/115060009262157699234" target="_blank">Google+ community</a>, or getting in touch by submitting <a onclick="BAROMETER.show();">feedback</a> through the site. We occasionally host online and in person meetups where you can interact with other mappers and see how people are using the platform. The story continues to unfold, and we'd be glad for you to take part.</p>
<div class="question">How can I participate, or support the project? <div class="switch"></div></div>
<p class="answer off">We welcome contributions in many forms. One of the easiest and best things you can do is to keep on mapping your ideas into the commons on the platform! If you're a developer interested in advancing the technology, contact us and take a look around our Github. Designers and others with professional skills can get in touch about opportunities for freelance collaboration through our innovative Open Value Network organizational structure for business development opportunities. Financial contributions are greatly appreciated in support of our work, and can be made by supporting us on <a href="https://flattr.com/profile/metamaps" target="_blank">Flattr</a> or donating <a href="https://blockchain.info/address/14GontNS1FKoiTQDEB5WBCUDZaFTiyxkzN" target="_blank">BitCoin</a>. All financial contributions are transparently recorded in our value accounting system.</p>
<p class="answer off">One of the core principles of our work is the enhancement of the pool of commons resources such as open source technology and shared knowledge. Our basic application framework is licensed as GPL open source on <a href="https://github.com/Connoropolous/metamaps_gen002">Github</a> for anyone to build on, and this public platform is freely accessible online.</p>
<div class="question">How can I find out more about the project? <div class="switch"></div></div>

View file

@ -5,111 +5,13 @@
#%>
<% content_for :title, @user.name + "'s Settings | Metamaps" %>
<h1 class="index">Your Settings</h1>
<%= formula_form_for @user, url: user_url do |form| %>
<h3>Choose Active Metacodes</h3>
<div class="allMetacodes"><span id="showAll">Show All</span><span id="hideAll">Hide All</span></div>
<div class="clearfloat"></div>
<div class="editMetacodes">
<ul id="filters-one">
<% $i = 0 %>
<% @m = Metacode.order("name").all %>
<% while $i < (Metacode.all.length / 4) do %>
<li id="<%= @m[$i].id %>" <% if not @m[$i].hasSelected(@user) %>class="toggledOff"<% end %> >
<img src="<%= @m[$i].icon %>" alt="<%= @m[$i].name %>" />
<p><%= @m[$i].name.downcase %></p>
<div class="clearfloat"></div>
</li>
<% $i += 1 %>
<% end %>
</ul>
<ul id="filters-two">
<% while $i < (Metacode.all.length / 4 * 2) do %>
<li id="<%= @m[$i].id %>" <% if not @m[$i].hasSelected(@user) %>class="toggledOff"<% end %> >
<img src="<%= @m[$i].icon %>" alt="<%= @m[$i].name %>" />
<p><%= @m[$i].name.downcase %></p>
<div class="clearfloat"></div>
</li>
<% $i += 1 %>
<% end %>
</ul>
<ul id="filters-three">
<% while $i < (Metacode.all.length / 4 * 3) do %>
<li id="<%= @m[$i].id %>" <% if not @m[$i].hasSelected(@user) %>class="toggledOff"<% end %> >
<img src="<%= @m[$i].icon %>" alt="<%= @m[$i].name %>" />
<p><%= @m[$i].name.downcase %></p>
<div class="clearfloat"></div>
</li>
<% $i += 1 %>
<% end %>
</ul>
<ul id="filters-four">
<% while $i < Metacode.all.length do %>
<li id="<%= @m[$i].id %>" <% if not @m[$i].hasSelected(@user) %>class="toggledOff"<% end %> >
<img src="<%= @m[$i].icon %>" alt="<%= @m[$i].name %>" />
<p><%= @m[$i].name.downcase %></p>
<div class="clearfloat"></div>
</li>
<% $i += 1 %>
<% end %>
</ul>
<div class="clearfloat"></div>
</div>
<h1 class="index">Your Settings</h1>
<h3>Edit Account</h3>
<%= form.input :name, label: "Name", class: "name" %>
<%= form.input :email, label: "Email", class: "email" %>
<%= form.input :password, label: "Password", class: "password" %>
<%= hidden_field(:metacodes, :value, {:value => 0}) %>
<%= form.submit "Update", class: "update" %>
<% end %>
<script>
var selectMetacodes = new Array;
var allMetacodes = new Array;
<% Metacode.all.each do |m| %>
<% if m.hasSelected(@user) %>
selectMetacodes.push("<%= m.id %>");
<% end %>
allMetacodes.push("<%= m.id %>");
<% end %>
$(document).ready(function() {
$('#metacodes_0').val(selectMetacodes.toString());
$('.editMetacodes li').click(function() {
if ($(this).attr('class') != 'toggledOff') {
$(this).addClass('toggledOff');
var value_to_remove = $(this).attr('id');
selectMetacodes.splice(selectMetacodes.indexOf(value_to_remove), 1);
$('#metacodes_value').val(selectMetacodes.toString());
}
else if ($(this).attr('class') == 'toggledOff') {
$(this).removeClass('toggledOff');
selectMetacodes.push($(this).attr('id'));
$('#metacodes_value').val(selectMetacodes.toString());
}
});
$('#showAll').click(function() {
$('.editMetacodes li').removeClass('toggledOff');
selectMetacodes = allMetacodes;
$('#metacodes_value').val(selectMetacodes.toString());
});
$('#hideAll').click(function() {
$('.editMetacodes li').addClass('toggledOff');
selectMetacodes = [];
$('#metacodes_value').val(0);
});
$('.edit_user').bind('submit', function(event) {
if (selectMetacodes.length == 0) {
alert('Would you pretty please select at least one metacode to map with?');
return false;
}
});
});
</script>

View file

@ -1,21 +0,0 @@
development:
min_messages: WARNING
adapter: postgresql
host: 127.0.0.1
port: 5432
encoding: unicode
database: metamap002_development
pool: 5
username: postgres
password: "3112"
production:
min_messages: WARNING
adapter: postgresql
host: ec2-107-21-107-194.compute-1.amazonaws.com
port: 5432
encoding: unicode
database: ddcrn2lgphjk9k
pool: 5
username: qqpckkahytovwv
password: "njeP6cMA8EjM9ukHk9s3ReOdy7"

View file

@ -1,24 +0,0 @@
{
"name" : "uglify-js",
"description" : "JavaScript parser and compressor/beautifier toolkit",
"author" : {
"name" : "Mihai Bazon",
"email" : "mihai.bazon@gmail.com",
"url" : "http://mihai.bazon.net/blog"
},
"version" : "1.2.3",
"main" : "./uglify-js.js",
"bin" : {
"uglifyjs" : "./bin/uglifyjs"
},
"repository": {
"type": "git",
"url": "git@github.com:mishoo/UglifyJS.git"
}
}