Skip to content
Snippets Groups Projects
Commit 6b9e25fd authored by Arnaud Levy's avatar Arnaud Levy
Browse files

list sites

parent 27b62cd8
No related branches found
No related tags found
No related merge requests found
class Server::WebsitesController < Server::ApplicationController
def index
@websites = Communication::Website.all.ordered
breadcrumb
end
end
\ No newline at end of file
<% content_for :title, University.model_name.human(count: 2) %>
<% content_for :title, "#{ @universities.count} #{University.model_name.human(count: @universities.count).downcase}" %>
<div class="table-responsive">
<table class="<%= table_classes %>">
......
<% content_for :title, "#{@websites.count} #{Communication::Website.model_name.human(count: @websites.count).downcase}" %>
<div class="table-responsive">
<table class="<%= table_classes %>">
<thead>
<tr>
<th><%= Communication::Website.human_attribute_name('name') %></th>
<th><%= Communication::Website.human_attribute_name('url') %></th>
<th><%= University.model_name.human %></th>
</tr>
</thead>
<tbody>
<% @websites.each do |website| %>
<tr>
<td><%= website.name %></td>
<td><%= link_to website.url, website.url, target: :_blank if website.url.present? %></td>
<td><%= link_to website.university, [:server, website.university] %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
\ No newline at end of file
namespace :server do
resources :universities, :languages
resources :universities, :languages, :websites
get 'blocks' => 'blocks#index', as: :blocks
get 'blocks/:id' => 'blocks#show', as: :block
post 'blocks/:id' => 'blocks#resave', as: :resave_block
......
......@@ -11,6 +11,9 @@ SimpleNavigation::Configuration.run do |navigation|
primary.item :universities,
University.model_name.human(count: 2),
server_universities_path, { icon: 'university' } if can?(:read, University)
primary.item :websites,
Communication::Website.model_name.human(count: 2),
server_websites_path, { icon: 'globe' }
primary.item :languages,
Language.model_name.human(count: 2),
server_languages_path,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment