|
187 | 187 | } |
188 | 188 | </style> |
189 | 189 | <% if show_google_docs %> |
190 | | - <% if @google_docs %> |
| 190 | + <% if @google_docs_token %> |
191 | 191 | <% form_tag(context_url(@context, :controller => :submissions, :assignment_id => @assignment.id, :action => :create), {:id => "submit_google_doc_form", :class => "submit_assignment_form"}) do %> |
192 | | - <%= hidden_field :submission, :submission_type, :value => "google_doc" %> |
193 | | - <%= hidden_field :google_doc, :document_id, :value => "", :class => "google_doc_id" %> |
194 | | - <table class="formtable" style="width: 100%;"> |
195 | | - <tr> |
196 | | - <td style="padding-bottom: 10px;" colspan="2"> |
197 | | - <%= t 'instructions.google_docs', "Select the file from the list below." %> |
198 | | - <%= render :partial => "assignments/group_submission_reminder" if @assignment.has_group_category? %> |
| 192 | + <%= hidden_field :submission, :submission_type, :value => "google_doc" %> |
| 193 | + <%= hidden_field :google_doc, :document_id, :value => "", :class => "google_doc_id" %> |
| 194 | + <table class="formtable" style="width: 100%;"> |
| 195 | + <tr> |
| 196 | + <td style="padding-bottom: 10px;" colspan="2"> |
| 197 | + <%= t 'instructions.google_docs', "Select the file from the list below." %> |
| 198 | + <%= render :partial => "assignments/group_submission_reminder" if @assignment.has_group_category? %> |
| 199 | + </td> |
| 200 | + </tr><tr> |
| 201 | + <td colspan="2"> |
| 202 | + <div id="google_docs_container" style="height: 200px; overflow: auto;"> |
| 203 | + <div style="text-align: center; margin: 10px;"> |
| 204 | + <%= image_tag "ajax-loader-bar.gif" %> |
| 205 | + </div> |
| 206 | + </div> |
199 | 207 | </td> |
200 | | - </tr><tr> |
201 | | - <td colspan="2"> |
202 | | - <div style="height: 200px; overflow: auto;"> |
203 | | - <ul id="google_docs_tree" style="width: 100%;"> |
204 | | - <% @google_docs.folders.each do |folder| %> |
205 | | - <li class="folder"><%= folder %> |
206 | | - <ul> |
207 | | - <% @google_docs.files.select{|f| f.folder == folder}.each do |file| %> |
208 | | - <li class="file <%= file.extension %>" id="document_<%= file.document_id %>"> |
209 | | - <span class="filename"><%= file.entry.title %></span> |
210 | | - <a class="popout no-hover" href="<%= file.alternate_url %>" title="<%= t 'titles.view_in_separate_window', 'View in Separate Window' %>" target="_blank"><%= image_tag "popout.png " %></a> |
211 | | - <div class="clear"></div> |
212 | | - </li> |
213 | | - <% end %> |
214 | | - </ul> |
215 | | - </li> |
216 | | - <% end %> |
217 | | - <% @google_docs.files.select{|f| f.folder == nil}.each do |file| %> |
218 | | - <li class="file <%= file.extension %>" id="document_<%= file.document_id %>"> |
219 | | - <span class="filename"><%= file.entry.title %></span> |
220 | | - <a class="popout no-hover" href="<%= file.alternate_url %>" target="_blank"><%= image_tag "popout.png " %></a> |
221 | | - <div class="clear"></div> |
222 | | - </li> |
223 | | - <% end %> |
224 | | - </ul> |
225 | | - </div> |
226 | | - </td> |
227 | | - </tr><tr> |
228 | | - <td colspan="2" style="text-align: center;"> |
229 | | - <div style="text-align: left;"> |
230 | | - <%= text_area :submission, :comment, :class => 'submission_comment_textarea', :placeholder => t('comments_placeholder', 'Comments...'), :title => t('additional_comments', 'Additional comments') %> |
231 | | - </div> |
232 | | - </td> |
233 | | - </tr> |
234 | | - <%= render :partial => "group_comment" %> |
235 | | - <% if @assignment.turnitin_enabled? %> |
236 | | - <%= render :partial => "turnitin" %> |
237 | | - <% end %> |
238 | | - <tr> |
239 | | - <td colspan="2" class='button-container'> |
240 | | - <button type="submit" class="btn"><%= t 'buttons.submit_assignment', "Submit Assignment" %></button> |
241 | | - <button type="button" class='cancel_button button-secondary'><%= t '#buttons.cancel', "Cancel" %></button> |
242 | | - </td> |
243 | | - </tr> |
244 | | - </table> |
245 | | - <div id="uploading_google_doc_message" style="display: none;"> |
246 | | - <%= t 'messages.uploading', "Retrieving a copy of your Google Doc to submit for this assignment. This may take a little while, depending on the size of the file..." %> |
247 | | - <div style="text-align: center; margin: 10px;"> |
248 | | - <%= image_tag "ajax-loader-bar.gif" %> |
| 208 | + </tr><tr> |
| 209 | + <td colspan="2" style="text-align: center;"> |
| 210 | + <div style="text-align: left;"> |
| 211 | + <%= text_area :submission, :comment, :class => 'submission_comment_textarea', :placeholder => t('comments_placeholder', 'Comments...'), :title => t('additional_comments', 'Additional comments') %> |
| 212 | + </div> |
| 213 | + </td> |
| 214 | + </tr> |
| 215 | + <%= render :partial => "group_comment" %> |
| 216 | + <% if @assignment.turnitin_enabled? %> |
| 217 | + <%= render :partial => "turnitin" %> |
| 218 | + <% end %> |
| 219 | + <tr> |
| 220 | + <td colspan="2" class='button-container'> |
| 221 | + <button type="submit" class="btn"><%= t 'buttons.submit_assignment', "Submit Assignment" %></button> |
| 222 | + <button type="button" class='cancel_button button-secondary'><%= t '#buttons.cancel', "Cancel" %></button> |
| 223 | + </td> |
| 224 | + </tr> |
| 225 | + </table> |
| 226 | + <div id="uploading_google_doc_message" style="display: none;"> |
| 227 | + <%= t 'messages.uploading', "Retrieving a copy of your Google Doc to submit for this assignment. This may take a little while, depending on the size of the file..." %> |
| 228 | + <div style="text-align: center; margin: 10px;"> |
| 229 | + <%= image_tag "ajax-loader-bar.gif" %> |
| 230 | + </div> |
249 | 231 | </div> |
250 | | - </div> |
251 | 232 | <% end %> |
252 | 233 | <% else %> |
253 | 234 | <div id="submit_google_doc_form"> |
|
0 commit comments