Re: left menu for Fedena Project

Miquel Cubel
2011-08-16T14:01:38Z

<meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">


Hi,

    &nbsp;&nbsp;&nbsp; Assuming the code is the same as
    <a class="moz-txt-link-rfc2396E"
href="https://github.com/projectfedena/projectfedena_v2.0">"https://github.com/projectfedena/projectfedena_v2.0"

    &nbsp;&nbsp;&nbsp; You can find the upper menu embedded in
"/app/views/layouts/application.html.erb"

<font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="nt"><div <span
class="na">id=<span
class="s">"main-menu"<span
class="nt">> <div
class="line" id="LC47"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="cp"><%= <span
class="n">link_to <span
class="s2">"Dashboard"<span
class="p">, <span
class="ss">:controller <span
class="o">=> <span
class="s2">"user"<span
class="p">, <span
class="ss">:action <span
class="o">=> <span
class="s2">"dashboard" <span
class="cp">%> <div
class="line" id="LC48"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="cp"><% <span
class="n">this_user <span
class="o">= <span
class="no">User<span
class="o">.<span c
lass="n">find<span
class="p">(<span
class="n">session<span
class="o">[<span
class="ss">:user_id<span
class="o">]<span
class="p">) <span
class="k">if <span
class="n">session<span
class="o">[<span
class="ss">:user_id<span
class="o">] <span
class="cp">%> <div
class="line" id="LC49"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="cp"><% <span
class="k">if <span
class="n">this_user<span
class="o">.<span
class="n">student? <span
class="o">|| <span
class="n">this_user<span
class="o">.<span
class="n">employee? <span
class="cp">%> <div
class="line" id="LC50"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="cp"><%= <span
class="n">link_to <span
class="s2">"Calendar"<s
pan class="p">, <span
class="ss">:controller <span
class="o">=> <span
class="s2">"calendar" <span
class="cp">%> <div
class="line" id="LC51"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="cp"><% <span
class="k">end <span
class="cp">%> <div
class="line" id="LC52"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="cp"><%= <span
class="n">link_to <span
class="s2">"Students"<span
class="p">, <span
class="ss">:controller <span
class="o">=> <span
class="s2">"student"<span
class="p">, <span
class="ss">:action <span
class="o">=> <span
class="s2">"index" <span
class="p">\ <div
class="line" id="LC53"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
clas
s="k">if <span
class="n">this_user<span
class="o">.<span
class="n">admin? <span
class="cp">%> <div
class="line" id="LC54"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="cp"><%= <span
class="n">link_to <span
class="s2">"Attendance"<span
class="p">, <span
class="ss">:controller <span
class="o">=> <span
class="s2">"student_attendance"<span
class="p">, <span
class="ss">:action <span
class="o">=> <span
class="s2">"index" <span
class="p">\ <div
class="line" id="LC55"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="k">if <span
class="n">this_user<span
class="o">.<span
class="n">admin? <span
class="cp">%> <div
class="line" id="LC56"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="cp"><%= <span
class="n">link_to <span
class="s2">"Settings"<span
class="p">, <span
class="ss">:controller <span
class="o">=> <span
class="s2">"configuration"<span
class="p">, <span
class="ss">:action <span
class="o">=> <span
class="s2">"index" <span
class="p">\ <div
class="line" id="LC57"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="k">if <span
class="n">this_user<span
class="o">.<span
class="n">admin? <span
class="cp">%> <span
class="c"><!-- <div
class="line" id="LC58"><font
color="#999999">
<%= <span
class="n">link_to <span
class="s2">"News"<span
class="p">, <span
class="ss">:controller <span
class="o">=> <
span class="s2">"news"<span
class="p">, <span
class="ss">:action <span
class="o">=> <span
class="s2">"index" <span
class="p">\ <div
class="line" id="LC59"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="k">if <span
class="n">this_user<span
class="o">.<span
class="n">admin? <span
class="cp">%>
--> <div class="line"
id="LC60"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="cp"><%= <span
class="n">link_to <span
class="s2">"Timetable"<span
class="p">, <span
class="ss">:controller <span
class="o">=> <span
class="s2">"timetable"<span
class="p">, <span
class="ss">:action <span
class="o">=> <span
class="s2">"index" <span
class="p">\ <div
class="l
ine" id="LC61"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="k">if <span
class="n">this_user<span
class="o">.<span
class="n">admin? <span
class="cp">%> <div
class="line" id="LC62"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="cp"><% <span
class="k">if <span
class="n">this_user<span
class="o">.<span
class="n">admin? <span
class="cp">%> <div
class="line" id="LC63"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="nt"><a <span
class="na">href=<span
class="s">"#" <span
class="na">class=<span
class="s">"menuanchorclass" <span
class="na">rel=<span
class="s">"anylinkmenu1"<span
class="nt">>More &#9660;<span
class="nt"> <d
iv class="line" id="LC64"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="cp"><% <span
class="k">end <span
class="cp">%> <div
class="line" id="LC65"><font
color="#999999">
<div class="line"
id="LC66"><font
color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
class="nt">

    &nbsp;&nbsp;&nbsp; An easy solution will be (same menu
everywhere), change the CSS
    of "main-menu" and creating "sidebar_menu"&nbsp; and
