Commit cfa7e24b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Use last appearance settings. Show last edit date

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent c12695f1
...@@ -29,7 +29,7 @@ class Admin::AppearancesController < Admin::ApplicationController ...@@ -29,7 +29,7 @@ class Admin::AppearancesController < Admin::ApplicationController
# Use callbacks to share common setup or constraints between actions. # Use callbacks to share common setup or constraints between actions.
def set_appearance def set_appearance
@appearance = Appearance.first || Appearance.new @appearance = Appearance.last || Appearance.new
end end
# Only allow a trusted parameter "white list" through. # Only allow a trusted parameter "white list" through.
......
...@@ -21,7 +21,11 @@ ...@@ -21,7 +21,11 @@
= image_tag @appearance.logo, class: 'appearance-logo-preview' = image_tag @appearance.logo, class: 'appearance-logo-preview'
= f.file_field :logo, class: "" = f.file_field :logo, class: ""
.hint .hint
Logo size is limited with 1MB Maximum logo size is 1MB, page optimized for logo size 640x360px
.form-actions .form-actions
= f.submit 'Save', class: 'btn btn-save' = f.submit 'Save', class: 'btn btn-save'
= link_to 'Preview', preview_admin_appearances_path, class: 'btn', target: '_blank' = link_to 'Preview', preview_admin_appearances_path, class: 'btn', target: '_blank'
- if @appearance.updated_at
%span.pull-right
Last edit #{time_ago_with_tooltip(@appearance.updated_at)}
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :appearance do
title "GitLab Enterprise Edition"
description "Open source software to collaborate on code"
end
end
require 'spec_helper'
describe Appearance do
subject { create(:appearance) }
it { should be_valid }
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment