Skip to content

Commit fecf275

Browse files
committed
wip setting page v2
1 parent c0bd690 commit fecf275

35 files changed

+847
-440
lines changed

Gemfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ source 'https://rubygems.org' do
1616
# Load environment variables first
1717
gem 'dotenv-rails', groups: [:development, :test]
1818

19-
2019
# Attachements
2120
gem 'carrierwave'
2221
gem 'carrierwave_backgrounder' #background processing of images
@@ -89,11 +88,9 @@ source 'https://rubygems.org' do
8988
gem 'faraday', '~> 0.8.1'
9089
gem 'metamagic'
9190

92-
gem "mail_view", "~> 2.0.4"
9391

9492
# ----------------
9593

96-
9794
gem 'acts_as_follower', '0.1.1'
9895
gem 'fog'
9996
gem 'friendly_id', '4.0.10.1'
@@ -109,6 +106,7 @@ source 'https://rubygems.org' do
109106
gem 'sitemap_generator'
110107
gem 'tweet-button'
111108
gem 'local_time'
109+
gem 'materialize-sass'
112110

113111
gem 'closure_tree'
114112

@@ -125,6 +123,7 @@ source 'https://rubygems.org' do
125123
gem 'foreigner'
126124
gem 'state_machine'
127125
gem 'activerecord-postgres-json'
126+
gem "mail_view", "~> 2.0.4"
128127

129128
# ElasticSearch client
130129
gem 'tire'
@@ -182,7 +181,6 @@ source 'https://rubygems.org' do
182181
end
183182

184183
source 'https://rails-assets.org' do
185-
186184
gem 'rails-assets-font-awesome'
187185
gem 'rails-assets-jquery-cookie', '1.4.0'
188186
gem 'rails-assets-jquery-dropdown'

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ GEM
362362
treetop (~> 1.4.8)
363363
mail_view (2.0.4)
364364
tilt
365+
materialize-sass (0.97.0)
366+
sass (~> 3.3)
365367
memoizable (0.4.2)
366368
thread_safe (~> 0.3, >= 0.3.1)
367369
metamagic (3.1.7)
@@ -743,6 +745,7 @@ DEPENDENCIES
743745
linkedin!
744746
local_time!
745747
mail_view (~> 2.0.4)!
748+
materialize-sass!
746749
metamagic!
747750
mini_magick!
748751
mixpanel!
Loading

app/assets/javascripts/coderwallv2.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//= require jquery
2+
//= require jquery_ujs
3+
//= require materialize-sprockets
4+
5+
$(function () {
6+
$(".button-collapse").sideNav();
7+
8+
$(".dropdown-button").dropdown();
9+
});
10+

app/assets/javascripts/settings.js.coffee

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
@import "fonts","base","compass/css3", "materialize";
2+
3+
nav {
4+
.nav-wrapper {
5+
ul li a img {
6+
max-height: 64px;
7+
}
8+
}
9+
}
10+
11+
.logo {
12+
margin-top: 17px;
13+
margin-left: 15px;
14+
width: 182px;
15+
height: 27px;
16+
display: block;
17+
background: image-url("logo.png") no-repeat;
18+
text-rendering: optimizeLegibility;
19+
font-smoothing: subpixel-antialiased;
20+
transition: all 0.2s ease-out;
21+
span {
22+
display: none;
23+
}
24+
&:hover {
25+
opacity: 0.8;
26+
}
27+
}
28+
29+
.bg-primary {
30+
background-color: #d95626;
31+
color: #fff;
32+
.container {
33+
.row {
34+
margin-bottom: 0;
35+
.text-center {
36+
margin: 0;
37+
text-align: center;
38+
padding: 5px;
39+
a{
40+
color: #fff;
41+
&:hover{
42+
text-decoration: underline !important;
43+
}
44+
&.close{
45+
padding: 0px 10px;
46+
background-color: #AD2E00;
47+
float: right;
48+
&:hover{
49+
background-color: #AD0202 !important;
50+
}
51+
}
52+
}
53+
}
54+
}
55+
}
56+
}
57+
58+
footer{
59+
.right_part{
60+
text-align: right;
61+
}
62+
.copyright,.credits {
63+
color: #444;
64+
text-align: center;
65+
}
66+
}
67+
68+
.info-post{
69+
color: #fff !important;
70+
background-color: #26a69a;
71+
padding: 10px
72+
}
73+
74+
.no_margin{
75+
margin: 0;
76+
}
77+
78+
.no_shadow{
79+
box-shadow: none !important;
80+
81+
}
82+
83+
.bark_background{
84+
background-color: #9e9e9e;
85+
}
86+
.clearboth {
87+
clear: both;
88+
}
89+
.notification-bar-inside {
90+
margin: 0 auto;
91+
width: 100%;
92+
background-color: #26A69A;
93+
padding: 10px;
94+
color: #FFFFFF;
95+
p {
96+
display: inline-block;
97+
}
98+
a.close-notification {
99+
display: inline-block;
100+
float: right;
101+
background-color: #E66167;
102+
padding: 10px;
103+
color: #FFFFFF;
104+
&:hover{
105+
background-color: #CE4046;
106+
}
107+
}
108+
}
109+
110+
#member-settings{
111+
ul.linked-accounts{
112+
text-align: center;
113+
li{
114+
display: inline-block;
115+
padding: 20px;
116+
height: 200px;
117+
border: 1px solid #ddd;
118+
vertical-align: top;
119+
margin-bottom: 3px;
120+
i.fa-github-square{
121+
}
122+
i.fa-twitter-square{
123+
color: #03C1E6;
124+
}
125+
i.fa-linkedin-square{
126+
color: #1278AB;
127+
}
128+
}
129+
}
130+
.special-setting{
131+
div{
132+
display: inline-block;
133+
margin-right: 10px;
134+
vertical-align: top;
135+
}
136+
}
137+
.setting{
138+
padding: 20px 0;
139+
border-bottom: 2px dotted #e6e6e6;
140+
margin-bottom: 15px;
141+
}
142+
.collection {
143+
.collection-item.avatar {
144+
.title {
145+
background-color: #FBF9F9;
146+
display: block;
147+
}
148+
}
149+
}
150+
.collapsible {
151+
>li.active {
152+
box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15) !important;
153+
}
154+
.collapsible-header i{
155+
margin-right: 15px;
156+
img{
157+
height: 43px;
158+
}
159+
}
160+
form{
161+
padding: 20px;
162+
}
163+
}
164+
ul.tabs{
165+
margin-top: 50px;
166+
}
167+
.tab_content{
168+
margin-top: 10px;
169+
}
170+
ul.email_list{
171+
color: #505050;
172+
font-size: 13px;
173+
li{
174+
i {
175+
font-size: 13px;
176+
}
177+
}
178+
}
179+
.profile_card{
180+
.card-image {
181+
min-height: 300px;
182+
}
183+
.card-title {
184+
color: #000;
185+
font-size: 14px;
186+
.avatar{
187+
}
188+
}
189+
}
190+
}

