-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from UCSB-CS-Using-GitHub-In-Courses/feature/us…
…er-settings Feature/user settings
- Loading branch information
Showing
11 changed files
with
111 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.avatar { | ||
display: inline-block; | ||
overflow: hidden; | ||
line-height: 1; | ||
vertical-align: middle; | ||
border-radius: 3px; | ||
} | ||
.user-nav .avatar { | ||
float: left; | ||
margin-right: 5px; | ||
} | ||
.dropdown-caret { | ||
display: inline-block; | ||
width: 0; | ||
height: 0; | ||
vertical-align: middle; | ||
content: ""; | ||
border: 4px solid; | ||
border-right-color: transparent; | ||
border-bottom-color: transparent; | ||
border-left-color: transparent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
module ApplicationHelper | ||
def github_profile_img_for(user, height=20, width=20) | ||
image_tag( | ||
"https://avatars2.githubusercontent.com/u/#{user.uid}?v=3&s=40", | ||
height: "#{height}", | ||
width: "#{width}", | ||
alt: "@#{user.username}", | ||
class: "avatar" | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
<% if user_signed_in? %> | ||
<li><%= link_to 'Sign out', signout_path %></li> | ||
<li class="dropdown user-nav"> | ||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> | ||
<%= github_profile_img_for current_user %> | ||
<span class="dropdown-caret"></span> | ||
</a> | ||
<ul class="dropdown-menu"> | ||
<li class="dropdown-header">Signed in as <b><%= current_user.username %></b></li> | ||
<li role="separator" class="divider"></li> | ||
<li><a href="https://github.com/<%= current_user.username %>">GitHub Profile</a></li> | ||
<li><a href="https://github.com/<%= @course %>">Course Organization</a></li> | ||
<li role="separator" class="divider"></li> | ||
<li><%= link_to 'Settings', settings_path %></li> | ||
<li><%= link_to 'Sign out', signout_path %></li> | ||
</ul> | ||
</li> | ||
<% else %> | ||
<li><%= link_to 'Sign in', signin_path %></li> | ||
<% end %> | ||
<% if user_signed_in? %> | ||
<li><%= link_to 'Course', course_path %></li> | ||
<% end %> | ||
<% if is_instructor? %> | ||
<li><%= link_to 'Users', users_path %></li> | ||
<li><%= link_to 'Course Roster', students_path %></li> | ||
<li><p class="navbar-btn"> | ||
<%= link_to signin_path, class: 'btn btn-info' do %> | ||
<%= fa_icon "github", text: "Sign in" %> | ||
<% end %> | ||
</p></li> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
<%# add navigation links to this file %> | ||
<!-- <li><%= link_to 'About', page_path('about') %></li> --> | ||
<% if user_signed_in? %> | ||
<li><%= link_to 'Course', course_path %></li> | ||
<% end %> | ||
<% if is_instructor? %> | ||
<li><%= link_to 'Users', users_path %></li> | ||
<li><%= link_to 'Course Roster', students_path %></li> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="container"> | ||
<h1>User Settings</h1> | ||
|
||
<%= form_tag(update_settings_path) do -%> | ||
<p>In order to work in pairs or groups for your assignments, you must be "discoverable" by your classmates.</p> | ||
<p>The information that becomes accessible to your fellow classmates if you become "discoverable" includes but is not limited to: | ||
<ul> | ||
<li>Your name</li> | ||
<li>Your school email address</li> | ||
<li>Your github username</li> | ||
<li>The fact that you are enrolled in this course</li> | ||
</ul> | ||
</p> | ||
<p>Do you wish to be set as "discoverable" so that you can be found by your classmates?</p> | ||
|
||
<div class="checkbox"> | ||
<label> | ||
<%= check_box_tag 'discoverable', 1, @user_settings.discoverable %> | ||
Make me discoverable by classmates. | ||
</label> | ||
</div> | ||
|
||
<div><%= button_tag 'Save Settings', class: "btn btn-primary" %></div> | ||
<% end -%> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters