Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixes issue #30

  • Loading branch information...
commit 148f082c71a9f51041f2db6abf393ede739e739d 1 parent 97fe475
@qzio qzio authored
Showing with 13 additions and 6 deletions.
  1. +1 −2  coderdojowebstorage.rb
  2. +12 −4 views/home.erb
View
3  coderdojowebstorage.rb
@@ -96,8 +96,7 @@ class CoderDojoWebStorage < Sinatra::Base
ensure_authenticated!
@user = User.first :username => params[:username]
halt(403) unless @user.is_editable_by?(current_user)
- puts "SHOULD PROBABLY SAVE HERE params: #{params.inspect}"
- @user.public = params['user']['public']
+ @user.public = params['user']['public'].to_i
if @user.save
flash[:notice] = 'Användaren uppdaterades'
else
View
16 views/home.erb
@@ -5,8 +5,12 @@
<label class="checkbox">
<input id="public-checkbox" type="checkbox" name="waste" value="1">
<input id="public-hidden" type="hidden" name="user[public]" value="1">
- Publicera min hemsida i <a href="/users/"> Listan </a>
+ Publicera hemsidan?
</label>
+ <p>
+ Att publicera hemsidan innebär att du är med i <a href="/users/"> Listan</a>
+ över alla deltagare som har en egen hemsida.
+ </p>
</form>
<% if defined? @files %>
@@ -70,7 +74,11 @@
}
if (!validExtensions.hasOwnProperty(extension)) {
- alert('Tillåtna filnamn: jpg,gif,png,apng,swf,html,txt');
+ var validformats = [];
+ for (fileend in validExtensions) {
+ validformats.push(fileend);
+ }
+ alert('Tillåtna filnamn: '+validformats.join(", "));
return false;
}
@@ -79,9 +87,9 @@
});
// The skapa fil button should only be clickable when there is a filename
- $('#createfile_name').change(function() {
+ $('#createfile_name').keyup(function() {
var $me = $(this);
- if ($me.val() != '') {
+ if ($me.val().length > 4) {
$('#createfile_submit').removeAttr('disabled');
} else {
$('#createfile_submit').attr('disabled','disabled');
Please sign in to comment.
Something went wrong with that request. Please try again.