app/controllers/users_controller.rb

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ class UsersController < ApplicationController
22
after_action :track_referrer, only: :show
33
skip_before_action :require_registration, only: [:edit, :update]
44

5+
layout 'coderwallv2', only: :edit
6+
57
def new
68
return redirect_to(destination_url) if signed_in?
79
return redirect_to(new_session_url) if oauth.blank?
@@ -114,11 +116,27 @@ def update
114116
flash.now[:notice] = "There were issues updating your profile."
115117
end
116118

117-
if admin_of_premium_team?
118-
redirect_to(teamname_url(slug: @user.team.slug, full: :preview))
119+
respond_to do |format|
120+
format.js
121+
format.html do
122+
if admin_of_premium_team?
123+
redirect_to(teamname_url(slug: @user.team.slug, full: :preview))
124+
else
125+
redirect_to(edit_user_url(@user))
126+
end
127+
end
128+
end
129+
130+
end
131+
132+
def teams_update
133+
membership=Teams::Member.find(params['membership_id'])
134+
if membership.update_attributes(teams_member)
135+
flash.now[:notice] = "The changes have been applied to your profile."
119136
else
120-
redirect_to(edit_user_url(@user))
137+
flash.now[:notice] = "There were issues updating your profile."
121138
end
139+
redirect_to(edit_user_url(membership.user))
122140
end
123141

124142
def autocomplete
@@ -215,6 +233,10 @@ def oauth
215233
session["oauth.data"]
216234
end
217235

236+
def teams_member
237+
params.require(:teams_member).permit(:title,:team_avatar,:team_banner)
238+
end
239+
218240
def user_edit_params
219241
params.permit(:id)
220242
end

app/helpers/users_helper.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,4 +231,28 @@ def not_signedin_class
231231
return nil if signed_in?
232232
'not-signed-in'
233233
end
234+
235+
236+
237+
# option={
238+
# :type=>'paragraph|image|text',
239+
# :content_class=>'',
240+
# :attribute_class=>'',
241+
# :label_class=>'',
242+
# :image_class=>''
243+
# }
244+
def show_user_attribute(attribute,label,option={})
245+
if attribute.present?
246+
content_tag :div, class: option[:content_class] do
247+
case option[:type]
248+
when :paragraph
249+
content_tag(:b,label, class: option[:label_class])+' : '+content_tag(:div, attribute, class: option[:attribute_class],style: 'margin-left: 10px;')
250+
when :image
251+
content_tag(:b,label, class: option[:label_class])+' : '+content_tag(:div, image_tag(attribute, class: option[:image_class]), class: option[:attribute_class])
252+
else #text
253+
content_tag(:b,label, class: option[:label_class])+' : '+content_tag(:span, attribute, class: option[:attribute_class])
254+
end
255+
end
256+
end
257+
end
234258
end

0 commit comments

Comments
 (0)