Agent controller and dashboard page

jamesperet 10 lat temu
rodzic
commit
6f19f6dee0

+ 3 - 0
app/assets/javascripts/agents.js.coffee

@@ -0,0 +1,3 @@
1
+# Place all the behaviors and hooks related to the matching controller here.
2
+# All this logic will automatically be available in application.js.
3
+# You can use CoffeeScript in this file: http://coffeescript.org/

+ 3 - 0
app/assets/stylesheets/agents.css.scss

@@ -0,0 +1,3 @@
1
+// Place all the styles related to the agents controller here.
2
+// They will automatically be included in application.css.
3
+// You can use Sass (SCSS) here: http://sass-lang.com/

+ 6 - 0
app/controllers/agents_controller.rb

@@ -0,0 +1,6 @@
1
+class AgentsController < ApplicationController
2
+
3
+  def dashboard
4
+  end
5
+
6
+end

+ 2 - 0
app/helpers/agents_helper.rb

@@ -0,0 +1,2 @@
1
+module AgentsHelper
2
+end

+ 11 - 0
app/views/agents/dashboard.html.erb

@@ -0,0 +1,11 @@
1
+<%= content_tag(:div, class: 'container top-container') do %>
2
+	<%= content_tag(:div, class: 'row') do %>
3
+		<%= content_tag(:div, class: 'span12') do %>
4
+			<% # Page Content %>
5
+			<%= bootstrap_flash %>
6
+			<%= content_tag(:div, class: 'page-header') do %>
7
+				<%= content_tag(:h1, (t 'agent.dashboard')) %>
8
+			<% end %>
9
+		<% end %>
10
+	<% end %>
11
+<% end %>

+ 3 - 0
app/views/layouts/_navigation_links.html.erb

@@ -1,5 +1,8 @@
1 1
 <div class="container nav-collapse">
2 2
   <ul class="nav">
3
+    <% if user_signed_in? %>
4
+    	  <li><%= link_to (t 'agent.dashboard'), dashboard_path %></li>
5
+    <% end %>
3 6
     <li><%= link_to (t 'missions.missions'), missions_path %></li>
4 7
     <li><%= link_to "Blog", blog_path  %></li>
5 8
     <li><%= link_to (t 'contact.contact'), contact_messages_path  %></li>

+ 3 - 0
config/routes.rb

@@ -26,6 +26,9 @@ Avalanche2::Application.routes.draw do
26 26
   get '/missions/:id/agents', to: 'missions#show_agents', as: :mission_agents_list
27 27
   get 'missions/:id/agents/:agent', to: 'missions#show_agent_details', as: :mission_agent_details
28 28
   get 'missions/:id/agents/:agent/take_agent_role', to: 'missions#take_agent_role', as: :take_agent_role
29
+  
30
+  # Agents
31
+  get 'dashboard', to: 'agents#dashboard', as: :dashboard
29 32
 
30 33
   # Admin Panel
31 34
   get "admin/dashboard" => "admin_panel#dashboard", :as => :admin_dashboard

+ 7 - 0
test/controllers/agents_controller_test.rb

@@ -0,0 +1,7 @@
1
+require 'test_helper'
2
+
3
+class AgentsControllerTest < ActionController::TestCase
4
+  # test "the truth" do
5
+  #   assert true
6
+  # end
7
+end

+ 4 - 0
test/helpers/agents_helper_test.rb

@@ -0,0 +1,4 @@
1
+require 'test_helper'
2
+
3
+class AgentsHelperTest < ActionView::TestCase
4
+end