Skip to content

Commit

Permalink
Add logo
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyMorugin committed Nov 27, 2015
1 parent 739e04e commit 7b6b736
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 19 deletions.
17 changes: 17 additions & 0 deletions app/assets/stylesheets/custom.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,23 @@ p {
}

/* header */
#logo-lg {
float: left;
margin-left: 10px;
margin-right: 10px;
padding-top: 0px;
width: 300px;
height: 50px;
}

#logo-xs {
float: left;
//margin-left: 10px;
//margin-right: 10px;
padding-top: 3%;
width: 70%;
//height: 15%;
}

#logo {
float: left;
Expand Down
14 changes: 7 additions & 7 deletions app/policies/queue_image_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,33 @@ def new?
end

# GET /queue_images/1/edit
def edit
def edit?
update?
end

# POST /queue_images
# POST /queue_images.json
def create
def create?
!user.nil?
end

# PATCH/PUT /queue_images/1
# PATCH/PUT /queue_images/1.json
def update
def update?
user.admin?
end

# DELETE /queue_images/1
# DELETE /queue_images/1.json
def destroy
def destroy?
user.admin? && record.status != ConstHelper::STATUS_IN_PROCESS
end

def visible
user.admin? || user.id == record.user_id
def visible?
user.admin?
end

def hidden
def hidden?
visible?
end

Expand Down
9 changes: 6 additions & 3 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<div class="navbar navbar-fixed-top navbar-inverse visible-lg" role="navigation">
<div class="container headerStyle-lg">
<%= link_to "Ostagram", root_path, id: "logo" %>

<div id="logo-lg">
<%= image_tag('/logo.png', class: "imagesStyle") %>
</div>
<ul class="nav nav-pills pull-right">
<% if client_signed_in? %>
<li><%= link_to "Добавить изображения", new_queue_image_path, class: "btn btn-primary" %></li>
Expand Down Expand Up @@ -32,7 +33,9 @@
<span class="icon-bar"></span>
</button>

<%= link_to "Ostagram", root_path, class: "logoStyle" %>
<div id="logo-xs">
<%= image_tag('/logo.png', class: "imagesStyle") %>
</div>
</div>
<div class="navbar-collapse collapse" aria-expanded="false">
<ul class="nav navbar-nav">
Expand Down
25 changes: 18 additions & 7 deletions app/views/queue_images/_item_view_3.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</span>
<% end %>

<span class="textAboutStyle"><p><%= (item.created_at+10800).strftime("%d.%m.%Y %H:%M:%S")%></p> </span>
<span class="textAboutStyle"><p><%= (item.created_at+10800).strftime("%d.%m.%Y %H:%M:%S")%></p> </span>

<span class="textAboutStyle">
<% if item.status < 0 %>
Expand All @@ -60,13 +60,24 @@
<p> Обработано за <%= item.ptime.strftime("%H:%M:%S")if !item.ptime.nil? %> </p>
<% end %>
</span>

<span class="">
<p> </p>
<% if debug || item.status == 1 %>
<% if debug || item.status == 1 || policy(item).destroy? %>
<span class="">
<br>
<%= link_to "удалить", item, method: :delete, data: { confirm: "Вы точно хотите удалить?" } %>
<% end %>
</span>
</span>
<% end %>


<% if policy(item).visible? %>
<br><br>
<span class="">
<% if item.status == ConstHelper::STATUS_DELETED %>
<%= link_to "ПОКАЗАТЬ", "/queue_images/#{item.id}/visible", method: :put %>
<% else %>
<%= link_to "СКРЫТЬ", "/queue_images/#{item.id}/hidden", method: :put %>
<% end %>
</span>
<% end %>

</div>

Expand Down
4 changes: 2 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Rails.application.routes.draw do


resources :styles
resources :contents
#resources :styles
#resources :contents
get 'admin_pages/main'
get 'admin_pages/images'
get 'admin_pages/users'
Expand Down
Binary file added public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7b6b736

Please sign in to comment.