Browse files

Remove public editing of Entities

  • Loading branch information...
1 parent 95d9df4 commit de074cd45da6349431fbd6bbec28ef0c383a1492 @andey committed Feb 10, 2013
View
3 app/assets/javascripts/entities.js.coffee
@@ -1,3 +1,2 @@
jQuery ->
- $('.badge').popover()
- $('#edit-box form').nestedFields()
+ $('.badge').popover()
View
5 app/assets/javascripts/layout.js.coffee
@@ -1,5 +0,0 @@
-jQuery ->
- $("#li-navbar-search-button a").click ->
- $("#li-navbar-search-button").addClass("hidden")
- $("#li-navbar-search-form").removeClass("hidden")
- $("#li-navbar-search-form .search-query").focus()
View
72 app/views/entities/_edit.html.erb
@@ -1,72 +0,0 @@
-<div id="edit-box" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <%= form_for(@entity, :url => entity_path(@entity)) do |f| %>
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h3>Edit <%= @entity.name %></h3>
- </div>
- <div class="modal-body">
- <div class="tabbable">
- <ul class="nav nav-tabs">
- <li class="active"><a href="#tab1" data-toggle="tab">Basics</a></li>
- <li><a href="#tab2" data-toggle="tab">Picture</a></li>
- <li><a href="#tab3" data-toggle="tab">Social Media</a></li>
- </ul>
- <div class="tab-content">
- <div class="tab-pane active" id="tab1">
- <h4>Name
- <small>full name</small>
- </h4>
- <%= f.text_field :name, :class => 'input-mondal-size' %>
- <h4>Tags
- <small>comma separated</small>
- </h4>
- <%= f.text_field :tag_list, :class => 'input-mondal-size' %>
- <h4>Description
- <small>limit to 255 characters</small>
- </h4>
- <%= f.text_area :content, :class => 'input-mondal-size', :style => 'height: 100px' %>
- </div>
- <div class="tab-pane" id="tab2">
- <h4>Picture
- <small>leave blank to keep the current picture</small>
- </h4>
- <%= f.file_field :avatar %>
- </div>
- <div class="tab-pane" id="tab3">
- <h4>Social Media
- <small><%= link_to "Add Link", "#", :id => 'add-entities_link', :class => 'btn btn-mini add' %></small>
- </h4>
-
- <div class="items">
- <%= f.nested_fields_for :entities_links do |f| %>
-
- <div class="form-horizontal" style="margin-top: 15px;">
- <fieldset class="item">
- <%= f.text_field :link, :class => 'span5' %>
- <%= f.hidden_field :id %>
- <%= f.hidden_field :_destroy %>
- <%= link_to "Delete", "#", :class => 'btn btn-small btn-danger remove' %>
- </fieldset>
- </div>
-
- <% end %>
- </div>
-
- <h5>Links Allowed:</h5>
- <ul>
- <li>Wikipedia</li>
- <li>Facebook</li>
- <li>Twitter</li>
- <li>Google+</li>
- <li>Youtube</li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <a href="#" class="btn" data-dismiss="modal">Cancel</a>
- <%= f.submit "Submit", :class => 'btn btn-primary' %>
- </div>
- <% end %>
-</div>
View
5 app/views/entities/_show-advanced.html.erb
@@ -7,11 +7,6 @@
</p>
</div>
<div class="span9">
- <div class="pull-right" style="margin-top: 20px;">
- <a class="edit" href="<%= entity_edit_path() %>" role="button" data-toggle="modal">edit
- <i class="icon-pencil"></i>
- </a>
- </div>
<h1><%= @entity.name %></h1>
<p>
View
5 app/views/entities/_show-basic.html.erb
@@ -1,10 +1,5 @@
<div class="row">
<div class="span12">
- <div class="pull-right" style="margin-top: 20px;">
- <a class="edit" href="<%= entity_edit_path() %>" role="button" data-toggle="modal">edit
- <i class="icon-pencil"></i>
- </a>
- </div>
<h1><%= @entity.name %></h1>
<p>
View
4 app/views/entities/show.html.erb
@@ -43,8 +43,4 @@
<% end %>
<% end %>
</div>
-
- <% if current_user_session %>
- <%= render 'edit' %>
- <% end %>
</div>
View
38 app/views/layouts/public.html.erb
@@ -12,46 +12,10 @@
<div class="navbar-inner">
<div class="container">
<%= link_to "BestofAMA", root_path, :class => "brand" %>
- <ul class="nav">
+ <ul class="nav pull-right">
<li><%= link_to "Redditors", entities_path %></li>
<li><%= link_to "Categories", tags_path %></li>
<li><%= link_to "Submit", submit_path %></li>
- <li id="li-navbar-search-button">
- <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">Search</a>
- </li>
- <li id="li-navbar-search-form" class="hidden">
- <form action="http://www.google.com/cse" method="get" class="navbar-search pull-left">
- <input type="hidden" name="cx" value="003202986105447661025:fwrphcpwb4q"/>
- <input type="text" name="q" class="search-query" placeholder="Search">
- </form>
- </li>
- </ul>
- <ul class="nav pull-right">
- <% if current_user_session %>
- <li class="dropdown">
- <a id="current_user_username" href="#" class="dropdown-toggle" data-toggle="dropdown"><%= current_user.username %>
- <b class="caret"></b></a>
- <ul class="dropdown-menu">
- <% if current_user.is_admin? %>
- <li><%= link_to "Admin Panel", admin_amas_path %></li>
- <% end %>
- <li class="divider"></li>
- <li><%= link_to "Logout", logout_session_path(:return_to => request.path) %></li>
- </ul>
- </li>
- <% else %>
- <li class="dropdown">
- <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">Account</a>
-
- <%= form_for UserSession.new, :url => session_path(:return_to => request.path), :html => {:class => "dropdown-menu", :style => "padding: 15px;"} do |f| %>
- <h5>Account Login</h5>
- <%= f.text_field :username, :placeholder => "Reddit.com Username" %>
- <%= f.password_field :password, :placeholder => "Reddit.com Password" %>
- <span style="font-size: 10px;">Your reddit.com password <b style="color: red;">is not</b> stored, saved, or logged. <%= link_to "..wait what?", page_path(:id => "privacy") %></span>
- <%= f.submit "Login", :class => "btn btn-medium btn-block btn-inverse" %>
- <% end %>
- </li>
- <% end %>
</ul>
</div>
</div>

0 comments on commit de074cd

Please sign in to comment.