This file contains hidden or 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
.cols | |
position: absolute | |
top: $header-height | |
bottom: 0 | |
left: $navigation-width | |
right: 0 | |
.col | |
position: absolute | |
top: 0 | |
bottom: 0 |
This file contains hidden or 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
" Highlight currently open file in nerdtree | |
" see http://superuser.com/a/474298/175466 | |
" see http://superuser.com/a/509721/175466 | |
" returns true iff is NERDTree open/active | |
function! rc:isNTOpen() | |
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1) | |
endfunction | |
" returns true iff focused window is NERDTree window |
This file contains hidden or 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
{ "order": { | |
"id": 1, | |
"client_id": "815", | |
"articles": [ | |
{"title": "Lonestar Beer", | |
"id": 666, | |
"links":[ | |
{ "rel": "self", | |
"href": "http://articles/lonestarbeer"} | |
]} |
This file contains hidden or 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
// Legacy cm.e support | |
if (cm.e) { | |
snippetNeedsUpdating = true; | |
// Process queued errors | |
for (var i=0; i < cm.e.length; i+=1) { | |
cm.onerror.apply(this, cm.e[i]); | |
} | |
// Override push to immediately call onerror | |
cm.e.push = function(message, file, line, column) { | |
cm.onerror(message, file, line, column); |
This file contains hidden or 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
require 'test_helper' | |
class TierTest < ActiveSupport::TestCase | |
context "validations" do | |
should validate_uniqueness_of(:name).scoped_to(:company_id) | |
end | |
context "associations" do | |
should belong_to :company |
This file contains hidden or 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
class Backend::Settings::TiersController < BackendController | |
before_filter :authorize_admin | |
def index | |
@tiers = current_company.tiers.order('sort ASC') | |
end | |
def update | |
@tier = current_company.tiers.find(params[:id]) |
This file contains hidden or 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
class TierMembership < ActiveRecord::Base | |
attr_accessible :tier, :user | |
belongs_to :tier | |
belongs_to :user | |
validates :user_id, presence: true | |
validates :tier_id, presence: true, uniqueness: { scope: :user_id } | |
validate :valid_user_role |
This file contains hidden or 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
require "test_helper" | |
class TierMembershipTest < ActiveSupport::TestCase | |
context "associations" do | |
should belong_to :user | |
should belong_to :tier | |
end | |
This file contains hidden or 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 role_and_tier_names(user) | |
role_name = I18n.t("backend.users.index.role.#{user.account.role}") | |
res = if user.tiers | |
tier_names = user.tiers.map(&:name).join(", ") | |
I18n.t("backend.role_and_tier_names", role: role_name, tier_names: tier_names) | |
else | |
role_name | |
end | |
content_tag(:span, res, class: "role-and-tier-names").html_safe |
This file contains hidden or 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
#These refer to the installer, not the main package: | |
%global commit 095c05612000e571634997c5b0e44e828abb44bc | |
%global shortcommit %(c=%{commit}; echo ${c:0:7}) | |
%global repo http://repository.spotify.com/pool/non-free/s/spotify | |
%global github_repo https://github.com/pschyska/spotify-make/archive/%{commit} | |
# We cannot strip this binary (licensing restrictions). | |
%global debug_package %{nil} | |
%global __os_install_post \ |