some code like this:
<div
id="main-menu"&gt;
		&lt;% this_user = User.find(session[:user_id])%&gt;
		&lt;ul class="sidebar_menu"&gt;
			&lt;li&gt;&lt;%= link_to "Dashboard", :controller
=&gt; "user", :action =&gt; "dashboard"
%&gt;&lt;/li&gt;
			&lt;% if this_user.student? || this_user.employee? %&gt;
				&lt;li&gt;&lt;%= link_to "Calendar", :controller
=&gt; "calendar" %&gt;&lt;/li&gt;
			&lt;% end %&gt;
			&lt;% if this_user.admin? %&gt;
				&lt;li&gt;&lt;%= link_to "Students", :controller
=&gt; "student", :action =&gt; "index"
%&gt;&lt;/li&gt;
				&lt;li&gt;&lt;%= link_to "Attendance", :controller
=&gt; "student_attendance", :action =&gt; "index"
%&gt;&lt;/li&gt;
				&lt;li&gt;&lt;%= link_to "Settings", :controller
=&gt; "configuration", :action =&gt; "index"
%&gt;&lt;/li&gt;
				&lt;li&gt;&lt;%= link_to "News", :controller =&gt;
"news", :action =&gt; "index" %&gt;
&lt;/li&gt;
				&lt;li&gt;&lt;%= link_to "Timetable", :controller
=&gt; "timetable", :action =&gt; "index"
%&gt;&lt;/li&gt;
			&lt;% end %&gt;
		&lt;/ul&gt;
		&lt;a href="#" class="menuanchorclass"
rel="anylinkmenu1"&gt;More &lt;/a&gt;


    &nbsp;&nbsp;&nbsp; No need of partial or magic ROR... just HTML
and CSS.

Greetings,

    El 16/08/2011 15:25, hanish jadala escribi&oacute;:
    <blockquote
cite="mid:CAOKUzCnPwtmPnaSrwvNLkP2NrOyxO90D9BD2bu2f64rK68EEvg-JsoAwUIsXotQFR93xxRIaA@public.gmane.orgcom"
      type="cite">&nbsp;i hope u saw the &nbsp;site . there
is a menu on the top
      rite so, if i need that menu on left side of the screen &nbsp;what
      should i do. i mean how to write the code of that.
--
      You received this message because you are subscribed to the Google
Groups "Ruby on Rails: Talk" group.
      To post to this group, send email to
      <a class="moz-txt-link-abbreviated"
href="mailto:rubyonrails-talk@googlegroups.com">rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
      To unsubscribe from this group, send email to
      <a class="moz-txt-link-abbreviated"
href="mailto:rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org">rubyonrails-talk+unsubscribe-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm.
      For more options, visit this group at
      <a class="moz-txt-link-freetext"
href="http://groups.google.com/group/rubyonrails-talk?hl=en">http://groups.google.com/group/rubyonrails-talk?hl=en.


--
Miquel Cubel Escarr&eacute;
+34 699 73 22 46
<a class="moz-txt-link-abbreviated"
href="mailto:mcubel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">mcubel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

"Computers are good at following instructions, but not at reading your
mind." Donald Knuth.

"Los ordenadores son buenos siguiendo instrucciones, pero no leyendo tu
mente." Donald Knuth.





--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.