Skip to content

Commit b962c9b

Browse files
authored
Merge pull request #1193 from ElixirTeSS/spaces-themes
Space-specific sources
2 parents c8464e8 + 0f60d62 commit b962c9b

47 files changed

Lines changed: 331 additions & 117 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/assets/stylesheets/application.scss

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,32 @@
1818
@import "font-awesome-sprockets";
1919
@import "font-awesome";
2020
@import "mixins/mixins";
21-
@import "*";
21+
22+
// Local
23+
@import "about";
24+
@import "account";
25+
@import "activities";
26+
@import "autocomplete";
27+
@import "bootstrap-tweaks";
28+
@import "collaborations";
29+
@import "collection";
30+
@import "curators";
31+
@import "events";
32+
@import "external-resources";
33+
@import "footer";
34+
@import "forms";
35+
@import "headers";
36+
@import "helpers";
37+
@import "home";
38+
@import "icons";
39+
@import "learning-paths";
40+
@import "masonry";
41+
@import "nodes";
42+
@import "showcase";
43+
@import "toggle";
44+
@import "workflows";
45+
46+
// Vendor
2247
@import "cytoscape-panzoom";
2348
@import "jquery.simplecolorpicker";
2449
@import "eonasdan-bootstrap-datetimepicker";
@@ -1049,6 +1074,24 @@ td.day .calendar-text {
10491074
}
10501075
}
10511076

1077+
.theme-selector {
1078+
display: flex;
1079+
gap: 10px;
1080+
}
1081+
1082+
.theme-select-option {
1083+
flex-grow: 1;
1084+
label {
1085+
border: 5px solid;
1086+
padding: 10px 20px;
1087+
border-radius: 5px;
1088+
display: block;
1089+
1090+
hr {
1091+
border-width: 10px;
1092+
}
1093+
}
1094+
}
10521095
.btn-oidc-only {
10531096
font-size: 36px;
10541097
padding: 4px;

app/assets/stylesheets/learning-paths.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
}
3939
}
4040

41-
.learning-path-item {
41+
.block-item {
4242
text-align: center;
4343
border-image-slice: 80;
4444
border-image-width: 80px;

app/controllers/collections_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def destroy
114114
@collection.create_activity :destroy, owner: current_user
115115
@collection.destroy
116116
respond_to do |format|
117-
format.html { redirect_to collections_url, notice: 'Collection was successfully destroyed.' }
117+
format.html { redirect_to collections_path, notice: 'Collection was successfully destroyed.' }
118118
format.json { head :no_content }
119119
end
120120
end

app/controllers/content_providers_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def destroy
8686
@content_provider.create_activity :destroy, owner: current_user
8787
@content_provider.destroy
8888
respond_to do |format|
89-
format.html { redirect_to content_providers_url, notice: 'Content Provider was successfully destroyed.' }
89+
format.html { redirect_to content_providers_path, notice: 'Content Provider was successfully destroyed.' }
9090
format.json { head :no_content }
9191
end
9292
end

app/controllers/events_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def destroy
187187
@event.create_activity :destroy, owner: current_user
188188
@event.destroy
189189
respond_to do |format|
190-
format.html { redirect_to events_url, notice: 'Event was successfully destroyed.' }
190+
format.html { redirect_to events_path, notice: 'Event was successfully destroyed.' }
191191
format.json { head :no_content }
192192
end
193193
end

app/controllers/learning_path_topics_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def destroy
6868
@learning_path_topic.create_activity :destroy, owner: current_user
6969
@learning_path_topic.destroy
7070
respond_to do |format|
71-
format.html { redirect_to learning_path_topics_url, notice: 'Topic was successfully destroyed.' }
71+
format.html { redirect_to learning_path_topics_path, notice: 'Topic was successfully destroyed.' }
7272
# format.json { head :no_content }
7373
end
7474
end

app/controllers/learning_paths_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def destroy
8585
@learning_path.create_activity :destroy, owner: current_user
8686
@learning_path.destroy
8787
respond_to do |format|
88-
format.html { redirect_to learning_paths_url, notice: 'Learning path was successfully destroyed.' }
88+
format.html { redirect_to learning_paths_path, notice: 'Learning path was successfully destroyed.' }
8989
format.json { head :no_content }
9090
end
9191
end

app/controllers/materials_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def destroy
132132
@material.create_activity :destroy, owner: current_user
133133
@material.destroy
134134
respond_to do |format|
135-
format.html { redirect_to materials_url, notice: 'Material was successfully destroyed.' }
135+
format.html { redirect_to materials_path, notice: 'Material was successfully destroyed.' }
136136
format.json { head :no_content }
137137
end
138138
end

app/controllers/nodes_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def destroy
7979
@node.create_activity :destroy, owner: current_user
8080
@node.destroy
8181
respond_to do |format|
82-
format.html { redirect_to nodes_url, notice: 'Node was successfully destroyed.' }
82+
format.html { redirect_to nodes_path, notice: 'Node was successfully destroyed.' }
8383
format.json { head :no_content }
8484
end
8585
end

app/controllers/sources_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def show
2424

2525
# GET /sources/new
2626
def new
27-
authorize Source
27+
authorize @content_provider, :create_source?
2828
@source = @content_provider.sources.build
2929
end
3030

@@ -36,9 +36,10 @@ def edit
3636
# POST /sources
3737
# POST /sources.json
3838
def create
39-
authorize Source
39+
authorize @content_provider, :create_source?
4040
@source = @content_provider.sources.build(source_params)
4141
@source.user = current_user
42+
@source.space = current_space
4243

4344
respond_to do |format|
4445
if @source.save
@@ -145,13 +146,12 @@ def set_source
145146
def set_content_provider
146147
@content_provider = @source.content_provider if @source
147148
@content_provider ||= ContentProvider.friendly.find(params[:content_provider_id])
148-
authorize @content_provider, :manage?
149149
end
150150

151151
# Never trust parameters from the scary internet, only allow the white list through.
152152
def source_params
153153
permitted = [:url, :method, :token, :default_language, :enabled]
154-
permitted << :approval_status if policy(Source).approve?
154+
permitted << :approval_status if policy(@source || Source).approve?
155155
permitted << :content_provider_id if policy(Source).index?
156156

157157
params.require(:source).permit(permitted)

0 commit comments

Comments
 (0)