Implmented diary submit label changing depending on if new or editing
authorNumbuhFour <fad4470@rit.edu>
Fri, 20 Feb 2015 23:05:48 +0000 (18:05 -0500)
committerNumbuhFour <fad4470@rit.edu>
Fri, 20 Feb 2015 23:05:48 +0000 (18:05 -0500)
app/views/diary_entry/edit.html.erb
config/locales/en.yml

index 4021eaa4d30bf515cd14f2353dc8f88d512b9f75..f29dc30ffec2edce53a397ad78d0a51237c712bb 100644 (file)
       </div>
     </fieldset>
 
-    <%= submit_tag t('diary_entry.edit.save_button') %>
-    <%# TODO: button should say 'publish' or 'save changes' depending on new/edit state %>
+    <% if action_name == 'new' %>
+      <%= submit_tag t('diary_entry.new.publish_button') %>
+    <% else %>
+      <%= submit_tag t('diary_entry.edit.save_button') %>
+    <% end %>
   </div>
 <% end %>
index 3e3905298a9056a40a241aa686b6172242df235c..795611a0c68dc98531351e73a77981aabf699ce8 100644 (file)
@@ -248,6 +248,7 @@ en:
   diary_entry:
     new:
       title: New Diary Entry
+      publish_button: "Publish"
     list:
       title: "Users' diaries"
       title_friends: "Friends' diaries"