This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<iframe frameborder="0" scrolling="no" width="100%" height="250" src="http://humanrightslogo.net/voting_widget"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<iframe frameborder="0" scrolling="no" width="100%" height="250" src="http://hrl.staging.jovoto.net/voting_widget"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="profile"> | |
<%= link_to_if @user.url.present?, image_tag("avatars/#{avatar_name(@user)}", class: "avatar"), @user.url %> | |
<h1><%= link_to_if @user.url.present?, (@user.full_name.present? ? @user.full_name : @user.username), @user.url %></h1> | |
<dl> | |
<dt>Username:</dt> | |
<dd><%= @user.username %></dd> | |
<dt>Member Since:</dt> | |
<dd><%= @user.member_since %></dd> | |
<dt>Website:</dt> | |
<dd> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="profile"> | |
<%= @user.avatar %> | |
<h1><%= @user.linked_name %></h1> | |
<dl> | |
<dt>Username:</dt> | |
<dd><%= @user.username %></dd> | |
<dt>Member Since:</dt> | |
<dd><%= @user.member_since %></dd> | |
<dt>Website:</dt> | |
<dd><%= @user.website %></dd> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#profile | |
= @user.avatar | |
%h1= @user.linked_name | |
%dl | |
%dt Username: | |
%dd= @user.username | |
%dt Member Since: | |
%dd= @user.member_since | |
%dt Website: | |
%dd= @user.website |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// show tipsy with remaining characters | |
$('[data-maxlen]') | |
.tipsy({gravity: 'e', trigger: 'focus', html: true}) | |
.each(function(){ | |
var el = $(this); | |
el.data('doUpdateTitle', function(){ | |
var len = el.val().length; | |
var remaining = el.data('maxlen')-len; | |
el.attr('title', '<span class="'+(remaining<0 ? 'red' : '')+'">Verbleibende Zeichen: '+remaining+'</span>').tipsy('hide').tipsy('show');· | |
return len; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="jquery.js" ></script> | |
<script> | |
$(function(){ | |
$('body').on('DOMNodeInserted', function(){ | |
$(event.target).find('.color').css({ | |
'background-color': ('00000'+(Math.random()*(1<<24)|0).toString(16)).slice(-6) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def valid | |
failure = catch :fail do | |
code = Code.find_by_value(params[:id]) or throw :fail, 'unknown' | |
code.unused? or throw :fail, 'used' | |
nil | |
end | |
respond_with({:valid => !failure, :reason => failure}.compact) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module HashExtensions | |
def compact | |
self.reject{|key, value| value.nil? } | |
end | |
end | |
class Hash | |
include HashExtensions | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def valid | |
if code = Code.find_by_value(params[:id]) | |
unless code.used? | |
respond_with :valid => true | |
else | |
respond_with :valid => false, :reason => 'used' | |
end | |
else | |
respond_with :valid => false, :reason => 'unknown' | |
end |